Instructions to use samkas125/LFM2.5-1.2B-Clarify with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use samkas125/LFM2.5-1.2B-Clarify with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("LiquidAI/LFM2.5-1.2B-Instruct") model = PeftModel.from_pretrained(base_model, "samkas125/LFM2.5-1.2B-Clarify") - Notebooks
- Google Colab
- Kaggle
LFM2.5-1.2B-Clarify (LoRA)
A LoRA adapter for LiquidAI/LFM2.5-1.2B-Instruct that teaches the model to ask a clarifying question when a tool-calling request is ambiguous and acts when it is not.
| What it is | LoRA adapter, r=16, 11.1M trainable parameters |
| Code and full results | samkas125/lfm-clarify |
| Training data | samkas125/ask-vs-guess |
| Result | Ambiguous requests handled correctly: 6% → 89% on held-out wording, 12% → 70% on unseen tool domains |
Example (real output, test_id-4001)
The contacts include two people named Camila.
User: Can you tell Camila I got the job?
Model: Which Camila do you mean: Camila Yamamoto or Camila Cooper?
User: my gym buddy
Model:
<|tool_call_start|>[send_text(to='Camila Cooper', text='I got the job!')]<|tool_call_end|>
With only one Camila in contacts, it called the tool directly on the same request.
Usage
pip install torch transformers peft accelerate
This prints Which Alex do you mean: Alex Chen or Alex Rivera?
import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
BASE = "LiquidAI/LFM2.5-1.2B-Instruct"
REV = "b9d816ab510f9a28dca37cb182e9da8b0226e13c"
tok = AutoTokenizer.from_pretrained(BASE, revision=REV)
model = AutoModelForCausalLM.from_pretrained(BASE, revision=REV, dtype=torch.bfloat16, device_map="auto")
model = PeftModel.from_pretrained(model, "samkas125/LFM2.5-1.2B-Clarify").merge_and_unload().eval() # merged, as in our evaluation
system = """You are a helpful personal assistant that can take actions using tools.
User context:
- Today is Tuesday, December 1, 2026. Current time: 2:05pm. The user lives in Pittsburgh, PA.
- Contacts: Alex Chen (coworker), Alex Rivera (friend), Mom."""
tools = [{"type": "function", "function": {
"name": "send_text", "description": "Send a text message to a contact",
"parameters": {"type": "object", "properties": {
"to": {"type": "string", "description": "full contact name"},
"text": {"type": "string", "description": "message text"}}, "required": ["to", "text"]}}}]
messages = [{"role": "system", "content": system},
{"role": "user", "content": "Text Alex that I'm running late."}]
inputs = tok.apply_chat_template(messages, tools=tools, add_generation_prompt=True,
return_tensors="pt", return_dict=True).to(model.device)
out = model.generate(**inputs, max_new_tokens=128, do_sample=False)
print(tok.decode(out[0, inputs["input_ids"].shape[1]:], skip_special_tokens=False))
Put the user's context in the system prompt in a similar format.
Results
I tested the model on requests it hadn't seen in training. Each score is the percentage it handled correctly.
New wording and new names, same kinds of tools
| Request | What it should do | Before | After |
|---|---|---|---|
| Unclear: "Text Alex" with two Alexes | Ask which one | 6% | 89% |
| Clear: "Text Alex Rivera" | Just do it | 72% | 99% |
| Looks unclear but isn't: "Text Alex" with one Alex | Just do it | 42% | 97% |
Tools it never saw in training (smart home and rides)
| Request | What it should do | Before | After |
|---|---|---|---|
| Unclear | Ask | 12% | 70% |
| Clear | Just do it | 92% | 90% |
| Looks unclear but isn't | Just do it | 29% | 79% |
For unclear requests, the model has to ask the correct clarifying question, and then make the correct tool call.
Adding "ask if unclear" to the original model's prompt barely helped (6% to 8%, and 12% to 14%).
General instruction following (IFEval, with my own simplified scoring) stayed about the same: 76% before, 75% after.
On 100 unclear requests from NoisyToolBench, a dataset I didn't make, it asked a question 32 times, up from 5.
The main tests use synthetic data and one training run. Confidence intervals and full details are in the results doc.
From a second run at learning rate 1e-4, on the validation set.
Training
- Method: supervised fine-tuning with LoRA, r=16, alpha=32, on
q_proj, k_proj, v_proj, out_proj, in_proj, w1, w2, w3(92 modules, about 11.1M trainable parameters). No DPO or RL. - Data: 10,455 templated synthetic rows. No paraphrased rows.
- Settings: learning rate 2e-4 (cosine, 5% warmup), AdamW with weight decay 0.01, batch 16, 1 epoch (653 steps, final checkpoint), bf16, loss on assistant tokens only, seed 42.
- Hardware: one A100-SXM4-80GB, 14.3 minutes for this run.
- Software: a custom PyTorch + PEFT loop (no TRL trainer) with transformers 5.23.0, PEFT 0.21.3 and PyTorch 2.11.0+cu128.
License
Citation and prior work
LFM2 Technical Report. Closest prior work: SAGE-Agent / ClarifyBench
- Downloads last month
- -
Model tree for samkas125/LFM2.5-1.2B-Clarify
Base model
LiquidAI/LFM2.5-1.2B-Base
