arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2507.17307cs.LGcs.AIcs.CL
收藏

R-Stitch:动态轨迹拼接以实现高效的推理

R-Stitch: Dynamic Trajectory Stitching for Efficient Reasoning

Monash University, Australia(墨尔本大学,澳大利亚);School of Software, Beihang University, China(北航软件学院,中国);South China University of Technology, China(华南理工大学,中国);ZIP Lab, Zhejiang University, China(浙江大学ZIP实验室,中国)

Zhuokun Chen, Zeren Chen, Jiahao He, Lu Sheng, Mingkui Tan, Jianfei Cai, Bohan Zhuang

AI总结:

R-Stitch通过熵引导的混合解码框架,实现高效推理,减少计算成本并保持精度。

摘要:

链式思维(CoT)增强了大型语言模型(LLMs)的问题解决能力,但由于长的自回归轨迹导致推理成本显著增加。现有的加速策略要么通过提前停止或压缩来缩短轨迹,要么采用使用较小模型的推测解码。然而,当模型一致性较低时,推测解码的增益有限,并且严格强制令牌层面的一致性,忽略了这样一个观察:一些较小的模型在正确的情况下会产生显著更简洁的推理轨迹,从而减少推理长度。我们介绍了R-Stitch,一种无需训练的混合解码框架,它利用令牌层面的熵作为不确定性代理,将计算任务委托给小型语言模型(SLM)和LLM之间。我们的分析表明,高熵令牌更可能引起错误,这促使我们采用熵引导的路由策略,让SLM高效处理低熵令牌,同时将不确定的令牌委托给LLM,从而避免完全回滚并保持答案质量。我们进一步扩展了这一设计,引入R-Stitch+,它学习了一个自适应的路由策略,以动态调整令牌预算,超越固定阈值。通过同时减少每令牌解码复杂度和生成的令牌数量,我们的方法实现了显著的加速,同时精度损失可忽略不计。具体而言,它在DeepSeek-R1-Distill-Qwen-7B上达到峰值加速3.00倍,在14B上达到3.85倍,在QWQ-32B上达到4.10倍,同时保持与完整LLM解码相当的精度。此外,它自然地实现了自适应的效率-精度权衡,可以针对不同的计算预算进行调整,而无需重新训练。

英文摘要:

Chain-of-thought (CoT) enhances the problem-solving ability of large language models (LLMs) but incurs substantial inference cost due to long autoregressive trajectories. Existing acceleration strategies either shorten traces via early stopping or compression, or adopt speculative decoding with a smaller model. However, speculative decoding provides limited gains when model agreement is low and rigidly enforces token-level consistency, overlooking the observation that some smaller models, when correct, produce significantly more concise reasoning traces that could reduce inference length. We introduce R-Stitch, a training-free hybrid decoding framework that leverages token-level entropy as an uncertainty proxy to delegate computation between a small language model (SLM) and an LLM. Our analysis shows that high-entropy tokens are more likely to induce errors, motivating an entropy-guided routing strategy that lets the SLM efficiently handle low-entropy tokens while delegating uncertain ones to the LLM, thereby avoiding full rollbacks and preserving answer quality. We further extend this design with R-Stitch$^{+}$, which learns an adaptive routing policy to adjust the token budget dynamically beyond fixed thresholds. By jointly reducing per-token decoding complexity and the number of generated tokens, our method achieves substantial acceleration with negligible accuracy loss. Concretely, it attains peak speedups of 3.00$\times$ on DeepSeek-R1-Distill-Qwen-7B, 3.85$\times$ on 14B, and 4.10$\times$ on QWQ-32B while maintaining accuracy comparable to full LLM decoding. Moreover, it naturally enables adaptive efficiency--accuracy trade-offs that can be tailored to diverse computational budgets without retraining.

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

↑