Back Home

GitHub Repo

Ollama Community Proposes Gemma 4 Template Fix; Custom Model Names May Apply Small-Model Format to 12B Weights

A community reproduction on October 6 found that importing a Gemma 4 12B GGUF into Ollama under a name without its size may trigger the wrong prompt template. A proposed fix includes a regression test but has not been merged, and its effect on generation quality remains unmeasured.

Mattruffoni · CC BY-SA 4.0 · Image source
zh-Hant

On October 6, the Ollama community reported that custom GGUF models for Gemma 4 12B may use different conversation templates depending on how they are named. The case used version 0.35.1 on macOS; the reporter said the same selection logic was still present on the main branch that day. Official model labels containing 12b select the correct template, but custom names without a size designation may be affected. Issue report

The issue lies in the prompt renderer’s selection logic: Ollama first identifies the model size from its name, then falls back to the total parameter count if it cannot identify the size. The original threshold was 12 billion parameters, while Google’s model card lists the actual parameter count for 12B Unified as 11.95 billion, creating a boundary condition that can route it to the small-model branch. Google also explains that, except for E2B and E4B, disabling thinking still involves an empty thought block, and the template must preserve that distinction. Google model card

The reporter created three model names using the same weights, disabled thinking, and limited generation to one token. The prompt count was 10 for the generic name, versus 14 for a name containing 12b or one that explicitly specified the large renderer. In a separate comparison against Google’s template using 50 multi-turn prompts, the large renderer matched in every case, while the small renderer omitted the empty thought block in every case. These results support the existence of a difference in the prompt sequence, but the reporter did not measure any change in answer quality. Reproduction steps and results

A fix proposed the same day lowers the threshold to 11.5 billion and adds a test case for a 11.9-billion-parameter model whose name does not include its size. The submitter said the server tests passed; as of this report, the PR remains open with no review record, so the issue cannot be considered fixed in an official release. Proposed fix

For engineers who import models themselves or compare inference backends, this means the model name may affect the prompt actually sent to the model. The reporter’s temporary workaround is to explicitly set RENDERER gemma4-large in the Modelfile. Next, watch whether the fix is merged and whether, with weights, sampling settings, and prompts held constant, the template difference changes Chinese-language answers or tool-call results. There is currently no empirical evidence about those effects.

Sources

  1. Gemma 4 12B 自訂 GGUF 名稱觸發小模型渲染器的重現案例
  2. 將 Gemma 4 大型渲染器門檻降至 11.5B 的修補提案
  3. Google Gemma 4 12B IT 模型卡