Exposing the Implicit Energy Networks behind Masked Language Models via Metropolis--Hastings
Not on the map. Why?
Abstract (arXiv)
While recent work has shown that scores from models trained by the ubiquitous masked language modeling (MLM) objective effectively discriminate probable from improbable sequences, it is still an open question if these MLMs specify a principled probability distribution over the space of possible sequences. In this paper, we interpret MLMs as energy-based sequence models and propose two energy parametrizations derivable from the trained MLMs. In order to draw samples correctly from these models, we develop a tractable sampling scheme based on the Metropolis--Hastings Monte Carlo algorithm. In our approach, samples are proposed from the same masked conditionals used for training the masked language models, and they are accepted or rejected based on their energy values according to the target distribution. We validate the effectiveness of the proposed parametrizations by exploring the quality of samples drawn from these energy-based models for both open-ended unconditional generation and a conditional generation task of machine translation. We theoretically and empirically justify our sampling algorithm by showing that the masked conditionals on their own do not yield a Markov chain whose stationary distribution is that of our target distribution, and our approach generates higher quality samples than other recently proposed undirected generation approaches (Wang et al., 2019, Ghazvininejad et al., 2019).
Key facts. Cited by 37 papers in the map (data through 7 Oct 2026). Builds on 24 of its 52 references that are in the map. First posted on arXiv 4 Jun 2021.
Builds on
24 of 52 references.
References · 24
- 2017Attention Is All You Needcited by 59,932
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
- 2019BERTScore: Evaluating Text Generation with BERTcited by 5,462
- 2014Sequence to Sequence Learning with Neural Networkscited by 2,974
- 2019The Curious Case of Neural Text Degenerationcited by 2,881
- 2019XLNet: Generalized Autoregressive Pretraining for Language Understandingcited by 2,801
- 2018Deep contextualized word representationscited by 2,285
- 2020A Primer in BERTology: What we know about how BERT workscited by 807
- 2017Non-Autoregressive Neural Machine Translationcited by 457
- 2019BERT has a Mouth, and It Must Speak: BERT as a Markov Random Field Language Modelcited by 184
12 more
- 2016Sequence-to-Sequence Learning as Beam-Search Optimizationcited by 126
- 2016Energy-based Generative Adversarial Networkcited by 119
- 2020Residual Energy-Based Models for Text Generationcited by 95
- 2021Oops I Took A Gradient: Scalable Sampling for Discrete Distributionscited by 92
- 2015Structured Prediction Energy Networkscited by 59
- 2017Adversarial Feature Matching for Text Generationcited by 58
- 2020Pre-Training Transformers as Energy-Based Cloze Modelscited by 52
- 2020ENGINE: Energy-Based Inference Networks for Non-Autoregressive Machine Translationcited by 34
- 2019A Generalized Framework of Sequence Generation with Application to Undirected Sequence Modelscited by 17
- 2019An Empirical Investigation of Global and Local Normalization for Recurrent Neural Sequence Models Using a Continuous Relaxation to Beam Searchcited by 12
- 2017Learning neural trans-dimensional random field language models with noise-contrastive estimationcited by 7
- 2017Language modeling with Neural trans-dimensional random fieldscited by 4
Built on by
Citing papers per year: 2021: 3; 2022: 10; 2023: 15; 2024: 6; 2025: 1; 2026: 2.
37 papers.
Sort:
By area:
- 2022Continuous diffusion for categorical datacited by 202
- 2022Quantifying Privacy Risks of Masked Language Models Using Membership Inference Attackscited by 168
- 2022COLD Decoding: Energy-based Constrained Text Generation with Langevin Dynamicscited by 159
- 2023Aligning Language Models with Preferences through f-divergence Minimizationcited by 118
- 2023Amortizing intractable inference in large language modelscited by 94
- 2021Unleashing Transformers: Parallel Token Prediction with Discrete Absorbing Diffusion for Fast High-Resolution Image Generation from Vector-Quantized Codescited by 71
- 2022Mix and Match: Learning-free Controllable Text Generation using Energy Language Modelscited by 66
- 2023Anticipatory Music Transformercited by 35
- 2023BOLT: Fast Energy-based Controlled Text Generation with Tunable Biasescited by 24
- 2024A distributional simplicity bias in the learning dynamics of transformerscited by 23
- 2024QUEST: Quality-Aware Metropolis-Hastings Sampling for Machine Translationcited by 16
- 2023FiLM: Fill-in Language Models for Any-Order Generationcited by 13
25 more
- 2022Probing BERT's priors with serial reproduction chainscited by 11
- 2022Generative power of a protein language model trained on multiple sequence alignmentscited by 9
- 2022Converge to the Truth: Factual Error Correction via Iterative Constrained Editingcited by 9
- 2023Learning to Generate Text in Arbitrary Writing Stylescited by 9
- 2023Planning with Sequence Models through Iterative Energy Minimizationcited by 8
- 2023Deriving Language Models from Masked Language Modelscited by 8
- 2023On "Scientific Debt" in NLP: A Case for More Rigour in Language Model Pre-Training Researchcited by 7
- 2023MIMEx: Intrinsic Rewards from Masked Input Modelingcited by 6
- 2024Promises and Pitfalls of Generative Masked Language Modeling: Theoretical Framework and Practical Guidelinescited by 6
- 2023A Block Metropolis-Hastings Sampler for Controllable Energy-based Text Generationcited by 5
- 2023Principled Gradient-based Markov Chain Monte Carlo for Text Generationcited by 4
- 2024Conditional [MASK] Discrete Diffusion Language Modelcited by 4
- 2021Sampling from Discrete Energy-Based Models with Quality/Efficiency Trade-offscited by 2
- 2022Multi-segment preserving sampling for deep manifold samplercited by 2
- 2022Emergent Linguistic Structures in Neural Networks are Fragilecited by 2
- 2023Controlled Text Generation for Black-box Language Models via Score-based Progressive Editorcited by 2
- 2023Discrete Distribution Networkscited by 2
- 2022Inconsistencies in Masked Language Modelscited by 1
- 2023Pairing interacting protein sequences using masked language modelingcited by 1
- 2024GenPlan: Generative Sequence Models as Adaptive Plannerscited by 1
- 2021BERTian Poetics: Constrained Composition with Masked LMscited by 0
- 2024Adaptformer: Sequence models as adaptive iterative plannerscited by 0
- 2025Learning Extrapolative Sequence Transformations from Markov Chainscited by 0
- 2026Structured Inference with Large Language Gibbscited by 0
- 2026BayesPrompt: human readable prompts that make sensecited by 0
- 2026BayesPrompt: human readable prompts that make sense18 Aug 2026
- 2026Structured Inference with Large Language Gibbs17 Jun 2026
- 2025Learning Extrapolative Sequence Transformations from Markov Chains26 May 2025
- 2024GenPlan: Generative Sequence Models as Adaptive Planners11 Dec 2024
- 2024Adaptformer: Sequence models as adaptive iterative planners30 Nov 2024
- 2024Conditional [MASK] Discrete Diffusion Language Model10 Nov 2024
- 2024A distributional simplicity bias in the learning dynamics of transformers25 Oct 2024
- 2024Promises and Pitfalls of Generative Masked Language Modeling: Theoretical Framework and Practical Guidelines22 Jul 2024
- 2024QUEST: Quality-Aware Metropolis-Hastings Sampling for Machine Translation28 May 2024
- 2023Discrete Distribution Networks29 Dec 2023
- 2023Principled Gradient-based Markov Chain Monte Carlo for Text Generation29 Dec 2023
- 2023Learning to Generate Text in Arbitrary Writing Styles28 Dec 2023
25 more
- 2023A Block Metropolis-Hastings Sampler for Controllable Energy-based Text Generation7 Dec 2023
- 2023Controlled Text Generation for Black-box Language Models via Score-based Progressive Editor13 Nov 2023
- 2023FiLM: Fill-in Language Models for Any-Order Generation15 Oct 2023
- 2023Amortizing intractable inference in large language models6 Oct 2023
- 2023Pairing interacting protein sequences using masked language modeling14 Aug 2023
- 2023Anticipatory Music Transformer14 Jun 2023
- 2023On "Scientific Debt" in NLP: A Case for More Rigour in Language Model Pre-Training Research5 Jun 2023
- 2023Deriving Language Models from Masked Language Models24 May 2023
- 2023BOLT: Fast Energy-based Controlled Text Generation with Tunable Biases19 May 2023
- 2023MIMEx: Intrinsic Rewards from Masked Input Modeling15 May 2023
- 2023Planning with Sequence Models through Iterative Energy Minimization28 Mar 2023
- 2023Aligning Language Models with Preferences through f-divergence Minimization16 Feb 2023
- 2022Inconsistencies in Masked Language Models30 Dec 2022
- 2022Continuous diffusion for categorical data28 Nov 2022
- 2022Converge to the Truth: Factual Error Correction via Iterative Constrained Editing22 Nov 2022
- 2022Emergent Linguistic Structures in Neural Networks are Fragile31 Oct 2022
- 2022Multi-segment preserving sampling for deep manifold sampler9 May 2022
- 2022Generative power of a protein language model trained on multiple sequence alignments14 Apr 2022
- 2022Mix and Match: Learning-free Controllable Text Generation using Energy Language Models24 Mar 2022
- 2022Quantifying Privacy Risks of Masked Language Models Using Membership Inference Attacks8 Mar 2022
- 2022Probing BERT's priors with serial reproduction chains24 Feb 2022
- 2022COLD Decoding: Energy-based Constrained Text Generation with Langevin Dynamics23 Feb 2022
- 2021Sampling from Discrete Energy-Based Models with Quality/Efficiency Trade-offs10 Dec 2021
- 2021Unleashing Transformers: Parallel Token Prediction with Discrete Absorbing Diffusion for Fast High-Resolution Image Generation from Vector-Quantized Codes24 Nov 2021
- 2021BERTian Poetics: Constrained Composition with Masked LMs28 Oct 2021
- 2022COLD Decoding: Energy-based Constrained Text Generation with Langevin Dynamicscited by 159
- 2023Amortizing intractable inference in large language modelscited by 94
- 2022Mix and Match: Learning-free Controllable Text Generation using Energy Language Modelscited by 66
- 2023Anticipatory Music Transformercited by 35
- 2023BOLT: Fast Energy-based Controlled Text Generation with Tunable Biasescited by 24
- 2024A distributional simplicity bias in the learning dynamics of transformerscited by 23
- 2024QUEST: Quality-Aware Metropolis-Hastings Sampling for Machine Translationcited by 16
- 2023FiLM: Fill-in Language Models for Any-Order Generationcited by 13
- 2022Probing BERT's priors with serial reproduction chainscited by 11
- 2022Generative power of a protein language model trained on multiple sequence alignmentscited by 9
- 2022Converge to the Truth: Factual Error Correction via Iterative Constrained Editingcited by 9
- 2023Learning to Generate Text in Arbitrary Writing Stylescited by 9
12 most cited of 32 All 32 (JSON)
- 2026BayesPrompt: human readable prompts that make sense18 Aug 2026
- 2026Structured Inference with Large Language Gibbs17 Jun 2026
- 2025Learning Extrapolative Sequence Transformations from Markov Chains26 May 2025
- 2024GenPlan: Generative Sequence Models as Adaptive Planners11 Dec 2024
- 2024Adaptformer: Sequence models as adaptive iterative planners30 Nov 2024
- 2024A distributional simplicity bias in the learning dynamics of transformers25 Oct 2024
- 2024Promises and Pitfalls of Generative Masked Language Modeling: Theoretical Framework and Practical Guidelines22 Jul 2024
- 2024QUEST: Quality-Aware Metropolis-Hastings Sampling for Machine Translation28 May 2024
- 2023Discrete Distribution Networks29 Dec 2023
- 2023Principled Gradient-based Markov Chain Monte Carlo for Text Generation29 Dec 2023
- 2023Learning to Generate Text in Arbitrary Writing Styles28 Dec 2023
- 2023A Block Metropolis-Hastings Sampler for Controllable Energy-based Text Generation7 Dec 2023
12 newest of 32 All 32 (JSON)