Vocabulary-Aware Conformal Prediction (VACP)
- VACP is a framework that enhances next-token prediction by restricting the vocabulary and sharpening probability distributions for efficient uncertainty quantification.
- It employs structural filtering and temperature scaling on a reduced token set, achieving prediction sets up to 200× smaller than standard APS methods.
- Empirical results on benchmarks like SQuAD and WikiText-103 validate its near-nominal coverage and significant efficiency improvements over full-vocabulary approaches.
Vocabulary-Aware Conformal Prediction (VACP) is a framework designed for efficient and reliable uncertainty quantification in next-token prediction with LLMs that possess extremely large vocabularies (e.g., |V| ≈ 256,000). While Adaptive Prediction Sets (APS) provide provable marginal coverage guarantees for classification and next-token tasks, their naive application to LLMs results in prediction sets containing hundreds of tokens, which are inefficient and uninformative. VACP addresses this by systematically reducing the effective prediction space and sharpening uncertainty quantification, while maintaining marginal coverage guarantees comparable to standard APS (Kotla et al., 27 Dec 2025).
1. Formal Description of VACP
Let denote the full vocabulary of the LLM. Standard APS constructs the prediction set for a new context as
where
is the cumulative softmax mass up to token , with the softmax probability for token and the quantile of calibration scores.
VACP modifies this in three principal steps:
- Vocabulary restriction: Select a subset such that 0.
- Temperature-adjusted scoring: Apply temperature scaling to sharpen the prediction distribution over 1, using 2 for model logits 3 and temperature 4.
- APS on 5: Run APS on 6 with scores 7 and threshold 8.
The resulting prediction set
9
achieves the same marginal coverage as APS on 0 provided 1.
2. Algorithmic Workflow
VACP is structured as follows:
Step A: Effective Vocabulary Construction
- Structural filtering: Remove control tokens (e.g., <pad>, <eos>, <unused...>), non-printables.
- Empirical filtering: For each 2 (remaining), compute 3. Remove all 4 with 5 (6).
- The surviving set defines 7 (e.g., 8 for Gemma-2B).
Step B: Temperature Selection
- For each 9 in a grid 0:
- For 1:
- Mask 2 for 3.
- Compute 4.
- Compute 5.
- Compute threshold 6 as above; select 7 giving coverage 8 with smallest mean set size.
Step C: Prediction
- Given new 9, mask logits for 0.
- Compute 1.
- Form 2 as above.
3. Mathematical Guarantees and Core Formulas
With 3, temperature 4, and nonconformity score 5 defined as above, VACP sets use the threshold
6
Marginal coverage satisfies
7
provided 8. If 9, coverage is at least 0.
To bound 1, Proposition 2 gives 2, so choosing 3 yields 4; structural filtering yields 5.
4. Theoretical Analysis
Theorem 1 (Marginal Coverage under Vocabulary Restriction):
If 6 satisfies 7, then 8 constructed via APS restricted to 9 ensures 0. The proof follows by noting that calibration and prediction are both restricted to 1, and thus exchangeability holds under the true distribution, preserving the conformal validity argument.
Proposition 2 asserts that empirical filtering controls the size of 2, with the 3 bound being worst-case; actual LLM output distributions are even sparser (≈3,200 tokens above 4 on average). Exact marginal coverage in practice depends on 5, a property observed empirically on benchmarks such as SQuAD and WikiText.
5. Empirical Results and Efficiency
Experiments on the Gemma-2B model with SQuAD and WikiText-103 benchmarks compared standard APS and VACP for next-token prediction at 6 (nominal 90% coverage). Key outcomes are summarized below:
| Method | Empirical Coverage | Mean 7 (tokens) | Efficiency Ratio |
|---|---|---|---|
| Standard APS (full 8) | 91.2% ± 1.3% | 847 | 1× |
| VACP (mask + 9) | 89.7% ± 1.4% | 4.3 | 197× |
- Median prediction set size: standard APS median 0, VACP median 1.
- Ablations: APS + mask only (coverage 90.8%, mean 2), APS + temperature only (3; coverage 76.4%, mean 4).
- On WikiText-103 (no recalibration): coverage 88.4%, mean 5.
- After recalibration: coverage 90.1%, mean 6.
- By true-token confidence:
- 7: coverage 91.3%, mean 8
- 9: coverage 89.4%, mean 0
- 1: coverage 88.1%, mean 2
These results show VACP achieves near-nominal coverage rates with prediction sets that are approximately 200× smaller than those from uninformed APS.
6. Significance and Robustness
VACP demonstrates that conformal prediction methods can be made practical for LLM next-token prediction, with substantial improvements in efficiency while maintaining formal statistical guarantees under strong conditions (3). Empirical filtering and structural masking eliminate tokens with negligible probability under practical workloads, ensuring practical set sizes without loss of relevant support for 4 in evaluation. Furthermore, VACP transfers effectively to new benchmarks without requiring extensive reparameterization or set recalibration.
The design achieves a balance between computational tractability, interpretability (reasonably small prediction sets), and theoretical rigor in coverage. These aspects support its use in high-stakes LLM deployments requiring calibrated set-based uncertainty quantification (Kotla et al., 27 Dec 2025).
7. Context and Relation to Prior Work
VACP builds on the Adaptive Prediction Sets (APS) framework of Romano et al. (2020), whose direct application in large-vocabulary regimes results in unwieldy prediction sets. By integrating semantic masking and temperature-based distribution sharpening, VACP adapts the conformal prediction toolkit to the unique challenges of LLM architectures. The framework is primarily motivated by deficiencies in softmax calibration for LLMs and the need for uncertainty quantification in open-vocabulary, high-entropy predictive tasks. VACP offers theoretical and algorithmic foundations to extend conformal validity to applications previously impeded by efficiency constraints (Kotla et al., 27 Dec 2025).