Efficient Training of Language Models to Fill in the Middle

Mohammad Bavarian, Heewoo Jun, Nikolas Tezak, John Schulman, Christine McLeavey +2 more
7/28/2022
cs.CL

No official code found. Best implementation: openai/human-eval-infilling (209 stars, MIT, last commit 2023-04-02). 1 more below.

Abstract

We show that autoregressive language models can learn to infill text after we apply a straightforward transformation to the dataset, which simply moves a span of text from the middle of a document to its end. While this data augmentation has garnered much interest in recent years, we provide extensive evidence that training models with a large fraction of data transformed in this way does not harm the original left-to-right generative capability, as measured by perplexity and sampling evaluations across a wide range of scales. Given the usefulness, simplicity, and efficiency of training models to fill-in-the-middle (FIM), we suggest that future autoregressive language models be trained with FIM by default. To this end, we run a series of ablations on key hyperparameters, such as the data transformation frequency, the structure of the transformation, and the method of selecting the infill span. We use these ablations to prescribe strong default settings and best practices to train FIM models. We have released our best infilling model trained with best practices in our API, and release our infilling benchmarks to aid future research.

View on arXivView PDF

Code Implementations(2)

MIT

Code for the paper "Efficient Training of Language Models to Fill in the Middle"

20946PythonJul 29, 20223 years agoMIT
tbressers/fimCommunity64%

Implementation of "Efficient Training of Language Models to Fill in the Middle"

40PythonDec 1, 20241 years ago
fim

Similar Papers

Cite this paper

@article{bavarian2022efficient,
  title  = {Efficient Training of Language Models to Fill in the Middle},
  author = {Mohammad Bavarian and Heewoo Jun and Nikolas Tezak and John Schulman and Christine McLeavey and Jerry Tworek and Mark Chen},
  year   = {2022},
  eprint = {2207.14255},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2207.14255v1}
}

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.14255.svg)](https://codeofpaper.com/paper/2207.14255)

Discussion