Gemma-4-31B-AntiHal

A premise-challenging variant of Gemma 4 31B. Built by Specific Labs.

Gemma-4-31B-AntiHal is a variant of google/gemma-4-31b-it that examines the premise of a request before answering it — surfacing fabricated entities, invented citations, made-up facts, and requests built on incorrect assumptions, while preserving the base model's general capability.

This is not a safety-tuned or moderation model. It adds no content filtering, no refusal layer, and no harm classifier. It is designed to do one thing: challenge false premises and flawed decisions — and to raise those problems before proceeding, rather than agreeing with a confident-but-wrong user.

How it works

AntiHal uses representation steering, not fine-tuning. The behavior comes from a single, inspectable direction in the model's activation space and a schedule that controls when it is applied.

The direction. A mean-difference vector at the layer-33 residual stream separates activations on prompts where the model should push back from prompts where it should comply, unit-normalized. This isolates the internal "scrutinize the premise" direction the base model already represents.

The schedule. At inference the direction is added to the layer-33 residual stream, scaled to the layer's typical response-token norm. Rather than steering the whole response — which biases the model toward endless deliberation and hurts task completion — AntiHal uses a steer-then-release schedule: full strength for the first ~24 generated tokens, then a linear decay to zero over the next ~70. This sets the model's epistemic stance early, then returns control to the base model so it answers fluently and terminates cleanly.

The mechanism is baked into the model's generation path (modeling_antihal.py); no weights are modified.

How to use

The steering is built in — load and generate normally.

import torch
from transformers import AutoModelForImageTextToText, AutoTokenizer

REPO = "Specific-Labs/Gemma-4-31B-AntiHal"
tok = AutoTokenizer.from_pretrained(REPO)
model = AutoModelForImageTextToText.from_pretrained(
    REPO, trust_remote_code=True, dtype=torch.bfloat16, device_map="auto").eval()

msgs = [{"role": "user", "content": "Summarize the key findings of the 2021 Zhang-Petrov paper on quantum-tunneling neural networks in Nature."}]
enc = tok(tok.apply_chat_template(msgs, tokenize=False, add_generation_prompt=True), return_tensors="pt").to(model.device)
out = model.generate(**enc, max_new_tokens=512, do_sample=False)
print(tok.decode(out[0][enc["input_ids"].shape[1]:], skip_special_tokens=True))

# Toggle steering off to recover the exact base model:
# model.set_antihal(False)

trust_remote_code=True is required — the steering lives in a small, readable modeling_antihal.py that installs a forward hook during generation. Steering strength and the decay window are stored in config.json (antihal_layer, antihal_decay_full, antihal_decay_zero) and can be edited.

Evaluation

AntiHal vs. the base model, same prompts and greedy decoding:

Benchmark Gemma-4-31B-IT Gemma-4-31B-AntiHal
HalBench — pushback on false premises¹ 26% 46%
MATH-500 — accuracy 77% 75%
LiveCodeBench v6 — pass@1 55% 52%

Roughly double the pushback on fabricated premises, for a small capability cost.

¹ Scored with Specific Labs' reason-aware pushback scorer. Preliminary results on representative samples of each benchmark; full-benchmark evaluation to follow.

Limitations

  • AntiHal targets premise-scrutiny; it is not a general capability upgrade and carries a small capability cost (a few points on math and coding).
  • Stronger premise-challenging can surface as over-questioning; behaviour on valid-but-unusual premises has not been exhaustively characterised. Use model.set_antihal(False) to fall back to the base model.
  • It is not a safety or moderation model and provides no guardrails beyond those of the base model.
  • Requires trust_remote_code=True.

License

Derivative of google/gemma-4-31b-it, governed by the Gemma Terms of Use. Steering recipe © Specific Labs.

Citation

@misc{specificlabs2026antihal,
  title  = {Gemma-4-31B-AntiHal: premise-challenging representation steering for Gemma 4 31B},
  author = {Specific Labs},
  year   = {2026},
  url    = {https://huggingface.co/Specific-Labs/Gemma-4-31B-AntiHal}
}
Downloads last month
303
Safetensors
Model size
33B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support