快速启动,缓慢收尾:重新审视推理模型的位置无关缓存(PIC)
Fast to Start, Slow to Finish: Revisiting Position-Independent Caching for Reasoning Models
AI总结:
本文重新审视推理模型的位置无关缓存(PIC),发现现有PIC方法在低重新计算比例下准确率下降,提出无需训练的三步方案,在12个模型-基准组合中多数表现优于现有方法,且在H20 GPU上完成率达完整预填充的1.6-2.5倍。
摘要:
前缀缓存很少在提示词以不同顺序共享文本块时命中。位置无关缓存(PIC)则在离线时单独预填充每个文本块,在任意位置复用这些编译后的KV缓存,并在线重新计算一小部分token以恢复跨块注意力。PIC可缩短短答案的首token延迟,但对于长推理链,该延迟不再反映节省的时间。因此,我们在四个推理模型和三个问答基准上统一重新实现了八种PIC方法并对其进行重新审视。在重新计算比例为20%或更低时,已发表的方法与完整预填充相比准确率下降,且在12个模型-基准组合中的大多数情况下会生成更多token。在服务场景中,其中两种方法甚至比完整预填充更晚完成请求。为追踪PIC缓存如何损害推理,我们将完整预填充的输出重放到该缓存上。损害始于独立编译,其位移在不同提示词间基本共享。在固定文本后编译可在离线时抵消大部分位移,剩余部分留待在线重新计算。由于重新计算的token会揭示其文本块的偏移,传播其均值变化可进一步减少损害。我们将这三个步骤整合为一个无需训练的方案,在12个组合中的10-12个里,该方案在相同20%重新计算比例下的表现优于每种已发表方法,且在9-11个组合中生成的token更少。在H20 GPU上服务时,该方案在测试负载下达到完整预填充峰值完成率的1.6-2.5倍。
英文摘要:
Prefix caching rarely hits when prompts share text chunks in varying orders. Position-independent caching (PIC) instead prefills each chunk separately offline, reuses these compiled KV caches at any position, and recomputes a small share of tokens online to restore cross-chunk attention. PIC cuts first-token latency on short answers, but with long reasoning chains, that latency no longer reflects the time saved. We therefore revisit eight PIC methods in a unified reimplementation on four reasoning models and three QA benchmarks. At 20% recompute or less, the published methods lose accuracy against full prefill and generate more tokens in most of the 12 model-benchmark cells. In serving, two of them can even finish requests later than full prefill. To trace how a PIC cache damages reasoning, we replay full prefill's output over the cache. The damage begins with standalone compilation, whose displacement is largely shared across prompts. Compiling behind one fixed text therefore offsets much of it offline, leaving the rest to online recomputation. Since the recomputed tokens reveal their chunk's shift, propagating their mean change reduces the damage further. We assemble these three steps into a training-free recipe that outscores each published method at the same 20% recompute in 10-12 of the 12 cells and generates fewer tokens in 9-11. In serving on an H20 GPU, the recipe reaches 1.6-2.5x full prefill's peak completion rate over the loads tested.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。