arXiv(opens in a new tab)cs.CLAug 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2608.22758

XTC: Head-Aware Sampling by Excluding Top Choices

Philipp Emanuel Weidmann, Allen Roush, Judah Goldfeder, Sanjay Basu, Ravid Shwartz-Ziv

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Philipp Emanuel Weidmann ∗^{*}

Independent Researcher

pew@worldwidemann.com

Allen G. Roush ∗^{*}

Thoughtworks

allen.roush@thoughtworks.com

Judah Goldfeder

Columbia University

jag2396@columbia.edu

Sanjay Basu

Oracle

sanjay.basu@oracle.com

Ravid Shwartz-Ziv

New York University

ravid.shwartz.ziv@nyu.edu

Abstract

Standard decoding rules for autoregressive language models promote diversity by rescaling the full next-token distribution or by truncating its low-probability tail. These strategies overlook a recurring regime of open-ended generation in which the model already assigns substantial probability to several plausible continuations yet still concentrates too much mass on the most generic choice. We introduce XTC (Exclude Top Choices), a lightweight head-aware decoding operator that targets this head-ambiguity regime directly. Given a next-token distribution, XTC identifies the set of tokens exceeding an absolute plausibility threshold τ\tau. When two or more such tokens exist, it removes the dominant eligible choices with probability ρ\rho and retains only the weakest plausible alternative before renormalizing. A comprehensive evaluation spanning 60 experiments across three primary model families (Gemma 3 27B q4, Gemma 3 12B q6, DeepSeek R1 14B q6), extended with a scaling validation on Llama 3.3 70B q4, confirms the predicted operating profile. On creative generation tasks, XTC improves the diversity-repetition Pareto frontier with Distinct-2 gains of 11–15% (monotone in parameter count from 12B to 70B) and repeat trigram reductions of 27–47% across the four tested models. When composed with temperature scaling, total improvements reach 38% (Distinct-2) and 71% (repeat trigram reduction) over baseline. A blinded Amazon Mechanical Turk study with 150 Master raters confirms that these distributional shifts translate to a 62.3% creativity preference for XTC ( p<10−4p < 10^{-4}) without sacrificing fluency, and a cross-vendor GPT-4o control judge replicates the Anthropic-judge signal on every directional measure. On instruction-following (IFEval, Llama 3.3 70B q4), XTC preserves prompt-level strict accuracy within 1.7 percentage points of baseline at parameters that recover most of the diversity gain. A temperature setting matched on Distinct-2 collapses IFEval by 8.8 points at the same Distinct-2 target. The effect is additive with temperature and repetition penalties, robust across quantization levels and model families, and consistent across all twelve tested prompt genres. XTC has been adopted by popular open-source LLM inference frameworks, including llama.cpp, ExLlamaV2, and text-generation-webui, highlighting its impact on practical text generation.

∗^{*}Equal contribution.

†^{\dagger}Proposed the XTC sampling method and wrote the original reference implementations, which were merged into llama.cpp, text-generation-webui, and other open-source inference engines.

‡^{\ddagger}Designed and ran all experiments, evaluations, and statistical analysis.

Preprint.

1 Introduction

Autoregressive language models [Bengio et al., 2003, Vaswani et al., 2017, Brown et al., 2020] require a decoding strategy that balances faithfulness to the learned distribution against the goals of the downstream task [Wiher et al., 2022, Celikyilmaz et al., 2020]. Conservative sampling produces generic, repetitive text [Holtzman et al., 2020]. Aggressive sampling admits implausible low-probability tokens or perturbs steps where the model is already confident [Hewitt et al., 2022, Renze and Guven, 2024]. A large body of work has therefore sought decoding rules that broaden the space of plausible continuations without sacrificing coherence [Fan et al., 2018, Holtzman et al., 2020, Meister et al., 2023, Basu et al., 2021].

The most widely adopted samplers truncate the low-probability tail or rescale the full distribution. Temperature changes the relative sharpness of all logits [Ackley et al., 1985]. Top-k and top-p remove weak tokens by rank or cumulative mass [Fan et al., 2018, Holtzman et al., 2020]. Typical and truncation-based methods target atypical or improbable candidates [Meister et al., 2023, Hewitt et al., 2022]. Min-p thresholds relative to the maximum token probability, adapting the cutoff to the peakedness of each distribution [Nguyen et al., 2025]. These approaches share a structural assumption: undesirable randomness originates primarily in the tail of the distribution or in its overall entropy.

