Semantic uncertainty in advanced decoding methods for LLM generation
Darius Foodeei 1, Supervisor : Simin Fan 1, Prof. Martin Jaggi 1 · 2025
Read Semantic uncertainty in advanced decoding methods for LLM generation by Darius Foodeei 1, Supervisor : Simin Fan 1, Prof. Martin Jaggi 1 (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2506-17296.txt.
Introduction
Darius Foodeei and co-authors study how the choice of decoding method shapes meaning-level uncertainty in language model output, published in 2025. Decoding is the step that turns model scores into text. Newer methods include speculative sampling and chain-of-thought decoding, and their effect on reliability was not well known.
Tests covered question answering, summarizing, and code generation. Chain-of-thought decoding gave more varied meaning across outputs, yet lower predictive entropy, a sign of confidence. It also raised code scores a good deal, even as its answers matched reference answers less closely. Speculative sampling did best on summary scores while keeping variety moderate. The results challenge the usual idea that more variety must mean worse accuracy.
Catalog record
| CREATOR | Darius Foodeei 1, Supervisor : Simin Fan 1, Prof. Martin Jaggi 1 |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 68 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2506-17296
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Semantic uncertainty in advanced decoding methods for LLM generation Darius Foodeei 1, Supervisor : Simin Fan 1, Prof. Martin Jaggi 1 Abstract This study investigates semantic uncertainty in large language model (LLM) outputs across different decoding methods, focusing on emerging techniques like speculative sampling and chain-of-thought (CoT) decoding. Through experiments on question answering, summarization, and code generation tasks, we analyze how different decoding strategies affect both the diversity and reliability of model outputs. Our findings reveal that while CoT decoding demonstrates higher semantic diversity, it maintains lower predictive entropy, suggesting that structured exploration can lead to more confident and accurate outputs. This is evidenced by a 48.8% improvement in code generation Pass@2 rates, despite lower alignment with reference solutions. For summarization tasks, speculative sampling proved particularly effective, achieving superior ROUGE scores while maintaining moderate semantic diversity. Our results challenge conventional assumptions about trade-offs between diversity and accuracy in language model outputs, demonstrating that properly structured decoding methods can increase semantic exploration while maintaining or improving output quality. These findings have significant implications for deploying language models in practical applications where both reliability and diverse solution generation are crucial. 1 Introduction Recent advances in large language models (LLMs) have shown impressive capabilities in text generation and reasoning, but understanding the semantic uncertainty in their outputs remains challenging. While these models generate fluent text, their semantic consistency across different decoding strategies, including emerging techniques like speculative sampling and chain-of-thought decoding, is not well understood. This gap is particularly important as LLMs are increasingly deployed in critical applications. Semantic uncertainty in LLM outputs ranges from subtle meaning variations to significant differences in reasoning and factual consistency. Traditional metrics often miss these nuances, focusing instead on surface-level features. As LLM deployment expands, understanding semantic uncertainty becomes crucial for ensuring reliable model behavior. This paper investigates semantic uncertainty in LLM generation across multiple datasets, with particular attention to advanced decoding techniques. We examine how different decoding strategies affect semantic consistency through both traditional benchmarks and uncertainty metrics. Our methodology combines multiple approaches to measuring semantic uncertainty, evaluating how speculative sampling and chain-of-thought decoding influence both generation accuracy and semantic stability. 2 Background and Related Work 2.1 LLM generation Large Language Models typically generate text using auto-regressive decoding, where tokens are generated one at a time, with each new token conditioned on all previously generated tokens. During inference, the model estimates a probability distribution over its vocabulary for the next token, given the context of both the input prompt and any previously generated tokens. The most straightforward approach to selecting tokens is greedy decoding, where the model simply chooses the token with the highest probability at each step. However, this deterministic approach often leads to repetitive and less diverse outputs. To address this limitation, several sampling-based methods have become standard practice. Figure 1: This diagram illustrates the process of tokenizing text input (”Paris is the city”) into token IDs using a tokenizer, feeding those IDs into a large language model to generate logits, converting the logits into probabilities via a softmax function, and predicting the next word based on the probability distribution. Temperature sampling introduces controlled randomness into the token selection process by scaling the logits (pre-softmax probabilities) before sampling. A higher temperature makes the distribution more uniform and increases randomness, while a lower temperature makes the distribution more peaked around high-probability tokens. Top-k sampling restricts the sampling pool to only the k most likely tokens, while top-p (or nucleus) sampling dynamically selects tokens from the smallest set whose cumulative probability exceeds a threshold p. These basic decoding strategies face an inherent trade-off between quality and diversity. More deterministic approaches tend to produce higher-quality but potentially repetitive text, while more stochastic approaches increase diversity but may sacrifice coherence or factual accuracy. This trade-off has motivated the development of more sophisticated decoding techniques that aim to balance these competing objectives. 2.2 Semantic Uncertainty A key challenge in evaluating uncertainty in LLM outputs is semantic equivalence - the fact that different sequences of text can convey the same meaning. While traditional uncertainty metrics focus on token-level probabilities, in many applications what matters is uncertainty over the underlying meanings rather than specific phrasings. For example, an LLM might generate both ”Paris is the capital of France” and ”France’s capital is Paris” with different token probabilities, but from a semantic perspective, there is no real uncertainty since both convey the same information. Semantic uncertainty ( Kuhn et al., 2023 ) aims to measure the model’s uncertainty over distinct meanings rather than specific token sequences. This requires clustering model outputs that share the same semantic content, even if they differ in their exact phrasing. For example, when answering questions, multiple generated responses that express the same answer should be grouped together, with their probabilities combined to estimate the likelihood of that particular meaning. We can formalize semantic equivalence mathematically. Let the space of tokens in a language be T . The space of all possible sequences of tokens of length N is then S_{N}\equiv T^{N} . For some sentence s\in S_{N} , a sequence of tokens s_{i}\in T there is an associated meaning. Let us introduce a placeholder semantic equivalence relation, E(\textperiodcentered,\textperiodcentered) , which holds of any two sentences that mean the same thing. Recall that an equivalence relation is any reflexive, symmetric, and transitive relation, and that any equivalence relation on a set corresponds to a set of equivalence classes. Each semantic equivalence class corresponds to one possible meaning that our text can have. That is, for the space of semantic equivalence classes C the sentences in the set c\in C all share a meaning such that \forall s,s^{\prime}\in c:E(s,s^{\prime}) . Ordinarily, large language models produce conditional distributions over tokens and their resulting sequences. That is, the probability of the sequence conditioned on the context comes from conditional token probabilities p(s|x)=\Pi_{i}p(s_{i}|s_{<i},x) . Instead, we focus on the probability of the model generating any sequence that shares some meaning. This can be written as p(c\mid x)=\sum_{s\in c}p(s\mid x)=\sum_{s\in c}\prod_{i}p\bigl(s_{i}\mid s_{<i},x\bigr). Formally, this treats the output random variable whose event-space is C, a sub- \sigma -algebra of the standard event-space S. Measuring semantic uncertainty presents several technical challenges. First, we need reliable methods to determine when different text sequences are semantically equivalent. This can be approached through techniques like bidirectional entailment - checking if one sequence logically implies the other and vice versa. Second, we must aggregate probabilities across semantically equivalent outputs to estimate meaning-level uncertainties. Finally, the extremely high dimensionality of language makes comprehensive sampling of the output space impractical, requiring careful sampling strategies. Despite these challenges, semantic uncertainty metrics can provide valuable signals about model reliability that go beyond traditional token-level uncertainty measures. By focusing on uncertainty over meanings rather than specific phrasings, these approaches better align with how language models are actually used in practice. This is particularly important for applications like question answering or code, where different ways of expressing the same answer should not be interpreted as model uncertainty. 2.3 Review of decoding techniques 2.3.1 Chain of thought decoding Recent work by Wang and Zhou, 2024 introduced chain-of-thought (CoT) decoding, a novel approach that reveals large language models’ inherent reasoning capabilities without relying on prompting techniques. While