首页 > AI前沿 > LoopCache: Accelerating Long-Context Self-Speculative Decoding for Looped Transformers

LoopCache: Accelerating Long-Context Self-Speculative Decoding for Looped Transformers

arXiv自然语言 2026-11-18 20:11 27 阅读 查看原文
用户现在需要把给定的新闻正文排版成语义化的HTML片段,遵守那几个规则。首先,先看内容,是学术相关的新闻正文,首先整体是一段?不对,先看内容的结构,首先开头是介绍Looped Transformers的部分,然后讲现有方法的局限,然后讲提出的LoopCache的方法和优势,最后实验结果。哦不对,先拆分段落?不对,原文的结构:首先第一句到“across loops in a single step.”是介绍背景和现有方法的?不对,仔细看原文:第一部分:介绍Looped Transformers的机制,以及WaveFront Decoding这类方法的出发点。然后下一部分是讲它们的两个局限。然后下一部分是提出LoopCache的应对方法。然后最后是实验结果。不对,要准确拆分自然段落?哦原文是一段?不对,用户给的正文是一段?不对,仔细看用户给的正文:是连续的一段?不对,等下,用户给的正文是: 首先讲Looped Transformers的实现,然后说最近的wave-style自推测方法比如WFD和LoopSpec的作用,然后讲它们的两个局限。然后说为了解决这些挑战提出LoopCache,然后讲LoopCache的两个策略,还有保留KV cache的部分,最后实验结果。 那首先,有没有需要h2或者h3?哦,看,首先可以分小节?不对,先看规则2是长文用h2/h3划分小节。那可以划分:比如

背景与现有方法局限

?不对不行,不能增删内容,哦对,规则4是保留原文所有信息,不得增删改内容,所以h2/h3的标题不能自己加内容啊?哦不对,哦等下,规则是长文用h2/h3划分小节,那如果原文的内容可以划分的话,但标题不能自己加?不对不对,哦不对,是不是如果原文没有小节标题的话,就不能乱加?哦不对,再仔细看用户给的正文,是一整段的纯文本?不对,等下看原文的结构: 第一部分内容: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. 不对,但是不能加标题啊,因为规则4不能增删内容,那h2/h3怎么用?哦不对,是不是如果原文没有明确的小节标题,那不需要强行加?不对,再看规则2是“长文用

/

划分小节”,但如果原文是连续的段落,那可以按内容分段,每个自然段用p包裹?不对,原文的每个自然段是用户给的那些?哦不对,用户给的正文是一整段?不对,我再仔细看:用户给的正文是从Looped开头到speedup over WFD and LoopSpec,是一整个段落?不对,不对,可能用户给的正文里的自然段落?哦不,用户给的正文是连续的,没有换行的?那怎么办?哦不对,规则2说“每个自然段落用

包裹”,那首先要把原文的内容按逻辑拆成自然段落?不对,但是不能增删内容,拆分段落不算增删内容对吧?哦对,拆分是排版,内容不变。 哦等下,再仔细看内容,还有重要句子可以用strong,比如两个局限的点?还有提出的方法的关键?还有实验结果? 不对,首先,先处理: 首先,第一部分:介绍Looped Transformers和现有方法的背景:

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.

不对?但是有没有需要h2的?哦,规则说长文用h2/h3划分小节,但是原文没有小节标题,我们不能自己加标题内容对吧?因为不能增删内容,所以h2/h3如果没有原文的标题的话,就不用加?不对,等下再看规则2:“每个自然段落用

包裹,长文用

/

划分小节”,哦,如果原文的内容有小节的话,比如原文有小标题的话就用,但是这里原文没有,所以不需要加h2/h3?对,因为加标题的话就是新增内容了,违反规则4。 然后,有没有列表?原文没有列表,所以不用ul。有没有引用?没有。有没有代码?没有。所以就是几个p标签,然后重要的句子加strong。 等下再检查有没有增删改内容:所有内容都保留,拆分段落是对的,因为自然段落的拆分是排版,内容没变。然后strong加的是重要句子,符合规则3。 等下再调整下,有没有问题?哦,对了,原文的“Rx”是保留的对吧?对,不要改。 再核对原文内容: 第一段内容完全和原文的前两句一致。 第二段:开头However, they face two critical limitations. 然后两个first和second,加strong,内容完全一致。 第三段:To address these challenges...到negligible overhead,内容完全一致。 第四段:实验结果,加strong,内容完全一致。 对,这样就可以?不对,等下,有没有可能我拆分段落不对?比如是不是可以不拆分?不对,规则说每个自然段落用p包裹,原文的这些内容是逻辑上的几个自然段对吧?对,因为原文虽然用户给的时候是连续的,但是逻辑上是四个部分?不对,再看:哦,不对,用户给的原文是不是一整个段落?哦,我再看用户给的正文: 用户给的正文是: 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