# TIGS: An Inference Algorithm for Text Infilling with Gradient Search

arXiv: https://arxiv.org/abs/1905.10752 · HTML: https://mlsanity.com/paper/1905.10752/

## Key facts

- Cited by 10 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 26 May 2019.

## Built on by (most cited first, 10 of 10)

- [Efficient Training of Language Models to Fill in the Middle](https://mlsanity.com/paper/2207.14255/) (2022)
- [Amortizing intractable inference in large language models](https://mlsanity.com/paper/2310.04363/) (2023)
- [Conformal prediction for text infilling and part-of-speech prediction](https://mlsanity.com/paper/2111.02592/) (2021)
- [GENIUS: Sketch-based Language Model Pre-training via Extreme and Selective Masking for Text Generation and Augmentation](https://mlsanity.com/paper/2211.10330/) (2022)
- [Show Me How To Revise: Improving Lexically Constrained Sentence Generation with XLNet](https://mlsanity.com/paper/2109.05797/) (2021)
- [Controllable Fake Document Infilling for Cyber Deception](https://mlsanity.com/paper/2210.09917/) (2022)
- [Towards a Universal NLG for Dialogue Systems and Simulators with Future Bridging](https://mlsanity.com/paper/2105.10267/) (2021)
- [Interactive Editing for Text Summarization](https://mlsanity.com/paper/2306.03067/) (2023)
- [SC-Ques: A Sentence Completion Question Dataset for English as a Second Language Learners](https://mlsanity.com/paper/2206.12036/) (2022)
- [What am I missing here?: Evaluating Large Language Models for Masked Sentence Prediction](https://mlsanity.com/paper/2508.07702/) (2025)

## Abstract (arXiv)

Text infilling is defined as a task for filling in the missing part of a sentence or paragraph, which is suitable for many real-world natural language generation scenarios. However, given a well-trained sequential generative model, generating missing symbols conditioned on the context is challenging for existing greedy approximate inference algorithms. In this paper, we propose an iterative inference algorithm based on gradient search, which is the first inference algorithm that can be broadly applied to any neural sequence generative models for text infilling tasks. We compare the proposed method with strong baselines on three text infilling tasks with various mask ratios and different mask strategies. The results show that our proposed method is effective and efficient for fill-in-the-blank tasks, consistently outperforming all baselines.
