TL;DR
Large Language Models waste valuable "thinking" compute during inference by completely discarding their own self-generated reasoning paths. This paper introduces Experiential Latent Memories (ELM), a method that distills this test-time compute into ultra-lightweight, reusable "soft prompts" (~0.001% of model parameters) via self-supervised reinforcement learning. This allows LLMs to continuously self-improve online from their own experiences without requiring external labels or risking catastrophic forgetting.
What Problem Does This Paper Address?
When modern LLMs tackle complex mathematical or logical problems, they often use extended inference-time compute (like Chain-of-Thought) to explore various reasoning paths. However, once an answer is delivered, the model resets; it remains completely stateless, throwing away its own self-generated data and structural insights.
Existing attempts to fix this usually fall into two camps, both with major flaws:
- In-Context Learning (ICL) / Textual Memories: Storing past reasoning traces as raw text and retrieving them for new prompts. This hits a "textual bottleneck"—discrete tokens discard rich internal signals (like confidence and intermediate states) and struggle to generalize beyond surface-level patterns.
- Offline Reinforcement Learning (RL): Updating the entire model's parameters using self-generated rewards. This requires access to the full dataset upfront and full-model updates, which are computationally expensive and prone to "catastrophic forgetting" (where learning new things destroys old capabilities).
The authors tackle the challenge of truly online, streaming self-improvement: How can a deployed LLM internalize its own problem-solving experiences on the fly, efficiently, and without external supervision or capability degradation?
Methods
The authors propose ELM (Experiential Latent Memory), an online framework that converts transient computation into persistent, modular knowledge units.
[Incoming Problem]
│
▼
[Retrieve Best Soft Prompt Memory] ──► [Generate Memory-Augmented Response] ──┐
│ ▼
├─────────────────────────────► [Generate Zero-Shot Response] ──► [PRM Verifier Routes to Best Answer]
│
▼
[Run 8 Rollouts + Majority Vote Reward] ──► [Train New Soft Prompt (10 Steps GRPO)] ──► [Add to Memory Pool]
ELM operates via three core mechanisms:
- Memory Creation via Test-Time RL: When a model encounters a problem, it generates multiple rollouts ($G=8$). It uses majority voting to establish a consensus answer, which serves as an internal reward signal. Instead of updating the massive base model, ELM uses Group Relative Policy Optimization (GRPO) to train a tiny soft prompt (a sequence of 20 trainable continuous vectors prepended to the input, representing $\sim 0.001\%$ of model parameters) for just 10 gradient steps.
- Memory Retrieval: These trained soft prompts are stored in a pool. When a new problem arrives, ELM retrieves the closest historical memory using cosine similarity. The paper explores two retrieval spaces: Input retrieval (in the embedding space) and KV retrieval (pooling key-value activations across internal layers).
- Response Routing: Because self-supervised memories can occasionally be noisy, ELM generates both a zero-shot response and a memory-augmented response. If they disagree, a Process Reward Model (PRM) acts as a verifier to route the final output to the higher-scoring response.
Datasets
The authors evaluated ELM on three challenging mathematical reasoning benchmarks:
- MATH500: A 500-problem subset of the competition-level MATH dataset, covering algebra, geometry, and number theory.
- AMC23: Problems from the 2023 American Mathematics Competitions.
- AIME24: High-difficulty problems from the 2024 American Invitational Mathematics Examination.
Evaluations were conducted using two distinct model families: Llama-3.1-8B-Instruct (a general-purpose instruction model) and Qwen2.5-Math-7B (a math-specialized base model).
Key Insights and Ideas
- The Textual Bottleneck is Real: Storing raw text traces or self-reflections fails to generalize. Latent representations (soft prompts) capture abstract reasoning structures rather than surface text patterns, allowing the model to transfer strategies to structurally similar but textually different problems.
- Instance-Level Training Elicits Strong Generalization: Surprisingly, lightly training a modular parameter on a single problem instance using internal rewards can yield broader generalization gains that match or even exceed full-dataset offline training.
- Memories are Highly Specialized: A latent memory that significantly helps one type of math problem can actively harm performance on an unrelated problem (a phenomenon called "negative flips"). This makes selective retrieval and verification routing absolutely mandatory for reliable deployment.
- Modularity Bypasses Forgetting: Because the base model remains entirely frozen and memories are isolated into independent soft prompts, there is zero cross-sample interference or catastrophic forgetting.
Key Results
ELM consistently outperformed zero-shot baselines and training-free memory methods (like Reasoning Bank and Log-Augmented Generation) across the board.
- MATH500 (Streaming Online): Llama-3.1-8B-Instruct improved from 45% (Zero-shot CoT) to 51.4% using ELM. Crucially, this online, single-pass approach beat full-dataset offline training methods like standard GRPO (47%) and TTRL (45.6%).
- AMC23: Qwen2.5-Math-7B jumped from 50% to 62.5%, matching full offline dataset training performance without needing any prior data access.
- Cross-Dataset Transfer: Memories trained entirely on AMC23 problems successfully boosted performance when evaluated on the harder AIME24 dataset (and vice versa), proving that the soft prompts capture reusable, structural mathematical expertise.
Limitations and Future Work
- No Upfront Quality Filtering: The current method cannot predict whether a specific problem will yield a high-quality, highly generalizable memory or a noisy one before running the training steps.
- Dependency on Verifiers: ELM relies heavily on an external Process Reward Model (PRM) to safeguard against bad memory retrievals.
- Memory Pool Scalability: As an LLM streams thousands of problems over its deployment lifespan, the memory pool will grow indefinitely. The authors note that future work must explore memory management strategies—such as composing, merging, evicting, or periodically distilling these latent memories back into the main model parameters.
Summary updated