Training data
Trajectories are multi-turn bash-agent rollouts. Tool calls are emitted as
plain text inside the assistant turn using a <tool_call>{"name": "bash", ...}</tool_call>
protocol defined in the system prompt (not native function calling), and tool
output returns in a tool role. Loss is computed on assistant turns only.
Training procedure
Full-parameter SFT via LLaMA-Factory,
DeepSpeed ZeRO-3, BF16, on 8x B200.
Table with columns: hyperparameter, value| hyperparameter | value |
|---|
| learning rate | 5e-6 |
| lr scheduler | cosine, warmup ratio 0.1 |
| weight decay | 0.0 |
| optimizer | AdamW |
| epochs | 5 |
| per-device batch size | 1 |
| gradient accumulation | 8 |
| effective batch size | 64 |
| max sequence length | 20,000 |
| precision | bf16 |
| attention | sdpa |
Results
Final train loss 0.2652 (from 0.9019 at step 5); mean train loss 0.3865
over 160 steps / 5 epochs. Runtime 8,812s.
Note: 5.3% of samples exceed the 20,000-token cutoff and are truncated.
Framework versions
- Transformers 5.8.0
- PyTorch 2.11.0+cu130
- DeepSpeed 0.18.9
- Datasets 4.0.0
- Tokenizers (via transformers)
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "March07/Qwen2.5-Coder-32B-terminal-agent-sft-mix2040"
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, dtype="bfloat16", device_map="auto")
messages = [
{"role": "system", "content": "You are an expert technical assistant with access to bash tools."},
{"role": "user", "content": "List the files in /workspace."},
]
inputs = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
out = model.generate(inputs, max_new_tokens=512)
print(tok.decode(out[0][inputs.shape[-1]:], skip_special_tokens=True))