FiLM: Fill-in Language Models for Any-Order Generation

Tianxiao Shen, Hao Peng, Ruoqi Shen, Yao Fu, Zaid Harchaoui +1 more
10/15/2023
cs.CL

No official code found. Best implementation: shentianxiao/FiLM (13 stars, Apache-2.0, last commit 2023-10-18).

Abstract

Language models have become the backbone of today's AI systems. However, their predominant left-to-right generation limits the use of bidirectional context, which is essential for tasks that involve filling text in the middle. We propose the Fill-in Language Model (FiLM), a new language modeling approach that allows for flexible generation at any position without adhering to a specific generation order. Its training extends the masked language modeling objective by adopting varying mask probabilities sampled from the Beta distribution to enhance the generative capabilities of FiLM. During inference, FiLM can seamlessly insert missing phrases, sentences, or paragraphs, ensuring that the outputs are fluent and are coherent with the surrounding context. In both automatic and human evaluations, FiLM outperforms existing infilling methods that rely on left-to-right language models trained on rearranged text segments. FiLM is easy to implement and can be either trained from scratch or fine-tuned from a left-to-right language model. Notably, as the model size grows, FiLM's perplexity approaches that of strong left-to-right language models of similar sizes, indicating FiLM's scalability and potential as a large language model.

View on arXivView PDF

Code Implementations(1)

shentianxiao/FiLMCommunity100%
Apache-2.0
130Shell, PythonOct 13, 20233 years agoApache-2.0

Similar Papers

Cite this paper

@article{shen2023film,
  title  = {FiLM: Fill-in Language Models for Any-Order Generation},
  author = {Tianxiao Shen and Hao Peng and Ruoqi Shen and Yao Fu and Zaid Harchaoui and Yejin Choi},
  year   = {2023},
  eprint = {2310.09930},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2310.09930v1}
}

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

Discussion