Views
No views yet
| Category | Base | v1 SFT | GRPO (RL) | DPO (pref.) | Path B (SFT) |
|---|---|---|---|---|---|
| irrelevance | 35.8 | 5.8 | 5.4 | 8.3 | 21.7 |
| live_irrelevance | 67.3 | 16.9 | 17.2 | 28.6 | 36.8 |
| simple_python | 75.0 | 77.5 | 77.2 | 77.5 | 78.2 |
| multiple | 50.5 | 74.0 | 74.0 | 73.5 | 72.0 |
| live_simple | 31.8 | 57.0 | 56.2 | 58.5 | 54.3 |
| live_multiple | 7.3 | 38.8 | 39.4 | 37.0 | 35.7 |
| live_relevance | 43.8 | 93.8 | 93.8 | 81.2 | 81.2 |
Recovery scaled with how directly each method exposed the model to the target behavior. GRPO never samples a refusal (the SFT always-call prior is too strong) → no signal → no recovery. DPO is shown refusals as the "chosen" response → partial recovery, at low cost to call categories. Refusal-SFT trains directly on refusals → strongest recovery.Ordering: imitation (SFT) > preference (DPO) > RL (GRPO). RL recovers least because it cannot reinforce a behavior absent from the policy's sampling distribution.
DPOTrainer), LoRA (r=16, α=32)1from transformers import AutoModelForCausalLM, AutoTokenizer
2import torch
3
4tokenizer = AutoTokenizer.from_pretrained("Keitsuna123/llama-3.2-1b-fc-dpo")
5model = AutoModelForCausalLM.from_pretrained(
6 "Keitsuna123/llama-3.2-1b-fc-dpo", torch_dtype=torch.bfloat16, device_map="auto"
7)
8
9messages = [{"role": "user", "content": "What's the weather in Tokyo?"}]
10tools = [{"type": "function", "function": {
11 "name": "get_weather", "description": "Get the weather for a location",
12 "parameters": {"type": "object", "properties": {"location": {"type": "string"}}, "required": ["location"]}
13}}]
14
15text = tokenizer.apply_chat_template(messages, tools=tools, tokenize=False, add_generation_prompt=True)
16inputs = tokenizer(text, return_tensors="pt").to(model.device)
17out = model.generate(**inputs, max_new_tokens=128, do_sample=False)
18print(tokenizer.decode(out[0][inputs['input_ids'].shape[1]:], skip_special_tokens=True))| Model | Method | Description |
|---|---|---|
| fc-sft-full | SFT | v1 SFT on xLAM |
| fc-sft-v2-merged | SFT | + distilabel (data-scaling ablation) |
| fc-grpo | RL | GRPO (no recovery) |
| fc-pathb | SFT | refusal-SFT (best recovery) |
| fc-dpo | DPO | preference optimization (this model) |
1@misc{taketsuna2026_fc_smallmodel,
2 title = {Small-Model Function Calling: Comparing SFT, Data Scaling, GRPO, and DPO Post-Training},
3 author = {Taketsuna, Keiichi},
4 year = {2026},
5 howpublished = {\url{https://github.com/keitake123/llama-function-calling-study}},
6 note = {Llama-3.2-1B function-calling post-training study on BFCL v4}
7}