atlas

Research map / Large language models / Reasoning and chain of thought

PENCIL: Long Thoughts with Short Memory

ICML 2025 · Large language models › Reasoning and chain of thought · approach: Chain-of-thought training and analysis

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes PENCIL, an autoregressive generation scheme that interleaves token generation with a learned-pattern reduction rule that erases finished intermediate thoughts, enabling polynomial-memory long reasoning and proving universal space-efficient computation for transformers.

Problem

Chain-of-thought reasoning accumulates all intermediate computation in context, so memory grows with reasoning length, which limits solving computationally hard problems (SAT, QBF, Einstein's puzzle) under fixed context windows.

Approach

Add a reduction rule (inspired by function call stacks) with special tokens [CALL], [SEP], [RETURN] that deletes the intermediate thoughts of a completed sub-computation and keeps only its answer, applied repeatedly during autoregressive generation; training computes loss only on newly generated tokens per reduced sequence.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use PENCIL reduction instead of CoTSAT · SAT n=10accuracy: 50 -> 100Helped
Use PENCIL reduction instead of CoTQBF · QBF n=10accuracy: 73 -> 100Helped
Use PENCIL reduction instead of CoTEinstein's puzzle · Einstein's puzzle 5×5accuracy: 25% -> 97%Helped
Remove tail recursion (ablation)PENCIL on Einstein's puzzle · Einstein's puzzle 5×5maximal sequence length: 3,335 -> 7,705Hurt

Surprising findings

Limitations

Experimental setup

Datasets: synthetic 3-SAT instances (ratio 4.3) synthetic QBF instances synthetic Einstein's puzzle instances (3x3, 4x4, 5x5)

Benchmarks: 3-SAT (n=3-10) QBF (n=3-10) Einstein's puzzle 3x3, 4x4, 5x5

Metrics: accuracy trace rate inference time FLOPs-based convergence

Baselines: CoT GPT-4 few-shot CoT

Builds on: chain-of-thought RASP average-hard attention DPLL algorithm

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy