Language Models Can Teach Themselves to Program Better

Patrick Haluptzok, Matthew Bowers, Adam Tauman Kalai
7/29/2022
114 citations
cs.LGcs.AI

Official code: microsoft/PythonProgrammingPuzzles (999 stars, Python, MIT, last commit 2024-04-24).

Abstract

Recent Language Models (LMs) achieve breakthrough performance in code generation when trained on human-authored problems, even solving some competitive-programming problems. Self-play has proven useful in games such as Go, and thus it is natural to ask whether LMs can generate their own instructive programming problems to improve their performance.

Show full abstract

We show that it is possible for an LM to synthesize programming problems and solutions, which are filtered for correctness by a Python interpreter. The LM's performance is then seen to improve when it is fine-tuned on its own synthetic problems and verified solutions; thus the model 'improves itself' using the Python interpreter. Problems are specified formally as programming puzzles [Schuster et al., 2021], a code-based problem format where solutions can easily be verified for correctness by execution. In experiments on publicly-available LMs, test accuracy more than doubles. This work demonstrates the potential for code LMs, with an interpreter, to generate instructive problems and improve their own performance.

View on arXivView PDF

Code Implementations(1)

MIT

A Dataset of Python Challenges for AI Research

99996Python, Jupyter NotebookApr 25, 20212 years agoMIT
aiprogram-synthesisprogramming-competitionspuzzles

Similar Papers

Cite this paper

@article{haluptzok2022language,
  title  = {Language Models Can Teach Themselves to Program Better},
  author = {Patrick Haluptzok and Matthew Bowers and Adam Tauman Kalai},
  year   = {2022},
  eprint = {2207.14502},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2207.14502v4}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2207.14502.svg)](https://codeofpaper.com/paper/2207.14502)

Discussion