Reproduce “PENCIL: Long Thoughts with Short Memory” on OpenResearch

Turn your favorite coding agents into research agents that review literature, develop hypotheses, and run experiments.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Chenxiao Yang, Nathan Srebro, David McAllester, Zhiyuan Li

PENCIL introduces a learned memory management framework for Large Language Models, enabling them to dynamically prune intermediate thoughts during complex reasoning tasks. This approach achieves near-perfect accuracy on PSPACE-complete problems like QBF and drastically reduces context length by up to 230x compared to standard Chain-of-Thought methods.

Key insights

  • Active, dynamic memory management is crucial for scaling Large Language Model (LLM) reasoning to complex, multi-step problems, moving beyond simple context extension.
  • PENCIL-augmented transformers can achieve universal space-efficient computation, theoretically enabling the solution of PSPACE-complete problems with polynomial maximal context length.
  • Integrating learned reduction rules allows LLMs to mimic efficient computational paradigms like function calls and stack deallocation, improving both performance and resource utilization.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.