A Block Metropolis-Hastings Sampler for Controllable Energy-based Text Generation

Jarad Forristal, Niloofar Mireshghallah, Greg Durrett, Taylor Berg-Kirkpatrick
12/7/2023
cs.CLcs.LG

No confident code implementation found for this paper.

Abstract

Recent work has shown that energy-based language modeling is an effective framework for controllable text generation because it enables flexible integration of arbitrary discriminators. However, because energy-based LMs are globally normalized, approximate techniques like Metropolis-Hastings (MH) are required for inference. Past work has largely explored simple proposal distributions that modify a single token at a time, like in Gibbs sampling. In this paper, we develop a novel MH sampler that, in contrast, proposes re-writes of the entire sequence in each step via iterative prompting of a large language model. Our new sampler (a) allows for more efficient and accurate sampling from a target distribution and (b) allows generation length to be determined through the sampling procedure rather than fixed in advance, as past work has required. We perform experiments on two controlled generation tasks, showing both downstream performance gains and more accurate target distribution sampling in comparison with single-token proposal techniques.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Cite this paper

@article{forristal2023block,
  title  = {A Block Metropolis-Hastings Sampler for Controllable Energy-based Text Generation},
  author = {Jarad Forristal and Niloofar Mireshghallah and Greg Durrett and Taylor Berg-Kirkpatrick},
  year   = {2023},
  eprint = {2312.04510},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2312.04510v1}
}

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

Discussion