Open-ended generation frequently exhibits a distinct failure mode. The model assigns substantial probability to several individually plausible continuations while overweighting the safest or most conventional one. In this head-ambiguity regime, tail truncation has little effect because the relevant alternatives already reside in the head, and global flattening is too coarse because it intervenes at every step regardless of whether the model is genuinely uncertain among strong options. Recent studies confirm that LM-assisted writing reduces population-level content diversity even when individual outputs appear varied [Padmakumar and He, 2024, Doshi and Hauser, 2024, Anderson et al., 2024], suggesting that the head-dominance problem has practical consequences beyond benchmark scores.

We introduce XTC (Exclude Top Choices), a decoding operator for the head-ambiguity regime. Given a next-token distribution, XTC identifies the set of tokens exceeding an absolute plausibility threshold τ\tau. When this set contains at least two tokens, it removes the dominant eligible choices with probability ρ\rho, retains only the weakest token that still clears the plausibility floor, and renormalizes. The operator has four defining properties:

• It is sparse in time: inactive whenever the head is effectively unambiguous.

• It is head-aware: targets individually probable alternatives in the head.

• It is compositional: inserts into any existing sampler stack as a small distribution transformation.

• It is conditionally beneficial: helps most when head multiplicity is present and is nearly inert otherwise.

Our contributions are as follows. (1) We formalize XTC as an operator on a token distribution and provide a complete, implementation-ready algorithm (Section 3). (2) We derive structural properties including a KL-projection interpretation that distinguishes XTC from both tail-truncation and global-entropy methods (Appendix A.4). (3) We present a comprehensive evaluation: 60 experiments across three primary model families (Gemma 3 27B q4, Gemma 3 12B q6, DeepSeek R1 Qwen 14B q6) plus a scaling validation on Llama 3.3 70B q4, covering creative diversity, long-form degeneration, code exactness, design ablations, sampler composition, parameter interaction, and cross-model robustness (Section 4). (4) We show that XTC improves the diversity-repetition Pareto frontier on creative tasks (Distinct-2 gains of 11–15% across four tested models, monotone in parameter count from 12B to 70B) while preserving quality on exactness-sensitive tasks within identified safe operating boundaries. (5) We demonstrate that XTC composes additively with temperature and repetition penalties, achieving combined Distinct-2 improvements of up to 38% with repeat trigram reductions of 71% over baseline. (6) We close the loop on the evaluation hierarchy with a blinded AMT human study, a Claude Opus 4.7 LLM judge cross-checked by an OpenAI gpt-4o control, and an IFEval characterization that quantifies the instruction-following cost of head-aware diversity (Section 4.3, Section 4.4).

2 Background and related work

The tension between faithfulness and diversity in autoregressive decoding has generated a rich literature [Gatt and Krahmer, 2018, Wiher et al., 2022, Li et al., 2024a]. Top-k sampling [Fan et al., 2018] and nucleus sampling (top-p) [Holtzman et al., 2020] truncate the distribution tail by rank or cumulative mass. Typical decoding removes atypical tokens according to an information-theoretic criterion [Meister et al., 2023]. Epsilon and eta sampling apply fixed or entropy-adaptive probability cutoffs [Hewitt et al., 2022]. Mirostat maintains a target perplexity level through online surprise control [Basu et al., 2021]. Min-p sampling thresholds relative to the maximum probability, adapting truncation to the peakedness of each distribution [Nguyen et al., 2025]. Temperature scaling, the oldest diversity control, rescales all logits by a single factor [Ackley et al., 1985, Renze and Guven, 2024]. These methods focus on the tail or the global shape of the distribution. XTC targets the head.

Sequence-level and training-time diversity. Diverse beam search injects inter-group diversity penalties into beam decoding [Vijayakumar et al., 2016]. Contrastive search [Su et al., 2022] and contrastive decoding [Li et al., 2023] improve generation by contrasting with degenerate continuations or weaker reference models. DoLa decodes by contrasting early and late layers [Chuang et al., 2024], FUDGE steers generation with future discriminators [Yang and Klein, 2021], and COLD formulates controlled generation as energy-based sampling [Qin et al., 2022]. Unlikelihood training discourages repeated tokens at the objective level [Welleck et al., 2020], controllable generation methods steer with conditional prefixes or control codes [Keskar et al., 2019], and MMI-based decoding promotes diversity through mutual-information objectives [Li et al., 2016]. These methods operate at the sequence level, require auxiliary models, or modify training. XTC operates on a single next-token distribution within any sampler stack.

