Procedural Knowledge at Scale Improves Reasoning

Di Wu, Devendra Singh Sachan, Wen-tau Yih, Mingda Chen

This paper, published at COLM 2026, introduces Reasoning Memory, a framework designed to help Large Language Models (LLMs) reuse "procedural knowledge"—the strategies and subroutines used to solve problems—rather than just factual data. By building a massive datastore of 32 million reasoning subroutines, the authors demonstrate that retrieving how to solve a problem is far more effective for reasoning models than retrieving what a fact is.

TL;DR

Reasoning Memory is a RAG framework that allows LLMs to retrieve and reuse specific problem-solving strategies (subroutines) distilled from millions of prior reasoning trajectories. It significantly boosts performance on math, science, and coding benchmarks, outperforming standard document-based RAG by nearly 20% at scale.

What Problem Does This Paper Address?

Recent "reasoning models" (like OpenAI’s o1 or DeepSeek-R1) improve their performance by "thinking longer" at inference time. However, these models typically treat every new problem in isolation, failing to reuse successful strategies from previous tasks.

While Retrieval-Augmented Generation (RAG) is the standard way to give models external knowledge, the authors find that standard RAG—which retrieves raw documents or facts—often hurts reasoning models. These models don't need a definition of a triangle; they need to know the specific steps to calculate its circumradius. This "procedural knowledge" is often missing from web corpora and is difficult to extract from long, noisy reasoning traces.

Figure 2: Standard document RAG benefits instruction-tuned models more than reasoning models. Under the CompactDS pipeline, instruction-tuned models obtain modest gains from retrieval, whereas the corresponding reasoning models often see limited gains or even degradation, despite much stronger no-retrieval performance.

Methods

The authors propose a two-part system: Datastore Construction and In-Thought Retrieval.

  1. Procedural Datastore Construction: Instead of indexing whole documents, they take existing reasoning trajectories (from the Nemotron V1 corpus) and decompose them. Using a teacher model (QwQ-32B), they break long chains of thought into atomic subquestion-subroutine pairs.
  2. Subquestion: A concise query (e.g., "How to compute the area of a triangle given side lengths?").
  3. Subroutine: A high-level, reusable strategy (e.g., "Use Heron’s formula:
  4. Find semiperimeter..."). This resulted in a datastore of 32 million entries.

  5. In-Thought Active Retrieval: At inference time, they use a "thought-hijacking" prompt. The model is forced to start its thinking process by verbalizing a search query. The system then retrieves the top-$k$ subroutines and injects them directly into the model's "thinking" stream as a hint.

  6. Diversity-First Scaling: To make the most of a test-time compute budget, the framework samples multiple reasoning trajectories under different retrieved subroutines. They then use a length-based uncertainty heuristic (preferring shorter, more concise reasoning paths) to filter and select the final answer.
Figure 1: Illustration of the Reasoning Memory framework. (a) We extract self-contained procedural knowledge from diverse public reasoning trajectories to construct a datastore. (b) At inference time, we retrieve top-k subquestion-subroutine pairs, generate separate groups of candidate trajectories under each subroutine, and filter and rank the candidates. The source trajectories are not inserted.

Datasets

  • Datastore Source: Nemotron V1 post-training corpus (Math, STEM, and Code subsets).
  • Evaluation Benchmarks:
    • Math: AIME 2024, AIME 2025, and MATH500.
  • Science: GPQA-Diamond.
  • Coding: LiveCodeBench (LCB) V1-V4 and V5-V6.

Key Insights and Ideas

  • Procedural > Factual: For reasoning tasks, a targeted strategy (procedural) is significantly more helpful than a relevant fact (factual). In pilot studies, even synthesized procedural hints outperformed factual ones across all model families.
  • The RAG Mismatch: Standard RAG is poorly aligned with reasoning models. Because these models generate long internal "thoughts," irrelevant retrieved context can be amplified, leading to worse performance than no retrieval at all.
  • Diversity Wins: When you have a fixed compute budget (e.g., 100 samples), it is better to explore a diverse set of retrieved strategies (Diversity-First) than to generate many samples for a single strategy (Intensity-First).
  • Cross-Domain Transfer: Interestingly, code-only trajectories were found to be surprisingly effective for math and science tasks, suggesting that the logic of debugging and case analysis is highly transferable.

Key Results

Reasoning Memory consistently outperformed all baselines, including document-level RAG, trajectory-level RAG, and compute-matched "Length Scaling" (sampling without retrieval).

  • Overall Gain: Averaged across models and tasks, it improved accuracy by 19.5% over no retrieval.
  • Efficiency: It outperformed compute-matched baselines by 8.9%, proving that retrieval is a more efficient use of test-time compute than just "thinking longer" blindly.
  • Scaling: As the inference budget increases, the gap between Reasoning Memory and standard scaling widens, particularly in math and coding.
Figure 3: Performance scales more effectively with Reasoning Memory (Diversity-First) than with simple length-based scaling.

Limitations and Future Work

  • Query Specificity: If the model's self-generated query is too specific (e.g., including specific numbers from the problem), the retriever may fail to find a general, useful subroutine.
  • Problem Mismatch: Sometimes a retrieved hint is logically sound but doesn't fit the specific constraints of the problem (e.g., suggesting a law that assumes a condition not present in the prompt).
  • Model Size: The study focused on models 7B and larger; the effectiveness on smaller edge-device models remains untested.
  • Future Directions: The authors suggest exploring "active learning" for the memory corpus—letting the model identify and store its own successful subroutines over time.

The experiment code is available at github.com/facebookresearch/reasoning-memory.

Summary updated

BibTeX
@inproceedings{wu2026procedural,
  author = {Di Wu and Devendra Singh Sachan and Wen-tau Yih and Mingda Chen},
  title = {{Procedural Knowledge at Scale Improves Reasoning}},
  booktitle = {COLM},
  year = {2026},
  url = {https://openreview.net/forum?id=Bmsm9ciJ5D},
}
Figure