LoopCache: Accelerating Long-Context Self-Speculative Decoding for Looped Transformers
Zizhuo Fu, Haochen Huang, Shengxuan Qiu, Linye Wei, Ziyu Tang, Runsheng Wang, Meng Li
Abstract
Looped Transformers achieve large effective depth with compact models by repeatedly applying a weight-shared block across R recurrent steps, each maintaining a loop-specific key-value (KV) cache. To accelerate sequential loop execution, recent wave-style self-speculative methods like WaveFront Decoding (WFD) and LoopSpec pipeline draft and target tokens across loops in a single step. However, they face two critical limitations. First, they draft only at fixed loops and ignore intermediate prediction changes, wasting computation on stale trajectories. Second, batching tokens from different loops loads up to Rx the KV cache per step, severely amplifying memory traffic in long-context scenarios. To address these challenges, we propose LoopCache, an efficient self-speculative decoding framework for long-context Looped Transformers. Based on the correlation between prediction switches and output confidence, LoopCache introduces confidence-guided dynamic draft updating to refine drafts in flight across all intermediate loops. Furthermore, LoopCache employs a cyclic loop KV cache strategy that rotates through loop-specific KV caches, restricting per-step KV traffic to a single loop while batching tokens at the nearest matching cycle for lossless verification. By also selectively retaining independent KV caches for a few loop-sensitive shallow layers, LoopCache improves acceptance rates with negligible overhead. Experiments show that LoopCache achieves average 10.25x and 14.56x speedup over WFD and LoopSpec.
Create a lesson
Related papers
LongCat Recall Sparse Attention: Co-Designing Key Organization and Retrieval for Long-Context Inference
Shared title terminology · Hao Zhang, Bin Xiao, Kefeng Zhang
NarrowSpec: Draft Hidden Width Need Not Match the Target in Speculative Decoding
Shared title terminology · Alagappan Valliappan, Ankit More, Dheevatsa Mudigere et al.
From Repositories to Training Environments: Scaling Long-Horizon Coding Agents with Environment Evolution Loop
Shared title terminology · Yang Tian, Tianyu Zheng, Xiyuan Yang et al.
Breaking the Long Horizon: Short-Horizon Process Supervision for Long-Form Generation in LLMs
Shared title terminology · Heyang Xu, HanWen Hao, Qianren Mao et al.
Explicit Style Extraction for Personalized Long-Form Text Generation
Shared title terminology · Jenitha Reddy Patel, Sameeksha Kini, Amulya Rayasam et al.
Your Judge Inherits Your Prompt: In-Context Label Bias in an LLM-as-Judge Is Directional, Not Symmetric
Shared title terminology · Abdullah Ahmad, Ahmed J. O. Ahmed, Luca Citi