RankGen: Improving Text Generation with Large Ranking Models

Kalpesh Krishna, Yapei Chang, John Wieting, Mohit Iyyer
5/19/2022
cs.CLcs.LG

Official code: martiansideofthemoon/rankgen (140 stars, Python, Apache-2.0, last commit 2023-08-02).

Abstract

Given an input sequence (or prefix), modern language models often assign high probabilities to output sequences that are repetitive, incoherent, or irrelevant to the prefix; as such, model-generated text also contains such artifacts. To address these issues we present RankGen, a 1.2B parameter encoder model for English that scores model generations given a prefix.

Show full abstract

RankGen can be flexibly incorporated as a scoring function in beam search and used to decode from any pretrained language model. We train RankGen using large-scale contrastive learning to map a prefix close to the ground-truth sequence that follows it and far away from two types of negatives: (1) random sequences from the same document as the prefix, and (2) sequences generated from a large language model conditioned on the prefix. Experiments across four different language models (345M-11B parameters) and two domains show that RankGen significantly outperforms decoding algorithms like nucleus, top-k, and typical sampling, as well as contrastive decoding and search, on both automatic metrics (85.0 vs 77.3 MAUVE over nucleus) as well as human evaluations with English writers (74.5% human preference over nucleus sampling). Analysis reveals that RankGen outputs are more relevant to the prefix and improve continuity and coherence compared to baselines. We release our model checkpoints, code, and human preference data with explanations to facilitate future research.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

Official code and model checkpoints for our EMNLP 2022 paper "RankGen - Improving Text Generation with Large Ranking Models" (https://arxiv.org/abs/2205.09726).

14011Python, ShellMar 25, 20223 years agoApache-2.0

Similar Papers

Cite this paper

@article{krishna2022rankgen,
  title  = {RankGen: Improving Text Generation with Large Ranking Models},
  author = {Kalpesh Krishna and Yapei Chang and John Wieting and Mohit Iyyer},
  year   = {2022},
  eprint = {2205.09726},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2205.09726}
}

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

Discussion