GradCuit: 信用分配的梯度流实现鲁棒且可解释的测试时潜在推理
GradCuit: Credit-Assigned Gradient Flow Enables Robust and Interpretable Test-Time Latent Reasoning
August 3, 2026
作者: Zhaoxin Yu, Qi Shen, Hengli Li, Zhaowei Zhang, Song-Chun Zhu, Chi Zhang, Zilong Zheng
cs.AI
摘要
基于优化的潜在推理通过在测试时优化实例特定的连续状态来提升大语言模型的输出,同时保持模型参数冻结。然而,现有方法通常通过解码词元将这些状态与推理轨迹连接起来,使得序列级信用分配变得间接,并模糊了潜在更新如何塑造后续推理。我们提出GradCuit(通过电路的梯度),它在选定的Transformer层中,于提示的隐表示与生成的续写之间插入可优化的潜在状态。因果自注意力为每个续写词元的对数概率提供了通向每个先前潜在状态的可微路径——经由剩余的Transformer模块——使得来自整个续写的奖励加权梯度能够直接分配给潜在状态。在五个指令微调骨干模型、三个推理基准和两种答案格式上,GradCuit实现了64.5%的平均准确率,比思维链提示高出6.6个百分点,比最强竞争方法高出2.4个百分点。GradCuit还展现出更强的鲁棒性:在七种学习率设置下,它持续优于LatentSeek,同时将准确率的标准差从1.53降至0.82,甚至其随机游走变体仍可与LatentSeek媲美。在可解释性方面,词元级梯度归因显示潜在影响集中于推理连接词元,而层分析则识别出早期至中期的Transformer层是最有效的优化空间。通过从结果反馈中直接优化内部推理,GradCuit开辟了鲁棒且可解释的测试时扩展的新维度——大语言模型调整自身的推理方式,而非仅仅重新生成、采样或重排输出。
English
Optimization-based latent reasoning improves large language model outputs by optimizing instance-specific continuous states at test time while keeping model parameters frozen. Existing methods, however, typically connect these states to the reasoning trajectory through decoded tokens, making sequence-level credit assignment indirect and obscuring how latent updates shape subsequent reasoning. We introduce GradCuit (gradient through circuit), which inserts optimizable latent states at a selected Transformer layer between the hidden representations of the prompt and the generated continuation. Causal self-attention provides every continuation-token log-probability with a differentiable path to every preceding latent state through the remaining Transformer blocks, enabling reward-weighted gradients from the entire continuation to be assigned directly to the latents. Across five instruction-tuned backbones, three reasoning benchmarks, and two answer formats, GradCuit achieves an average accuracy of 64.5%, outperforming chain-of-thought prompting by 6.6 percentage points and the strongest competing method by 2.4 points. GradCuit also demonstrates greater robustness: across seven learning-rate settings, it consistently outperforms LatentSeek while reducing the standard deviation of accuracy from 1.53 to 0.82, and even its random-walk variant remains competitive with LatentSeek. For interpretability, token-level gradient attribution reveals that latent influence concentrates on reasoning-connector tokens, while layer analysis identifies early-to-middle Transformer layers as the most effective optimization space. By directly optimizing internal reasoning from outcome feedback, GradCuit opens a new axis of robust and interpretable test-time scaling, where LLMs adapt how they reason rather than merely regenerate, sample, or rerank outputs.