TL;DR
LatentHarness unifies memory access and reasoning by treating them as sequential "latent actions"—THINK, RECALL, and EXIT—selected by a learned policy. By using a novel training method called Counterfactual Policy Distillation (CPD), the model learns exactly when to compute further and when to retrieve stored evidence, resulting in a 10% accuracy boost and a massive 5.9x speedup on long-context reasoning tasks.
What Problem Does This Paper Address?
Reasoning over long contexts presents two major hurdles for Large Language Models (LLMs). First, they must retain evidence across massive inputs (the "needle in a haystack" problem). Second, they must sustain complex, multi-step computation without losing their way.
Current solutions usually treat these as separate problems: "external memory" (like RAG or specialized memory tokens) handles the evidence, while "latent reasoning" (looping through layers) handles the computation. However, these systems are often inefficient. Models might waste "thinking" cycles on information they already have or fail to recall a crucial fact because the memory system is disconnected from the reasoning process. The authors ask: can we unify memory and reasoning into a single, fluid latent process?
Methods
The authors introduce LatentHarness, which builds on "looped" transformer architectures. Instead of a fixed number of layers, the model treats each internal step as a decision point.
The Latent Action Space
At each step, a policy chooses one of three actions:
- THINK: Applies the transformer block again to deepen reasoning and writes the result to a fast-weight associative memory.
- RECALL: Performs a cheap matrix-vector product to read from that memory, injecting evidence or prior thoughts back into the hidden state.
- EXIT: Stops internal processing and emits the next token.
Counterfactual Policy Distillation (CPD)
The core innovation is how this policy is trained. Standard Reinforcement Learning (RL) provides "coarse" credit—you only know if the final answer was right. LatentHarness uses CPD, which branches every possible action for one step at every internal state to see how it affects the probability of the correct next token.
If a RECALL action significantly boosts the probability of the right word compared to a THINK action, the policy receives a strong signal to prefer memory in that specific context. This also teaches a "write gate" which intermediate states are actually worth saving for later.
Datasets
The model was evaluated across two main categories:
- General Reasoning: GSM8K (math), MATH500, and GPQA-Diamond (science).
- Long-Context Reasoning: 2WikiMultihopQA, MuSiQue, and HotpotQA. These were specifically padded with "distractor" text to lengths of 4k, 8k, 16k, 32k, and 64k tokens to test the limits of memory retrieval.
Key Insights and Ideas
- Selective Recall is Mandatory: The authors found that an "always read" strategy (reading memory at every step) actually performs worse than LatentHarness. The model needs to decide to read only when evidence is missing; otherwise, the memory signal just acts as noise.
- Thinking Converges, Memory Diverges: Analysis showed that repeated
THINKsteps eventually produce diminishing returns, as the hidden state converges.RECALL, however, introduces a "new direction" to the hidden state that further computation alone cannot reconstruct. - Efficiency on Long Inputs: On long-context tasks, LatentHarness actually uses fewer
THINKsteps than baselines. It realizes that for unsettled positions, evidence is missing from the hidden state, makingRECALLa much higher-gain action than another loop of computation.
Key Results
LatentHarness demonstrates that being "smart" about when to think leads to both better answers and faster inference:
- Accuracy: At the 1.4B parameter scale, it improved general reasoning by 2.8% and long-context reasoning by 10.0% relative to the strongest baselines.
- Speed: It is 5.9x faster than the strongest long-context baseline (Memory-R2) because it avoids unnecessary token-space memory operations and redundant computation.
- Compute Efficiency: It achieves these gains while using only about 55% of the backbone's full-depth FLOPs.
Limitations and Future Work
- Distractor Interference: While highly effective, the model still struggles with "nearby distractors" in extremely complex multi-hop queries (like 4-hop MuSiQue). The query mechanism sometimes retrieves a plausible-looking distractor instead of the true supporting fact.
- Training Overhead: While inference is much faster, the CPD training process requires branching and scoring multiple actions, which increases the computational cost during the training phase.
- Scaling: The study focused on 1.4B and 2.6B models. Exploring how these latent actions scale to 70B+ models remains a promising frontier.
Summary updated