Possible incorrect YaRN `attention_factor` metadata in Olmo-3-7B-Instruct GGUF

#2
by John6666 - opened

Hi.


I found a reproducible BF16 logit mismatch in the current unsloth/Olmo-3-7B-Instruct-GGUF that appears to be caused by the legacy generic YaRN attention-factor metadata.

The original allenai/Olmo-3-7B-Instruct config contains YaRN scaling with factor = 8.0 and attention_factor = 1.2079441541679836.

Reproduction

Using the same BF16 GGUF, same runtime/environment, and the same three prompts:

GGUF metadata condition Mean Pearson vs native HF BF16 NRMSE
baseline 0.978020076 0.208896
exact-F32 identity: olmo2.rope.scaling.attn_factor = 1.2079441547393799 0.978020076 0.208896
olmo2.rope.scaling.attn_factor = 1.0 β€” run 1 0.999812275 0.019375
olmo2.rope.scaling.attn_factor = 1.0 β€” run 2 0.999812275 0.019375

Controls were deterministic:

  • baseline and exact-F32 identity logits were bit-for-bit identical
  • both 1.0 runs were bit-for-bit identical
  • changing only this metadata scalar removes almost all of the large native-BF16/GGUF-BF16 mismatch

Relevant upstream evidence

The initial llama.cpp OLMo3 support PR #16015 added the HF-to-GGUF conversion in bd1f3e5. That conversion copied the Hugging Face YaRN attention_factor into the generic GGUF RoPE attention-factor field:

self.gguf_writer.add_rope_scaling_attn_factors(
    rope_scaling["attention_factor"]
)

The same PR's BF16 logits verification reported NMSE = 2.331092e-03 and classified it as PASS. This therefore does not appear to rule out the mismatch observed above.

Later, llama.cpp PR #18013, merged as 5c8a717, refactored RoPE conversion into common handling. The OLMo-specific generic attention_factor mapping was removed, and current YaRN conversion uses the YaRN-specific metadata handling instead.

Suggested fix / check

Could you regenerate the BF16 GGUF directly from the original HF model using the current llama.cpp converter and compare its logits against native HF BF16?

If the fresh BF16 conversion confirms the result, the existing quantized files derived from the older GGUF may also need regeneration.

The important part is to regenerate from the original HF weights rather than repairing or re-quantizing the existing GGUF, so the legacy metadata mapping is not inherited.

Sign up or log in to comment