TL;DR
Traditional Large Language Models (LLMs) output simple probability distributions, making it impossible to distinguish whether a model is genuinely conflicted between two good choices or completely ignorant. This paper introduces Random-Set Large Language Models (RS-LLMs), which predict sets of tokens (belief functions) instead of single-token probabilities. This approach not only boosts text generation accuracy across multiple architectures but also introduces a mathematically rigorous way to detect hallucinations using "credal set width."
What Problem Does This Paper Address?
When a standard LLM predicts the next word, its final layer outputs a softmax probability distribution over the entire vocabulary. If it assigns a 50% chance to "baseball" and a 50% chance to "basketball," classical probability cannot tell us why. Does it mean "both answers are equally valid in this context" (aleatoric uncertainty), or does it mean "I lack the knowledge to choose between them" (epistemic uncertainty)?
Conflating these two types of uncertainty makes LLMs less trustworthy, especially in high-stakes decision-making. To make LLMs truly reliable, we need a mechanism that allows them to express "second-level" uncertainty—essentially enabling the model to say, "I know the answer belongs to this group of words, but I don't have enough information to pick one."
Methods
The authors introduce RS-LLMs, which replace standard probability vectors with finite random sets, formalized as belief functions (from Dempster-Shafer theory).
The Scalability Challenge
Predicting probabilities for every possible combination of words is a computational nightmare. For a typical LLM vocabulary of 32,000 tokens, the number of possible subsets is an astronomical $2^{32000}$.
Token Budgeting via Clustering
To make this scalable, the authors introduce a "budgeting" strategy. They apply hierarchical clustering to token embeddings to group semantically similar tokens into $K$ clusters (e.g., grouping "football", "basketball", and "poodle", "bulldog").
The model's final layer is modified to predict values only for this restricted "budget" $\mathcal{O}$, which consists of the $K$ clusters plus the $T$ original individual tokens (singletons), bringing the total output size down to a manageable $K + T$.
Training and Generation
The model is fine-tuned using a modified Binary Cross-Entropy loss alongside custom regularization terms that force the network to output valid belief masses. During text generation, this predicted belief function is mapped to a convex set of probability vectors (a credal set). The center of mass of this set—the pignistic probability—is then used to sample the actual next token.
Datasets
The RS-LLM framework was evaluated using three prominent open-source base models (Llama2-7b, Mistral-7b, and Phi-2) across the following datasets:
- CoQA (Conversational Question Answering): A generative QA dataset where the model answers questions based on a provided background story.
- OBQA (Open Book Question Answering): A multiple-choice QA dataset focused on STEM facts.
- XSum: An additional dataset used to test the framework on one-line document summarization tasks.
Key Insights and Ideas
- Semantic Confusion is Structured: The clustering approach works because when an LLM is uncertain, it is usually confused between semantically related words (synonyms or words within the same category).
- Credal Width as a Hallucination Alarm: The size (width) of the predicted credal set directly measures epistemic uncertainty. When the model is forced to answer a question using scrambled or incorrect context, the credal set width spikes dramatically. This provides a clean, threshold-based signal to detect hallucinations.
- Better Representations Mean Better Accuracy: Moving from flat probabilities to set-based belief functions forces the model to learn relationships between groups of classes during training, which inherently improves its overall prediction accuracy.
Key Results
RS-LLMs consistently outperformed their standard counterparts in both accuracy and uncertainty quantification:
- Accuracy Improvements: On the OBQA dataset, RS-Llama2 achieved 89.60% accuracy, a significant jump from standard Llama2's 83.20%. Similar improvements were observed for Mistral and Phi-2.
- Closer to Ground Truth: On the generative CoQA dataset, RS-LLMs achieved higher text cosine similarity scores compared to standard models.
- Superior Hallucination Detection: As shown in the uncertainty distributions below, standard entropy measures (d, e) heavily overlap between correct and incorrect predictions. In contrast, the Credal Width (f) provides near-perfect separability, making it easy to flag incorrect context and hallucinations.
Limitations and Future Work
- Manual Budgeting: The number of focal clusters ($K$) is currently a static hyperparameter that must be manually tuned. The authors note that a dynamic clustering strategy based on token overlap would improve flexibility.
- Fine-Tuning vs. Pre-Training: This method was implemented via parameter-efficient fine-tuning (LoRA). Scaling the random-set mathematical framework to train a massive language model entirely from scratch remains an open, computationally intensive challenge.
Summary updated