Weighted Ensemble Sampling for Rare-Event Estimation in Language Models
cs.CL
Submitted: 2026-10-13
Updated: 2026-10-13
Code: https://github.com/rangell/LMTailRisk
License: http://creativecommons.org/licenses/by/4.0/
The gist: Rare but severe failures of large language models can become practically significant at deployment scale.
Abstract
Rare but severe failures of large language models can become practically significant at deployment scale. Estimating their probabilities with direct Monte Carlo sampling is highly inefficient, while proposal-based methods typically require auxiliary learning of an additional proposal distribution. We introduce Weighted Ensemble (WE), a training-free framework for rare-event estimation in language models. WE samples exclusively from the original language model and improves upon direct Monte Carlo by periodically reallocating the sampling budget toward prefixes that appear more likely to reach the target rare event. To guide this reallocation without learning a separate proposal distribution, we exploit internal LLM representations as prefix-level signals and empirically validate their effectiveness. We provide a theoretical analysis of the proposed algorithm. Experiments on safety-related tasks spanning both small-scale and modern large-scale LLMs demonstrate that WE improves the efficiency and reliability of rare-event probability estimation.
Sources
- GPT-4 Technical Report
- Estimating Tail Risks in Language Model Output Distributions
- On the Convergence of Adaptive Sequential Monte Carlo Methods
- Rare Event Analysis of Large Language Models
- TinyStories: How Small Can Language Models Be and Still Speak Coherent English?
- The Llama 3 Herd of Models
- Forecasting Rare Language Model Behaviors
- Improving Constrained Language Generation via Self-Distilled Twisted Sequential Monte Carlo
- DeepSeek-V3 Technical Report
- Enhancing LLM Safety via Constrained Direct Preference Optimization
- Modern hierarchical, agglomerative clustering algorithms
- Estimating Rare Events in Language Models with Proper Evaluation
- Reweighting from the mixture distribution as a better way to describe the Multistate Bennett Acceptance Ratio
- A StrongREJECT for Empty Jailbreaks
- Gemini: A Family of Highly Capable Multimodal Models
- Gemma: Open Models Based on Gemini Research and Technology
- ForeSight: Enhancing Risk Monitoring via Early Safety Signal Distillation
- Text Embeddings by Weakly-Supervised Contrastive Pre-training
- Rare Event Estimation via Iterative Unalignment
Related papers
- Exploring Solution Divergence and Its Effect on Large Language Model Problem Solving
- Ishigaki-IDS-Bench: A Benchmark for Generating Information Delivery Specification from BIM Information Requirements
- Subliminal Steering: Stronger Encoding of Hidden Signals
- MedStruct-S: A Benchmark for Key Discovery, Key-Conditioned QA and Semi-Structured Extraction from OCR Clinical Reports
- The End of Transformers? On Challenging Attention and the Rise of Sub-Quadratic Architectures
- Untangling the Mechanisms of Misleading Context in Medical Question Answering