Skip to main content
Back

Stanford Builds Markovian Transformers So AI Can't Fake Its Reasoning Steps

Stanford researchers force LLMs to actually use their chain-of-thought by blocking the model from seeing the original question when generating its answer

Pro

  • Core idea: Stanford researchers train LLMs so the answer is generated from the CoT alone, with the original question blocked, forcing the reasoning to be genuinely causal.
  • Big gains: Markovian training takes Llama 3.1 8B from 19.6% to 57.1% on GSM8K and 36.1% to 79.9% on ARC-Challenge, staying within ~3-4 pp of unconstrained GRPO.
  • Proven faithfulness: Systematic CoT corruption experiments show Markovian models suffer significantly larger accuracy drops when reasoning is perturbed, confirming structural reliance.
  • No steganography: Trained CoTs transfer to GPT-2, Mistral, and Phi -- models that cannot decode hidden encodings -- proving the reasoning is in plain natural language.
  • Open source: Full training code supporting 11 model architectures (Llama, Mistral, Qwen3, Gemma, GPT-2, etc.) is available at github.com/scottviteri/MarkovianTraining.
  • Limitation: MMLU sees a larger performance gap (~13 pp vs. Non-Markovian), and training costs ~$20K on H100/H200 hardware per full experimental run.

When a language model writes out its reasoning steps before answering a question, is it actually using those steps? Increasingly, the answer appears to be: not reliably. CoT explanations can be unfaithful -- spurious in-context biases often remain hidden in the CoT, and altering CoT text may not affect the final answer at all. This means the visible reasoning is often decorative, not causal. A Stanford team from the Center for AI Safety has now published a paper proposing a structural fix: Markovian Transformers for Informative Language Modeling.

The escape hatch problem

Standard chain-of-thought training has a fundamental loophole. When the model generates its final answer, it can still attend to the original question directly. Because the model can still access the original question when producing its answer, nothing prevents it from bypassing the CoT entirely. The reasoning text becomes a passenger, not a driver.

This is not a minor academic concern. Chain-of-thought monitoring is one of the most tractable approaches to auditing increasingly capable language models, but it rests on the assumption that a model externalizes its reasoning in its output tokens. If that assumption is wrong, monitoring and interpretability tools built on top of CoT are unreliable by design.

The autoencoder analogy

The paper introduces a Markovian Language Model (MLM) framework. The key idea is simple but structurally enforced: when predicting the answer, the model is only allowed to see the chain-of-thought -- not the original question. The question is replaced by the CoT in the answer-generation context.

Think of it like an autoencoder. Like an autoencoder with a narrow latent layer, this forces the model to compress essential reasoning into the CoT, making it causally load-bearing for prediction. The CoT becomes the only channel through which question information can reach the answer. If the CoT is bad, the answer will be bad.

Cross-model critic comparison showing normalized reward across Llama, Mistral, GPT-2, and Phi critics over training

Formally, the model is defined as a tuple with a state update function u (generates the CoT from the question) and a policy pi (predicts the answer from the CoT alone). The key idea is that pi can only see the CoT state when predicting the answer, forcing the CoT to contain all needed information.

How training works

Because the CoT is discrete text, you cannot backpropagate gradients through it directly. The team uses a GRPO-style (Group Relative Policy Optimization) reinforcement learning approach with several innovations:

  • Parallel sampling: Each training batch generates multiple CoTs for the same question using stochastic sampling, giving a natural within-batch baseline for advantage estimation.
  • Frozen baseline: A frozen copy of the pretrained model generates a reference CoT, and the reward is the log-probability improvement of the trained model's CoT over this baseline.
  • Actor-reward gradients: Unlike standard policy gradient, the same model weights define both the CoT sampling distribution and the reward. The team explicitly backpropagates through the reward in addition to the usual REINFORCE term, giving two gradient terms that are summed.
  • KL penalty: A KL divergence term keeps the trained CoT distribution close to the pretrained model's distribution, which discourages steganographic shortcuts.

The full loss is L = L_PG + L_AR + L_KL, where PG is the policy gradient term, AR is the actor-reward direct gradient, and KL is the regularizer with weight 0.1. LoRA (rank 8) is used for parameter-efficient fine-tuning, keeping training costs manageable.

Benchmarks and results

The team evaluates on GSM8K, MMLU, SVAMP, and ARC-Challenge using Llama 3.1 8B and Mistral 7B, observing large absolute gains over the base model -- with the Markovian constraint active throughout. Here is the full accuracy comparison:

