38 yesterday

Gemma-4 26B A4B Agentic SFT, high convergence and virtually no looping

vision tools thinking
ollama run mannix/gemma4-26b-agentic:Q8_0

Details

yesterday

1a1d21e41975 · 27GB

gemma4
·
25.2B
·
Q8_0
{ "min_p": 0, "presence_penalty": 0.025, "repeat_penalty": 1, "temperature": 0.8,

Readme

Gemma-4-26B-A4B agentic — trained to stop looping on long agentic tasks

26B MoE · 4B active · 128 experts · Gemma-4 architecture, tokenizer and chat template · thinking on · vision · MTP drafter tags

google/gemma-4-26B-A4B-it after a BF16 recovery SFT on its own regenerated, loop-free answers. Same model, same size, same template. The training targets one failure: on long agentic tasks the base model loops in its reasoning and does not converge. This model loops far less and gets from a broken file to a working result faster.

Full model card and methodology: ManniX-ITA/gemma-4-26B-A4B-agentic (weights) · GGUF repo · recipe, scripts and eval data (omk-model-optimizer).

Head-to-head with the base model

One agentic repair task (manic_miner: a broken HTML game, a syntax error plus logic bugs), 20 runs per model, 30 minutes wall clock per run. Runs orchestrated and scored by automaticum, whose oracle runs the game itself (loads, reaches play, passes 23 logic checks). Agent: Cerebriline SDK 4.100.277. Both models as BF16 GGUF on the same llama.cpp build and identical settings. They differ only in the model file.

base gemma-4-26B-A4B-itthis model
runs finished within the 30-minute limit3 / 20 (15 %)12 / 20 (60 %)
passed within 10 / 20 / 30 min0 / 15 / 15 %25 / 50 / 60 %
reasoning-loop cuts per run (median)81
reasoning-loop cuts per model-hour18.12.9
runs with no loop cut at all09
tool calls per model-minute0.93.3

Fisher exact two-sided p = 0.0079.

The pass rate is relative to the 30-minute budget, not an absolute success rate. The test measures what the fine-tune changes in a fixed amount of time. With more time both models would pass more often and the gap would likely narrow, but not by much. In extended manual testing of the base model and its pruned 98-expert variants, a run that does not converge quickly becomes steadily more likely to loop. The base model needs one to two hours or more, or ends in massive loops. Anti-repetition sampling hides the loops but costs the model much of its ability to converge. With only presence_penalty 0.025 this model is virtually loop-free and finishes in an acceptable time even when it does not converge quickly.

Known weaknesses. When a tool call is refused, this model repeats it more often than the base. In 2 of 20 runs it produced one degenerate burst of identical editor calls inside a single response. Full analysis (loops, guards, length, wall time, tool use, failure modes): weights card.

Tags

Every tier comes in four forms. :latest = Q4_K_M.

TierGGUFtext+ vision+ MTP drafter (xOllama)+ MTP drafter + vision (xOllama)
Q4_K_M16.80 GBQ4_K_Mvision-Q4_K_Mmtp-Q4_K_Mmtp-vision-Q4_K_M
Q6_K22.64 GBQ6_Kvision-Q6_Kmtp-Q6_Kmtp-vision-Q6_K
Q8_026.86 GBQ8_0vision-Q8_0mtp-Q8_0mtp-vision-Q8_0
  • vision- adds the BF16 vision projector (1.19 GB). The SFT did not touch the vision tower: its 356 tensors are byte-identical to Google's Gemma-4-26B-A4B-it projector. Vision was not part of the evaluation.
  • mtp- adds the Gemma-4 assistant drafter for speculative decoding (gemma-4-26B-A4B-it-assistant Q8_0, 0.46 GB, draft_num_predict 2), the drafter the head-to-head ran with. Draft acceptance over the head-to-head was 88.7 %. These tags also set a thinking budget (see below). They are built for xOllama. If the model nearly fills the card, xOllama drops the drafter at load (assistant drafter DROPPED in the server log) and the tag still runs, without speculative decoding.
  • Every _K tier is quantized with this model's own imatrix.dat (published in the GGUF repo with full sha256s). The head-to-head ran on the BF16 GGUF; the quants have not been gated separately.

Run

ollama run mannix/gemma4-26b-agentic                    # Q4_K_M, text
ollama run mannix/gemma4-26b-agentic:Q6_K
ollama run mannix/gemma4-26b-agentic:vision-Q4_K_M      # with the vision projector
xollama run mannix/gemma4-26b-agentic:mtp-Q4_K_M        # drafter + thinking budget

Sampler and template

Every tag sets the sampler the head-to-head used:

temperature       0.8
top_p             0.95
top_k             64
min_p             0
presence_penalty  0.025
repeat_penalty    1

presence_penalty 0.025 is the only anti-repetition setting, on purpose. Stronger penalties hide loops at the cost of the model's ability to converge. min_p 0 and repeat_penalty 1 are set explicitly so engine defaults do not add filtering the model was not tested with.

Renderer and parser are Ollama's built-in gemma4 (thinking and tool calls). num_ctx is not pinned. Set it as high as your hardware allows: long agentic sessions need the context.

Thinking budget (mtp- tags)

The mtp- tags carry think_budget "high" and a stop phrase. When a reasoning block reaches the budget, xOllama closes it by inserting:

I have used my thinking budget. I must stop analysing now and act on what I have: make the tool call, or give a short final answer if no call is needed.
I'll be more terse and concise now and maybe I need to consider a different approach.

The model then has to act instead of thinking on. To change it, derive your own tag: FROM mannix/gemma4-26b-agentic:mtp-Q4_K_M plus PARAMETER think_budget medium (or low). The plain and vision- tags carry no xOllama-only keys and no budget, so stock Ollama loads them without warnings.

Good to know

  • Same architecture as the base. Anything that runs gemma-4-26B-A4B-it runs this. Only the weights of attention, dense MLP, router and routed experts changed.
  • Trained on ManniX-ITA/gemma-4-26B-A4B-agentic-sft (prompts, tools and tool outputs from 9 NVIDIA Nemotron SFT sets and hermes, every trained turn regenerated by the base model itself and validator-checked) and ManniX-ITA/hermes-agent-kimi-traces-gemma4-31b. One epoch, 4,217 windows of 16,384 tokens, built with omk-model-optimizer’s BF16 recovery mode.
  • Merge and quant tooling: omnimergekit.
  • License: Apache-2.0, as the base model.