arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.18567cs.LGcs.AIcs.CL
收藏

潜在相位偏移回滚:通过残差流监控和KV-缓存引导进行推理时的误差校正

Latent Phase-Shift Rollback: Inference-Time Error Correction via Residual Stream Monitoring and KV-Cache Steering

BITS Pilani, Pilani Campus(比斯派恩大学,帕利尼校区)

Manan Gupta, Dhruv Kumar

AI总结:

本文提出LPSR方法,通过监控残差流和引导KV缓存来校正大语言模型中的推理错误,显著提升在MATH-500上的性能,同时在参数和token成本上更具优势。

摘要:

大型语言模型在生成过程中常出现不可恢复的推理错误:一旦出现错误步骤,后续的token会放大错误而非纠正。我们引入潜在相位偏移回滚(LPSR):在每个生成步骤中,监控关键层lcrit的残差流,通过余弦相似度+熵双门控检测突变方向反转(相位偏移),并响应时回滚KV缓存并注入预计算的引导向量。无需微调、梯度计算或额外前向传递。LPSR在8B模型上达到MATH-500的44.0%,优于标准AR(+15.2个百分点;McNemar χ²=66.96,p<10^-15)。关键的是,受提示的自我校正,最自然的推理时基线,仅得19.8%,低于标准AR;LPSR超过它+24.2个百分点(χ²=89.4,p≈0)。LPSR在5.4倍更低的token成本下优于Best-of-16(+7.8个百分点),并在参数更少的情况下超越标准70B模型(35.2%)。32层扫描揭示了新的检测-校正脱节现象:误差检测AUC在第14层峰值(0.718),但任务准确率在第16层峰值(44.0% vs. 29.2%),表明检测和校正的最优监控深度不同。

英文摘要:

Large language models frequently commit unrecoverable reasoning errors mid-generation: once a wrong step is taken, subsequent tokens compound the mistake rather than correct it. We introduce $\textbf{Latent Phase-Shift Rollback}$ (LPSR): at each generation step, we monitor the residual stream at a critical layer lcrit, detect abrupt directional reversals (phase shifts) via a cosine-similarity $+$ entropy dual gate, and respond by rolling back the KV-cache and injecting a pre-computed steering vector. No fine-tuning, gradient computation, or additional forward passes are required. LPSR achieves $\mathbf{44.0\%}$ on MATH-500 with an 8B model versus $28.8\%$ for standard AR ($+15.2$ pp; McNemar $χ^2 = 66.96$, $p < 10^{-15}$). Critically, prompted self-correction, the most natural inference-time baseline, scores only $19.8\%$, below standard AR; LPSR exceeds it by $+24.2$ pp ($χ^2 = 89.4$, $p \approx 0$). LPSR also outperforms Best-of-16 ($+7.8$ pp) at $5.4\times$ lower token cost, and surpasses a standard 70B model ($35.2\%$) with $8.75\times$ fewer parameters at ${\sim}3\times$ the token budget. A 32-layer sweep reveals a novel \textbf{detection-correction dissociation}: error-detection AUC peaks at layer~14 ($0.718$) but task accuracy peaks at layer~16 ($44.0\%$ vs.\ $29.2\%$), demonstrating that optimal monitoring depth differs for detection and correction.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