ReflectionCoder: Learning from Reflection Sequence for Enhanced One-off Code Generation

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Ren, Houxing, Zhan, Mingjie, Wu, Zhongyuan, Zhou, Aojun, Pan, Junting, Li, Hongsheng
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866913865530343424
author Ren, Houxing
Zhan, Mingjie
Wu, Zhongyuan
Zhou, Aojun
Pan, Junting
Li, Hongsheng
author_facet Ren, Houxing
Zhan, Mingjie
Wu, Zhongyuan
Zhou, Aojun
Pan, Junting
Li, Hongsheng
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2405_17057
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle ReflectionCoder: Learning from Reflection Sequence for Enhanced One-off Code Generation
Ren, Houxing
Zhan, Mingjie
Wu, Zhongyuan
Zhou, Aojun
Pan, Junting
Li, Hongsheng
Computation and Language
Artificial Intelligence
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.
title ReflectionCoder: Learning from Reflection Sequence for Enhanced One-off Code Generation
topic Computation and Language
Artificial Intelligence
url https://arxiv.org/abs/2405.17057