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

是什么让大型语言模型在(多轮)代码生成中进行推理?

What Makes Large Language Models Reason in (Multi-Turn) Code Generation?

Meta AI (FAIR)(Meta AI(FAIR));Paris Dauphine University - PSL(巴黎多芬大学 - 巴黎文理研究大学)

Kunhao Zheng, Juliette Decugis, Jonas Gehring, Taco Cohen, Benjamin Negrevergne, Gabriel Synnaeve

AI总结:

本文系统研究多轮代码生成中的提示策略,通过在 CodeContests 和 TACO 上对多种 LLM 进行网格搜索,找到能稳定提升性能的最优配置,并证明基于该配置微调可使模型内化推理过程,从而改善多轮代码生成的性能与可扩展性。

摘要:

诸如思维链之类的提示技术已成为提升大型语言模型(LLMs)输出质量的一种流行手段。然而,对于代码生成而言,它们的确切机制和有效性尚未得到充分探索。因此,我们研究了一系列广泛的提示策略的效果,重点关注多轮自动重新提示和计算需求。在系统性地分解推理、指令和执行反馈提示之后,我们在竞争性编程基准 CodeContests 和 TACO 上,针对多个 LLM 系列和规模(Llama 3.0 和 3.1,8B、70B、405B 以及 GPT-4o)进行了广泛的网格搜索。我们的研究揭示了在小采样预算和大采样预算下均能持续提升所有模型性能的策略。随后,我们展示了如何利用这种最优配置进行微调,使模型能够内化所诱导的推理过程,并在多轮代码生成中获得性能和可扩展性的提升。

英文摘要:

Prompting techniques such as chain-of-thought have established themselves as a popular vehicle for improving the outputs of large language models (LLMs). For code generation, however, their exact mechanics and efficacy are under-explored. We thus investigate the effects of a wide range of prompting strategies with a focus on automatic re-prompting over multiple turns and computational requirements. After systematically decomposing reasoning, instruction, and execution feedback prompts, we conduct an extensive grid search on the competitive programming benchmarks CodeContests and TACO for multiple LLM families and sizes (Llama 3.0 and 3.1, 8B, 70B, 405B, and GPT-4o). Our study reveals strategies that consistently improve performance across all models with small and large sampling budgets. We then show how finetuning with such an optimal configuration allows models to internalize the induced reasoning process and obtain improvements in performance and scalability for multi-turn code generation.

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

↑