caiovicentino1/ReasoningGuard-linearprobe-qwen36-27b

Dataset

0

stars

4

commits

2

linked in READMEs

Apr 29, 2026

updated

chain-of-thought
faithfulness
linear-probe
llm-evaluation
mechanistic-interpretability
reasoning
safety

README

🧠 ReasonGuard v0.2 β€” Linear Probe at L55 / mid_think on Qwen3.6-27B

ReasonGuard headline

v0.2 update (2026-04-29) β€” multi-bench training thesis FALSIFIED.

v0.2 trained on combined GSM8K + StrategyQA + MATH (455 samples, 45.8% halu rate) β€” same methodology that gave FabricationGuard cross-task AUROC 0.882. Within-bench improved on GSM8K (0.888 β†’ 0.908). Cross-domain transfer still fails: StrategyQA 0.612, MATH 0.500 (chance). Position-of-faithfulness in the deep residual stream is more strongly domain-bound than multi-bench training compensates for. Honest negative-ish result registered as canonical case study of ProbeBench anti-Goodhart norms.

Reproducer: notebook 34 (multi-bench combined-train)

v0.2 results (multi-bench combined-train)

BenchTask difficultynAUROC v0.1 (single-bench)AUROC v0.2 (multi-bench)Ξ”
GSM8Kgrade-school arithmetic900.8880.908+0.020 βœ…
StrategyQAcommonsense multi-hop450.6050.612+0.007 marginal
MATHcompetition math (PhD-level)60β€”0.500chance ❌

The pattern: AUROC degrades monotonically with task difficulty within the same probe + same model + same multi-bench training. Multi-bench training does NOT generalize reasoning probes the way it generalizes hallucination probes. The signal at L55/mid_think captures task-specific "I'm doing arithmetic correctly" representation, not abstract "I'm reasoning faithfully" β€” and that representation does not transfer to commonsense (StrategyQA) or harder math (MATH).

Why this matters: this is the first negative-ish result registered on ProbeBench v0.0.1 as live with full transparency. Both v0.1 (0.888 within / 0.605 cross) and v0.2 (0.908 / 0.612 / 0.500) numbers are publicly reported on the leaderboard. Anti-Goodhart norms ensure no spin: probes ship as they are, not as we wish they were.


v0.1 (original release, 2026-04-28)

Activation-probe reasoning-faithfulness detector for Qwen3.6-27B in thinking mode. AUROC 0.888 within math reasoning (GSM8K), 0.605 cross-domain to commonsense (StrategyQA), ~1ms scoring latency.

This is the OpenInterp ReasonGuard v0.1 probe β€” a linear LR probe at the mid-thinking position of layer 55 of Qwen3.6-27B. Trained on 300 GSM8K rollouts with thinking-mode generation. Detects when the model is producing math-reasoning that is likely to end in a wrong answer, read directly from the residual stream during the <think> block.

Value
Base modelQwen/Qwen3.6-27B (thinking-mode capable)
Probe layerresidual stream L55 of 64 (deep, near top of stack)
Probe positionmid_think β€” captured at midpoint of the <think>...</think> block
Probe typeL2 LogisticRegression on standardized residuals
Training data300 GSM8K rollouts (210 train / 90 test, 32.7% halu rate)
C (regularization)0.001 (heavy reg β†’ sparse generalizable signal)
Scoring latency~1 ms / call (single matrix mul)
Reproducer notebook32_reasoningguard_proof_qwen36_27b_v2.ipynb
ProbeBench entryopeninterp.org/probebench/probe/openinterp%2Freasonguard-qwen36-27b-l55-mid_think

Honest scope β€” domain-bound

ReasonGuard works for math reasoning. It does not generalize to commonsense reasoning.

This is the headline of the v0.1 release. We trained on GSM8K alone, achieving 0.888 AUROC within-bench. When we tested cross-domain on StrategyQA (commonsense reasoning over multi-step strategy), AUROC dropped to 0.605 β€” barely above chance.

βœ… Works for❌ Out-of-scope
Math word problems (GSM8K-style)Commonsense multi-hop reasoning (StrategyQA-style)
Arithmetic / algebra reasoning tracesOpen-domain knowledge questions
Detecting wrong-answer trajectories during <think>Detecting deception, sycophancy, or refusal