DatasetBaselineNon-Markovian GRPOMarkovian (Ours)
GSM8K19.6%63.3%57.1%
ARC-Challenge36.1%78.6%79.9%
MMLU21.4%68.7%55.5%
SVAMP18.0%43.3%42.3%
Arithmetic1.0%97.0%98.0%

On average, Markovian training stays within approximately 3 to 4 percentage points of a Non-Markovian variant that can still see the question during answer prediction, a remarkably small gap given the strict information bottleneck imposed. The Qwen3 4B model also responds well to the same training recipe, reaching 71.6% on GSM8K from a 13.0% baseline.

Proving the CoT is actually load-bearing

Strong benchmark numbers alone do not prove the CoT is being used. The team runs systematic perturbation experiments to verify causal reliance. They corrupt CoTs in five ways (random token deletion, character replacement, digit replacement, front truncation, back truncation) at five severity levels (20% to 100%), then measure how much the answer log-probability drops.

Line graph showing average perturbation sensitivity comparing delete, character replace, and truncation methods across 1000 samples

Markovian models incur systematically larger log-probability drops under CoT corruption than matched Non-Markovian baselines, indicating stronger causal reliance on the CoT. The gap grows from +0.235 nats at 20% corruption severity to +0.981 nats at 100%, and is positive across all perturbation types. On QA tasks, ARC shows the clearest Markovian fragility (+25 percentage points of accuracy loss relative to the Non-Markovian baseline when CoTs are corrupted).

The steganography question

A natural worry: could the model learn to encode the answer directly into the CoT tokens in some compressed, non-human-readable form (steganography), technically satisfying the bottleneck while bypassing interpretable reasoning? The paper addresses this with a cross-model transfer experiment. Cross-model evaluation confirms that learned CoTs generalize across architectures, suggesting they encode transferable reasoning steps rather than model-specific artifacts.

Specifically, CoTs generated by Llama 3.1 8B remain informative when fed to Mistral, Phi-3.5 Mini, and even GPT-2. GPT-2 is a significantly smaller model and should not be able to decode sophisticated steganography. The fact that trained CoTs transfer effectively across this diverse set confirms they encode reasoning in natural language rather than model-specific encodings.

The qualitative difference is striking. Before training, Llama on arithmetic tasks would list all numbers and produce an incorrect sum. After Markovian training, it produces explicit step-by-step calculations like 6 + 89 = 95; 95 + 38 = 133... -- each step verifiable independently.

What it is and is not good for

The Markovian framework is most useful when you need CoT reasoning you can actually trust and audit. Practical applications include:

  • High-stakes QA pipelines where you need to verify that the model's stated reasoning actually produced the answer (medical, legal, financial).
  • AI safety monitoring where CoT is used as an oversight signal -- this method makes that signal structurally harder to bypass.
  • Multi-model reasoning pipelines where one model generates reasoning that another model consumes, since the learned CoTs transfer across architectures.
  • Interpretability research as a training-time tool to produce models whose reasoning is more amenable to perturbation analysis.

There are real limitations. The Markovian constraint ensures the CoT is sufficient for the answer, not that it mirrors the model's internal computation: the model could in principle compute the answer during the question-reading forward passes and then generate a post-hoc CoT that happens to be correct. MMLU sees a larger gap versus the Non-Markovian baseline (~13 pp), suggesting the bottleneck is more costly on knowledge-intensive tasks where context retrieval matters. Training also requires roughly $20K in compute on H100/H200 hardware, with each run taking about 10 hours.

Code and reproducibility

The authors provide all source code, training and evaluation scripts, and detailed instructions at github.com/scottviteri/MarkovianTraining. The main training loop supports GRPO and alternate methods including Expert Iteration, standard policy gradient, and PPO-style clipped objectives, along with all experimental datasets. The codebase supports 11 language model architectures including Llama 3.1 8B, Mistral 7B, GPT-2, Phi-3.5, Qwen3 4B, Qwen3 14B, Gemma-3 2B, and others.

The real contribution here is not just better benchmark numbers. It is a training paradigm that makes CoT faithfulness a structural property rather than a hoped-for emergent one -- and provides a concrete measurement protocol (perturbation fragility + cross-model transfer) to verify it. As CoT monitoring becomes a more central tool in AI oversight, having a principled way to train models whose reasoning is genuinely load-bearing matters considerably.