Research
Chance-Constrained Inference for Hallucination Risk Control in Large Language Models
Overview Research area: Machine learning / large language model reliability — specifically inference-time risk control for hallucination in stochastic text generation, drawing on chance-constrained op

- arXiv
- 2602.01637
- Published
- 2026-02-02
- Authors
- Sreenivasan Mohandas
AI summary
Overview
Research area: Machine learning / large language model reliability — specifically inference-time risk control for hallucination in stochastic text generation, drawing on chance-constrained optimization, sequential hypothesis testing, and anytime-valid concentration inequalities.
Technical level: Advanced. The paper assumes familiarity with chance constraints, Bernoulli concentration bounds, confidence sequences, and selective prediction. The high-level motivation is stated plainly, but the core machinery (stitched Hoeffding bounds, time-uniform coverage, feasibility certification) is mathematically dense.
Scope (one sentence): The paper formulates LLM hallucination control as a deployment-time chance-constrained feasibility problem and proposes a sequential, anytime-valid inference procedure that certifies whether a given input's hallucination probability can be held below a user-specified risk budget, evaluated on NaturalQuestions-inspired and multi-hop questions with a GROQ-hosted LLaMA-3.3-70B generator.
What This Paper Is About
Large language models produce fluent but incorrect outputs, and because decoding is stochastic (temperature or nucleus sampling), a given input does not have a fixed outcome — it has a distribution of outcomes with some probability of hallucination. Existing fixes such as retrieval-augmented generation, post-hoc detection, and confidence-based abstention reduce error rates on average but give no explicit guarantee about how often a failure occurs when a query is repeated or embedded in an agentic loop. The paper's goal is to bound that failure frequency directly: for a fixed input and a risk budget ε(x), decide whether generation can be accepted while keeping the hallucination rate among accepted outputs at or below ε(x).
Key Contributions
- A chance-constrained formulation of hallucination control. Hallucination is modeled as a stochastic constraint violation H(x, y) ∈ {0, 1}, and the deployment objective becomes a bound on the conditional violation probability among accepted outputs, P(H(x,y)=1 | A(x,y)=1) ≤ ε(x), rather than a bound on individual outputs or average error.
- A sequential, anytime-valid feasibility certification procedure. Using a stitched Hoeffding confidence sequence, the algorithm (Algorithm 1) adaptively draws generations and stops as soon as feasibility or infeasibility can be certified with confidence 1 − δ, avoiding conservative fixed-sample bounds. Infeasibility and undecided outcomes trigger abstention and are treated as correct inference results, not failures.
- A demonstration that confidence-based selective prediction does not imply probabilistic risk guarantees. A constructed example shows a generator with hallucination probability 0.1 and identical confidence scores for valid and invalid outputs yields P(H=1 | A=1) = 0.1 under any confidence rule — violating the chance constraint for any ε < 0.1 even with perfect calibration.
- An empirical evaluation under identical stochastic decoding conditions comparing CCI against confidence-based selective prediction (Conf-SP) and self-consistency selective prediction (SC-SP), plus extensions to severity-weighted and hierarchical constraints.
Main Findings
- Difficulty-stratified certification is sharp and interpretable (ε = 0.4, N_max = 40, δ = 0.05). Easy inputs: 1.00 feasible, 0.00 infeasible, 0.00 undecided, averaging 9.3 samples. Medium inputs: 0.50 feasible, 0.50 infeasible, 0.00 undecided, averaging 14.7 samples. Hard inputs: 0.00 feasible, 1.00 infeasible, 0.00 undecided, averaging 6.1 samples.
- Hard inputs are rejected quickly, boundary inputs take longest. The 6.1-sample average for hard inputs versus 14.7 for medium inputs reflects adaptive sampling: strongly infeasible inputs are certified after few samples, while inputs near the feasibility boundary Δ(x) = 0 require the most evidence.
- Heuristic baselines accept almost everything and inherit the risk (acceptance rate / empirical violation rate). Conf-SP: easy 1.00 / 0.00, medium 1.00 / 0.31, hard 1.00 / 0.92. SC-SP: easy 1.00 / 0.01, medium 1.00 / 0.28, hard 1.00 / 0.89. CCI: easy 1.00 / 0.00, medium 0.50 / 0.00, hard 0.00 / 0.00.
- CCI achieves zero empirical violation on accepted outputs by construction. Because it abstains whenever feasibility cannot be certified, accepted medium inputs show 0.00 violation (versus 0.31 for Conf-SP and 0.28 for SC-SP) and accepted hard inputs are zero (versus 0.92 and 0.89).
- Confidence calibration alone is insufficient. The worked example with a 0.1 hallucination probability and identical confidence scores shows any confidence-based acceptance rule violates the constraint for ε < 0.1 despite perfect calibration.
- Anytime validity holds under arbitrary data-dependent stopping. Theorem 1 and Theorem 2 establish that, with probability at least 1 − δ, a "Feasible" return implies P(H=1) ≤ ε(x) and an "Infeasible" return implies P(H=1) > ε(x), for all sample sizes simultaneously.
- Guarantees depend on conditional independence. Deterministic decoding, beam search, shared key-value caches, or very low temperatures can break the independence assumption and invalidate concentration-based guarantees; temperature sampling, cache resets, randomized prompts, or decorrelation across calls are suggested remedies.
- Violation severity and priority can be folded in. Replacing H(x,y) with the indicator I[C(x,y) > τ] extends certification to severity-weighted cost, and lexicographic ordering handles hierarchical constraints where higher-priority constraints must be certified feasible first.
- A stated limitation: reliance on automatic verifiers. The authors note that automatic proxies for hallucination detection may be imperfect in open-ended settings.
Methodology in Plain English
The authors treat the model as a coin-flipping machine rather than a deterministic answerer. For a fixed question, they repeatedly sample answers from the LLM through its API, and each sampled answer is run through a verifier that labels it as a violation or not — a binary outcome. Because repeated samples for the same question are assumed conditionally independent, the observed violation rate behaves like flips of a biased coin whose bias is unknown.
The trick is that they do not need to estimate that bias accurately. They only need to decide one of three things: the bias is confidently below the risk budget (feasible), confidently above it (infeasible), or neither yet (undecided). They build a confidence interval around the running violation rate that is valid at every sample size at once, using a stitched Hoeffding bound. After each new sample, they check whether the whole interval sits below the budget, or entirely above it. If a conclusion is reached, they stop and — in the feasible case — return the next generation; otherwise they abstain. This design means a sample-hungry question is only expensive when its true risk is genuinely close to the budget line.
For evaluation, they grouped questions inspired by NaturalQuestions and HotpotQA into easy, medium, and hard categories, ran everything against the GROQ-hosted LLaMA-3.3-70B generator with ε = 0.4, δ = 0.05, and N_max = 40, and compared against two heuristic baselines operating on the same generations. The paper reports fractions of feasible/infeasible/undecided outcomes, average samples to terminate, and acceptance and violation rates; it does not report dataset sizes, the number of questions per group, or the identity of the automatic verifier used.
Why This Matters
Impact on research. The paper reframes hallucination from a detection problem ("find the bad output") to a risk-control problem ("bound how often bad outputs reach the user"), and argues that selective prediction, conformal prediction, and split conformal risk control offer only marginal, fixed-budget guarantees that do not support adaptive stopping or early infeasibility detection. It also connects recent anytime-valid statistics work (previously used mainly in online experimentation and safety monitoring) to inference-time control of generative models.
Real-world applications:
- Agentic pipelines where a single model is queried hundreds of times and a small per-query risk compounds into a large aggregate failure probability.
- High-stakes question answering and decision support, where the correct behavior on an unanswerable or underspecified question is to abstain rather than guess — the paper's hard-category questions about future events are exactly this case.
- Content and policy compliance, using the severity-weighted extension where P(C(x,y) > τ) ≤ ε(x) lets teams set a tolerance only for failures above a chosen severity threshold.
- Layered system requirements, using the hierarchical extension so that safety constraints are certified before stylistic or quality constraints are even considered.
Industry relevance. The method runs entirely at inference time with no retraining, no fine-tuning, and no calibration of the underlying model, and it works against a deployed API (GROQ-hosted LLaMA-3.3-70B) rather than requiring model internals. That makes it deployable as a wrapper or gateway layer, and it gives teams a tunable, auditable knob — the risk budget ε(x) — instead of an opaque confidence threshold.
Future Directions
- Stronger semantic verification. The authors identify reliance on automatic hallucination proxies as the study's key limitation and call for integrating stronger semantic verifiers.
- Human-in-the-loop evaluation to validate the certification outcomes against human judgments of factual correctness.
- Online adaptation of risk budgets, allowing ε(x) to change dynamically during deployment rather than being fixed per input.
- Extension to safety-critical deployments, alongside a fuller treatment of the independence assumption — the paper notes that deterministic decoding, beam search, shared key-value caches, and very low temperatures can break the guarantees and only sketches deployment remedies.
- Utility–risk optimization. Appendix E promises a formal characterization of optimal acceptance policies under probabilistic risk constraints, but the main text leaves the operational choice of which candidate to accept when several are available as an open optimization question.
Target Audience
Researchers and practitioners in LLM reliability, uncertainty quantification, and safe deployment who are already comfortable with probabilistic guarantees and selective prediction; applied ML engineers building abstention or verification layers around hosted LLM APIs; and statisticians interested in applying anytime-valid inference and chance-constrained optimization to generative model outputs. Readers without a background in concentration inequalities will find the motivation and experimental tables accessible, but the certification machinery requires intermediate-to-advanced statistical maturity.
Authors’ abstract
Large language models generate outputs stochastically and may produce fluent but invalid responses, including factual hallucinations. Existing mitigation strategies reduce average error rates but do not provide explicit control over the \emph{frequency} of such failures under repeated use. We formulate inference as a deployment-time risk control problem and introduce \emph{chance-constrained inference}, which directly bounds the probability of hallucinations among accepted generations. Hallucinations are modeled as stochastic constraint violations, and we show that confidence-based selective prediction does not, in general, imply probabilistic risk guarantees. To enforce chance constraints efficiently, we propose a sequential, anytime-valid inference procedure that adaptively certifies feasibility or infeasibility using finite samples, avoiding conservative fixed-sample bounds. Experiments on questions inspired by NaturalQuestions and controlled multi-hop question answering demonstrate reliable risk control, early detection of intrinsically infeasible inputs, and safe composition under repeated use, while confidence-based baselines fail to provide consistent guarantees.