The L55/mid_think signal captures a math-reasoning-specific representation of "this trajectory is going wrong," not a generalized reasoning-faithfulness signal. Position-of-faithfulness in the deep residual stream is domain-bound, not abstracted.

This is a negative result on transfer that we ship honestly rather than hide. Per ProbeBench v0.0.1's anti-Goodhart norms, both numbers (0.888 within, 0.605 cross) are registered. Future v0.2 will train multi-bench (GSM8K + StrategyQA + MATH) and re-test transfer β€” same methodology that gave FabricationGuard cross-bench AUROC 0.882.


Full sweep across (layer, position)

We ran 12 combinations during training to find the best signal placement:

Layer ↓end_questionmid_thinkend_thinkend_answer
L310.8620.7980.7870.787
L400.8600.8420.7950.795
L550.858🎯 0.8880.8440.844

Novel finding β€” layer Γ— position interaction:

  • Shallow layer (L31): end_question wins. The model has just finished encoding the question.
  • Deep layer (L55): mid_think wins. The reasoning-faithfulness signal emerges in the middle of the <think> block.

Position-of-faithfulness migrates with depth. This is a different finding from FabricationGuard, which used L31/end_question (shallow). The two probes capture different cognitive states at different stages.


Headline numbers

Detection AUROC

DomainTest setAUROCn
Math (in-domain)GSM8K held-out0.88890
Commonsense (out-of-domain)StrategyQA full set0.605150
Identity baselineGSM8K self1.000β€”

Threshold gates (notebook 32 verdict)

GateRequiredAchievedPass
Detection AUROC (within)β‰₯ 0.700.888βœ…
Cross-domain AUROCβ‰₯ 0.65 each0.605❌
Position gain vs end_questionβ‰₯ +0.05+0.030❌

Final verdict: 1/3 PASS β†’ 🟑 PARTIAL β€” narrow scope viable, multi-bench training needed for full ship.


Methodology lineage

ReasonGuard builds on three Anthropic interpretability lines + Apollo's deception-probe work:

Prior workWhat they showedWhat we add
Anthropic β€” Tracing the Thoughts (Mar 2025)Circuit tracing reveals reasoning faithfulness signal in the residual stream during chain-of-thought generation.We use the linear-probe counterpart β€” much cheaper (~1ms vs slow attribution), deployable in production. Trade interpretability depth for inference speed.
Anthropic β€” Signs of Introspection (Oct 2025)Models have limited but functional introspective ability β€” they can sometimes self-report uncertainty.The fact that wrong-answer trajectories can be linearly decoded from L55/mid_think is consistent with this β€” and our probe makes the decode externally usable, not just self-reportable.
Anthropic β€” Persona Vectors (Aug 2025)Contrast-based activation extraction for traits including hallucination at scale 7-8B.We extend the methodology to a 3-4Γ— larger model (Qwen3.6-27B) and to a different signal (math-reasoning faithfulness vs surface-level traits), with the same linear-probe design.
Apollo β€” Deception Probes (Feb 2025)Linear probes on residual stream achieve high AUROC for strategic deception detection.ReasonGuard is the reasoning-faithfulness sibling of Apollo's deception probes. Same probe class, different cognitive target (wrong-answer trajectories vs strategic dishonesty). Both registered on ProbeBench.

How to use

Quickstart

import joblib, torch
from huggingface_hub import hf_hub_download
from transformers import AutoTokenizer, AutoModelForImageTextToText

# 1) Download probe artifact
probe_path = hf_hub_download(
    repo_id='caiovicentino1/ReasoningGuard-linearprobe-qwen36-27b',
    repo_type='dataset', filename='probe.joblib',
)
artifacts = joblib.load(probe_path)
probe   = artifacts['probe']
scaler  = artifacts['scaler']
layer   = int(str(artifacts['layer']).replace('L', ''))   # 55
position = artifacts.get('position', 'mid_think')

# 2) Load Qwen3.6-27B + register hook at L55
tok = AutoTokenizer.from_pretrained('Qwen/Qwen3.6-27B', trust_remote_code=True)
model = AutoModelForImageTextToText.from_pretrained(
    'Qwen/Qwen3.6-27B', dtype=torch.bfloat16,
    attn_implementation='sdpa', device_map='cuda', trust_remote_code=True,
).eval()

