witcheer's picture
Upload reports/t127.md with huggingface_hub
8a18711 verified
|
Raw
History Blame Contribute Delete
7.58 kB

Reasoning is load-bearing for LFM2.5-2.6B on agentic tool-use, and a broken toggle nearly hid it

Rig: one RTX 5090 32GB (sm_120a) · llama.cpp server (b9653) with --jinja · LFM2.5-2.6B-Q8_0.gguf · native tool-calling loop, 30-task battery (10 single-tool, 10 multi-step, 10 multi-turn-instruction), 3 reps/task, max_steps 12 · greedy (temp 0) · anchors Qwen3.5-9B, Gemma-4-E4B-it, Qwen3.5-4B all Q8_0, run at their default (thinking) regime · 2026-08-06.

LFM2.5-2.6B is a small reasoning model. The question was direct: on agentic tool-use, does its reasoning earn the tokens it costs? So the plan was an A/B, the same model on the same tasks with reasoning on vs off, plus three larger models as anchors for scale. The first sweep said reasoning made no difference at all. That answer was wrong, and the way it was wrong is the more useful half of this report.

The bug that nearly shipped a null

The first run reported reasoning on and off as identical: 96.7% both ways, and a paired McNemar test of p=1.0, meaning not one task out of thirty changed outcome. A clean null: "reasoning is free and useless here."

The tell was in the token counts. The reasoning-off leg still logged ~699 reasoning tokens per task, only ~12% below the on leg, with an identical min/max envelope. If the toggle worked, off should have been near zero. It was not off.

The cause was the chat template. LFM2.5's shipped GGUF template hard-codes <think> at the start of every assistant turn and reads none of the disable flags (enable_thinking, reasoning, reasoning_effort). The harness sent enable_thinking: false; the template ignored it. Both legs reasoned. The "A/B" was reasoning-on vs reasoning-on, which is why nothing moved.

The fix was to serve the model with a patched template (--chat-template-file) that pre-closes the think block, <think></think>, when enable_thinking is false, so the model goes straight to the answer. After the patch the off leg produced 0 reasoning tokens across all 90 runs, and the on leg reproduced its original result exactly: 96.7%, same numbers. A genuine toggle at last.

One more thing surfaced only once off was really off: with no thinking scaffold the model sometimes fails to terminate, so the server needs a generation cap (--predict) or a request hangs. That non-termination is itself a symptom of the finding below.

The finding

With a working toggle, reasoning is load-bearing. LFM2.5-2.6B drops from 96.7% to 70.0% with reasoning off: a 26.7-point fall, McNemar p=0.0078, with 8 of 30 tasks flipping from pass to fail and 0 flipping the other way. The clean null was a measurement artifact; the real effect is large and one-directional.

The drop is not uniform. It is worst where you would least expect it, on the easy tier:

tier reasoning ON reasoning OFF drop
single-tool 100.0% 60.0% −40.0
multi-step 100.0% 90.0% −10.0
multi-turn instruction 90.0% 60.0% −30.0
overall 96.7% 70.0% −26.7

Single-tool tasks (pick one tool, call it correctly) collapse from 100 to 60 without reasoning. The model can still do them; it just stops doing them reliably when it cannot think first.

The mechanism

Turning reasoning off does not make the model rush a shorter, wronger answer. It makes it act without a plan. The behavioural columns show it:

reasoning ON reasoning OFF
tool calls / task 2.7 4.16
bad tool calls / task 0.97 1.48
gen tokens / task 740 685
reasoning tokens / task 662 0
total tokens / task 1403 685

Without the think block it makes more tool calls (4.16 vs 2.7) and more bad ones (1.48 vs 0.97), flailing rather than terminating early. Generation tokens barely move (685 vs 740), so the failures are not truncation, they are misfires. The reasoning block is where this model decides which tool to use and how to call it. Remove it and it guesses, retries, and stalls.

Reasoning roughly doubles the token bill (1403 vs 685 per task). On this battery it is worth every token.

The anchors (context, not a headline)

Run at their default thinking regime, the three larger anchors land below LFM2.5-with-reasoning and above LFM2.5-without:

model params success 95% CI
LFM2.5-2.6B (reasoning on) 2.6B 96.7% 90.7–98.9
Qwen3.5-9B 9B 86.7% 78.1–92.2
Gemma-4-E4B-it ~4B 83.3% 74.3–89.6
Qwen3.5-4B 4B 80.0% 70.6–87.0
LFM2.5-2.6B (reasoning off) 2.6B 70.0% 59.9–78.5

The same 2.6B model is top of this board with reasoning and bottom without. Reading "2.6B beats a 9B" as the headline is tempting, but at 30 tasks that comparison is underpowered: LFM-on never lost a paired task to any anchor, yet the McNemar tests are not significant (p = 0.25, 0.25, 0.0625). Treat the anchor ranking as directional. The significant, defensible result is the on/off effect at p=0.0078.

What's not here (and why)

  • The anchor win is not significant. n=30 tasks, few discordant pairs, p≥0.0625 vs each anchor. LFM2.5-on being best on this battery is directional only. A larger battery would be needed to claim it beats a 9B.
  • The single-tool tier is saturated on the ON side. Every model scores 100% single-tool with thinking, so that tier discriminates nothing among the on-legs, and it only became informative when LFM-off collapsed on it.
  • One battery, one model's toggle. This is LiquidAI's LFM2.5, one 30-task tool-use suite, greedy. The "reasoning helps agentic" result is specific to this model and this battery, not a general law.
  • Off required a non-standard template. LFM2.5 has no supported way to disable thinking, so "reasoning off" here means forced no-think via a pre-closed block: a legitimate probe, not a mode the vendor ships.
  • The one-sided gate check. The first result (p=1.0) would have been published as a clean null if the token counts had not been read. The probe that gated the run verified only that the on leg reasoned, never that the off leg stopped. The harness now checks both directions.

Reproduce

# capsule: run the sweep (Donald drained + restored; ~50 min)
cd ~/benchmark-rig
PYTHONPATH=. .venv/bin/python scripts/run_t127.py --probe   # projects hours + checks the toggle
PYTHONPATH=. .venv/bin/python scripts/run_t127.py           # full 5-leg, 450-run sweep

# the fix: serve LFM2.5 with a patched template that honours enable_thinking, so the
# off leg genuinely stops reasoning (the shipped template hard-forces <think>).
#   patched trailing block:
#     {%- if enable_thinking is defined and not enable_thinking -%}
#         {{- "<|im_start|>assistant\n<think>\n\n</think>\n\n" -}}
#     {%- else -%}  ... "<|im_start|>assistant\n<think>"  ... {%- endif -%}
# serve with --chat-template-file <patched.jinja> --predict 8192  (cap runaway no-think gens)

# analyze (offline, no GPU)
PYTHONPATH=. .venv/bin/python - <<'PY'
import json
from lib.agentic.native.analyze_t127 import analyze
rows = [json.loads(l) for l in open("results/t127/results.jsonl") if l.strip()]
print(analyze(rows))
PY

# chart (Mac, matplotlib on system python3)
python3 scripts/chart_t127.py   # writes reports/chart_t127.png

Model: LiquidAI/LFM2.5-2.6B (Q8_0 GGUF). Anchors: Qwen3.5-9B, Gemma-4-E4B-it, Qwen3.5-4B, all Q8_0. The reasoning-off confound and its fix are the rig's own (2026-08-06); the shipped chat template that forces <think> is quoted from the LFM2.5 GGUF metadata.