TL;DR
Humans chain together discrete mental subroutines—like "stand up" then "walk away"—to solve complex tasks, yet neural networks think almost entirely in continuous, opaque vectors. This paper introduces Dynamic Latent Routing (DLR), a single-stage training method that teaches language models to invent, search over, and sequence their own discrete internal "steering codes" on the fly. Not only does DLR significantly boost reasoning accuracy in low-data regimes where similar methods collapse, it also naturally externalizes hidden algorithmic steps into readable, controllable symbols.
What Problem Does This Paper Address?
Language is discrete, yet Large Language Models (LLMs) process information through continuous hidden states. Recently, researchers have tried giving LLMs discrete internal "thinking tokens" (like Pause Tokens) to help them compose multi-step behaviors. However, existing approaches share two major headaches:
- Sequence Disruption: Inserting new tokens directly into the text stream breaks the natural language patterns the model learned during pre-training. Fixing this requires massive compute and data budgets—if you try it in a low-data fine-tuning setup, performance craters.
- Clunky Multi-Stage Pipelines: Current methods can't simultaneously figure out what the codes should mean and when to use them. They rely on pre-fixed codes, external labeling models, or separate warm-up phases.
Beneath this practical engineering problem lies a theoretical one: in reinforcement learning, why does chaining together temporal sub-policies actually help? Standard theory assumes stationary rewards, leaving temporal composition poorly justified.
Methods
The authors first build a theoretical bridge using Dynamic Markov Decision Processes (DMDPs), where rewards change over time. They introduce General Dijkstra Search (GDS) and prove that instead of tweaking actions state-by-state (like classic Bellman updates), you can find optimal goal-reaching policies by concatenating sub-policies via a search, select, update loop.
Dynamic Latent Routing (DLR) translates GDS into a single-stage neural post-training method:
- Chunk-Level Residual Steering (What's new): Instead of inserting extra tokens into the input text, DLR groups tokens into chunks of length $K$ (e.g., 4 tokens). At a specific transformer layer, a lightweight linear "routing head" looks at the first token of a chunk and picks a discrete code from a learned codebook. That code's vector is added directly into the residual stream (the model's internal highway of hidden states) for all tokens in that chunk, leaving the text sequence completely intact.
- Search–Select–Update Loop: During training, the routing head samples $N$ candidate code sequences (Search). The model evaluates them and picks the sequence that maximizes the likelihood of the ground-truth text (Select). Finally, the base LLM, codebook, and router are optimized together in one step (Update).
- Preventing Collapse: The loss function balances four terms: standard language modeling, information gain (rewarding codes that beat the unsteered model), router policy optimization, and a Bigram-Zipfian KL regularizer that encourages diverse, heavy-tailed code transitions so the model doesn't just spam a single vector.
Datasets
For post-training experiments (using Qwen3 0.6B–8B and Llama3.2 1B–3B), the authors evaluate a strict low-data regime (1 epoch on standard training splits) across four question-answering benchmarks:
- GSM8K (math word problems)
- ScienceQA (multi-topic science questions)
- StrategyQA (implicit multi-hop reasoning)
- CSQA (CommonsenseQA)
For mechanistic interpretability case studies, they use a synthetic six-digit arithmetic dataset (annotated with carry/borrow cascade depths, training tiny transformers from scratch) and real Python code from CodeNet.
Key Insights and Ideas
- Steer the stream, spare the sequence: Injecting discrete decisions as additive vectors in the residual stream completely sidesteps pre-training disruption, allowing models to learn new routing capabilities on tiny datasets from step one.
- Unsupervised subtask specialization: Without any topic or step labels during training, DLR's codes spontaneously organize around real-world concepts. Longer code sequences ($n$-grams) become increasingly pure to specific subjects (like physics vs. biology).
- Built-in mechanistic interpretability: Usually, figuring out how an LLM does math requires post-hoc surgery with sparse autoencoders or circuit probing. DLR bakes discrete symbols right into the forward pass. In six-digit addition, individual codes naturally map to specific carry-cascade behaviors—acting as causal "knobs" you can flip to fix wrong answers or selectively boost one subject at the expense of another.
Key Results
Across all 24 post-training settings (6 models $\times$ 4 datasets), DLR wins every single cell:
- Outperforming SFT in low-data regimes: DLR achieves a +6.6 percentage point (pp) mean accuracy gain over Supervised Fine-Tuning (SFT) overall, and +7.8 pp on reasoning-heavy tasks. Peak gains hit +18.8 pp on ScienceQA (Qwen3-8B) and +10.2 pp on GSM8K (Llama3.2-1B). Meanwhile, token-inserting baselines like TokenAssorted frequently collapse on small-scale math (dropping from 46.0% SFT to 15.7% on Qwen3-0.6B GSM8K).
- Compute efficiency: Caching activations below the injection layer and searching every four micro-batches brings DLR's cost to ~1.2$\times$ SFT FLOPs; even when SFT is given 1.2 epochs to match compute, DLR wins across all 24 setups.
- Causal load-bearing & Arithmetic: Zeroing out DLR's steering vectors drops ScienceQA accuracy by 6.2–17.4 pp. On six-digit arithmetic trained from scratch, DLR beats SFT by up to +50 pp on deep carry cascades, and swapping a single routed code via oracle search repairs 27–31% of the model's mistakes.
Limitations and Future Work
- Theory-to-practice gap: While General Dijkstra Search guarantees optimality in tabular DMDPs, DLR is a neural relaxation where rewards and dynamics shift as model weights update—meaning GDS's formal optimality proofs motivate DLR, rather than strictly transferring to it.
- Scale and scope: Post-training evaluations focus on low-data regimes and models up to 8B parameters. Testing DLR on massive frontier models or large-scale multi-epoch pre-training remains open territory (further discussed in the paper's appendices).
Summary updated