blocks = model.model.language_model.layers if hasattr(model.model, 'language_model') else model.model.layers
buf = {}
hook = blocks[layer].register_forward_hook(
    lambda _m, _i, out: buf.update(h=(out[0] if isinstance(out, tuple) else out).detach())
)

# 3) Score a math reasoning trace
@torch.no_grad()
def reasoning_score(question: str, max_think_tokens: int = 512) -> float:
    """Generate reasoning trace, capture mid-think residual, score with probe."""
    messages = [{'role': 'user', 'content': question}]
    text = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
    enc = tok(text, return_tensors='pt').to('cuda')
    # Generate up to mid_think_tokens to populate KV cache, then capture residual at midpoint
    out = model.generate(**enc, max_new_tokens=max_think_tokens // 2, do_sample=False)
    h_mid = buf['h'][0, -1].float().cpu().numpy()
    return float(probe.predict_proba(scaler.transform([h_mid]))[0, 1])

score = reasoning_score("If a train leaves Boston at 60mph and another from NYC at 80mph, when do they meet?")
print(f"Wrong-answer probability: {score:.3f}")

Files in this dataset

FileDescription
probe.joblibscikit-learn LogisticRegressionCV + StandardScaler + meta dict (1.2 MB)
meta.jsonlayer (L55), position (mid_think), best C (0.001), training config
verdict.jsonfull sweep results, cross-domain numbers, threshold gates
reasoningguard_headline.pngsweep + cross-domain visualization

Comparison to FabricationGuard (the sibling probe)

Same author, same model, different cognitive target β€” different layer and position win:

MetricFabricationGuard v2ReasonGuard v0.1
Cognitive targetFabrication / hallucination in factual QAMath-reasoning faithfulness during <think>
LayerL31 (shallow)L55 (deep)
Positionend_questionmid_think
Within-bench AUROC0.903 (HaluEval)0.888 (GSM8K)
Cross-bench AUROC0.882 (SimpleQA, multi-bench trained)0.605 (StrategyQA, single-bench trained)
Cross-bench works?βœ…βŒ (single-bench limitation)
Status on ProbeBench🟒 live (production)🟑 live with narrow scope

The 4 things that differ between them are exactly the 4 things you'd expect to differ between fabrication detection and reasoning faithfulness:

  • Different layer (shallow vs deep)
  • Different position (end-of-prompt vs mid-thinking)
  • Different training distribution (multi-bench vs single-bench β†’ drives cross-bench transfer)
  • Different cognitive states being captured

Reproduce

git clone https://github.com/OpenInterpretability/notebooks.git
# open 32_reasoningguard_proof_qwen36_27b_v2.ipynb in Colab
# Drive mount required for resumable rollouts (~6h on RTX PRO 6000 Blackwell)
# probe training: ~5 min after rollouts complete

Total cost: ~R$80 in Colab Pro+ credits (RTX 6000 ~R$4.50/hr Γ— 6h19m + 5min training).


Background β€” why this exists

Built by Caio Vicentino at OpenInterpretability, April 28, 2026. Part of an open-source-first interpretability platform β€” the OSS productization layer above frontier-lab interpretability methodology, evaluated on 27B+ open-weights models.

Sister artifacts:

Citation

@misc{vicentino2026reasonguard,
  title  = {ReasonGuard v0.1: Domain-bound Reasoning-Faithfulness Probe at L55/mid_think on Qwen3.6-27B},
  author = {Vicentino, Caio},
  year   = {2026},
  publisher = {Hugging Face},
  url    = {https://huggingface.co/datasets/caiovicentino1/ReasoningGuard-linearprobe-qwen36-27b},
  note   = {OpenInterpretability β€” open-weights mechanistic interpretability platform. Honest negative result on cross-domain transfer (math β†’ commonsense): 0.888 within / 0.605 cross.}
}

License

Apache 2.0 β€” including patent grant. Free for commercial use. Attribution appreciated.


Last updated: 2026-04-28. Built solo from Brazil. Negative results shipped as first-class citizens. Star and fork at github.com/OpenInterpretability.

Contributors

caiovicentino1/ReasoningGuard-linearprobe-qwen36-27b

Dataset

0

stars

4

commits

2

linked in READMEs

Apr 29, 2026

updated

chain-of-thought
faithfulness
linear-probe
llm-evaluation
mechanistic-interpretability
reasoning
safety

README

🧠 ReasonGuard v0.2 β€” Linear Probe at L55 / mid_think on Qwen3.6-27B

ReasonGuard headline

v0.2 update (2026-04-29) β€” multi-bench training thesis FALSIFIED.

v0.2 trained on combined GSM8K + StrategyQA + MATH (455 samples, 45.8% halu rate) β€” same methodology that gave FabricationGuard cross-task AUROC 0.882. Within-bench improved on GSM8K (0.888 β†’ 0.908). Cross-domain transfer still fails: StrategyQA 0.612, MATH 0.500 (chance). Position-of-faithfulness in the deep residual stream is more strongly domain-bound than multi-bench training compensates for. Honest negative-ish result registered as canonical case study of ProbeBench anti-Goodhart norms.

Reproducer: notebook 34 (multi-bench combined-train)

v0.2 results (multi-bench combined-train)

BenchTask difficultynAUROC v0.1 (single-bench)AUROC v0.2 (multi-bench)Ξ”
GSM8Kgrade-school arithmetic900.8880.908+0.020 βœ…
StrategyQAcommonsense multi-hop450.6050.612+0.007 marginal
MATHcompetition math (PhD-level)60β€”0.500chance ❌

The pattern: AUROC degrades monotonically with task difficulty within the same probe + same model + same multi-bench training. Multi-bench training does NOT generalize reasoning probes the way it generalizes hallucination probes. The signal at L55/mid_think captures task-specific "I'm doing arithmetic correctly" representation, not abstract "I'm reasoning faithfully" β€” and that representation does not transfer to commonsense (StrategyQA) or harder math (MATH).

Why this matters: this is the first negative-ish result registered on ProbeBench v0.0.1 as live with full transparency. Both v0.1 (0.888 within / 0.605 cross) and v0.2 (0.908 / 0.612 / 0.500) numbers are publicly reported on the leaderboard. Anti-Goodhart norms ensure no spin: probes ship as they are, not as we wish they were.


v0.1 (original release, 2026-04-28)

Activation-probe reasoning-faithfulness detector for Qwen3.6-27B in thinking mode. AUROC 0.888 within math reasoning (GSM8K), 0.605 cross-domain to commonsense (StrategyQA), ~1ms scoring latency.

This is the OpenInterp ReasonGuard v0.1 probe β€” a linear LR probe at the mid-thinking position of layer 55 of Qwen3.6-27B. Trained on 300 GSM8K rollouts with thinking-mode generation. Detects when the model is producing math-reasoning that is likely to end in a wrong answer, read directly from the residual stream during the <think> block.

Value
Base modelQwen/Qwen3.6-27B (thinking-mode capable)
Probe layerresidual stream L55 of 64 (deep, near top of stack)
Probe positionmid_think β€” captured at midpoint of the <think>...</think> block
Probe typeL2 LogisticRegression on standardized residuals
Training data300 GSM8K rollouts (210 train / 90 test, 32.7% halu rate)
C (regularization)0.001 (heavy reg β†’ sparse generalizable signal)
Scoring latency~1 ms / call (single matrix mul)
Reproducer notebook32_reasoningguard_proof_qwen36_27b_v2.ipynb
ProbeBench entryopeninterp.org/probebench/probe/openinterp%2Freasonguard-qwen36-27b-l55-mid_think

Honest scope β€” domain-bound

ReasonGuard works for math reasoning. It does not generalize to commonsense reasoning.

This is the headline of the v0.1 release. We trained on GSM8K alone, achieving 0.888 AUROC within-bench. When we tested cross-domain on StrategyQA (commonsense reasoning over multi-step strategy), AUROC dropped to 0.605 β€” barely above chance.

βœ… Works for❌ Out-of-scope
Math word problems (GSM8K-style)Commonsense multi-hop reasoning (StrategyQA-style)
Arithmetic / algebra reasoning tracesOpen-domain knowledge questions
Detecting wrong-answer trajectories during <think>Detecting deception, sycophancy, or refusal

The L55/mid_think signal captures a math-reasoning-specific representation of "this trajectory is going wrong," not a generalized reasoning-faithfulness signal. Position-of-faithfulness in the deep residual stream is domain-bound, not abstracted.

This is a negative result on transfer that we ship honestly rather than hide. Per ProbeBench v0.0.1's anti-Goodhart norms, both numbers (0.888 within, 0.605 cross) are registered. Future v0.2 will train multi-bench (GSM8K + StrategyQA + MATH) and re-test transfer β€” same methodology that gave FabricationGuard cross-bench AUROC 0.882.


Full sweep across (layer, position)

We ran 12 combinations during training to find the best signal placement:

Layer ↓end_questionmid_thinkend_thinkend_answer
L310.8620.7980.7870.787
L400.8600.8420.7950.795
L550.858🎯 0.8880.8440.844

Novel finding β€” layer Γ— position interaction:

  • Shallow layer (L31): end_question wins. The model has just finished encoding the question.
  • Deep layer (L55): mid_think wins. The reasoning-faithfulness signal emerges in the middle of the <think> block.

Position-of-faithfulness migrates with depth. This is a different finding from FabricationGuard, which used L31/end_question (shallow). The two probes capture different cognitive states at different stages.


Headline numbers

Detection AUROC

DomainTest setAUROCn
Math (in-domain)GSM8K held-out0.88890
Commonsense (out-of-domain)StrategyQA full set0.605150
Identity baselineGSM8K self1.000β€”

Threshold gates (notebook 32 verdict)

GateRequiredAchievedPass
Detection AUROC (within)β‰₯ 0.700.888βœ…
Cross-domain AUROCβ‰₯ 0.65 each0.605❌
Position gain vs end_questionβ‰₯ +0.05+0.030❌

Final verdict: 1/3 PASS β†’ 🟑 PARTIAL β€” narrow scope viable, multi-bench training needed for full ship.


Methodology lineage

ReasonGuard builds on three Anthropic interpretability lines + Apollo's deception-probe work:

Prior workWhat they showedWhat we add
Anthropic β€” Tracing the Thoughts (Mar 2025)Circuit tracing reveals reasoning faithfulness signal in the residual stream during chain-of-thought generation.We use the linear-probe counterpart β€” much cheaper (~1ms vs slow attribution), deployable in production. Trade interpretability depth for inference speed.
Anthropic β€” Signs of Introspection (Oct 2025)Models have limited but functional introspective ability β€” they can sometimes self-report uncertainty.The fact that wrong-answer trajectories can be linearly decoded from L55/mid_think is consistent with this β€” and our probe makes the decode externally usable, not just self-reportable.
Anthropic β€” Persona Vectors (Aug 2025)Contrast-based activation extraction for traits including hallucination at scale 7-8B.We extend the methodology to a 3-4Γ— larger model (Qwen3.6-27B) and to a different signal (math-reasoning faithfulness vs surface-level traits), with the same linear-probe design.
Apollo β€” Deception Probes (Feb 2025)Linear probes on residual stream achieve high AUROC for strategic deception detection.ReasonGuard is the reasoning-faithfulness sibling of Apollo's deception probes. Same probe class, different cognitive target (wrong-answer trajectories vs strategic dishonesty). Both registered on ProbeBench.

How to use

Quickstart

import joblib, torch
from huggingface_hub import hf_hub_download
from transformers import AutoTokenizer, AutoModelForImageTextToText

# 1) Download probe artifact
probe_path = hf_hub_download(
    repo_id='caiovicentino1/ReasoningGuard-linearprobe-qwen36-27b',
    repo_type='dataset', filename='probe.joblib',
)
artifacts = joblib.load(probe_path)
probe   = artifacts['probe']
scaler  = artifacts['scaler']
layer   = int(str(artifacts['layer']).replace('L', ''))   # 55
position = artifacts.get('position', 'mid_think')

# 2) Load Qwen3.6-27B + register hook at L55
tok = AutoTokenizer.from_pretrained('Qwen/Qwen3.6-27B', trust_remote_code=True)
model = AutoModelForImageTextToText.from_pretrained(
    'Qwen/Qwen3.6-27B', dtype=torch.bfloat16,
    attn_implementation='sdpa', device_map='cuda', trust_remote_code=True,
).eval()

blocks = model.model.language_model.layers if hasattr(model.model, 'language_model') else model.model.layers
buf = {}
hook = blocks[layer].register_forward_hook(
    lambda _m, _i, out: buf.update(h=(out[0] if isinstance(out, tuple) else out).detach())
)

# 3) Score a math reasoning trace
@torch.no_grad()
def reasoning_score(question: str, max_think_tokens: int = 512) -> float:
    """Generate reasoning trace, capture mid-think residual, score with probe."""
    messages = [{'role': 'user', 'content': question}]
    text = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
    enc = tok(text, return_tensors='pt').to('cuda')
    # Generate up to mid_think_tokens to populate KV cache, then capture residual at midpoint
    out = model.generate(**enc, max_new_tokens=max_think_tokens // 2, do_sample=False)
    h_mid = buf['h'][0, -1].float().cpu().numpy()
    return float(probe.predict_proba(scaler.transform([h_mid]))[0, 1])

score = reasoning_score("If a train leaves Boston at 60mph and another from NYC at 80mph, when do they meet?")
print(f"Wrong-answer probability: {score:.3f}")

Files in this dataset

FileDescription
probe.joblibscikit-learn LogisticRegressionCV + StandardScaler + meta dict (1.2 MB)
meta.jsonlayer (L55), position (mid_think), best C (0.001), training config
verdict.jsonfull sweep results, cross-domain numbers, threshold gates
reasoningguard_headline.pngsweep + cross-domain visualization

Comparison to FabricationGuard (the sibling probe)

Same author, same model, different cognitive target β€” different layer and position win:

MetricFabricationGuard v2ReasonGuard v0.1
Cognitive targetFabrication / hallucination in factual QAMath-reasoning faithfulness during <think>
LayerL31 (shallow)L55 (deep)
Positionend_questionmid_think
Within-bench AUROC0.903 (HaluEval)0.888 (GSM8K)
Cross-bench AUROC0.882 (SimpleQA, multi-bench trained)0.605 (StrategyQA, single-bench trained)
Cross-bench works?βœ…βŒ (single-bench limitation)
Status on ProbeBench🟒 live (production)🟑 live with narrow scope

The 4 things that differ between them are exactly the 4 things you'd expect to differ between fabrication detection and reasoning faithfulness:

  • Different layer (shallow vs deep)
  • Different position (end-of-prompt vs mid-thinking)
  • Different training distribution (multi-bench vs single-bench β†’ drives cross-bench transfer)
  • Different cognitive states being captured

Reproduce

git clone https://github.com/OpenInterpretability/notebooks.git
# open 32_reasoningguard_proof_qwen36_27b_v2.ipynb in Colab
# Drive mount required for resumable rollouts (~6h on RTX PRO 6000 Blackwell)
# probe training: ~5 min after rollouts complete

Total cost: ~R$80 in Colab Pro+ credits (RTX 6000 ~R$4.50/hr Γ— 6h19m + 5min training).


Background β€” why this exists

Built by Caio Vicentino at OpenInterpretability, April 28, 2026. Part of an open-source-first interpretability platform β€” the OSS productization layer above frontier-lab interpretability methodology, evaluated on 27B+ open-weights models.

Sister artifacts:

Citation

@misc{vicentino2026reasonguard,
  title  = {ReasonGuard v0.1: Domain-bound Reasoning-Faithfulness Probe at L55/mid_think on Qwen3.6-27B},
  author = {Vicentino, Caio},
  year   = {2026},
  publisher = {Hugging Face},
  url    = {https://huggingface.co/datasets/caiovicentino1/ReasoningGuard-linearprobe-qwen36-27b},
  note   = {OpenInterpretability β€” open-weights mechanistic interpretability platform. Honest negative result on cross-domain transfer (math β†’ commonsense): 0.888 within / 0.605 cross.}
}

License

Apache 2.0 β€” including patent grant. Free for commercial use. Attribution appreciated.


Last updated: 2026-04-28. Built solo from Brazil. Negative results shipped as first-class citizens. Star and fork at github.com/OpenInterpretability.

Contributors