Prefix Sliding is a technique for cutting memory use during . Instead of keeping the whole reasoning trace, it keeps the prompt prefix plus a sliding window over the most recent tokens, dropping intermediate steps. Because those intermediate tokens receive little attention once the model has moved on, the memory cost becomes constant no matter how long the model thinks.
Without retraining, this gives existing models a 3x speedup at the same performance. With , it enables rollouts beyond 100,000 tokens and better final performance. Ablations show it beats summarizing old tokens or using a sliding window alone.