[Paper Review] Residual Energy-Based Models for Text Generation
This paper proposes residual energy-based models (EBMs) for text generation by learning an energy function over sequences in the residual space of a pretrained autoregressive language model. Using noise contrastive estimation and importance sampling, the method achieves lower perplexity and higher-quality generations than strong autoregressive baselines, with human evaluation favoring its outputs.
Text generation is ubiquitous in many NLP tasks, from summarization, to dialogue and machine translation. The dominant parametric approach is based on locally normalized models which predict one word at a time. While these work remarkably well, they are plagued by exposure bias due to the greedy nature of the generation process. In this work, we investigate un-normalized energy-based models (EBMs) which operate not at the token but at the sequence level. In order to make training tractable, we first work in the residual of a pretrained locally normalized language model and second we train using noise contrastive estimation. Furthermore, since the EBM works at the sequence level, we can leverage pretrained bi-directional contextual representations, such as BERT and RoBERTa. Our experiments on two large language modeling datasets show that residual EBMs yield lower perplexity compared to locally normalized baselines. Moreover, generation via importance sampling is very efficient and of higher quality than the baseline models according to human evaluation.
Motivation & Objective
- To address exposure bias and lack of long-range coherence in autoregressive text generation by modeling sequences holistically rather than token-by-token.
- To enable tractable training and efficient generation in unnormalized energy-based models (EBMs) for natural language, which are typically intractable due to normalization and sampling challenges.
- To improve text generation quality by combining the strengths of pretrained autoregressive models with the global sequence scoring of EBMs through a residual formulation.
- To demonstrate that EBM-based text generation can outperform strong autoregressive baselines in both perplexity and human evaluation.
Proposed method
- The model uses a residual formulation: $ P_{\theta}(x) \propto P_{LM}(x) \exp(-E_{\theta}(x)) $, where $ P_{LM}(x) $ is a fixed, pretrained autoregressive language model and $ E_{\theta}(x) $ is a learnable energy function.
- Training employs conditional noise contrastive estimation (NCE), using real training sequences as positives and samples from the base language model as negatives.
- Generation is performed via importance sampling over a large set of candidate sequences from the base language model, enabling efficient and high-quality sampling.
- The method leverages bidirectional contextual representations (e.g., BERT, RoBERTa) in the energy function to improve sequence-level modeling.
- Perplexity is estimated using the joint model, allowing direct comparison with autoregressive baselines.
- The approach is interpreted as a way to fine-tune bidirectional transformers like BERT for text generation by learning a residual energy function.
Experimental results
Research questions
- RQ1Can energy-based models be effectively trained and used for text generation when direct maximum likelihood and MCMC sampling are infeasible?
- RQ2Does learning a sequence-level energy function in the residual space of a pretrained language model improve generation quality and reduce perplexity?
- RQ3Can importance sampling over a large set of base model generations yield higher-quality outputs than greedy or beam search in autoregressive models?
- RQ4How well does the joint EBM model fit the true data distribution compared to the base language model?
Key findings
- The residual EBM achieves lower perplexity than the base autoregressive language model on two large-scale language modeling datasets.
- The difference in mean log-likelihood scores between real data and model samples is reduced from 21.64 (base model) to 6.20 (joint model), indicating a better fit to the data distribution.
- Human evaluation shows that generations from the residual EBM are significantly preferred over those from the baseline language model.
- The model maintains high efficiency in both training and inference, relying on pregenerated negatives and importance sampling.
- The energy function successfully down-weights low-quality generations from the base model, improving overall output quality.
- The method demonstrates that EBM-based text generation can outperform strong autoregressive baselines in both automatic and human evaluation metrics.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.