Improving Code Generation by Training with Natural Language Feedback

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Chen, Angelica, Scheurer, Jérémy, Korbak, Tomasz, Campos, Jon Ander, Chan, Jun Shern, Bowman, Samuel R., Cho, Kyunghyun, Perez, Ethan
Format: Preprint
Published: 2023
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866929253567692800
author Chen, Angelica
Scheurer, Jérémy
Korbak, Tomasz
Campos, Jon Ander
Chan, Jun Shern
Bowman, Samuel R.
Cho, Kyunghyun
Perez, Ethan
author_facet Chen, Angelica
Scheurer, Jérémy
Korbak, Tomasz
Campos, Jon Ander
Chan, Jun Shern
Bowman, Samuel R.
Cho, Kyunghyun
Perez, Ethan
contents The potential for pre-trained large language models (LLMs) to use natural language feedback at inference time has been an exciting recent development. We build upon this observation by formalizing an algorithm for learning from natural language feedback at training time instead, which we call Imitation learning from Language Feedback (ILF). ILF requires only a small amount of human-written feedback during training and does not require the same feedback at test time, making it both user-friendly and sample-efficient. We further show that ILF can be seen as a form of minimizing the KL divergence to the ground truth distribution and demonstrate a proof-of-concept on a neural program synthesis task. We use ILF to improve a Codegen-Mono 6.1B model's pass@1 rate by 38% relative (and 10% absolute) on the Mostly Basic Python Problems (MBPP) benchmark, outperforming both fine-tuning on MBPP and fine-tuning on repaired programs written by humans. Overall, our results suggest that learning from human-written natural language feedback is both more effective and sample-efficient than training exclusively on demonstrations for improving an LLM's performance on code generation tasks.
format Preprint
id arxiv_https___arxiv_org_abs_2303_16749
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle Improving Code Generation by Training with Natural Language Feedback
Chen, Angelica
Scheurer, Jérémy
Korbak, Tomasz
Campos, Jon Ander
Chan, Jun Shern
Bowman, Samuel R.
Cho, Kyunghyun
Perez, Ethan
Software Engineering
Artificial Intelligence
Computation and Language
Machine Learning
The potential for pre-trained large language models (LLMs) to use natural language feedback at inference time has been an exciting recent development. We build upon this observation by formalizing an algorithm for learning from natural language feedback at training time instead, which we call Imitation learning from Language Feedback (ILF). ILF requires only a small amount of human-written feedback during training and does not require the same feedback at test time, making it both user-friendly and sample-efficient. We further show that ILF can be seen as a form of minimizing the KL divergence to the ground truth distribution and demonstrate a proof-of-concept on a neural program synthesis task. We use ILF to improve a Codegen-Mono 6.1B model's pass@1 rate by 38% relative (and 10% absolute) on the Mostly Basic Python Problems (MBPP) benchmark, outperforming both fine-tuning on MBPP and fine-tuning on repaired programs written by humans. Overall, our results suggest that learning from human-written natural language feedback is both more effective and sample-efficient than training exclusively on demonstrations for improving an LLM's performance on code generation tasks.
title Improving Code Generation by Training with Natural Language Feedback
topic Software Engineering
Artificial Intelligence
Computation and Language
Machine Learning
url https://arxiv.org/abs/2303.16749