PENCIL: Long Thoughts with Short Memory

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Yang, Chenxiao, Srebro, Nathan, McAllester, David, Li, Zhiyuan
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866916828373057536
author Yang, Chenxiao
Srebro, Nathan
McAllester, David
Li, Zhiyuan
author_facet Yang, Chenxiao
Srebro, Nathan
McAllester, David
Li, Zhiyuan
contents While state-of-the-art LLMs have demonstrated great promise of using long Chains-of-Thought (CoT) to boost reasoning, scaling it up to more challenging problems at test-time is fundamentally limited by suboptimal memory usage -- intermediate computations accumulate indefinitely in context even when no longer needed for future thoughts. We introduce PENCIL, which incorporates a novel reduction mechanism into the autoregressive generation process that recursively cleans up intermediate thoughts based on patterns learned from training. By iteratively generating and erasing thoughts, PENCIL can think deeper to solve harder problems using shorter context and less compute. Empirically, we observe PENCIL is significantly more effective and efficient than CoT. For example, we demonstrate PENCIL with a small 25M-parameter transformer and 2048 context length solves Einstein's puzzle -- a task that challenges much larger models like GPT-4. Theoretically, we prove PENCIL can perform universal efficient computation by simulating any Turing machines with optimal time and space complexity, and thus can solve arbitrary computable tasks that are otherwise intractable for vanilla CoT.
format Preprint
id arxiv_https___arxiv_org_abs_2503_14337
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle PENCIL: Long Thoughts with Short Memory
Yang, Chenxiao
Srebro, Nathan
McAllester, David
Li, Zhiyuan
Machine Learning
Computation and Language
While state-of-the-art LLMs have demonstrated great promise of using long Chains-of-Thought (CoT) to boost reasoning, scaling it up to more challenging problems at test-time is fundamentally limited by suboptimal memory usage -- intermediate computations accumulate indefinitely in context even when no longer needed for future thoughts. We introduce PENCIL, which incorporates a novel reduction mechanism into the autoregressive generation process that recursively cleans up intermediate thoughts based on patterns learned from training. By iteratively generating and erasing thoughts, PENCIL can think deeper to solve harder problems using shorter context and less compute. Empirically, we observe PENCIL is significantly more effective and efficient than CoT. For example, we demonstrate PENCIL with a small 25M-parameter transformer and 2048 context length solves Einstein's puzzle -- a task that challenges much larger models like GPT-4. Theoretically, we prove PENCIL can perform universal efficient computation by simulating any Turing machines with optimal time and space complexity, and thus can solve arbitrary computable tasks that are otherwise intractable for vanilla CoT.
title PENCIL: Long Thoughts with Short Memory
topic Machine Learning
Computation and Language
url https://arxiv.org/abs/2503.14337