Stay on topic with Classifier-Free Guidance

Guillaume Sanchez, Honglu Fan, Alexander Spangher, Elad Levi, Pawan Sasanka Ammanamanchi +1 more
6/30/2023
cs.CLcs.CVcs.LG

No confident code implementation found for this paper.

Abstract

Classifier-Free Guidance (CFG) has recently emerged in text-to-image generation as a lightweight technique to encourage prompt-adherence in generations. In this work, we demonstrate that CFG can be used broadly as an inference-time technique in pure language modeling. We show that CFG (1) improves the performance of Pythia, GPT-2 and LLaMA-family models across an array of tasks: Q\&A, reasoning, code generation, and machine translation, achieving SOTA on LAMBADA with LLaMA-7B over PaLM-540B; (2) brings improvements equivalent to a model with twice the parameter-count; (3) can stack alongside other inference-time methods like Chain-of-Thought and Self-Consistency, yielding further improvements in difficult tasks; (4) can be used to increase the faithfulness and coherence of assistants in challenging form-driven and content-driven prompts: in a human evaluation we show a 75\% preference for GPT4All using CFG over baseline.

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!

Similar Papers

Cite this paper

@article{sanchez2023stay,
  title  = {Stay on topic with Classifier-Free Guidance},
  author = {Guillaume Sanchez and Honglu Fan and Alexander Spangher and Elad Levi and Pawan Sasanka Ammanamanchi and Stella Biderman},
  year   = {2023},
  eprint = {2306.17806},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2306.17806v1}
}

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

Discussion