XTC: Head-Aware Sampling by Excluding Top Choices

2026-08-24Computation and Language

Computation and LanguageArtificial IntelligenceMachine Learning
AI summary

The authors introduce XTC, a new method to make language models generate more interesting and varied text by removing overly common next-word choices when several plausible options exist. Unlike standard techniques that adjust the whole probability distribution, XTC focuses on excluding the most dominant tokens, encouraging the model to pick less generic but still reasonable words. Tested on multiple large models and tasks, XTC improved creativity and reduced repetitive phrases without hurting accuracy or fluency. User studies confirmed that texts generated with XTC were preferred for creativity. The method works well alongside existing techniques and has been adopted by popular language model tools.

autoregressive language modeldecoding strategytoken probabilitydiversityrepeat trigramstemperature scalingprompt accuracyquantizationdistinct-nfluency
Authors
Philipp Emanuel Weidmann, Allen Roush, Judah Goldfeder, Sanjay Basu, Ravid Shwartz-Ziv
Abstract
Standard decoding rules for autoregressive language models promote diversity by rescaling the full next-token distribution or truncating its low-probability tail. These strategies overlook a common regime of open-ended generation in which several continuations are plausible but too much probability mass remains concentrated on the most generic choice. We introduce XTC (Exclude Top Choices), a lightweight head-aware decoding operator that targets this regime directly. XTC identifies tokens whose probabilities exceed an absolute plausibility threshold $τ$: when at least two qualify, it removes the dominant eligible choices with probability $ρ$ and retains only the weakest plausible alternative before renormalization. Across 60 experiments on Gemma 3 27B Q4, Gemma 3 12B Q6, and DeepSeek R1 14B Q6, with scaling validation on Llama 3.3 70B Q4, XTC improves the diversity-repetition Pareto frontier. On creative generation, Distinct-2 increases by 11--15% and repeat trigrams decrease by 27--47% across the four models. Combined with temperature scaling, gains reach 38% in Distinct-2 and 71% in repeat-trigram reduction over baseline. A blinded Amazon Mechanical Turk study with 150 Master raters yields a 62.3% creativity preference for XTC ($p<10^{-4}$) without reduced fluency, while a GPT-4o control judge reproduces the Anthropic-judge direction on every measure. On IFEval with Llama 3.3 70B Q4, XTC preserves prompt-level strict accuracy within 1.7 percentage points of baseline while recovering most of the diversity gain; a temperature setting matched on Distinct-2 reduces IFEval by 8.8 points. The effect is additive with temperature and repetition penalties, robust across quantization levels and model families, and consistent across twelve prompt genres. XTC has been adopted by llama.cpp, ExLlamaV2, and text-generation-webui.