Diversity measurement and LLM-as-judge. Evaluating text diversity is itself an active research area [Shaib et al., 2025, 2024, Zhu et al., 2018, Papineni et al., 2002, Pillutla et al., 2021, Zhang et al., 2020, Hashimoto et al., 2019]. We follow the multi-metric philosophy advocated by these works and report five complementary diversity families. Strong language models are also routinely used to score open-ended text [Zheng et al., 2023, Chiang and Lee, 2023, Li et al., 2024b]. Systematic biases of LLM judges (position, verbosity, same-family preference) have been documented and partially controlled through randomization, length normalization, and cross-vendor calibration [Dubois et al., 2024, Wang et al., 2024]. We pre-register seven criteria, score every generation with Claude Opus 4.7 as the primary judge, and cross-validate against an OpenAI gpt-4o control judge (Section 4.3).

The homogenization problem. A growing body of work documents that LM-assisted writing reduces content diversity at a population level, even when individual outputs appear varied [Padmakumar and He, 2024]. Similar effects appear in creative writing [Doshi and Hauser, 2024], ideation [Anderson et al., 2024], and more broadly across expression and reasoning strategies [Sourati et al., 2025]. RLHF training has been shown to narrow the stylistic and topical range of model outputs [Kirk et al., 2024, Ouyang et al., 2022, Bai et al., 2022], and training data deduplication can partially mitigate convergence in generation [Lee et al., 2022]. These findings motivate decoding-time interventions that increase diversity within individual generation episodes, the regime XTC targets.

Position of XTC. XTC requires no retraining, beams, or auxiliary models. It acts on a single next-token distribution after any upstream transformations. The closest conceptual relative is locally typical sampling [Meister et al., 2023], which removes atypical (low-probability) tokens to keep generation close to the model's expected information content. XTC inverts this target: it removes the most typical (highest-probability) tokens among those that are individually plausible, promoting a less dominant but still viable continuation. This inversion of the target set, from tail to head, is the core conceptual distinction.

