arXiv:2604.18567cs.LGcs.AI2026-04

通过监测残差流实现推理时错误修正,无需微调即可提升大模型推理准确率。

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

论文配图:Latent Phase-Shift Rollback: Inference-Time Error Correction via Residual Stream Monitoring and KV-Cache Steering
图 1 · 摘自论文原文
  • 实时监控关键层残差流,用双门机制检测方向突变
  • 错误发生时回滚KV缓存并注入修正向量,准确率提升15.2个百分点
  • 不需额外计算,适合对推理精度要求高的部署场景

大语言模型在生成过程中常出现无法挽回的推理错误:一旦出错,后续输出会不断放大错误。本文提出潜变量相位回滚(LPSR):每一步生成时,监测关键层lcrit的残差流,通过余弦相似度与熵的双重门控检测突然的方向反转(相位突变),并通过回滚KV缓存和注入预计算的引导向量进行纠正。无需微调、梯度计算或额外前向传播。LPSR在MATH-500上以8B模型达到44.0%准确率,远超标准自回归生成(28.8%,+15.2个百分点;McNemar χ² = 66.96, p < 10⁻¹⁵)。相比之下,提示式自我修正仅得19.8%,低于标准生成;LPSR高出24.2个百分点(χ² = 89.4, p ≈ 0)。LPSR以5.4倍更低的令牌成本超越Best-of-16,且在约3倍令牌预算下,以8.75倍更少参数超越标准70B模型(35.2%)。32层扫描发现检测与纠错的解耦现象:错误检测AUC在第14层达峰值0.718,但任务准确率在第16层最高(44.0% vs. 29.2%),表明最佳监控深度因任务而异。

原文摘要 · Abstract (English)

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.

推理优化错误修正大模型

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。