Improving Code Generation by Training with Natural Language Feedback

By Angelica Chen. 2023

97 citations recorded by the source corpus.

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.

Subfields: Artificial Intelligence, Information Systems, Alignment & RLHF, Code Generation & Program Synthesis

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Artificial Intelligence

  1. Mohit Bansal
  2. Percy Liang
  3. Hannaneh Hajishirzi
  4. Luke S. Zettlemoyer
  5. Yejin Choi
  6. Noah A. Smith
  7. Jianfeng Gao
  8. Quoc V. Le

In Information Systems

  1. Hannaneh Hajishirzi
  2. Xinyun Chen
  3. Quoc V. Le
  4. Denny Zhou
  5. Percy Liang
  6. Kyunghyun Cho
  7. Carlos Guestrin
  8. Noah A. Smith

In Alignment & RLHF

  1. Angelica Chen
  2. Denny Zhou
  3. Xinyun Chen
  4. Nathanael Scharli
  5. Maxwell Lin
  6. Percy Liang
  7. Tomasz Korbak
  8. Hannaneh Hajishirzi

In Code Generation & Program Synthesis

  1. Denny Zhou
  2. Xinyun Chen
  3. Nathanael Scharli
  4. Maxwell Lin
  5. Angelica Chen
  6. Carlos Guestrin
  7. Percy Liang
  8. Jimmy Ba

Citations in the corpus