Structured Voronoi Sampling

Afra Amini, Li Du, Ryan Cotterell
2/12/2026

No official code found. Best implementation: AfraAmini/svs (6 stars, last commit 2024-03-17).

Abstract

Gradient-based sampling algorithms have demonstrated their effectiveness in text generation, especially in the context of controlled text generation. However, there exists a lack of theoretically grounded and principled approaches for this task. In this paper, we take an important step toward building a principled approach for sampling from language models with gradient-based methods. We use discrete distributions given by language models to define densities and develop an algorithm based on Hamiltonian Monte Carlo to sample from them. We name our gradient-based technique Structured Voronoi Sampling (SVS). In an experimental setup where the reference distribution is known, we show that the empirical distribution of SVS samples is closer to the reference distribution compared to alternative sampling schemes. Furthermore, in a controlled generation task, SVS is able to generate fluent and diverse samples while following the control targets significantly better than other methods.

View on arXivView PDF

Code Implementations(1)

AfraAmini/svsCommunity100%

This repository contains code for our NeurIPS paper titled "Structured Voronoi Sampling".

60Python, Jupyter NotebookOct 26, 20232 years ago

Similar Papers

Cite this paper

@article{amini2026structured,
  title  = {Structured Voronoi Sampling},
  author = {Afra Amini and Li Du and Ryan Cotterell},
  year   = {2026},
  eprint = {2306.03061},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/pdf/2306.03061},
  journal = {NEURIPS 2023 2023}
}

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

Discussion