Skip to content

[QUALITY] Llama-3.2-1B-Instruct: GPTQ is worse than plain RTN (ppl up to 104 vs 15.9) because the BOS attention-sink activation dominates the Hessian of layers.1.mlp.down_proj #4393

Closed

Description

@Qubitium

Severity: medium (accuracy). Status: confirmed on a Radeon AI PRO R9700 (ROCm, PYTHON_GIL=0) at def6e61. Kind: pre-existing. At 842d666, plain sym gives 65.8 (vs 63.1 at HEAD). The shipped 5.4.2 checkpoint Llama-3.2-1B-Instruct-GPTQ-4bits-gp128 scores ppl 82–115 on the same eval.

Where

gptqmodel/quantization/gptq.py:789 (add_batch) and :1056 (process_batch). The Hessian is accumulated over every calibration token, including the BOS token the tokenizer prepends to each row. Nothing down-weights or excludes attention-sink tokens.

Setup

  • Calibration: 128 wikitext-2-raw train rows longer than 400 chars, batch_size=4.
  • Eval: the first 40 wikitext-2 test articles longer than 2000 chars, each cut to 512 tokens with its own BOS (20,440 tokens).
  • Baseline (fp16): ppl 12.263.

Results (4-bit, g128)

Config ppl
RTN sym 15.90
GPTQ default (sym, act_group_aware=True) 18.49
GPTQ plain sym (act_group_aware=False) 63.09
GPTQ desc_act sym 13.48
GPTQ desc_act asym 103.9
GPTQ GAR asym 15.15
GPTAQ 17.06
QQQ 19.73 (answers "The largest city in France is Marseille")
AWQ / GGUF q4_k_m / FOEM / ParoQuant 14.13 / 13.66 / 13.83 / 14.30

On Qwen3-0.6B the GPTQ family behaves well: 21.9–22.6, against 27.3 for RTN.

Localisation

  1. Not the kernels. A pure-torch dequant oracle reproduces the kernel ppl (fp16: 19.278 for both).

  2. One module is responsible. Swapping only model.layers.1.mlp.down_proj from the plain-GPTQ checkpoint into the fp16 model raises ppl from ~12.5 to 26.8. RTN on that one module gives 13.44.

  3. Its input is dominated by BOS. The module's input max |x| is 1176, on the BOS token.

  4. Error split, ||(W−Q)X||² over calibration tokens:

    total BOS rows non-BOS rows
    GPTQ 6.9e4 6.7e4 2136
    RTN 5.3e5 5.3e5 625

    GPTQ minimises its objective (7.6× lower than RTN in total), but almost all of that objective is the BOS rows. On ordinary tokens GPTQ is 3.4× worse than RTN.

  5. Errors compound. desc_act asym on L1 down_proj alone gives 14.9; all other layers alone give 13.4; together they give 103.9.

Caveat: a round-11 run with a different calibration set (128 nm-calibration rows) and an in-distribution eval did not show this. The effect depends on the calibration data and eval, but it is large on standard wikitext calibration and eval.

Repro

from datasets import load_dataset
from gptqmodel import GPTQModel
from gptqmodel.quantization.config import GPTQConfig, RTNConfig
calib = [t for t in load_dataset("Salesforce/wikitext", "wikitext-2-raw-v1", split="train")["text"] if len(t.strip()) > 400][:128]
for i, cfg in enumerate([GPTQConfig(bits=4, group_size=128, sym=True, desc_act=False, act_group_aware=False),
                         GPTQConfig(bits=4, group_size=128, sym=False, desc_act=True, act_group_aware=False),
                         RTNConfig(bits=4, group_size=128, sym=True)]):
    m = GPTQModel.load("meta-llama/Llama-3.2-1B-Instruct", quantize_config=cfg); m.quantize(calib, batch_size=4); m.save(f"out{i}")
# then wikitext-2 test ppl with one BOS per article (40 articles x 512 tokens)

Expected: GPTQ ≤ RTN.

Suggestion: mask BOS / attention-sink positions, or cap per-token weight, when accumulating H. Alternatively, exclude position 0 from the Hessian when it is a special token.


Found during an AI-assisted review (Claude Code, round 12) of def6e61; repros were run at that commit (A/B against 842d666 where noted) on RTX 4090/5090 (CUDA 13) and/or Radeon AI PRO R9700 (ROCm) unless marked static/suspected.

Activity

  1. added
    bug
    on Nov 16, 2026
  2. Qubitium commented on Nov 16, 2026

    @Qubitium
    CollaboratorAuthor

    Claimed by an AI agent. Investigating: BOS/attention-sink token domination of GPTQ Hessian on Llama-3.2 calibration; measuring per-token Hessian contribution and evaluating an explicit GPTQConfig masking option.

  3. Qubitium commented on Nov 16, 2026

    @Qubitium
    CollaboratorAuthor

    Re-checked at 489aed6. The opt-in exclude_attention_sinks (8d6ebb0) gets Llama-3.2-1B GPTQ below RTN (sym 33.81 → 21.77, default 23.24 → 21.30).

    Two problems remain, filed as #4459:

    • Defaults are unchanged. Plain or asym GPTQ, 3-bit, GSQ, FOEM and QQQ are still worse than RTN.
    • The flag drops position 0 even when it is not a BOS token. On Qwen3-0.6B, which has no BOS, it makes default GPTQ worse than RTN (37.89 vs 36.84).

    The VPTQ, dynamic and AWQ/ParoQuant paths silently ignore the flag (#4447).

    (AI-assisted review, round 13 at 489aed6)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions