Downloads · 30 days
31
5% of all-time downloads
Specific-Labs/Gemma-4-31B-AntiHal
Gemma-4-31B-AntiHal is a text generation model from Specific-Labs. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as gemma.
A premise-challenging variant of Gemma 4 31B. Built by Specific Labs.
Downloads · 30 days
31
5% of all-time downloads
All-time downloads
594
Public
Parameters
32.7B
62.6 GB on disk
Likes
4
Public
Click a slice to open those files.
.safetensors62.5 GB · 100%
From the Hugging Face model README
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.
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.
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.
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.
model.set_antihal(False) to fall back to the base model.trust_remote_code=True.Derivative of google/gemma-4-31b-it, governed by the Gemma Terms of Use. Steering recipe © Specific Labs.
@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}
}