Research map / Large language models / Reasoning and chain of thought
Stay on Topic with Classifier-Free Guidance
Read the paperCheck your idea against 108,967 papers
AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Adapts classifier-free guidance from text-to-image diffusion to autoregressive language model decoding, showing inference-time gains on zero-shot benchmarks, CoT, code generation, and chatbot system-prompt adherence.
Problem
Language models often lose adherence to the prompt over long generations and struggle with system-prompt following; existing fixes like instruction tuning or RL are costly, so an inference-time method is sought.
Approach
Applies classifier-free guidance to next-token logits: log P(w|c) is extrapolated from the unconditional distribution (prompt dropped or negative prompt) by a factor gamma, requiring no retraining, and extends to negative prompting for chatbots.
Key results
- LLaMA-7B with CFG (gamma=1.5) reaches 81% zero-shot LAMBADA accuracy, above PaLM-540B's 77.9%.
- On HumanEval, CodeGen-350M-mono pass@1 rises from 11.0% to 11.8% at gamma=1.1 (temperature 0.2), with gains concentrated at low gamma.
- In a blind human study on GPT4All chatbot prompts, 75% of raters preferred the CFG output for system-prompt following at gamma=3.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| use CFG with γ=1.1 (ablation) | CodeGen-350M-mono · HumanEval, temperature 0.2 | pass@1: 11.0% -> 11.8% | Helped |
| use CFG with γ=2.0 (ablation) | CodeGen-350M-mono · HumanEval, temperature 0.2 | pass@1: 11.0% -> 8.6% | Hurt |
| use CFG with γ=1.5 (ablation) | CodeGen-2B-mono · HumanEval, temperature 0.2 | pass@1: 19.5% -> 20.9% | Helped |
| use CFG with γ=2.0 (ablation) | CodeGen-2B-mono · HumanEval, temperature 0.2 | pass@1: 19.5% -> 16.5% | Hurt |
| use CFG with γ=1.5 (ablation) | CodeGen-6B-mono · HumanEval, temperature 0.2 | pass@1: 19.5% -> 20.9% | Helped |
| use CFG with γ=1.10 (ablation) | Bloom-3B · WMT14 fr-en, 0-shot | BLEU: 14.16 -> 15.81 | Helped |
| use CFG with γ=1.25 (ablation) | RedPajama-Incite-3B · WMT14 fr-en, 0-shot | BLEU: 15.04 -> 17.78 | Helped |
| use CFG with γ=1.10 (ablation) | Bloom-3B · WMT14 fr-en, 1-shot | BLEU: 29.84 -> 28.53 | Hurt |
| use CFG with γ=1.10 (ablation) | mT0 · WMT14 fr-en, 0-shot | BLEU: 29.77 -> 27.79 | Hurt |
| use CFG with γ=1.25 (ablation) | GPT-J · prompted code generation | correct programming language rate: 73% -> 86% | Helped |
| apply negative-prompt CFG with γ=3 | GPT4All-J v1.3-jazzy · assistant prompts, human evaluation | system-prompt following preference: 75% | Helped |
| apply negative-prompt CFG with γ=3 | GPT4All-J v1.3-jazzy · assistant prompts, human evaluation | user-prompt relevance preference: 52% | No clear effect |
Surprising findings
- CFG with a model of half the size matches the performance of a model twice as large on about half of the tasks, per ANCOVA tests.
- CFG lowers sampling entropy but its vocabulary reordering differs substantially from instruction tuning's.
Limitations
- gamma requires per-task tuning; values good for one context may be poor for another
- Doubles inference compute since two forward passes are needed
- Possible misuse, e.g. with prompt injection or alignment-overriding prompts, was not tested
Experimental setup
Datasets: LAMBADA SciQ TriviaQA HellaSwag PiQA ARC BoolQ WinoGrande GSM8K AQuA HumanEval WMT14 fr-en
Benchmarks: LAMBADA SciQ TriviaQA HellaSwag PiQA ARC BoolQ WinoGrande GSM8K AQuA HumanEval WMT14 fr-en
Metrics: accuracy pass@k BLEU top-p overlap entropy ANCOVA p-value
Baselines: PaLM-540B Chinchilla 70B GPT-3 175B vanilla sampling (gamma=1)
Builds on: classifier-free guidance classifier guidance negative prompting chain-of-thought prompting PPLM
Closest papers by meaning
- Adaptive Classifier-Free Guidance via Dynamic Low-Confidence Masking (NeurIPS 2025 · similarity 0.91)
- Execution Guided Line-by-Line Code Generation (NeurIPS 2025 · similarity 0.86)
- Self-Play Fine-Tuning Converts Weak Language Models to Strong Language Models (ICML 2024 · similarity 0.86)
- Adaptable Logical Control for Large Language Models (NeurIPS 2024 · similarity 0.86)
- Visual Generation Without Guidance (ICML 2025 · similarity 0.85)
- DELIFT: Data Efficient Language model Instruction Fine-Tuning (ICLR 2025 · similarity 0.85)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
