ReflectionCoder:从反思序列中学习以增强一次性代码生成
ReflectionCoder: Learning from Reflection Sequence for Enhanced One-off Code Generation
AI总结:
本文提出ReflectionCoder,通过整合编译器反馈构建反思序列,结合反思自蒸馏和动态掩码蒸馏技术,显著提升一次性代码生成性能,并在多个基准上达到最先进水平。
摘要:
代码生成在代码自动补全和数学推理等各种任务中发挥着关键作用。先前的工作提出了许多方法来提升代码生成性能,包括整合来自编译器的反馈。受此启发,我们提出了ReflectionCoder,这是一种新颖的方法,通过整合编译器反馈构建的反思序列,有效提升一次性代码生成性能。此外,我们提出了反思自蒸馏和动态掩码蒸馏,以有效利用这些反思序列。在HumanEval(+)、MBPP(+)和MultiPL-E三个基准上的广泛实验表明,使用我们的方法微调的模型实现了最先进的性能。在代码领域之外,我们相信该方法可以惠及关注最终结果并需要长推理路径的其他领域。代码和数据可在https://github.com/SenseLLM/ReflectionCoder获取。
英文摘要:
Code generation plays a crucial role in various tasks, such as code auto-completion and mathematical reasoning. Previous work has proposed numerous methods to enhance code generation performance, including integrating feedback from the compiler. Inspired by this, we present ReflectionCoder, a novel approach that effectively leverages reflection sequences constructed by integrating compiler feedback to improve one-off code generation performance. Furthermore, we propose reflection self-distillation and dynamically masked distillation to effectively utilize these reflection sequences. Extensive experiments on three benchmarks, i.e., HumanEval (+), MBPP (+), and MultiPL-E, demonstrate that models fine-tuned with our method achieve state-of-the-art performance. Beyond the code domain, we believe this approach can benefit other domains that focus on final results and require long reasoning paths. Code and data are available at https://github.com/SenseLLM/ReflectionCoder.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。