References (81)

  • A learning algorithm for boltzmann machines
  • Homogenization effects of large language models on human creative ideation
  • Training a Helpful and Harmless Assistant with Reinforcement Learning from Human Feedback
  • Mirostat: A neural text decoding algorithm that directly controls perplexity
  • A neural probabilistic language model
  • Evaluation of text generation: A survey (opens arXiv in a new tab)
  • Can large language models be an alternative to human evaluations? In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 15607–15631, 2023
  • DoLa: Decoding by contrasting layers improves factuality in large language models
  • Elements of Information Theory
  • DeepSeek-R1 incentivizes reasoning in LLMs through reinforcement learning
  • Generative AI enhances individual creativity but reduces the collective diversity of novel content
  • Length-controlled AlpacaEval: A simple way to debias automatic evaluators
  • Hierarchical neural story generation
  • GPTQ: Accurate post-training quantization for generative pre-trained transformers
  • Survey of the state of the art in natural language generation: Core tasks, applications and evaluation
  • Unifying human and statistical evaluation for natural language generation
  • Truncation sampling as language model desmoothing
  • The curious case of neural text degeneration
  • Creative writing with an AI-powered writing assistant: Perspectives from professional writers (opens arXiv in a new tab)
  • CTRL: A conditional transformer language model for controllable generation (opens arXiv in a new tab)
  • Understanding the effects of RLHF on LLM generalisation and diversity
  • Deduplicating training data makes language models better
  • A diversity-promoting objective function for neural conversation models
  • Pre-trained language models for text generation: A survey
  • Contrastive decoding: Open-ended text generation as optimization
  • Leveraging large language models for NLG evaluation: Advances and challenges
  • Awq: Activation-aware weight quantization for on-device llm compression and acceleration
  • Locally typical sampling
  • Gemma: Open Models Based on Gemini Research and Technology
  • Large language models: A survey (opens arXiv in a new tab)
  • Turning up the heat: Min-p sampling for creative and coherent LLM outputs
  • Does writing with language models reduce content diversity? In International Conference on Learning Representations, 2024
  • BLEU: A method for automatic evaluation of machine translation
  • MAUVE: Measuring the gap between neural text and human text using divergence frontiers
  • COLD decoding: Energy-based constrained text generation with Langevin dynamics
  • Language models are unsupervised multitask learners
  • The effect of sampling temperature on problem solving in large language models
  • Detection and measurement of syntactic templates in generated text
  • Standardizing the measurement of text diversity: A tool and comparative analysis
  • The homogenizing effect of large language models on human expression and thought (opens arXiv in a new tab)
  • A contrastive framework for neural text generation
  • Llama 2: Open Foundation and Fine-Tuned Chat Models
  • Attention is all you need
  • Diverse beam search: Decoding diverse solutions from neural sequence models (opens arXiv in a new tab)
  • An automatic evaluation benchmark for LLM instruction tuning optimization
  • Neural text generation with unlikelihood training
  • On decoding strategies for neural text generators
  • FUDGE: Controlled text generation with future discriminators
  • Wordcraft: Story writing with large language models
  • BERTScore: Evaluating text generation with BERT. In International Conference on Learning Representations, 2020
  • A Survey of Large Language Models
  • Instruction-Following Evaluation for Large Language Models
  • Texygen: A benchmarking platform for text generation models
  • This gives the support edit a principled information-geometric status
  • Taking the ratio gives $q_t(v)/q_t(w) = p_t(v)/p_t(w)$
  • Therefore $q(v) = p_t(v) / (1 - \sum_{r \in R_t} p_t(r))$, which is exactly $q_t(v)$
  • The IFEval characterization (Section 4.4) and the structured-quality safety sweeps (Appendix H) quantify this
  • The threshold $\tau$ is defined in absolute probability terms, so the same value can behave differently across model scales, tokenizer granularities, and upstream sampler stacks [Wiher et al., 2022]
  • If newline, end-of-sequence, indentation, or schema-critical delimiter tokens enter the eligible set, removing them may destabilize structured outputs
  • A broader evaluation across additional mixture-of-experts architectures [Minaee et al., 2024, Brown et al., 2020, Touvron et al., 2023], state-space models, and non-English languages would strengthen the generality claims
  • It can redirect a model among already plausible next tokens, but it cannot create competence that the base model does not have
  • We re-ran the cross-model creative configuration with max_tokens=8192 and stripped the <think>
  • the head-ambiguity regime where the model is already uncertain among strong options but still defaults to the safest one
  • >Model family</td><td colspan=
  • Means and 95% paired-bootstrap CIs are computed over per-prompt deltas (24 prompts for the 27B and 70B runs, 10 for the 12B/14B cross-model runs)
  • Llama 3.3 70B q4 shows the largest Distinct-2 improvement (+15.1%), extending the effect to a third architecture family and a parameter count $2.6 \times$ larger than Gemma 3 27B
  • The Llama 3.3 70B q4 scaling validation is shown separately in Figure 9
  • Retaining only the weakest eligible alternative maximizes the displacement from the dominant head pattern while staying above the plausibility floor
  • keep weakest eligible token
  • Keep Least (the published XTC rule) achieves the highest Distinct-2, the lowest Self-BLEU-4, and the largest repeat-trigram reduction
  • At all three temperatures and across all three models, XTC Medium and Strong improve Distinct-2 and reduce both Self-BLEU-4 and repeat trigram rate
  • Diagonal structure (improvement increasing along both axes independently) is consistent with additive composition
  • XTC Medium and Strong both produce highly significant improvements on Distinct-2 (p<0.001 each) and significant improvements on Self-BLEU-4
  • We extended the comparator suite on the same 24-prompt creative pool (Gemma 3 27B q4) with two recent tail-shaping methods: eta sampling [Hewitt et al., 2022] at $\eta = 3\times 10^{-4}$ and min-$p$ sampling [Nguyen et al., 2025] at $p_{\mathrm{min}} = 0.10$, plus the min-$p$ + XTC composition
  • Temperature 1.3 alone substantially improves diversity, but the composition T=1.3 + XTC ( $\rho=0.75$, $\tau=0.05$) achieves the highest score on all four metrics
  • The composition of T=1.3 with XTC occupies the far upper-left corner
  • Green indicates improvement
  • XTC Light and Medium maintain quality at or near baseline
  • ><tr><td>Judge</td><td>Condition</td><td>Overall</td><td>Creativity</td><td>Repetition</td><td>Lexical</td></tr><tr><td rowspan=
  • Bold entries have a 95% interval that excludes zero
  • ><tr><td>Judge</td><td>Condition</td><td>Overall</td><td>Creativity</td><td>Repetition</td><td>Fluency</td></tr><tr><td rowspan=