对软件工程任务中投机解码的实证研究
An Empirical Study of Speculative Decoding on Software Engineering Tasks
AI总结:
本文通过实证研究评估了投机解码在软件工程任务中的有效性,发现其在代码生成、修复和编辑任务中表现各异,模型基于方法适合生成,模型无关方法更适合仓库级任务,且任务重复性提升模型无关方法性能。
摘要:
大型语言模型(LLMs)已广泛应用于软件工程(SE)任务,从函数级代码生成到复杂的仓库级工作流。然而,自回归推断的高延迟仍然是显著瓶颈,阻碍其在交互环境中的部署。虽然投机解码(SD)提供了一种有前途的无损加速技术,但关于长上下文仓库级任务和复杂代理交互的先前研究仍有限。为弥合这一差距,我们提出了首次系统性的实证研究,以评估SD在SE任务中的有效性。我们系统地评估了涵盖模型基于和模型无关方法的全面策略,涵盖代表性的生成、编辑和修复场景。我们的实证结果表明,SD在加速推断方面显示出明显潜力,特别是对于较小的模型,其加速效果优于较大模型。我们发现SD方法的有效性因不同任务场景而异。模型基于方法适合代码生成,而模型无关方法更适合仓库级修复和编辑场景。此外,我们观察到软件工程任务的重复性提升了模型无关方法的性能。与自然语言任务不同,软件工程任务的更高可预测性允许使用更激进的超参数。我们的发现总结为指南,以帮助提高软件工程场景的推断效率。
英文摘要:
Large Language Models (LLMs) have become widely used for Software Engineering (SE) tasks, spanning from function-level code generation to complex repository-level workflows. However, the high latency of autoregressive inference remains a significant bottleneck, hindering their deployment in interactive environments. While Speculative Decoding (SD) offers a promising technique for lossless acceleration, prior research on long-context repository-level tasks and complex agentic interactions remains limited. To bridge this gap, we present the first systematic empirical study to evaluate the effectiveness of SD in SE tasks. We systematically benchmark a comprehensive spectrum of strategies, encompassing both model-based and model-free methods, across representative generation, editing, and repair scenarios. Our empirical results indicate that SD demonstrates clear potential for accelerating inference, particularly for smaller models that achieve higher speedups than those of their larger counterparts. We find that the effectiveness of SD methods varies across different task scenarios. Model-based approaches are well-suited for code generation, whereas model-free methods are better adapted to repository-level repair and editing scenarios. Furthermore, we observe that the repetitiveness of SE tasks improves the performance of model-free methods. In contrast to natural language tasks, the higher predictability of SE tasks allows for more aggressive hyperparameters. Our findings are summarized as guidelines to help increase inference efficiency for SE scenarios.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。