Files
gemma4-research/scripts/mort-bakeoff/runs/movies-think-true.json
T
Mortdecai 8436a91571 feat: mort-bot think=true vs think=false bakeoff
Seth's challenge: "we experienced this context eating with every
implementation that had think=true. mort-bot runs a loop. Can you do
a bake-off?"

Built a harness that replicates mort-bot's /api/chat loop verbatim
(num_ctx=8192, num_predict=2048, temperature=0.7, gemma4:26b,
STEP_BUDGET=20, exact payload shape) but with stubbed tools and a
prebuilt 15-turn fake chat history. Ran 4 tasks × 2 think settings.

Finding: on Ollama 0.20.4 the "thinking eats context" concern does
NOT reproduce. Direct evidence:
- Movies task step 2 (think=true) returned 905 chars of thinking.
- Step 3 prompt_eval_count delta: +76 tokens (think=true) vs +135
  tokens (think=false). If thinking had accumulated in the prompt,
  think=true would have grown by +360 tokens, not shrunk.
- Ollama's chat template strips the `thinking` field when serializing
  assistant turns for subsequent prompts.

All 4 tasks × 2 settings produced identical step counts and tool
counts. Wall clocks comparable. Gemma only actually generated
thinking on 1 of 4 tasks (the one with check_sethflix verify-loop);
on the others with think=true it emitted 0 thinking tokens.

Reconciled with the earlier coding-agent bakeoff: the two findings
are orthogonal. Coding bakeoff was at num_ctx=32K with a different
harness; mort at 8K doesn't touch the silent-stop regime either way.
Seth's prior may have been correct on an older Ollama or in a
different API shape (/api/generate has its own issues) but does not
reproduce here.

Concrete recommendation: mort-bot THINK=False is defensible but not
load-bearing; THINK=True or unset-default would also work. Keep as-is
unless a different need arises.

New: docs/reference/mort-bakeoff-2026-04-18.md, scripts/mort-bakeoff/
(harness + 8 run logs). README updated with pointer.
2026-04-18 18:23:43 -04:00

62 lines
1.4 KiB
JSON

{
"think": true,
"task": "Recommend 3 sci-fi movies NOT already in my sethflix library. Check your picks against check_sethflix before finalizing.",
"num_ctx": 8192,
"num_predict": 2048,
"started_at": 1776550750.6050062,
"turns": [
{
"step": 1,
"elapsed_s": 0.93,
"prompt_eval_count": 1319,
"eval_count": 34,
"content_len": 0,
"thinking_len": 0,
"tool_call_count": 1,
"history_chars_before_append": 2697,
"msg_keys_returned": [
"role",
"content",
"tool_calls"
]
},
{
"step": 2,
"elapsed_s": 3.15,
"prompt_eval_count": 1501,
"eval_count": 317,
"content_len": 0,
"thinking_len": 905,
"tool_call_count": 1,
"history_chars_before_append": 3306,
"msg_keys_returned": [
"role",
"content",
"thinking",
"tool_calls"
]
},
{
"step": 3,
"elapsed_s": 1.29,
"prompt_eval_count": 1577,
"eval_count": 111,
"content_len": 390,
"thinking_len": 0,
"tool_call_count": 0,
"history_chars_before_append": 4333,
"msg_keys_returned": [
"role",
"content"
]
}
],
"final": {
"halt_reason": "no_tool_calls",
"steps_used": 3,
"tool_calls_total": 2,
"wall_clock_s": 5.36,
"final_message_count": 18,
"final_history_chars": 4723
}
}