Dynamic Cheatsheet: Test-Time Learning with Adaptive Memory

Mirac Suzgun, Mert Yüksekgönül, Federico Bianchi, Dan Jurafsky, James ZouarXiv 2025 · DOI

Introduction

Current Large Language Models (LLMs) are fundamentally "stateless" during inference. They treat each query in isolation, often repeating the same logical or arithmetic errors across similar tasks. While Retrieval-Augmented Generation (RAG) provides access to external data, it typically relies on static databases. The Dynamic Cheatsheet (DC) framework addresses this by enabling test-time learning: a mechanism for models to incrementally improve their own problem-solving "toolkit" through a persistent, self-evolving memory.

Methodology: The Learning Loop

The DC framework operates through a continuous cycle involving two primary modules:

  1. Solution Generation (Gen): Upon receiving a query, the model retrieves relevant insights from its "cheatsheet"—a text-based external memory—and combines them with its internal reasoning to generate a solution.
  2. Memory Curation (Cur): Following the response, the model evaluates its own output. It identifies successful strategies, code snippets, or heuristics to add to the cheatsheet, while pruning or refining less effective entries.
The Memory Curation process refines the model's cheatsheet by evaluating output quality and keeping useful strategies.

The paper explores two variants: DC-Cu (Cumulative), where memory grows linearly, and DC-RS (Retrieval & Synthesis), where the model synthesizes a task-specific cheatsheet from a broader history log. Crucially, this approach is parameter-free and compatible with closed-source models like GPT-4o and Claude 3.5 Sonnet.

Benchmarking Performance

The framework was evaluated on high-difficulty reasoning benchmarks, including:

  • AIME (2020–2025): Multi-step competitive mathematics.
  • GPQA-Diamond: Expert-validated graduate-level science questions.
  • Game of 24 & Math Equation Balancer: Complex arithmetic puzzles.
  • MMLU-Pro: Professional-level Engineering and Physics subsets.

Key Insights: Tool Discovery and Curation

A standout observation was the emergent "Aha!" moment in the "Game of 24." GPT-4o discovered it could solve puzzles using Python brute-force scripts. By storing this strategy in its cheatsheet, the model's success rate jumped from a 10% baseline to 99%.

The study also found that Curation is superior to simply appending full history. By distilling high-impact strategies, DC avoids "context ballooning" and noise. However, this capability is scale-dependent; while frontier models excel at self-curation, smaller models often populate their memory with "garbage," leading to performance degradation.

Results

The implementation of Dynamic Cheatsheet led to significant performance leaps across all tested domains.

Performance improvements across AIME, GPQA Diamond, Game of 24, and Math Equation Balancer benchmarks using the Dynamic Cheatsheet framework.
  • Mathematics: Claude 3.5 Sonnet's accuracy on AIME 2024 doubled from 23.3% to 50.0%.
  • Arithmetic: Success rates on the Math Equation Balancer reached near-perfection (97.8%).
  • Science: GPQA-Diamond saw a boost to 68.7% as the model maintained a repository of validated formulas and patterns.

Limitations and Future Outlook

While powerful, DC cannot overcome fundamental reasoning gaps; a model must be able to solve a problem at least once to "learn" from it. Additionally, the sequence of tasks matters, as early success on simpler problems helps build a robust heuristic repository. Future research may explore hierarchical memory structures and the integration of more diverse external tools.

Summary updated

BibTeX
@misc{suzgun2025dynamic,
  author = {Mirac Suzgun and Mert Yüksekgönül and Federico Bianchi and Dan Jurafsky and James Zou},
  title = {{Dynamic Cheatsheet: Test-Time Learning with Adaptive Memory}},
  year = {2025},
  eprint = {2504.07952},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2504.07952},
}
Figure