betaFeedback

WorksComputer Science

A statistical measure of trust in generative AI

Abstract

Trustworthiness is a crucial issue for generative AI, as modern models can produce convincing and confident responses even when their outputs are incomplete, unsupported, or wrong. The frequent absence of ground-truth knowledge or labels complicates verification of generative AI outputs. To address this issue, we propose a trustworthiness framework grounded in model-internal confidence calibrated against an external expert reference. We estimate per-token trustworthiness of a student generative model as the statistical typicality of each generated token relative to an expert model's distribution, where the expert is used as a distributional reference rather than as a source of factual verification labels. To this end, we introduce an AI ontology calibrator that leverages the student model's internal latent features and token-level output statistics to compute expert-reference acceptance scores. Combined with traditional token-level confidence, entropy, and perplexity statistics, calibrator scores yield a compact set of 1515 response-level indicators for correctness classification. Evaluated across BF program generation, mathematical problem solving, and medical question answering, combined calibrator and traditional indicators provide complementary reliability signal which could be used to build detectors of untrustworthy outputs and hallucinations. Remarkably, our experiments show that these detectors are transferable across domains, although transferability is not always symmetric.

Introduction

Generative AI has become a common component of modern computational systems, supporting coding, text processing, search, learning, and decision making. As these systems are increasingly used in consequential domains, the problem of trustworthiness becomes central. This is particularly visible for Large Language Models (LLMs), which can produce fluent and confident responses even when the underlying content is incomplete, unsupported, or wrong.

Current gold standard approaches to trustworthiness in LLMs emphasize factual incorrectness [4, 24, 42], unfaithfulness to input context [46, 9], or internal inconsistency [30]. They presuppose access to some notion of ground truth, such as an external knowledge base, a reference document, an objective fact, or a set of internally consistent statements [20]. Dependence on ground truth introduces a practical limitation. In open-domain settings, long-tail knowledge may be unavailable or poorly documented. In domains such as medicine, correctness can be context-dependent, and accepted standards may evolve over time. These constraints motivate methods that estimate trustworthiness without requiring verified factual labels at inference time.

Our goal is circumvent this issue by showing learnability of alternative confidence-style reliability signals in a student-expert framework enabling to ensure statistical trustworthiness. There a smaller generative model constitutes a student. A larger expert model can be used offline during calibration. The expert is not treated as an oracle and does not define absolute truth. Instead, it provides a distributional reference against which the student’s token-level behavior can be calibrated. At deployment time, the resulting trustworthiness indicators are computed from the student model’s own internal states and token-level statistics.

To this end, we propose an AI ontology calibrator. By ontology we denote a task domain, an operational representation of its outputs, and evaluation protocol. The calibrator compares student hidden representations and token-level output with expert-reference acceptance scores. The scores estimate if a generated token agrees with the expert reference under chosen alignment criteria.

We evaluate the framework on three ontologies of increasing complexity. In BF program generation, correctness can be verified by executing a generated program and comparing its output to the requested behavior. In mathematical reasoning, correctness is evaluated using reference-based and ProcessBench-style labeling protocols, reflecting the fact that multiple solution paths may be valid. In medical multiple-choice question answering, we evaluate several student LLMs using response-level labels obtained through an automated annotation pipeline, and interpret detector outputs as reliability or routing signals rather than clinical validation. Our theoretical analysis gives a finite-sample justification for the calibration step. Empirical results show that calibrator-derived indicators provide information complementary to standard confidence features.

Our specific contributions are as follows:

  1. We frame trustworthiness estimation through the lens of confidence, distinguishing it from uncertainty and consistency. Complementary to approaches looking for factual errors, we treat unreliable generations as outputs whose token-level internal signals are atypical relative to an expert-reference calibration criterion.

  1. We propose an AI ontology calibrator – a tool for estimating token-level trustworthiness of a student generative model using an expert model as an offline distributional reference.

  1. As part of the AI ontology calibrator, we introduce expert-reference acceptance scores: confidence-style token-level statistics grounded in the typicality of generated tokens relative to the expert reference. These scores are supported by bounds on threshold-defined acceptance and rejection probabilities.

  1. We construct a small set of 15 response-level indicators by aggregating calibrator scores with traditional token-level confidence, entropy, and perplexity statistics. These indicators can be used to train supervised classifiers for discriminating correct and incorrect responses under ontology-specific labeling protocols.

  1. We evaluate the proposed indicators across BF program generation, mathematical problem solving, and medical question answering. The combined calibrator and traditional indicators provide complementary reliability signal, with the clearest gains in Medicine and BF and more mixed behavior in Math.

  1. We analyze transfer across models within the same ontology and across different ontologies. The results show selected improvements from calibrator-derived features, but transfer remains heterogeneous rather than universal.

Related Work

An overview of classical approaches such as consistency-based, retrieval-based, and model-based are discussed in Appendix A. Since our method studies trustworthiness through the lens of confidence, we concentrate here on confidence-based and internal-signal methods.

Low-confidence validation methods monitor minimum token probabilities, token entropy, or related scalar statistics to flag candidates for external verification [41]. Length-Normalized Token Probability (LNTP) [6] is a representative example: it aggregates token probabilities into a length-normalized sequence-level score, providing a strong and efficient baseline that avoids multiple generations. However, such approaches usually rely on raw intrinsic confidence signals and remain vulnerable to miscalibration, especially after instruction tuning, where aleatoric ambiguity and epistemic ignorance can become conflated [38].

To better isolate epistemic uncertainty, ensemble-based estimation has been proposed. Input clarification ensembling generates KK semantic rephrasings, while Monte Carlo Dropout approximates Bayesian posterior variance via TT stochastic forward passes [19, 15, 45]. These methods can provide richer uncertainty estimates, but they incur linear overhead in the number of samples or stochastic passes and typically operate at the sequence or concept level rather than as token-level reliability scores available from a single generation. Beyond scalar probability and entropy measures, hidden-state and logit-based methods aim to use richer internal model information. INSIDE Chen et al., [8] and related probing approaches leverage hidden states across transformer layers via eigenvalue analysis or learned classifiers, while energy-based methods such as Semantic Energy use pre-softmax logits to mitigate entropy saturation Ma et al., [27]. These methods show that internal representations contain reliability-relevant information, but they are often framed as out-of-distribution or uncertainty detectors and do not directly calibrate token-level student behavior against an external expert reference.

Our work occupies a complementary position. Like confidence-based methods, it uses model-internal signals and can produce lightweight indicators from a single student generation. Unlike raw confidence proxies, however, the proposed AI ontology calibrator uses an expert model offline as a distributional reference to calibrate student hidden states and token-level statistics. The resulting expert-reference acceptance scores are not factuality guarantees, but calibrated reliability features that can be aggregated with traditional confidence, entropy, and perplexity-style statistics for supervised response-level correctness prediction.

Overall Approach

In what follows, a generative model whose trustworthiness is being assessed will be referred to as a student. We assume that the student’s generation process can be decomposed into individual steps and at each step the student generates a token. Since we focus on LLMs, tokens include whole words, subword units, or single characters as determined by the underlying LLM tokenizer.

At the core of our approach is the observation that a statistically grounded measure of a student model’s token-level behavior, relative to what an expert would produce in the same context and ontology, correlates with human judgments of the quality and factuality of the student’s overall response [44, 14]. We build on this by treating such a measure as a signal, among others, for detecting whether a response can be trusted.

In order to test and assess our method, we consider three ontologies of increasing complexity, BF, Math, and Medicine, and their corresponding trustworthiness/correctness definitions:

  • BF program generation (BF): a student-LLM generated program is considered trustworthy if it compiles, executes, and produces correct intended output.

  • Math problem solving (Math): a generated solution is considered trustworthy if it correlates with reference solution according to an agreed metric. Reference solution constitutes solution provided by an external expert, a human or another AI system. Technical details explaining how we compared student’s and expert’s responses are provided in § 4.3.

  • Medical question answering (Medicine): student LLMs answer multiple-choice questions with all reasoning traces, and expert responses are taken as a reference. In this paper, we treat all inaccuracies as equally important. A promising direction for future research is to introduce semantic-context awareness, where errors are weighted by their clinical significance. A variant of labeling accounting for context criticality is presented in Appendix § 12.§ 3.

Before diving into details of the method, we want to distinguish between three related but fundamentally different concepts for evaluating statistical trustworthiness of a model:

  • Uncertainty is a problem-level property that characterizes the spread of the answer space for a given prompt, regardless of any particular output.

  • Consistency measures behavioral stability across multiple outputs, requiring at least two generations or inputs to compare.

  • Confidence, by contrast, is an instance-level property of a single prediction – it reflects how strongly internal or expressed signals point to correctness for that specific answer.

Our framework is specifically designed to estimate trustworthiness through a single generation pass and with no ground truth information required. This contrasts with consistency measures which require at least two outputs or inputs to be compared. Regarding remaining two measures, we prefer confidence over uncertainty for two complementary reasons. First, uncertainty is a prompt-level property shaped by factors external to the prediction itself such as training data distribution, prompt ambiguity, and the overall spread of the answer space. Confidence, by contrast, is an instance-level signal reflecting the model’s internal conviction about a specific generated element, independently of these distributional factors and without any knowledge of the model’s training data. Second, in many real-world ontologies, ground truth is neither static nor universally accessible: medical treatment protocols are revised as evidence accumulates, scientific consensus shifts, and accepted best practices change over time. By grounding our framework in the model’s own internal confidence signals, we obtain a formulation that remains feasible in absence of external ground truth stability.

Methodology

Our framework comprises two components: (1) measuring statistical confidence of each generated token, relative to that of expert’s through a single generation pass without accessing expert’s own confidence, uncertainty and state, and without ground truth information; and (2) determining whether the generated response as a whole is trustworthy, by aggregating per-token indicators that combine our proposed statistical confidence scores with traditional measures. The resulting workflow is illustrated in Figure 1, whose components are described in detail in the following sections.

Our workflow for building an AI ontology calibrator and evaluating response correctness

Figure 1. Our workflow. Solid lines indicate the necessary steps for building an AI ontology calibrator; dashed lines correspond to the proposed procedure for obtaining indicators and evaluating how well they reflect response correctness; the dotted line highlights the optional use of reference answers for labeling the student’s correctness for classifier training.

Framework component 1: AI ontology calibrator

The AI ontology calibrator’s aim is to assess each student token’s typicality with respect to the conditional distribution induced by the reference answer. The process of its construction is further illustrated with solid lines in Figure 1. Reference answers are responses provided by expert models – SOTA models of much larger size than the student models. For each token position we learn token-conditional generation probability with expert’s response taken as a reference.

More formally, let GG be a generative AI model mapping inputs u∈Uu \in\mathcal{U} to finite output sequences (T1,T2,…,Tm)(T_1,T_2,\ldots,T_m), m∈Nm \in\mathbb{N}, where mm is the length of generated sequence and TiT_i represents a token. In this paper, we consider the map GG represents an LLM, while our method can be implemented to other generative models. Let us denote the set of possible tokens by T={τ1,…,τq}\mathcal{T} = \{\tau_1,\ldots,\tau_q\}. Since output sequences are generated sequentially, generation decomposes into individual steps. For each step of the generation, GG generates many objects, including the vector of probabilities for all possible tokens and the vector of features ϕ=Φ(⋅)\phi= \Phi(\cdot). Here we use outputs of the last fully connected layer before the heads as features, albeit other model variables could be used too.

The response generation process of an AI model proceeds as follows. Let us denote input uu corresponding to generation of the first token as u1=uu_1 = u. Output of the first step of generation is a qq dimensional vector of probabilities s1s_1, and the vector of features is Φ(u)∈Rd\Phi(u) \in\mathbb{R}^d, where dd is the dimension of the last fully connected layer before the heads. Based on the values of s1s_1, the system selected one token T1T_1. At the next step, the model’s input becomes u2=u∪{T1}u_2 = u \cup\{T_1\}, and the process repeats. As a result, generation of a single token in the output sequence can be modelled as a map from the set of inputs U\mathcal{U} (inputs are different for different steps) to a finite set of outputs T\mathcal{T}:

G:U→T.(1)G:\mathcal{U}\to\mathcal{T}. \tag*{(1)}

To distinguish different steps of generation, input at the kk-th step is denoted as uk=u∪⋃j=1k−1{Tj}u_k = u \cup\bigcup_{j=1}^{k-1}\{T_j\}.

In what follows student model will be denoted as GSG^{S}, and expert (a model judge or a human) will be referred to as GEG^{E}. In response to the same initial input these models produce two sequences of tokens: (T1E,…,TmEE)(T^{E}_{1},\ldots,T^{E}_{m_{E}}) (expert) and (T1S,…,TmSS)(T^{S}_{1},\ldots,T^{S}_{m_{S}}) (student). For the student, we assume access to its vector of features Φ(uj)\Phi(u_{j}). For the expert model, this is not required.

Our goal is to estimate the probability of correctness of token TiST^{S}_{i}. Token TiST^{S}_{i} is deemed correct if TiS=TiET^{S}_{i}=T^{E}_{i}, and it is considered incorrect otherwise. If mE<mSm_{E}<m_{S}, then all tokens TiST^{S}_{i} with i>mEi>m_{E} are deemed wrong. This enables posing the task of identifying “correct” generations as a classical classification problem at the level of each individual token τi\tau_{i}: we need to find a map accepting or rejecting tokens produced by GSG^{S} with some inferrable confidence. This map could formally be defined as:

Ai:T×Rd→T∪{τ×},\mathcal{A}^{i}:\mathcal{T}\times\mathbb{R}^{d}\to\mathcal{T}\cup\{\tau^{\times}\},

where τ×\tau^{\times} is the label corresponding to rejected tokens.

As a measure of model GSG^{S} confidence relative to expert’s response we consider conditional probabilities (or suitable proxies of):

P(Ai(GS(uk),Φ(uk))=τj∣GS(uk)=τj,GE(uk)=τj),P(\mathcal{A}^{i}(G^{S}(u_{k}),\Phi(u_{k}))=\tau_{j}\mid G^{S}(u_{k})=\tau_{j},G^{E}(u_{k})=\tau_{j}),

where Ai\mathcal{A}^{i} is map discussed above, and kk is the token’s position. Low values of these probabilities indicate disagreement between GSG^{S}’s outputs and the target distribution, and therefore insufficient trust. We also can estimate the probability of the opposite event that token τj\tau_{j} produced by GSG^{S} is in position kk does not match that of GEG^{E}:

P(Ai(GS(uk),Φ(uk))=τ×∣GS(uk)=τj,GE(uk)≠τj).P(\mathcal{A}^{i}(G^{S}(u_{k}),\Phi(u_{k}))=\tau^{\times}\mid G^{S}(u_{k})=\tau_{j},G^{E}(u_{k})\ne\tau_{j}).

If the distribution underpinning the above data generation process would have been known then these probabilities could be computed. However, in most practically-relevant instances, this is not the case, and hence we need to learn or estimate the corresponding probabilities from empirical data.

In this work, we introduce a tool to estimate these probabilities which we are referring to in the text as an AI ontology calibrator. To form/build the calibrator, we assume access to a dataset, which we will refer to as the forming dataset:

S={(ui,τi):ui∈U, τi∈T, i=1,…,M}.(2)S=\{(u_{i},\tau_{i}):u_{i}\in\mathcal{U},\ \tau_{i}\in\mathcal{T},\ i=1,\ldots,M\}. \tag*{(2)}

The forming dataset SS is further partitioned into Sj={(u,τ)∈S:τ=τj}S_{j}=\{(u,\tau)\in S:\tau=\tau_{j}\}, where each such set is non-empty. For each j=1,…,qj=1,\ldots,q, partition SjS_{j} into:

S+,j={(u,τ)∈Sj∣τ=τj},S−,j={(u,τ)∈Sj∣τ≠τj},S_{+,j}=\{(u,\tau)\in S_{j}\mid\tau=\tau_{j}\},\quad S_{-,j}=\{(u,\tau)\in S_{j}\mid\tau\ne\tau_{j}\},

that are assumed not empty, with cardinalities M+,jM_{+,j} and M−,jM_{-,j}. Let H={h1,…,hq}\mathcal{H}=\{h_{1},\ldots,h_{q}\} be a class of measurable projection functions h:Rd→Rh:\mathbb{R}^{d}\to\mathbb{R}. Each function hjh_{j} defines empirical cumulative distribution functions:

F+,j(s)=1M+,j∑(u,τ)∈S+,j1hj(Φ(u))≤s,F−,j(s)=1M−,j∑(u,τ)∈S−,j1hj(Φ(u))≤s,(3)F_{+,j}(s)=\frac{1}{M_{+,j}}\sum_{(u,\tau)\in S_{+,j}}\mathbf{1}_{h_{j}(\Phi(u))\le s},\quad F_{-,j}(s)=\frac{1}{M_{-,j}}\sum_{(u,\tau)\in S_{-,j}}\mathbf{1}_{h_{j}(\Phi(u))\le s}, \tag*{(3)}

and 1D1_{D} is the indicator function of the set DD. Detailed theoretical background and justification of the calibrator’s capability to learn desired probability estimates from empirical data are presented in Appendix § 11.

In general, we have several attributes for each token: the output token itself GS(uj)=TjG^{S}(u_{j})=T_{j}, the vector of output probabilities (softmaxes in standard models) (s1j,…,sqj)(s^{j}_{1},\ldots,s^{j}_{q}), and the vector of features Φ(uj)=(ϕ1j,…,ϕnj)\Phi(u_{j})=(\phi^{j}_{1},\ldots,\phi^{j}_{n}), jj is the position in the generated sequence. The vectors ϕj\phi^{j} are used as feature vectors Φ(u)\Phi(u) for the calibrator. These vectors could be used ‘as is’ without any pre-processing. For each token ii with rich enough forming set (in this study we consider only tokens that occur at least 1,000 times in the dataset) we computed three arrays: (1) projection functions hj∈Hh_{j}\in\mathcal{H}, which for simplicity have been chosen as functionals projecting data onto normalized direction of the corresponding Fisher discriminants; (2) thresholds of acceptance thijth^{j}_{i} (score representation of thij=F−,j−1(Δji)th^{j}_{i}=F^{-1}_{-,j}(\Delta^{i}_{j})), where Δji∈(0,1)\Delta^{i}_{j}\in(0,1); (3) the vector of the adjusted lower bounds on the probabilities of acceptance pijp^{j}_{i} for the corresponding threshold thijth^{j}_{i}. Calculation (estimation) of the probability of correct acceptance of the token τj\tau_j with feature vector ϕ\phi can be computed as follows. Calculate dot product of feature vector with corresponding projection function r=(hτ,ϕ)r = (h_\tau, \phi). Define the maximal kk, such that thτk<rth_\tau^k < r. Take pτ=pτkp_\tau= p_\tau^k as answer. For each generated token TjT_j, compute the following quantities:

  1. the probability of correct acceptance pjp_j (or its lower bound), hereafter referred to as calibrator probabilities;

  1. the maximum softmax probability of the generated token sj=s1js^j = s^j_1 (where s1j,…,sqjs^j_1, \ldots, s^j_q are sorted in the descending order), i.e., the probability assigned to the model’s top-predicted token at position jj, hereafter referred to as softmaxes;

  1. the Shannon entropy of the predictive distribution ej=−∑i=1qsijln⁡(sij)e^j = -\sum_{i=1}^{q}s_i^j\ln(s_i^j), hereafter referred to as entropies;

  1. the log-probability of the next generated token under the model’s predictive distribution at position jj, lj=ln⁡P(Tj+1∣T1,…,Tj)=ln⁡srank⁡(Tj+1)jl^j = \ln P(T_{j+1}\mid T_1,\ldots,T_j) = \ln s^j_{\operatorname{rank}(T_{j+1})}, where rank⁡(Tj+1)\operatorname{rank}(T_{j+1}) indicates the position of the actual token Tj+1T_{j+1} in the sorted softmaxes list; hereafter referred to as token log-probabilities.

Quantities (1)-(3) are collectively used to construct a set of indicators for training trustworthiness classifiers, while quantities (4) are utilized for baseline indicators (baselines) calculation. Details on indicator construction and classifier training are provided in the following section.

Framework component 2: determining response correctness

For each generated response of an LLM, we obtain four per-token quantities described in § 4.1. To determine trustworthiness of responses, we aggregate quantities into indicators, and train a classifier mapping indicators of each generated sequence to a probability that the response/generation is correct (trustworthy). We thus now deal with a binary classification task where labels are available. During training, responses whose probability of being correct ≥0.5\ge0.5 are considered correct (see § 4.3 for details).

Our set of indicators for each generated sequence includes the following:

  • Mean (⋅ˉ\bar{\cdot}), standard deviation (std(⋅)std(\cdot)), and geometric mean (Gˉ⋅\bar{G}_{\cdot}) aggregations of calibrator probabilities (pp), softmaxes (ss), and entropies (ee).

  • Entropy-like (E⋅E_{\cdot}) and perplexity-like (PP⋅PP_{\cdot}) values of calibrator probabilities and softmaxes.

  • Pearson (PCCPCC) and Spearman (SCCSCC) correlation coefficients between calibrator probabilities and entropies.

The complete set of indicators comprises 15 quantities:

{pˉ,sˉ,eˉ,std(p),std(s),std(e),PCC,SCC,Ep,Es,PPp,PPs,Gˉp,Gˉs,Gˉe}.(4)\{\bar{p},\bar{s},\bar{e},std(p),std(s),std(e),PCC,SCC,E_p,E_s,PP_p,PP_s,\bar{G}_p,\bar{G}_s,\bar{G}_e\}. \tag*{(4)}

Among these indicators, we have two traditional confidence measures, namely, Mean Token Entropy (eˉ\bar{e}) and LNTP [6][6](Gˉs\bar{G}_s), along with the newly proposed ones. Moreover, two of our indicators coincide with standard baselines under greedy decoding: Mean Token Probability (TP‾\overline{TP}) ≈sˉ\approx\bar{s} and Geomean Token Probability (GTP‾\overline{G_{TP}}) ≈Gˉs\approx\bar{G}_s. Note also that LM Perplexity (LM PPLM\ PP) =1/GTP= 1/G_{TP}. We also consider MSP, Max Token Probability Max (TETE), and Min Token Probability (min (TPTP)) as baselines. A diagram illustrating computation of all provided indicators and baselines based on quantities from § 4.1 is shown in Figure 2.

Sources of derivation of quantities, indicators, and baselines

Figure 2. Sources of derivation of quantities, indicators, and baselines. Entropies provide both indicators and baselines, token log-probabilities – only baselines, calibrator probabilities and softmaxes – only indicators. Green arrows highlight indicators produced by our proposed calibrator probabilities, blue arrows – traditional indicators. {PCC,SCC}\{PCC, SCC\} – indicators of mixed category: to calculate them, both calibrator probabilities and traditional indicators are needed.

Specifics of our framework and the considered ontologies

For math, we use the first 5, 000 problems to build the calibrator and train classifiers in the following settings: (V1) concatenate the first 5, 000 problems with the second 5, 000 problems and train classifiers via 20-fold cross-validation; and (V2) train classifiers on the first 5, 000 problems and test them on the second 5, 000 problems. As Figure 1 shows, using reference answers when labeling students’ responses is not always necessary. For math, we compare two labeling strategies: (1) LLM-Judge labeling with Qwen2.5-32B, which uses expert answers, and (2) ProcessBench labeling with DeepSeek-V3.2, which does not require expert answers. For the (V1) and (V2) settings described above, we use only those problems from the first 5,000 and the second 5,000 that have both LLM-Judge and ProcessBench labels. For BF and medicine, we build calibrators on the full datasets and train classifiers via 20-fold cross-validation. For BF labeling, we select 10,000 programs and label them by compiling each program and comparing its output with the desired output: programs whose outputs match are assigned label 1 (correct), while those that do not are assigned label 0 (incorrect). For medical question answers, we apply the ProcessBench technique with GLM-4.7.

Experiments

Table 1 details experimental setups for all ontologies and the statistics of built calibrators. Full implementation is available in [2].

Ontology 1: BF. We consider the problem of developing a program in the BF language that produces a specified output. BF is a Turing-complete language consisting of only eight possible symbols. We chose BF due to its simplicity and the straightforward process of verifying the correctness of a generated program. The dataset comprises 433,688 program-output pairs. Programs are constrained to a maximum of 18 commands, while outputs are limited to 256 character codes. A detailed description of BF is presented in Appendix § 12.1.1. Details regarding the model architecture and training procedure are provided in Appendix § 12.1.2. Ontology 2: Math. In this setup, we consider mathematical tasks from [29]. Since the tasks are open-ended mathematical problems requiring full reasoning traces rather than just final answers, evaluation of their correctness cannot be reduced to simple answer matching. Manual annotation of such responses would be both time-consuming and costly – particularly given that most tasks admit multiple valid solution paths. To address this, we employ an LLM to generate reference solutions (as described in § 4.1), offering a practical balance between annotation quality and scalability. Our aim is not to establish absolute ground truth, but to validate a general method for assessing student-model quality in a regime where expert’s answers can be treated as references. Specifically, as an expert, we use DeepSeek R1 [10] (671B parameters), one of the strongest publicly available LLMs [17], generating a single reference solution per task, while as a student we use Qwen3-8B [33], which is a relatively small LLM. To evaluate the correctness of the student’s solutions, we employ two techniques. Details about labeling strategies and their comparison are provided in Appendix § 12.§ 2.

Ontology 3: Medicine. We use Medical-Reasoning-SFT-GPT-OSS-120B dataset [32]. From the original collection, we sample and curate 12, 369 questions, focusing on multiple-choice items that require reasoning about human biology and medicine. To improve topical consistency, we apply a series of filters and exclude: (i) animal-related questions, (ii) questions about medical legal procedures, (iii) ecology- and taxonomy-focused questions, (iv) non-English questions, (v) plant and marine biology questions, (vi) questions centered on organizations (e.g., WHO, UNICEF), and (vii) microbiology questions (e.g., bacteria-related items). We found that a subset of slightly more than 12, 000 questions provides sufficient coverage for our experiments while keeping evaluation and analysis tractable. Most questions focus on medical conditions and diagnosis, as well as the biological processes underlying diseases and broader aspects of human biology. As the dataset has already provided the results of GPT-OSS-120B generations, we consider them as the expert’s answers. As student LLMs, we consider four models:

  • MedGemma-1.5-4B [36] is a multimodal instruction-tuned variant of Gemma 3, specifically trained on medical text and images;

  • Qwens [33, 34]: two representatives of the Qwen3 family – Qwen3-8B and Qwen3-0.6B – and one from the more recent Qwen3.5 small series, Qwen3.5-0.8B.

To annotate correct answers we use ProcessBench labeling [48] with GLM-4.7.

Results: prediction of generations correctness. As described in § 4.2, for each student from each ontology, we obtain a set of 15 indicators and six baselines: MSP, LM PPLM\ PP, max⁡(TE)\max(TE), TP‾\overline{TP}, min⁡(TP)\min(TP), and G‾TP\overline{G}_{TP}. Feature correlations across all considered ontologies are provided in Appendix § 13.§ 1, and classifier technical details in Appendix § 14. Notably, several papers [22, 26] report a correlation between generation correctness and the model’s self-assessment labels; our results on medical ontology show no such correlation (see Appendix § 13.§ 2).

Table 2 presents the classifiers’ results. Logistic Regression was trained only on the provided cases, while MLPs were trained on all possible combinations of the 15 indicators, with only the best results reported here. The table shows that our proposed indicator set consistently outperforms traditional confidence measures. Even using features derived from calibrator probabilities alone provides reasonable quality across all ontologies. This also supports the validity of using the same data for classifier training and calibrator construction, since cross-validation relies on stratified 20-fold splitting and a weighted loss function. MLPs’ results show that the best results were obtained on the indicators subsets including at least one derived from calibrators. The poor performance on Math, V2 reflects a train/test distribution mismatch rather than weaker classifier quality – particularly for ProcessBench labeling, where the class ratio is inverted between train and test.

IndicatorsMedGemmaQwen3-8BQwen3-0.6BQwen3.5-0.8BCustom TransformerLLM-JudgeProcessBenchLLM-JudgeProcessBench
Individual (ours)pˉ\bar{p} 0.5681±0.02990.5131±0.04330.5674±0.04030.4922±0.05620.7179±0.14100.5049±0.07300.4798±0.02210.5026/0.52200.5162/0.4777
std⁡(p)\operatorname{std}(p) 0.5779±0.03290.5281±0.04160.5564±0.03960.5263±0.07180.5709±0.13580.5397±0.08320.5676±0.06740.5101/0.50550.5217/0.4691
EpE_p 0.6701±0.03770.4857±0.03920.7890±0.05180.5311±0.04860.5509±0.21320.6511±0.07250.5134±0.05700.6004/0.76100.5379/0.5463
PpP_p 0.6693±0.03610.5708±0.03560.6375±0.04470.5154±0.04830.5028±0.21950.6528±0.08310.4985±0.05400.6080/0.73490.5390/0.5244
GpG_p 0.5019±0.00250.5098±0.01800.6180±0.03500.5107±0.00770.6365±0.11840.5531±0.10480.5910±0.11690.4927/0.50340.4953/0.4967
Mixed (ours and traditional)PCCP_{CC} 0.5231±0.03090.5017±0.04660.5869±0.03690.5189±0.04380.5314±0.11940.4338±0.05790.5703±0.07840.5453/0.51630.5120/0.5096
SCCSCC 0.5161±0.02390.5359±0.02610.5406±0.05420.4818±0.06110.5235±0.09340.5238±0.05240.5118±0.05000.5036/0.52670.4992/0.5108
12 indicators 0.7081±0.03660.7245±0.04140.8432±0.03130.6626±0.05140.7813±0.14830.6529±0.08920.7099±0.22640.6115/0.53230.5739/0.4985
15 indicators 0.7197±0.03200.7276±0.04850.8426±0.03050.6634±0.05570.7815±0.14030.6523±0.09010.7095±0.22750.6121/0.52330.5709/0.4954
Traditional (included into our indicators’ set)eˉ\bar{e} 0.5892±0.02840.5680±0.05090.8087±0.03610.5026±0.00370.6921±0.20670.6099±0.16390.6723±0.20590.5482/0.49970.5485/0.4991
std⁡(e)\operatorname{std}(e) 0.5507±0.02960.5940±0.04560.8203±0.02980.5367±0.05100.6807±0.11610.6179±0.19180.6935±0.21980.5304/0.49800.5259/0.4967
GeG_e 0.6009±0.03430.5494±0.05040.7394±0.04410.5305±0.04430.7049±0.19760.5968±0.11900.6324±0.16750.5456/0.49970.5365/0.4997
sˉ\bar{s} 0.5761±0.03110.4839±0.06590.7525±0.04260.5026±0.00370.6842±0.20500.6016±0.15940.6611±0.19540.5448/0.51270.5520/0.4991
std⁡(s)\operatorname{std}(s) 0.5815±0.03120.4292±0.05670.8108±0.03270.549±0.05430.6957±0.14460.6280±0.18230.6837±0.21470.5447/0.50440.5405/0.4981
EsE_s 0.6815±0.03490.6835±0.03520.7873±0.05080.5026±0.00370.6861±0.16340.6359±0.09380.5409±0.04080.6023/0.75010.5367/0.5580
PpP_p 0.6825±0.03330.5669±0.03550.6337±0.04910.5026±0.00370.6861±0.16340.6506±0.10030.6289±0.04220.6054/0.76500.5349/0.5352
BaselinesGpG_p 0.5757±0.02930.5510±0.05160.7884±0.03500.5026±0.00370.6867±0.20470.6129±0.16400.6651±0.19890.5491/0.50870.5534/0.4990
MSPMSP 0.6531±0.03030.5685±0.03800.6635±0.05310.5976±0.06730.6853±0.14940.6317±0.08610.6135±0.15750.6011/0.52890.5454/0.4978
LM PPLM\ PP 0.5362±0.02740.6036±0.04120.8224±0.03270.5300±0.04690.5026±0.00370.6012±0.18230.6148±0.18660.5188/0.50000.5367/0.5000
max⁡(TP)\max(TP) 0.5409±0.02170.4892±0.05480.7404±0.03210.5270±0.02920.6679±0.16370.6286±0.22030.7147±0.24660.5380/0.50000.5004/0.5000
TPTP 0.5552±0.02930.5740±0.04980.8124±0.03110.5026±0.00370.7126±0.20220.6148±0.18660.6884±0.21650.5357/0.49980.5437/0.5002
min⁡(TP)\min(TP) 0.4971±0.02230.6225±0.03110.5074±0.03910.4945±0.05670.4996±0.00940.5302±0.06440.5478±0.05480.5060/0.49980.5059/0.5002
GTPG_{TP} 0.5370±0.02650.5862±0.03380.8019±0.03620.5026±0.00370.4930±0.03330.6277±0.22060.7148±0.24380.5087/0.50000.5370/0.5000
Const = 1 0.5000±0.00000.5000±0.00000.5000±0.00000.5000±0.00000.5000±0.00000.5000±0.00000.5000±0.50000.5000/0.50000.5000/0.5000
Const = 0 0.5000±0.00000.5000±0.00000.5000±0.00000.5000±0.00000.5000±0.00000.5000±0.00000.5000±0.50000.5000/0.50000.5000/0.5000
Rand. 0.5 0.5018±0.03040.5000±0.04000.5000±0.03400.5110±0.03600.5200±0.00000.5380±0.00000.5000±0.50000.5020/0.50350.5000/0.5188
Rand. major 0.4935±0.03200.5099±0.03290.5108±0.02210.5040±0.04850.4877±0.00070.4965±0.00840.5150±0.00460.4898/0.50990.5016/0.4859
Best results MLP0.7141±0.02860.7284±0.04170.8604±0.03540.7035±0.03570.8299±0.11300.6389±0.21160.7153±0.23540.6148/0.78230.5309/0.5703

Table 2. Mean ± standard deviation of balanced accuracy of Logistic Regression and MLP across 20 folds for all ontologies. For MLP, we provide only the best results with the subset of indicators used for training. For Math, V2, we provide train/test balanced accuracy. “15 indicators” denotes using all proposed indicators, whereas “12 indicators” refers to the first 12 indicators defined in Equation (4). For each ontology, top-1 scores are in bold, top-2 in bold underlined, and top-3 in bold italic. We also provide results for four naive baselines: constant predictions of ones (Const = 1) and zeros (Const = 0), and random predictions where the probability of predicting 1 is either fixed at 0.5 (Rand. 0.5) or set to the majority class proportion (Rand. major).

Experiments demonstrating transferability of our trustworthiness detectors across different domains and models are provided in Appendix § 16.

Conclusion

In this work we considered the problem of assessing the trustworthiness of outputs of generative AI models. The major challenge of this task is that the ground truth data or gold-standard methods for checking the correctness of responses are not always available. Sometimes, it may not even be possible to expect that such information could be provided. To mitigate this issue, we ”calibrate” outputs of generative models with that of experts models, representing intended model outputs to given inputs. We also introduced a metric of trust characterising probabilities of the model’s correct generations conditional on the generations of expert models or agents. These estimated probabilities (calibrator probabilities) are statically grounded and together with a set of traditional features, after aggregations form a set of 15 indicators that may constitute a new basis for AI reliability evaluation. Our results demonstrate that classifiers trained on these 15 indicators can discriminate correct and incorrect answers. Our experiments illustrate this across three ontologies: the BF programming language, math problems, and medical question answering. In all settings, subsets including probability-based indicators yielded better discrimination than subsets comprising traditional indicators. Moreover, adding probability-based indicators to the traditional ones either improves transferability or leaves it nearly unchanged, both across models within the same ontological class and across ontologies entirely. Where the subsets of only traditional indicators transfer better, the margin is small.

Limitations

While the proposed framework is theoretically applicable to diverse generative AI modalities – for instance, by treating image patches as discrete tokens – the empirical validation in this study was limited to generative language models. The observed transferability of the trust measure within and across ontologies suggests that universal patterns underlying hallucinations may exist across language model outputs. However, since the indicators are predicated on probability distributions derived from an ontology-specific calibrator, adapting the classifier to a novel ontology (including alternative language model architectures) necessitates construction of a new calibrator for the target ontology. Calibrator-based probabilities improve performance only in combination with the traditional indicators (see Appendix § 16), and the most effective combination may differ across ontologies.

AI USE STATEMENT

In this work, we used generative AI tools for text checking on grammatical issues. We have not used generative AI tools for research ideas generation, experiment setup and run, making conclusions.

REPRODUCIBILITY STATEMENT

The code for all experiments is provided in our repository [2]. § 4 provides a detailed methodological descriptions of our framework, Appendix § 14 – technical details for experiments reproducing.

Related work

In this Section, we review existing work on hallucination detection and mitigation in LLMs, with a particular focus on approaches that motivate or relate to our proposed framework.

Consistency-based detection

Consistency-based methods detect hallucinations by identifying contradictions or instability within a model’s outputs or across multiple generations. These approaches rely on internal agreement rather than external knowledge, making them applicable in black-box settings.

Self-contradiction detection generates paired sentences or internal claims and employs automated checking (via prompting or classification) to identify logical inconsistencies. Constrained prompting techniques elicit comparable sentence pairs that can be systematically evaluated for contradictions [30]. Self-contradiction methods, however, only detect internal contradictions; many factual hallucinations produce no internal contradiction. Moreover, these methods require generating multiple outputs or auxiliary prompts, which increases computational cost and introduces sensitivity to the prompting strategy used to elicit contradictions.

Self-consistency and Best-of-N sampling approaches sample multiple outputs (n-best) and measure agreement through majority voting or semantic similarity. Outputs with low agreement across samples are flagged as potentially hallucinated [46, 47]. These methods are computationally expensive, requiring multiple forward passes; they may miss consistently repeated hallucinations that appear across all samples.

External verification and retrieval-based methods

External verification methods ground model outputs in retrieved sources or knowledge bases, enabling detection of unsupported claims through comparison with authoritative information.

Retrieval-Augmented Generation (RAG) and grounding conditions generation on retrieved documents or knowledge snippets, allowing outputs to be traced to sources. Detection involves comparing generated claims to retrieved evidence or enforcing grounding constraints during decoding [25]. However, retrieval noise, stale sources, or biased corpora can propagate errors. Incorrect alignment between retrieved passages and claims can produce grounded-but-incorrect outputs.

Fact-checking with reward models and rejection sampling. Fine-grained reward or classifier models are trained on human annotations marking hallucinations. These models score generations, enabling rejection sampling or fine-tuning to prefer non-hallucinatory outputs [16]. The approach requires substantial annotated data, which is costly to obtain. It inherits annotator biases and coverage limitations. Furthermore, generalization to out-of-distribution ontologies can be limited.

Knowledge base verification and benchmarks verify model statements by querying structured knowledge bases or curated benchmarks to identify unsupported facts [24]. Their drawbacks include limited recall when knowledge bases lack coverage for the ontology. Also, mapping free-text claims to structured knowledge base queries is non-trivial.

Model-based and prompt-based detection

This category encompasses training separate classifiers to detect hallucinations and using prompt engineering to elicit self-verification from the model itself.

Separate detector models and classifiers. A classifier or detector model is fine-tuned on annotated examples to predict whether generated content is hallucinated. Detectors can operate at token, span, or full-answer levels [1, 16]. The methods are heavily dataset-dependent and require costly annotation efforts.

Prompted self-verification and Chain-of-Thought (CoT) checks. The model is prompted to list supporting evidence, explain its reasoning chain, or directly judge whether a generated claim is supported (self-critic approach) [30, 25]. Models, however, can produce plausible but fabricated supporting evidence. Self-verification may fail when models lack knowledge to judge their own outputs.

Counterfactual perturbations and intervention methods

These methods intentionally alter claims or model components to measure sensitivity, using behavioral responses to distinguish hallucinations from robust knowledge.

Counterfactual probing and perturbation sensitivity generate counterfactual variants of a claim (introducing subtle factual changes), and the model’s confidence or output consistency is measured. Hallucinated content is expected to show inconsistent sensitivity compared to grounded knowledge [13]. The challenge, however, is that generating high-quality counterfactuals is non-trivial and may require ontology knowledge. False conclusions can arise if counterfactuals are unnatural or easily distinguished. Computational cost increases with the volume of counterfactuals tested.

Component interventions during generation target specific model components (attention heads, MLP layers, residual streams) to identify causal factors in hallucination generation. Steering pre-hallucination signals can prevent hallucinations, informing detection strategies [37]. Intervention success varies by component and may harm language modeling quality. It also requires extra computational resources. Importantly, findings may not generalize across model architectures.

Summary

Despite the breadth and depth of the repertoire of methods, approaches and tools assisting the identification of trusted AI generations, several issues remain open. Common limitations across detection approaches include:

Dataset and ontology sensitivity: Detectors and reward models rely on annotated distributions and can fail under ontology shift [1, 37].

Overconfidence problem: Model confidence is an imperfect proxy for factuality, producing both false negatives (overconfident hallucinations) and false positives (uncertain correct outputs) [41].

Computational cost: Many effective methods (ensemble sampling, retrieval, counterfactual generation) impose significant computational overhead [46, 13].

Sentence-level detection: Most methods only support sentence- or response-level hallucination detection, which can jeopardize the perceived reliability of the entire answer even when it is largely correct.

Theoretical justification

In what follows we provide a theoretical justification of the possibility to learn ontology-calibrated confidence from expert’s data. We do so by showing that the probability bounds on threshold-defined acceptance or rejection events, specified by Δji\Delta^{i}_{j} in Algorithm 1, can indeed be inferred from empirical calibration. In fact these bounds converge to true probabilities as the size of the calibration sets grow. For simplicity, the results are presented in two steps. In Section B.1 we show how these bounds can be derived within standard i.i.d. setting. This enables a clear and focused explanation of main theoretical machinery supporting our approach. In Section B.2 we demonstrate how the results can be extended to more practical setups in which i.i.d. assumptions could be violated.

Simplified settings

Let elements of the set S\mathcal{S} be independent samples drawn from the same, albeit unknown, distribution. In this case conditional probabilities of confidence judges’ AiA^{i} acceptance or rejection of AI model’s output at thresholds Δji\Delta^{i}_{j} could be estimated from empirical data. Moreover, when subsets S+,j\mathcal{S}_{+,j} and S−,j\mathcal{S}_{-,j} are sufficiently large, these estimates converge to true conditional probabilities. The results are formally stated in Theorem 1.

Theorem 1. *Let measurable maps GSG^{S}, GEG^{E}, feature map Φ\Phi, and confidence judges’ training set S\mathcal{S} be defined as in (1) – (2). Suppose that the elements of S\mathcal{S} are independently sampled from the

Algorithm 1 Confidence Judge

Require: Generative model GG, feature map Φ\Phi, forming dataset SS, projectors hj∈H:Rd→Rh_j \in\mathcal{H} : \mathbb{R}^d \to\mathbb{R}, and parameters Δji∈(0,1)\Delta_j^i \in(0,1), i=1,…,ki=1,\ldots,k, k∈Nk \in\mathbb{N} defining the judge’s confidence grid.

  1. for j=1j=1 to qq do

  2. Compute S−,jS_{-,j}, S+,jS_{+,j} and functions F−,jF_{-,j}, F+,jF_{+,j} (as defined in (3)).

  3. Define the class-wise calibrators

Aji(z)={τ×,if hj(z)≤F−,j†(Δji),τj,otherwise.\mathcal{A}_j^i(z)= \begin{cases} \tau^{\times}, & \text{if } h_j(z) \le F_{-,j}^{\dagger}(\Delta_j^i),\\ \tau_j, & \text{otherwise.} \end{cases}

The map F−,j†F_{-,j}^{\dagger} is defined as

F−,j†(z)=inf⁡{x∈R:F−,j(x)≥z}.F_{-,j}^{\dagger}(z)=\inf\{x\in\mathbb{R}:F_{-,j}(x)\ge z\}.
  1. end for

  2. Define global calibrators

Ai(τj,z)=Aji(z).\mathcal{A}^i(\tau_j,z)=\mathcal{A}_j^i(z).

Ensure: calibrator maps Ai\mathcal{A}^i.

(unknown) data distribution PDP_D, that S+,jS_{+,j} and S−,jS_{-,j} are not empty, and that GSG^S, GEG^E and Φ\Phi are chosen independently of SS. Pick λ∈(0,16/e)\lambda\in(0,\sqrt{16/e}).

For each class index jj, select hjh_j from H\mathcal{H} independently of SS, and let Ai\mathcal{A}^i be the outputs of Algorithm 1 with inputs GSG^S, Φ\Phi, SS, {hj∈H∣j=1,…,q}\{h_j\in\mathcal{H}\mid j=1,\ldots,q\} and Δji∈(0,1)\Delta_j^i\in(0,1).

Then, for a new independent sample (u,ℓ)∼PD(u,\ell)\sim P_D and each j=1,…,qj=1,\ldots,q, conditional on the realized M+,j,M−,jM_{+,j},M_{-,j} the following hold:

With probability at least

max⁡{1−λr(M+,j,λ),0}\max\{1-\lambda r(M_{+,j},\lambda),0\}

over the draw of S+,jS_{+,j}

1−F+,j(F−,j†(Δji))+r(M+,j,λ)≥P(Ai(GS(u),Φ(u))=τj∣GS(u)=τj,GE(u)=τj)≥1−F+,j(F−,j†(Δji))−r(M+,j,λ).1-F_{+,j}\left(F_{-,j}^{\dagger}(\Delta_j^i)\right)+r(M_{+,j},\lambda) \ge P\left(\mathcal{A}^i(G^S(u),\Phi(u))=\tau_j\mid G^S(u)=\tau_j,G^E(u)=\tau_j\right) \ge1-F_{+,j}\left(F_{-,j}^{\dagger}(\Delta_j^i)\right)-r(M_{+,j},\lambda).

Similarly, with probability at least

max⁡{1−λr(M−,j,λ),0}\max\{1-\lambda r(M_{-,j},\lambda),0\}

over the draw of S−,jS_{-,j}

F−,j(F−,j†(Δji))+r(M−,j,λ)≥P(Ai(GS(u),Φ(u))=τ×∣GS(u)=τj,GE(u)≠τj)≥Δji−r(M−,j,λ),F_{-,j}\left(F_{-,j}^{\dagger}(\Delta_j^i)\right)+r(M_{-,j},\lambda) \ge P\left(\mathcal{A}^i(G^S(u),\Phi(u))=\tau^{\times}\mid G^S(u)=\tau_j,G^E(u)\ne\tau_j\right) \ge\Delta_j^i-r(M_{-,j},\lambda),

where

r(x,λ)=(14x[log⁡(16xλ−2)−12log⁡log⁡(16xλ−2)])1/2.r(x,\lambda)=\left(\frac{1}{4x}\left[\log(16x\lambda^{-2})-\frac{1}{2}\log\log(16x\lambda^{-2})\right]\right)^{1/2}.

Proof of Theorem 1. Given that GSG^S, GEG^E are measurable and elements in SS are independently sampled from the distribution PDP_D, we can conclude that SjS_j and S+,jS_{+,j}, S−,jS_{-,j} are independent samples from their corresponding conditional distributions PD((u,τ)∣GS(u)=τj)P_D((u,\tau)\mid G^S(u)=\tau_j), PD((u,τ)∣GE(u)=τj,GS(u)=τj)P_D((u,\tau)\mid G^E(u)=\tau_j,G^S(u)=\tau_j), and PD((u,τ)∣GE(u)≠τj,GS(u)=τj)P_D((u,\tau)\mid G^E(u)\ne\tau_j,G^S(u)=\tau_j). Moreover, since hj∈Hh_j\in\mathcal{H} is chosen independently of SS and that hjh_j and Φ\Phi are measurable, we may conclude that elements of the multi-sets

X+,j={hj(Φ(u)), for each (u,τ)∈S+,j},\mathcal{X}_{+,j}=\{h_j(\Phi(u)),\ \text{for each }(u,\tau)\in S_{+,j}\},
X−,j={hj(Φ(u)), for each (u,τ)∈S−,j},\mathcal{X}_{-,j}=\{h_j(\Phi(u)),\ \text{for each }(u,\tau)\in S_{-,j}\},

are independent samples from the respective conditional probability distributions induced on R\mathbb{R} by hjh_j.

To proceed with the proof we will need the following lemma.

Lemma 1. Let θ∈R\theta\in\mathbb{R}, λ∈(0,∞)\lambda\in(0,\infty), and X⊂R\mathcal{X} \subset\mathbb{R} be a finite multi-set whose elements are sampled independently from some unknown probability distribution. Let ∣X∣=n|\mathcal{X}| = n, and FnF_n be defined as follows:

Fn(s)=1n∑x∈X1x≤s.F_n(s) = \frac{1}{n} \sum_{x \in\mathcal{X}} 1_{x \le s}.

Let zz be a new independent sample from the same distribution and consider the events:

E1:z≤θ,E2:z>θ.E_1 : z \le\theta,\quad E_2 : z > \theta.

Then, conditional on the realized nn, with probability at least

max⁡{1−λ(14nW0(16nλ2))1/2,0}\max\left\{1-\lambda\left(\frac{1}{4n}W_0\left(\frac{16n}{\lambda^2}\right)\right)^{1/2},0\right\}

over the draw of X\mathcal{X}

Fn(θ)+(14nW0(16nλ2))1/2≥P(E1)≥Fn(θ)−(14nW0(16nλ2))1/2(5)F_n(\theta)+\left(\frac{1}{4n}W_0\left(\frac{16n}{\lambda^2}\right)\right)^{1/2} \ge P(E_1) \ge F_n(\theta)-\left(\frac{1}{4n}W_0\left(\frac{16n}{\lambda^2}\right)\right)^{1/2} \tag*{(5)}

and

1−Fn(θ)+(14nW0(16nλ2))1/2≥P(E2)≥1−Fn(θ)−(14nW0(16nλ2))1/2,(6)1-F_n(\theta)+\left(\frac{1}{4n}W_0\left(\frac{16n}{\lambda^2}\right)\right)^{1/2} \ge P(E_2) \ge1-F_n(\theta)-\left(\frac{1}{4n}W_0\left(\frac{16n}{\lambda^2}\right)\right)^{1/2}, \tag*{(6)}

where W0W_0 is the principal branch of the Lambert WW function.

Proof of Lemma 1. Let PcP_c be the cumulative distribution function associated with the unknown probability distribution from which both the multi-set X\mathcal{X} and zz were independently drawn. It is clear that

P(E1)=Pc(θ),P(E2)=1−Pc(θ).P(E_1) = P_c(\theta),\qquad P(E_2) = 1-P_c(\theta).

Introduce the auxiliary event

E(ϵ):sup⁡s∈R∣Fn(s)−Pc(s)∣>ϵ,E(\epsilon): \sup_{s \in\mathbb{R}} |F_n(s)-P_c(s)|>\epsilon,

and its complement E‾(ϵ)\overline{E}(\epsilon): not E(ϵ)E(\epsilon). The Dvoretzky-Kiefer-Wolfowitz inequality ([12, 28]) states that, for any ϵ>0\epsilon>0,

P(sup⁡s∈R∣Fn(s)−Pc(s)∣>ϵ)≤2exp⁡(−2nϵ2),(7)P\left(\sup_{s \in\mathbb{R}} |F_n(s)-P_c(s)|>\epsilon\right)\le2\exp(-2n\epsilon^2), \tag*{(7)}

and therefore, event E(ϵ)E(\epsilon) occurs with probability at most 2exp⁡(−2nϵ2)2\exp(-2n\epsilon^2) over the draw of X\mathcal{X}. Similarly, event E‾(ϵ)\overline{E}(\epsilon) occurs with probability at least 1−2exp⁡(−2nϵ2)1-2\exp(-2n\epsilon^2) over the draw of X\mathcal{X}.

Now, consider the following equation

λϵ=2exp⁡(−2ϵ2n).\lambda\epsilon=2\exp(-2\epsilon^2n).

Its solution ϵ∗\epsilon^* is

ϵ∗=(14nW0(16nλ2))1/2>0.\epsilon^*=\left(\frac{1}{4n}W_0\left(\frac{16n}{\lambda^2}\right)\right)^{1/2}>0.

Given that the Dvoretzky-Kiefer-Wolfowitz inequality holds true for any ϵ>0\epsilon>0, it is certainly true for ϵ∗\epsilon^*. Substituting ϵ∗\epsilon^* into the bounds and recalling that λϵ∗=2exp⁡(−2ϵ∗2n)\lambda\epsilon^*=2\exp(-2\epsilon^{*2}n) completes the proof. □

Proof of Theorem 1 continued. By the construction of AiA^i in Algorithm 1, the probability that the confidence judge correctly accepts the label assigned by the underlying AI system is:

P(Ai(GS(u),Φ(u))=τj∣GS(u)=τj,GE(u)=τj)=P(hj(Φ(u))>F−,j+(Δji)∣GS(u)=τj,GE(u)=τj).(8)\begin{aligned} P\left(A^i(G^S(u),\Phi(u))=\tau_j\mid G^S(u)=\tau_j,G^E(u)=\tau_j\right) \\ &=P\left(h_j(\Phi(u))>F^+_{-,j}(\Delta^i_j)\mid G^S(u)=\tau_j,G^E(u)=\tau_j\right). \tag*{(8)} \end{aligned}

Since F+,jF_{+,j}, as defined in (3), is empirical cumulative distribution function of the conditional distribution P(hj(Φ(u))∣GS(u)=τj,GE(u)=τj)P(h_j(\Phi(u))\mid G^S(u)=\tau_j,G^E(u)=\tau_j), bounds (6) for event E2E_2 from Lemma 1 apply (with θ=F−,j−(Δji)\theta=F^-_{-,j}(\Delta^i_j), Fn=F+,jF_n=F_{+,j}, n=M+,jn=M_{+,j}).

Turning to the probability of the confidence judge AiA^i correctly rejecting an incorrect label assigned by the underlying AI system, we observe that

P(Ai(GS(u),Φ(u))=τx∣GS(u)=τj,GE(u)≠τj)=P(hj(Φ(u))≤F−,j+(Δji)∣GS(u)=τj,GE(u)≠τj).\begin{aligned} P\left(A^i(G^S(u),\Phi(u))=\tau^x\mid G^S(u)=\tau_j,G^E(u)\ne\tau_j\right) \\ &=P\left(h_j(\Phi(u))\le F^+_{-,j}(\Delta^i_j)\mid G^S(u)=\tau_j,G^E(u)\ne\tau_j\right). \end{aligned}

Similarly to the previous case, we note that the conditional distribution P(h(Φ(u))∣GS(u)=τj, GE(u)≠τj)P(h(\Phi(u)) \mid G^{S}(u) = \tau_j,\ G^{E}(u) \ne\tau_j) admits a cumulative distribution function with empirical approximation F−,jF_{-,j} which is used by Algorithm 1. Therefore bounds (5), for the event E1E_1 from Lemma 1 apply (with θ=F−,j−1(Δi)\theta= F_{-,j}^{-1}(\Delta_i), Fn=F−,jF_n = F_{-,j}, n=M−,jn = M_{-,j}, and observing that F−,j(F−,j−1(Δi))≥ΔiF_{-,j}(F_{-,j}^{-1}(\Delta_i)) \ge\Delta_i).

Finally, we note that for any x≥ex \ge e, the principal branch W0W_0 of the Lambert WW function satisfies [18]

log⁡(x)−log⁡log⁡(x)≤W0(x)≤log⁡(x)−12log⁡log⁡(x).\log(x) - \log\log(x) \le W_0(x) \le\log(x) - \frac{1}{2}\log\log(x).

Combining this with bound stemming from Lemma 1 completes the proof.

Generalization beyond i.i.d. assumptions

Theorem 1 explicitly assumes that 1) elements of the set S\mathcal{S} are all drawn independently from the same distribution, and 2) a new measurement is sampled independently from the same distribution. Here we show how these results could be generalised to dependent samples.

In order to do so, we need to introduce notion enabling quantification of various degrees of dependencies. For LLMs the most relevant framework concerns dependencies in sequences and sequential data. Therefore, consider (xi)i∈Z(x_i)_{i\in\mathbb{Z}}, a strictly stationary sequence of real-valued random variables defined on a common probability space (Ω,B,P)(\Omega,\mathcal{B},\mathcal{P}). For integers k∈Zk \in\mathbb{Z}, let

F−∞k=σ(xj:j≤k),Fk∞=σ(xj:j≥k)\mathcal{F}_{-\infty}^{k} = \sigma(x_j : j \le k), \qquad\mathcal{F}_{k}^{\infty} = \sigma(x_j : j \ge k)

denote the σ\sigma-algebras of the past up to time kk and the future from time kk onward, respectively.

Definition 1 (Strong-mixing coefficient). The strong-mixing (or α\alpha-mixing) coefficient at lag n≥1n \ge1 is

α(n)=sup⁡k∈Zsup⁡A∈F−∞kB∈Fk+n∞∣P(A∩B)−P(A)P(B)∣.\alpha(n) = \sup_{k\in\mathbb{Z}} \sup_{\substack{A\in\mathcal{F}_{-\infty}^{k}\\ B\in\mathcal{F}_{k+n}^{\infty}}} \left|P(A\cap B) - P(A)P(B)\right|.

The sequence (xi)(x_i) is said to be α\alpha-mixing (or strongly mixing, in the sense of Rosenblatt [35]) if α(n)→0\alpha(n) \to0 as n→∞n \to\infty.

We say that the mixing is geometric (or that the sequence is geometrically α\alpha-mixing) if there exists λ>0\lambda> 0 such that α(n)=O(e−λn)\alpha(n) = O(e^{-\lambda n}) as n→∞n \to\infty.

The mixing is polynomial of order pp if there exist constants K0>0K_0 > 0 and p>1p > 1 such that

α(n)≤K0n−pfor all n≥1.(9)\alpha(n) \le K_0 n^{-p} \quad\text{for all } n \ge1. \tag*{(9)}

The α\alpha-mixing coefficient measures essentially how far the probability P(A∩B)P(A \cap B) of the joint event A∩BA \cap B deviates from the product P(A)P(B)P(A)P(B).

We note that for stationary sequences the supremum over kk in Definition 1 is redundant and may be replaced by any single value of kk. We also note that the notion of mixing presented in Definition 1 is the least constrained amongst other classical mixing notions. Indeed it is implied by β\beta-mixing (absolute regularity) and ϕ\phi-mixing (uniform mixing), with 2α(n)≤β(n)≤ϕ(n)2\alpha(n) \le\beta(n) \le\phi(n). See Bradley [7] for details, Eqns. (1.11)–(1.18)).

At the heart of the proof of Theorem 1, and the sole place where independence of samples is required, is Lemma 1. There the independence is needed to appropriately invoke the Dvoretzky–Kiefer–Wolfowitz inequality [12, 28]. Hence if a suitable replacement to the classical Dvoretzky–Kiefer–Wolfowitz inequality is used that does not require independence, then Lemma 1 and Theorem 1 could be generalized to dependent settings too.

Geometric mixing

The replacement follows immediately from [31].

Lemma 2 (Naaman 2021, Lemma 4.3, k=1k = 1). Let (xi)(x_i) be a stationary α\alpha-mixing sequence of real-valued random variables with marginal CDF FF, and suppose α(n)=O(e−λn)\alpha(n) = O(e^{-\lambda n}) for some λ>0\lambda> 0. Let (δn)(\delta_n) be a non-decreasing positive integer sequence satisfying

δn→∞andnδn→∞as n→∞.(10)\delta_n \to\infty\qquad\text{and} \qquad\frac{\sqrt{n}}{\delta_n} \to\infty\qquad\text{as } n \to\infty. \tag*{(10)}

Then for every t≥0t \ge0 and all nn sufficiently large,

P(sup⁡θ∈R∣∑i=δnn+δn−1{1{xi≤θ}−F(θ)}∣≥nt)≤(n+δn)2exp⁡(−nt232δn2(1+ln⁡n)).(11)P\left(\sup_{\theta\in\mathbb{R}}\left|\sum_{i=\delta_n}^{n+\delta_n-1}\left\{\mathbf{1}\{x_i \le\theta\}-F(\theta)\right\}\right| \ge nt\right) \le(n+\delta_n)^2 \exp\left(-\frac{nt^2}{32\delta_n^2(1+\ln n)}\right). \tag*{(11)}

The sequence δn\delta_n trades off the polynomial pre-exponential factor against the rate inside the exponent in (11). With the choice δn=⌊n1/p⌋\delta_n=\lfloor n^{1/p}\rfloor for any fixed p>2p>2, the conditions in (10) are satisfied, and the exponent in (11) becomes

nt232δn2(1+ln⁡n)=n1−2/pt232(1+ln⁡n),\frac{nt^2}{32\delta_n^2(1+\ln n)}=\frac{n^{1-2/p}t^2}{32(1+\ln n)},

while the prefactor (n+δn)2(n+\delta_n)^2 remains O(n2)O(n^2). As p→∞p\to\infty, the exponential rate approaches n/log⁡nn/\log n, almost matching (up to constants and the polynomial prefactor) the exponential rate of the classical Dvoretzky–Kiefer–Wolfowitz inequality.

Polynomial mixing

When the mixing is polynomial, the dependencies have longer tails and convergence of empirical estimates of the cumulative distribution function to the true one may no longer follow exponential law. Yet, for large enough data samples the convergence still occurs, as is shown in the theorem below.

Theorem 2. Let (xi)(x_i) be strictly stationary and α\alpha-mixing with polynomial rate (9) for some p>1p>1 and K0>0K_0>0. For every q∈(2,p+1)q\in(2,p+1) there exists a constant C=C(q,p,K0)<∞C=C(q,p,K_0)<\infty such that for every n≥2n\ge2 and every t∈(0,1]t\in(0,1],

P(sup⁡θ∈R∣1n∑i=1n(1{xi≤θ}−F(θ))∣>t)≤Cnq/2tq+1.(12)P\left(\sup_{\theta\in\mathbb{R}}\left|\frac{1}{n}\sum_{i=1}^{n}\left(\mathbf{1}\{x_i\le\theta\}-F(\theta)\right)\right|>t\right)\le\frac{C}{n^{q/2}t^{q+1}}. \tag*{(12)}

Proof of Theorem 2. The proof proceeds in three steps: a moment bound for partial sums via Yokoyama’s inequality (step 1), a pointwise tail via Markov inequality (step 2), followed by a standard deterministic grid reduction (step 3).

Recall that

Fn(θ)=1n∑i=1n1{xi≤θ}.F_n(\theta)=\frac{1}{n}\sum_{i=1}^{n}\mathbf{1}\{x_i\le\theta\}.

In what follows we will use the standard notation for the left limit of a non-decreasing function g:R→Rg:\mathbb{R}\to\mathbb{R} at x∈Rx\in\mathbb{R}:

g(x−):=lim⁡ε↓0g(x−ε)=lim⁡y↑xg(y).g(x^-):=\lim_{\varepsilon\downarrow0}g(x-\varepsilon)=\lim_{y\uparrow x}g(y).

It is clear that

F(x−)=P(x1<x),Fn(x−)=1n∣{i:xi<x}∣,F(x^-)=P(x_1<x),\qquad F_n(x^-)=\frac{1}{n}\left|\{i:x_i<x\}\right|,

with the gap F(x)−F(x−)=P(x1=x)F(x)-F(x^-)=P(x_1=x) equal to the atom mass of FF at xx (which vanishes when FF is continuous at xx). Both FF and FnF_n are right-continuous and non-decreasing, so all left limits exist and lie below the corresponding values: F(x−)≤F(x)F(x^-)\le F(x) and Fn(x−)≤Fn(x)F_n(x^-)\le F_n(x).

Step 1 (Accounting for dependencies via the Yokoyama’s moments inequality). Fix θ∈R\theta\in\mathbb{R} and define two centred indicator processes

wi(θ)=1{xi≤θ}−F(θ),wi−(θ)=1{xi<θ}−F(θ−),i∈Z.w_i(\theta)=\mathbf{1}\{x_i\le\theta\}-F(\theta),\qquad w_i^-(\theta)=\mathbf{1}\{x_i<\theta\}-F(\theta^-),\qquad i\in\mathbb{Z}.

Observe that E(wi(θ))=0\mathbb{E}(w_i(\theta))=0, E(wi−(θ))=0\mathbb{E}(w_i^-(\theta))=0 and ∣wi(θ)∣≤1|w_i(\theta)|\le1, ∣wi−(θ)∣≤1|w_i^-(\theta)|\le1. That is, both sequences are bounded by 1 in absolute value and centred. Moreover, they are measurable functions of xix_i and as such inherit the α\alpha-mixing of (xi)(x_i) with coefficients no larger than α(⋅)\alpha(\cdot). To see this, note first that the maps ϕ(y)=1{y≤θ}−F(θ)\phi(y)=\mathbf{1}\{y\le\theta\}-F(\theta) and ϕ−(y)=1{y<θ}−F(θ−)\phi^-(y)=\mathbf{1}\{y<\theta\}-F(\theta^-) are Borel-measurable functions R→R\mathbb{R}\to\mathbb{R}: they are indicators of the Borel sets (−∞,θ](-\infty,\theta] and (−∞,θ)(-\infty,\theta) respectively. By the measurability of compositions (Billingsley, 1995, Theorem 13.1, p. 182), ϕ(xi)=wi(θ)\phi(x_i)=w_i(\theta) and ϕ−(xi)=wi−(θ)\phi^-(x_i)=w_i^-(\theta) are themselves measurable random variables on the underlying probability spaces (Ω,F−∞∞,P)(\Omega,\mathcal{F}_{-\infty}^{\infty},P), (Ω,Fk+n∞,P)(\Omega,\mathcal{F}_{k+n}^{\infty},P) (see Definition 1).

Let BR\mathcal{B}_{\mathbb{R}} denote the Borel σ\sigma-field on R\mathbb{R}. Recall that the σ\sigma-field generated by a random variable X:Ω→RX : \Omega\to\mathbb{R} on (Ω,B,P)(\Omega,\mathcal{B},P) is the σ\sigma-field of preimages σ(X)=X−1(BR)={X−1(B):B∈BR}⊆B\sigma(X)=X^{-1}(\mathcal{B}_{\mathbb{R}})=\{X^{-1}(B):B\in\mathcal{B}_{\mathbb{R}}\}\subseteq\mathcal{B}. For ψ∈{ϕ,ϕ−}\psi\in\{\phi,\phi^{-}\}, and B∈{F−∞k,F−∞k}\mathcal{B}\in\{\mathcal{F}^{k}_{-\infty},\mathcal{F}^{k}_{-\infty}\}

σ(ψ(xi))=(ψ∘xi)−1(BR)=xi−1(ψ−1(BR))⊆xi−1(BR)=σ(xi),\sigma(\psi(x_i))=(\psi\circ x_i)^{-1}(\mathcal{B}_{\mathbb{R}})=x_i^{-1}(\psi^{-1}(\mathcal{B}_{\mathbb{R}}))\subseteq x_i^{-1}(\mathcal{B}_{\mathbb{R}})=\sigma(x_i),

where σ\sigma stands for the corresponding sigma-fields, and the inclusion uses ψ−1(BR)⊆BR\psi^{-1}(\mathcal{B}_{\mathbb{R}})\subseteq\mathcal{B}_{\mathbb{R}}, i.e. Borel-measurability of ψ\psi. Therefore, all three σ\sigma-fields σ(xi)\sigma(x_i), σ(wi(θ))\sigma(w_i(\theta)) and σ(wi(θ−))\sigma(w_i(\theta^{-})) are sub-σ\sigma-fields of the same ambient B\mathcal{B}. Hence the σ\sigma-field monotonicity of the mixing coefficient in Definition 1 implies that the same mixing coefficient is inherited by wi(θ),wi(θ−)w_i(\theta),w_i(\theta^{-}).

Observe that both wi(θ)w_i(\theta) and wi(θ−)w_i(\theta^{-}) are bounded. This implies that their qq-th moments, q∈Nq\in\mathbb{N} are all defined and bounded. By Yokoyama’s moment inequality [43 Theorem 1], for every q>2q>2 such that

∑k=1∞(k+1)q−2α(k)<∞,(13)\sum_{k=1}^{\infty}(k+1)^{q-2}\alpha(k)<\infty, \tag*{(13)}

there exists a constant Aq<∞A_q<\infty, depending only on qq and on the sum in (13), such that

E∣∑i=1nwi(θ)∣q≤Aqnq/2,E∣∑i=1nwi(θ−)∣q≤Aqnq/2,n≥1.(14)\mathbb{E}\left|\sum_{i=1}^{n}w_i(\theta)\right|^q\leq A_q n^{q/2},\qquad\mathbb{E}\left|\sum_{i=1}^{n}w_i(\theta^{-})\right|^q\leq A_q n^{q/2},\qquad n\geq1. \tag*{(14)}

Under polynomial mixing (9), condition (13) reduces to ∑k(k+1)q−2−p<∞\sum_k(k+1)^{q-2-p}<\infty, i.e. q−2−p<−1q-2-p<-1, equivalently q<p+1q<p+1.

Step 2 (point-wise tail bounds). Set Sn(θ)=∑i=1nwi(θ)S_n(\theta)=\sum_{i=1}^{n}w_i(\theta). According to Markov’s inequality and (14), we obtain that for any t>0t>0,

P(∣Fn(θ)−F(θ)∣≥t)=P(∣Sn(θ)∣≥nt)≤E∣Sn(θ)∣q(nt)q≤Aqnq/2tq,(15)P(|F_n(\theta)-F(\theta)|\geq t)=P(|S_n(\theta)|\geq nt)\leq\frac{\mathbb{E}|S_n(\theta)|^q}{(nt)^q}\leq\frac{A_q}{n^{q/2}t^q}, \tag*{(15)}
P(∣Fn(θ−)−F(θ−)∣≥t)≤Aqnq/2tq.P(|F_n(\theta^{-})-F(\theta^{-})|\geq t)\leq\frac{A_q}{n^{q/2}t^q}.

Step 3 (Bounding the probability of supremum over R\mathbb{R}). For an integer N≥1N\geq1, define the grid via the standard quantile function:

θ0=−∞,θN=+∞,θi=inf⁡{x∈R:F(x)≥i/N},i=1,…,N−1.\theta_0=-\infty,\qquad\theta_N=+\infty,\qquad\theta_i=\inf\{x\in\mathbb{R}:F(x)\geq i/N\},\quad i=1,\ldots,N-1.

Note, that the grid points θi\theta_i, i=1,…,N−1i=1,\ldots,N-1 satisfy θi−1≤θi\theta_{i-1}\leq\theta_i, but they are not necessarily all distinct (consider e.g. distributions comprising a single atom containing all probability mass).

Right-continuity of FF, combined with the definition of the infimum, yields

F(θi−)≤iN≤F(θi),i=1,…,N−1.(16)F(\theta_i^{-})\leq\frac{i}{N}\leq F(\theta_i),\qquad i=1,\ldots,N-1. \tag*{(16)}

For any θ∈[θi−1,θi)\theta\in[\theta_{i-1},\theta_i), monotonicity of FnF_n and FF ensures that

Fn(θi−1)≤Fn(θ)≤Fn(θi−),F(θi−1)≤F(θ)≤F(θi−),F_n(\theta_{i-1})\leq F_n(\theta)\leq F_n(\theta_i^{-}),\qquad F(\theta_{i-1})\leq F(\theta)\leq F(\theta_i^{-}),

and from (16) the oscillation of FF on this interval is bounded by

F(θi−)−F(θi−1)≤iN−i−1N=1N.F(\theta_i^{-})-F(\theta_{i-1})\leq\frac{i}{N}-\frac{i-1}{N}=\frac{1}{N}.

Combining,

∣Fn(θ)−F(θ)∣≤max⁡(∣Fn(θi−1)−F(θi−1)∣, ∣Fn(θi−)−F(θi−)∣)+1N.|F_n(\theta)-F(\theta)|\leq\max\left(|F_n(\theta_{i-1})-F(\theta_{i-1})|,\ |F_n(\theta_i^{-})-F(\theta_i^{-})|\right)+\frac{1}{N}.

Since FF is the cumulative density function of a probability measure, its atom set {x:F(x)−F(x−)>0}\{x:F(x)-F(x^{-})>0\} is at most countable: for each k≥1k\geq1, atoms of mass ≥1/k\geq1/k are at most kk in number, and the atom set is the countable union over kk of these finite sets. The function ∣Fn−F∣|F_n-F| is càdlàg, and its discontinuities are contained in the (at most countable) union of the atom set of FF and the data points {x1,…,xn}\{x_1,\ldots,x_n\}. Consequently sup⁡θ∈R∣Fn(θ)−F(θ)∣\sup_{\theta\in\mathbb{R}} |F_n(\theta)-F(\theta)| equals its supremum over a countable set and is a well-defined measurable random variable.

Taking the supremum over θ∈R\theta\in\mathbb{R},

sup⁡θ∣Fn(θ)−F(θ)∣≤max⁡1≤i≤Nmax⁡{∣Fn(θi−1)−F(θi−1)∣, ∣Fn(θi−)−F(θi−)∣}+1N,(17)\sup_{\theta}|F_n(\theta)-F(\theta)|\leq\max_{1\leq i\leq N}\max\left\{|F_n(\theta_{i-1})-F(\theta_{i-1})|,\ |F_n(\theta_i^-)-F(\theta_i^-)|\right\}+\frac{1}{N}, \tag*{(17)}

since at θ=θ0=−∞\theta=\theta_0=-\infty and θ=θN=+∞\theta=\theta_N=+\infty both FnF_n and FF vanish or equal 1 identically.

Fix t∈(0,1]t\in(0,1] and choose N=⌈(q+1)/t⌉N=\lceil(q+1)/t\rceil. Since q>2q>2 and t≤1t\leq1, N≥q+1≥3N\geq q+1\geq3. Then 1/N≤t/(q+1)1/N\leq t/(q+1), so t−1/N≥qt/(q+1)t-1/N\geq qt/(q+1), and N−1≤(q+1)/tN-1\leq(q+1)/t.

By (17), the event {sup⁡θ∣Fn−F∣>t}\{\sup_{\theta}|F_n-F|>t\} is contained in the union, over i∈{1,…,N}i\in\{1,\ldots,N\}, of the events {∣Fn(θi−1)−F(θi−1)∣>qt/(q+1)}\{|F_n(\theta_{i-1})-F(\theta_{i-1})|>qt/(q+1)\} and {∣Fn(θi−)−F(θi−)∣>qt/(q+1)}\{|F_n(\theta_i^-)-F(\theta_i^-)|>qt/(q+1)\}.

Two of these events occur with probability 0 (at θ0=−∞\theta_0=-\infty and at θN=∞\theta_N=\infty). Boole’s inequality combined with (15) (each applied with qt/(q+1)qt/(q+1) in place of tt) results in

P(sup⁡θ∣Fn−F∣>t)≤2(N−1)⋅Aqnq/2(qt/(q+1))q=2(N−1)(q+1)qAqqqnq/2tq≤2((q+1)/t)(q+1)qAqqqnq/2tq(using N−1≤(q+1)/t)=2(q+1)q+1Aqqqnq/2tq+1.\begin{aligned} P\left(\sup_{\theta}|F_n-F|>t\right) &\leq2(N-1)\cdot\frac{A_q}{n^{q/2}(qt/(q+1))^q} =\frac{2(N-1)(q+1)^qA_q}{q^qn^{q/2}t^q}\\ &\leq\frac{2((q+1)/t)(q+1)^qA_q}{q^qn^{q/2}t^q} \qquad\text{(using }N-1\leq(q+1)/t\text{)}\\ &=\frac{2(q+1)^{q+1}A_q}{q^qn^{q/2}t^{q+1}}. \end{aligned}

Noticing that (1+q)q+1/qq≤(q+1)e(1+q)^{q+1}/q^q\leq(q+1)e, setting C(q,p,K0):=2e(q+1)AqC(q,p,K_0):=2e(q+1)A_q completes the proof, since AqA_q depends only on qq and on the mixing-tail sum, which under (9) is bounded by a quantity depending only on pp and K0K_0. □

According to Theorem 2, generalization of Theorem 1 to dependent data with dependencies conforming with polynomial mixing, could be achieved by replacing exponential tails with the ones in the rhs of (12). Doing so will loosen then confidence bounds. Yet, the overall principle of learnable inference of relevant probabilities would remain.

Details of building AI ontology calibrators

In the following sections, we provide details on the ontologies for which AI calibrators were built.

Ontology 1: BF

BF programs-outputs generation

Each BF program consists of commands represented by one of eight symbols, detailed in Table 3.

Symbol(s)Command description
>/<Increment/decrement the data pointer by one.
+/-Increment/decrement the byte at the data pointer by one.
.Output the byte at the data pointer.
,Accept one byte of input, storing its value in the byte at the data pointer.
[/]If the byte at the data pointer is zero/non-zero, then instead of moving the instruction pointer forward to the next command, jump it forward to the command after the matching ] / [ command.

Table 3. BF commands’ specifications. Our model uses all commands except input (, ) and predicts an end-of-sequence token for program termination.

The initial training data was generated using a genetic algorithm that evolves programs based on their output. This approach enables the generation of diverse program candidates.

We also implement a custom BF interpreter with the following specifications:

  1. Program outputs are represented as ASCII codes (values 0 − 255). The interpreter truncates output sequences exceeding 256 codes.

  1. All output values including zeros produced during execution are preserved in the output sequence.

  1. Programs entering infinite loops during execution are terminated, and a special token <InfLoop> is outputted.

BF programs prediction

Model’s training and the calibrator application details For model training, we tokenize BF programs by mapping each symbol to a digit and introducing special tokens: beginning-of-sequence (BOS = 1), end-of-sequence (EOS = 2), and padding (PAD = 0). Our programs do not contain the symbol ”,”; however, our model is also expected to generate EOS for each sequence. All programs are padded to length 18 using the PAD token.

Our Transformer architecture comprises a 12-layer encoder followed by two linear projection layers with interleaved dropout and layer normalization (applied twice), and a 12-layer decoder followed by two linear layers with three dropout-normalization stages. Sinusoidal positional encodings are applied to embeddings of both program tokens and output symbols. The training objective combines token-level cross-entropy loss with a set-level term that aggregates probability mass across all valid programs producing identical outputs. We train our Transformer model autoregressively.

We apply the calibrator to the entire dataset and analyse results for the first 10,000 program-output pairs. In 2,328 cases, the model generates programs identical to those in the training data. Surprisingly, in 1,490 cases, it produces functionally equivalent new programs that yield identical outputs to the original training programs. We count these as correct predictions since they satisfy the input-output specification. A length comparison of these novel programs is presented in Figure 3.

Scatter plot of initial and predicted programs' lengths

Figure 3. The dependence of initial and predicted programs lengths of new BF programs (that differ from the training data). Among 1, 490 new programs, 198 programs are shorter and 1, 061 are longer than in the initial data, and 231 programs of the same length as in the initial data.

As a result, we obtain 3,818 correctly generated programs and 6,182 incorrect ones.

Predicted programs analysis As noted above, our trained Transformer model generates programs that differ from training examples while producing identical outputs. Figure 3 shows the length relationship between initial and predicted programs for these 1,490 cases. Among them, 1,061 programs (71.2%) exceed their training counterparts in length (by up to 15 symbols). Notably, we also observe 231 structurally distinct programs of identical length (15.5%), and 198 shorter programs (13.3%) reduced by a maximum of 6 symbols.

We further analyse the relationship between entropy and the model’s internal statistics. First, we visualise entropy and the calibrator’s probability distributions for presented programs. Figure 4 shows examples for both correctly and incorrectly predicted programs, demonstrating that confidence and entropy may exhibit an inverse linear relationship (e.g., Figure 4a and Figure 4d) or no consistent correlation (e.g., Figure 4b and Figure 4c).

Symbol-level analysis of model confidence and uncertainty for program predictions

Figure 4. (a) The example of correctly predicted program. Confidence scores and entropy correlate. (b) The example of correctly predicted program. Confidence scores and entropy do not correlate. (c) The example of incorrectly predicted program: the initial program is -[.-.][+<]+. while the predicted program is -[.-.]+]]]+.. Confidence scores and entropy do not correlate. (d) The example of incorrectly predicted program: the initial program is <+...+. while the predicted program is ++...+.-. Confidence scores and entropy correlate. A symbol-level analysis of model confidence and uncertainty (entropy) for program predictions. Each token is visualized with triple encoding: (1) symbols’ foreground colour indicates prediction correctness (green for correct, red for incorrect symbols), (2) background intensity represents confidence scores, and (3) the border colour encodes predictive entropy.

Second, we compute the Pearson correlation coefficient between entropy and the calibrator’s probability across 10,000 program samples. Figure 5 reveals a weak negative linear correlation (r=−0.37r = -0.37, p<0.0001p < 0.0001).

Scatter plot showing the dependence of probability acceptance on uncertainty (entropy)

Figure 5. The dependence of the probability acceptance on the entropy. The Pearson correlation equals to −0.37 with p-value < 0.0001.

We also analyse the calibrator’s probability in more detail. Figure 6 characterizes the calibrator’s probability distributions. The histogram for incorrectly predicted programs (left) exhibits a sharp unimodal peak at near-zero probability (p≈0p \approx0, density ≈55\approx55), indicating the model’s low confidence in erroneous outputs, with only weak, diffuse elevation (density <15< 15) elsewhere in the range. Correctly predicted programs (all, second panel) instead show a clear bimodal distribution: a peak at p≈0p \approx0 (density ≈33\approx33) and a second mode around p≈0.12−0.135p \approx0.12 - 0.135 reaching a comparable density of ≈25\approx25, indicating two distinct confidence regimes among correct predictions. Decomposing this by memorization status reveals a clear asymmetry. For programs identical to those seen during training (third panel), the high-confidence mode is in fact the dominant feature, peaking at p≈0.135p \approx0.135 with density ≈33\approx33 and exceeding the near-zero peak (density ≈20\approx20) by roughly 1.6×1.6\times – the calibrator is markedly more confident when the correct program matches training data. For correct predictions on programs structurally different from training (right panel), the pattern reverses: the near-zero peak becomes the single largest peak in the entire figure (density ≈58\approx58), roughly 2.9×2.9\times its own high-confidence region (density ≈20\approx20 at p≈0.115p \approx0.115) and the corresponding near-zero peak in the training-identical subset (third panel).

Four histograms of calibrator’s probabilities

Figure 6. The histograms of calibrator’s probabilities.

This divergence implies the model develops specialized confidence heuristics for generating functionally equivalent but structurally novel programs. The consistent concentration of all distributions in the low-probability regime (p<0.16p < 0.16) further indicates that high-confidence predictions are rare, aligning with the weak entropy-probability correlation observed in Figure 5.

Ontology 2: math problems

To assess the correctness of math problem solutions, we employ two techniques:

  1. the LLM Judge – motivated by the impracticality of manual annotation at scale ([40, 21]). We use Qwen2.5-32B ([39]) as the judge. Each answer (from both the expert and the student) is split into double-newline-delimited fragments (”sentences”), which are assembled into a structured prompt asking the checker to align each sentence from the expert’s trace to one or more sentences in the student’s trace, assigning a confidence of ”high”, ”medium”, or ”low” to each correspondence. The full prompt is provided in Appendix § 12.2.1. Task correctness is then computed as the average confidence score (1, 0.5, or 0, respectively) across all associations and the final verdict is ”correct” (label 1) if the result ≥0.5\ge0.5 otherwise ”incorrect” (label 0), following a similar method to ([23]).

  1. the ProcessBench annotation – which reuses the benchmark’s original evaluation protocol ([48]). Answers are split into sentences using the same scheme as above and fed into the ProcessBench evaluator, which identifies the index of the first erroneous sentence in the student’s trace, or signals a fully correct solution. We use DeepSeek-V3.2 as the annotator given its strong performance on math tasks ([11]). Inference was done locally, on NVidia H100 80GB GPUs, full annotation took six hours per dataset.

Prompt for LLM-based checker of the correctness of math problems' solving

The full prompt for comparing the student’s model math problem solving with the expert’s via Qwen2.5-32B is the following:

You are analyzing two chain-of-thought (CoT) reasoning traces for the same math problem. One is from a large model and one is from a small model.

Your task is to map which sentences in the large CoT correspond to which sentences in the small CoT. Some sentences may correspond to multiple sentences, or some may have no clear correspondence.

Question:

{text_of_task_prompt}

Large Model CoT (numbered sentences):

{expert_list_of_sentences}

Small Model CoT (numbered sentences):

{student_list_of_sentences}

Please output a JSON array where each element maps a large_cot sentence index to matching small_cot sentence indices. Use this format:

[
  \{
    "large_idx": 0,
    "small_idx": [0, 1],
    "confidence": "high",
    "rationale": "Both introduce the problem and set up variables"
  \},
  \{
    "large_idx": 1,
    "small_idx": [2],
    "confidence": "medium",
    "rationale": "Similar equation setup but with different clarity"
  \}
]

Confidence levels: ”high” (clear correspondence), ”medium” (likely but not certain), ”low” (weak correspondence)

Output only the JSON array, no additional text.

Results of labeling strategies for math tasks

In this work, we consider only 6, 845 math problems for which we have both labelings: one from an LLM-based checker and one from ProcessBench. The LLM-based checker labeled 6, 453 problems as correctly solved, while ProcessBench labeled only 3, 452. Figure 7 shows that neither labeling yields separable classes under PCA. Nevertheless, we consider the ProcessBench labeling as more reliable, since the LLM-based checker marked almost all problems as correct. Therefore, for medical question answering we use the ProcessBench labeling.

PCA visualization of both labeling strategies

Figure 7. PCA visualization of both labeling strategies.

Ontology 3: medical-related question answering

For medical question answering, we provide the possible addition highlight of six parts of the models’ outputs:

  1. Decision – a clinical, surgical, or scientific action to take or avoid.

  1. Reasoning – a pivotal logical step that drives the conclusion.

  1. Conclusion – the final answer or diagnosis, expressed as a concept rather than a letter.

  1. Caution – a risk, contraindication, warning, or negation that prevents a wrong action.

  1. Mechanism – a biological, pharmacological, or molecular mechanism on which the answer hinges.

  1. Elimination – reasoning that rules out a wrong option (critical for NOT/incorrect/except questions).

To produce these highlights, we use MedGemma (google/medgemma-1.5-4b-it) with the following prompt:

You are a precise annotation judge for science and medicine questions.

Your task is to read a question and a model-generated answer, then identify spans of text that are SEMANTICALLY PIVOTAL – meaning that changing or removing them would either reverse the meaning, lead to the wrong conclusion, or cause a clinically or scientifically dangerous error.

The questions come from a broad range of ontologies:

  • Molecular and cell biology (mechanisms, pathways, organelles, proteins)

  • Genetics and genomics (mutations, inheritance, sequencing, gene regulation)

  • Physiology and anatomy (organ systems, hormones, homeostasis)

  • Neuroscience (synapses, neurotransmitters, brain function)

  • Ecology and evolution (selection, population dynamics, symbiosis)

  • Clinical medicine (diagnosis, treatment, surgical indications, patient management)

  • Pharmacology (drug targets, mechanisms of action, resistance)

  • Research methods (PCR, sequencing, microscopy, assays)

  • Healthcare systems and policy (EHR, public health, technology)

Semantically pivotal spans include:

  • Direction or magnitude words whose reversal flips the answer: ”increase” vs ”decrease”, ”inhibits” vs ”activates”, ”proximal” vs ”distal”

  • A negation that inverts the meaning of a claim: ”not”, ”except”, ”unlikely”, ”absent”

  • A specific named entity the answer critically depends on: a drug name, enzyme, gene, pathway, or anatomical structure

  • A key quantity, threshold, or relationship: ”above pH 7”, ”half-life of 8 days”, ”binds competitively”

  • The clause that eliminates a distractor in NOT/incorrect/except questions:

the reasoning that rules out a wrong option, not just the option letter

Do NOT highlight:

  • Bare answer labels in isolation (”answer D”, ”option C”) – highlight the reasoning or concept that justifies the choice instead

  • Connector words alone (”because”, ”therefore”, ”however”) – highlight the clause they introduce if that clause is pivotal, not the connector itself

  • Background or contextual sentences that do not affect the correctness of the answer if removed

If the answer contains only a bare label with no reasoning, return an empty highlights list and note this in the summary.

Return ONLY a valid JSON object (no markdown fences, no extra text):

{
  "highlights": [
    {
      "span":    "<exact substring copied character-for-character from the answer>",
      "type":    "<one of: decision | reasoning | conclusion | caution | mechanism | elimination>",
      "reason":  "<one sentence explaining why changing this span would make the answer wrong>"
    }
  ],
  "summary": "<2-3 sentence summary of what is semantically pivotal in this answer>"
}

Type definitions: decision - a clinical, surgical, or scientific action to take or avoid reasoning - a pivotal logical step that drives the conclusion conclusion - the final answer or diagnosis, expressed as a concept not a letter caution - a risk, contraindication, warning, or negation that prevents a wrong action mechanism - a biological, pharmacological, or molecular mechanism the answer hinges on elimination - reasoning that rules out a wrong option (critical for NOT/incorrect/except questions)

Rules:

  • ”span” must be an exact character-for-character substring of the answer text

  • Highlight every span that is semantically pivotal – neither more nor less

  • Do not add spans to reach a minimum count

  • Do not drop spans to stay under a maximum count

  • A short answer may have 1-2 highlights; a long reasoning chain may have more

  • Spans may overlap; that is fine

  • Do NOT include any text outside the JSON object.”

Figure 8 shows an example containing three types of highlights: reasoning (”providing the first step in glucose catabolism”), conclusion (”B: Glycolysis”), and mechanism (”takes place in the cytoplasm” and ”converts glucose into pyruvate”).

Visualization comparing the expert’s and the student’s answers

Figure 8. Visualization comparing the expert’s and the student’s answers to the following question: which of the following metabolic pathways primarily occurs in the cytoplasm and is responsible for the initial breakdown of glucose to pyruvate? A: Citric Acid Cycle; B: Glycolysis; C: Beta-oxidation; D: Electron Transport Chain; E: Pentose Phosphate Pathway; F: Urea Cycle; G: Calvin Cycle; H: Glycogenolysis; I: Gluconeogenesis; J: Fatty Acid Synthesis.

These highlights help identify which parts of a reasoning trace deserve closer attention. While a mistake on the example shown here would be inconsequential, this is not the case for many other medical questions, where an incorrect answer could cause real harm. These highlights can also be used in the labeling process: for example, an answer may be marked incorrect if an error appears in any span belonging to one of these six categories.

Positional biases of calibrators

To build the AI ontology calibrator, we need to label each student token as correct or not. This token-level correctness is a fundamentally ill-defined, almost philosophical question: there is no principled way to decide which individual token is correct or incorrect. In this paper, we implement a simple technique: we compare all student tokens with the expert tokens at the same positions and label a student token as correct if the student and the expert have the same token at that position, and as incorrect otherwise.

To ensure this approach does not introduce any biases, we additionally conduct the following experiment: we plot the distributions of normalized indices of tokens from S+S_{+}. Figure 9 shows the results for Qwen3-8B on Math and MedGemma on Medicine. In both cases, the distribution is nearly uniform, so no positional bias is found. Nevertheless, even if it is present, it does not harm our theory.

Distribution of the relative position of tokens in the student generation

Figure 9. Distribution of the relative position of tokens in S+S_{+} within the student generation, index(S+S_{+})/len(generation), for (a) Math with Qwen3-8B and (b) Medicine with MedGemma as the student. The distributions are approximately uniform, showing that tokens labeled as correct are not concentrated at the beginning, middle, or end of the response.

Relations of derived indicators for classifiers

Analysis of indicators and baselines on all ontologies

To analyse the relations between the 15 indicators and six baselines used for training classifiers, we calculate pairwise Spearman correlations, including correlations with the target label for all our domains, labelings, and students. Figure 10 presents feature pairs with a statistically significant (p-value ≤0.05\le0.05) absolute correlation coefficient exceeding 0.6 for all models and ontologies. The calibrator-based probability indicators provide signals largely independent from the entropies- and softmaxes-based indicators. In general, the following indicators provide their unique signals with no correlations with others: std(p)std(p), std(e)std(e), PCCPCC, SCCSCC, MSPMSP, max⁡(TE)\max(TE), min⁡(TP)\min(TP). In this list, we did not include pˉ\bar{p} and Gˉp\bar{G}_{p} as they correlate with each other, which is expected (will be additionally mentioned below).

Statistically significant strong Spearman correlations between classifier indicators and the target label

Figure 10. Statistically significant strong Spearman correlations (absolute coefficient > 0.6, p-value ≤0.05\le0.05) between the 15 classifier indicators and the target label, aggregated across all ontologies and models. Only pairs for which all correlations satisfy both criteria are shown. The target labels are presented with YY.

The obtained correlations can be divided into the following groups:

  1. Mathematically trivial: the correlation coefficient is not an empirical finding but a mathematical identity or a consequence of a monotone transformation. The correlated pairs of (Es,PPs)(E_s,PP_s), (Ep,PPp)(E_p,PP_p), (LM PP,1GˉTP)\left(LM\ PP,\frac{1}{\bar{G}_{TP}}\right) are the monotone transformations.

  1. Information theory: the correlation is fully predicted by information theory. Two distinct sub-patterns appear here. First, confidence-proxy convergence: (sˉ,TP‾)(\bar{s},\overline{TP}), (Gˉs,TP‾)(\bar{G}_s,\overline{TP}), and (Gˉs,GˉTP)(\bar{G}_s,\bar{G}_{TP}). sˉ\bar{s} aggregates the probability of the single most likely token at each position, regardless of what token was actually produced, while TP‾\overline{TP} aggregates the probability the model assigns to the token it actually generated; the two are identical under greedy decoding and remain strongly correlated otherwise, since sequences where the model’s best guess is confident also tend to be sequences where the realised token was highly probable. Second, the entropy–probability inverse relationship: (eˉ,1sˉ)\left(\bar{e},\frac{1}{\bar{s}}\right), (eˉ,1Gˉs)\left(\bar{e},\frac{1}{\bar{G}_s}\right), (sˉ,1Gˉe)\left(\bar{s},\frac{1}{\bar{G}_e}\right), (Gˉs,1Gˉe)\left(\bar{G}_s,\frac{1}{\bar{G}_e}\right), (Gˉe,1TP‾)\left(\bar{G}_e,\frac{1}{\overline{TP}}\right), and (eˉ,1TP‾)\left(\bar{e},\frac{1}{\overline{TP}}\right). A peaked (low-entropy) distribution necessarily places more mass on its top token, so any entropy-side statistic is inversely related to any probability-side statistic; these six pairs are the same relationship instantiated across the arithmetic/geometric aggregation choices on each side.

  1. Aggregation robustness: (eˉ,Gˉe)(\bar{e},\bar{G}_e), (sˉ,Gˉs)(\bar{s},\bar{G}_s), and (pˉ,Gˉp)(\bar{p},\bar{G}_p) confirm that switching from the arithmetic to the geometric mean of the same underlying per-token quantity (entropies, softmaxes, or calibrator probabilities) does not change the ranking of instances, i.e. the results are not artefacts of the choice of aggregator.

  1. Bounded Support Artifact: the correlation arises from the bounded range (1/K,1](1/K,1] that top-1 softmax values are confined to, not from a deep property of model behavior. Since each top-1 softmax value st∈(1/K,1]s_t \in(1/K,1] is bounded above, sequences that are consistently confident cluster near the ceiling and sequences that are consistently uncertain cluster near the floor 1/K1/K; in both regimes the values are compressed and std(s)std(s) is low, so sˉ\bar{s} and std(s)std(s) move in opposite directions: (sˉ,1std(s))\left(\bar{s},\frac{1}{std(s)}\right). Only an unstable mix of confident and uncertain positions yields a high std(s)std(s). The pair (std(s),1TP‾)\left(std(s),\frac{1}{\overline{TP}}\right) is not an independent finding: it follows by transitivity from (sˉ,1std(s))\left(\bar{s},\frac{1}{std(s)}\right) combined with the aggregation-robustness identity Gˉs∼sˉ\bar{G}_s \sim\bar{s}.

  1. Surprising / Non-Obvious: within a single token position, a more peaked softmax distribution mechanically implies both a higher top-1 value and a lower entropy – a negative relationship. The non-obvious finding is that, across instances, the sign flips: (eˉ,std(s))(\bar{e},std(s)) is positively correlated – instances that are uncertain on average (high eˉ\bar{e}) also the instances whose top-1 confidence is most unstable across positions (high std(s)std(s)), rather than uniformly low, reflecting instance-level difficulty where some positions remain confident while others do not, inflating the variance of sts_t. This aligns with a second, distinct pair, (std(s),1TP‾)\left(std(s),\frac{1}{\overline{TP}}\right): instances with high positional variability in top-1 confidence also show low average softmaxes on the tokens actually produced, i.e. the model is simultaneously

erratic in its best guess and less committed to its actual output. Combined, these compose into (eˉ,1TP‾)(\bar{e}, \frac{1}{\overline{TP}}): average per-token uncertainty positively correlated with low realised-token confidence, mediated by std(s)std(s).

In can also be noted that none of the provided indicators correlate with the target label.

Analysis of indicators including verbalized confidence on medical ontology

Some papers ([22, 26]) report a correlation between generation correctness and the model’s self-assessment labels. To verify this claim, we additionally prompt our students on the medical ontology data to label the correctness of their answers and assess their confidence on a scale from 1 to 10.

For self-correctness assessment, we tried to follow the technique from [22] and reuse their prompt; however, our models produced outputs whose verdicts were almost impossible to parse. Therefore, for self-correctness assessment we used the following prompt:

I will give you a question and a possible answer with reasoning traces. Please output whether the possible answer is correct or not. Output only a single word: ”correct” or ”wrong”.

Question:

{text_of_prompt}

Possible Answer:

{text_of_student_response}

The possible answer is:

The prompt used for self-confidence assessment is as follows:

I will give you a question and your answer with reasoning traces. Please output whether you are confident in the provided answer. Output only a single value from 1 to 10, where 1 means you are not confident and 10 means you are completely confident.

Question:

{text_of_prompt}

Your Answer:

{text_of_student_response}

Confidence score is:

Figure 11 presents the correlation of indicators with baselines and self-assessment labels: assessment of response correctness (P(True)P(True)) and assessment of confidence in a response (P(IC)P(IC)). For self-correctness and self-confidence assessment, we considered the responses labeled with ProcessBench. As shown in Figure 11, only about half of such data have self-assessment labels for the considered students: MedGemma – 58.7% (3,509 responses with both self-assessment labels out of 5,978 labeled with ProcessBench), Qwen3-8B – 40.8% (1,308 out of 3,207), Qwen3-0.6B – 38.6% (1,415 out of 3,663), and Qwen3.5-0.8B – 31.5% (615 out of 1,954). Nevertheless, we only consider responses from which self-assessment labels can be easily obtained: if a response contained a label but its parsing was difficult, it was not included in our list. Overall, unlike what is reported in other papers, we do not observe strong correlations of either P(True)P(True) or P(IC)P(IC) with YY.

Spearman correlation matrices for four students on the medical ontology data

Figure 11. Spearman correlation matrices for four students on the medical ontology data. ProcessBench labels are denotes as YY.

Technical details of built classifiers

In Section 5 we provide the metrics of trained Logistic Regression (with default hyperparameters (with random_state=123) on each of our 15 indicators, six baselines, and two cases of several indicators usage: all 15 indicators and the first 12 indicators (the set of all indicators without Gˉ\bar{G}-based). We additionally conduct the training of XGBoost with default hyperparameters (with random_state=123) and MLP with the architecture presented in Figure 12 on all possible combinations of our 15 indicators. The classifiers were trained on an internal cluster, consisting of NVidia Tesla H200 141GB and NVidia RTX 4090 96GB GPUs. Total training time was around 96 hours for both ablations and the final training run.

Figure 12. The scheme of the MLP architecture.

For the MLP, we use n=1n = 1 block, a hidden dimension of H=128H = 128, and a dropout rate of p=0.2p = 0.2.

All classifiers are trained on 20-folds cross-validation with stratification w.r.t. target labels. For XGBoost and MLP, we used weighted BCEWithLogitsLoss loss function (with pos_weight = Nzeros/NonesN_{\text{zeros}}/N_{\text{ones}}) for all the ontologies. For MLP, we additionally choose 20% of training part on each fold for validation and normalise the data. We also use AdamW optimizer with learning rate = 10−310^{-3} and weight decay = 10−410^{-4}. ReduceLROnPlateau scheduler maximizing F1 score with patience = 5, factor = 0.5. EarlyStopping with patience = 7 and delta = 10−410^{-4}. We train all out MLPs with 300 epochs for each features set.

Figure 13 shows the training process of XGBoost and MLP classifiers on the medical ontology with MedGemma. Although both classifiers achieve comparable ROC AUC scores on the test data, XGBoost exhibits clear overfitting, as its training score is substantially higher and is close to the ideal value of 1. We observe similar behavior across the other ontologies. Therefore, in the paper, we focus on MLP and in § 5 we present only the results for the best MLPs.

Training and testing ROC AUC of classifiers trained on MedGemma features

Figure 13. Training and testing ROC AUC of classifiers trained on MedGemma features.

Statistical significance of the classifiers' results

We additionally conducted the statistical tests to check whether adding the calibrator-based indicators significantly improves correctness classification. For this, we ran a one-tailed paired tt-test with H1H_1: Δ=mean⁡(dj)>0\Delta= \operatorname{mean}(d_j) > 0, where j∈[1,20]j \in[1, 20] is the fold and dj=BAj(traditional + calibrator indicators)−BAj(traditional)d_j = BA_j(\text{traditional + calibrator indicators}) - BA_j(\text{traditional}), where BABA denotes balanced accuracy. The test parts of the folds do not overlap, but the training sets do. We therefore also applied the Nadeau-Bengio corrected tt-test, and Table 4 reports these results for BF ontology. We adjusted pp-values with the Holm method, separately for the two comparison groups (traditional indicators with and without geometric means). A result is significant if Δ>0\Delta> 0 and p(Holm)<0.05p(\mathrm{Holm}) < 0.05.

IndicatorsTest mean ± std Balanced AccuracyΔ\Delta vs traditional [95% CI]p(Holm)p(\mathrm{Holm})
Traditional {sˉ,eˉ,std⁡(s),std⁡(e),Es,PPs}\{\bar{s}, \bar{e}, \operatorname{std}(s), \operatorname{std}(e), E_s, PP_s\}0.7846±0.01880.7846 \pm0.0188reference—
The first 12 indicators; with prejp_{rej}-based0.8079±0.02100.8079 \pm0.0210+0.0233+0.0233 [+0.0121,+∞)+0.0121, +\infty)0.00010.0001
The first 12 indicators; with pp-based0.7975±0.02320.7975 \pm0.0232+0.0129+0.0129 [+0.0032,+∞)+0.0032, +\infty)0.00380.0038
The first 12 indicators; with pcombp_{comb}-based0.7983±0.01770.7983 \pm0.0177+0.0137+0.0137 [+0.0064,+∞)+0.0064, +\infty)0.00020.0002
Traditional {sˉ,eˉ,std⁡(s),std⁡(e),Es,PPs,Gs,Gˉe}\{\bar{s}, \bar{e}, \operatorname{std}(s), \operatorname{std}(e), E_s, PP_s, G_s, \bar{G}_e\}0.7948±0.01330.7948 \pm0.0133reference—
The first 15 indicators; with prejp_{rej}-based0.8125±0.01840.8125 \pm0.0184+0.0177+0.0177 [+0.0030,+∞)+0.0030, +\infty)0.00430.0043
The first 15 indicators; with pp-based0.8090±0.02150.8090 \pm0.0215+0.0142+0.0142 [+0.0007,+∞)+0.0007, +\infty)0.00520.0052
The first 15 indicators; with pcombp_{comb}-based0.8122±0.01890.8122 \pm0.0189+0.0174+0.0174 [+0.0043,+∞)+0.0043, +\infty)0.00380.0038
22 indicators (traditional + all probabilities)0.8174±0.01740.8174 \pm0.0174+0.0226+0.0226 [+0.0099,+∞)+0.0099, +\infty)0.00030.0003
Traditional + PPpcombPP_{p_{comb}}0.8061±0.01570.8061 \pm0.0157+0.0113+0.0113 [+0.0026,+∞)+0.0026, +\infty)0.00560.0056

Table 4. Statistical significance of the balanced accuracy gain from adding calibrator-based indicators to traditional indicators, on the BF ontology with the Custom Transformer student. Balanced accuracy is reported as mean ± std over 20 folds. Δ\Delta is the mean per-fold balanced accuracy difference relative to the traditional baseline, with a one-sided 95% confidence interval. Calibrator indicators are computed from the probability of rejection (prejp_{rej}), the probability of acceptance (denoted as pp in Section 4), or the combined probability of two previous ones (pcomb=pp+(1−prej)p_{comb} = \frac{p}{p+(1-p_{rej})}). All presented entries are significant (Δ>0\Delta> 0 and p(Holm)<0.05p(\mathrm{Holm}) < 0.05).

For Medicine, the effect is more dependent on how many tokens in an answer can be calibrated. Some questions and answers contain rare, domain-specific terms, whereas we build calibrators only for tokens observed at least 1, 000 times. Figure 14 shows the distribution of the fraction of calibrated tokens per answer for MedGemma. Although the largest group of answers has 70–80% calibrated tokens, a non-trivial fraction has lower coverage. We therefore performed an additional analysis in which, for each training fold, we retained only training examples whose calibrated-token fraction exceeded a threshold THT_H. We considered TH∈[0.40,0.85]T_H \in[0.40, 0.85] in increments of 0.05, as well as no filtering (TH=0T_H = 0). This analysis is intended to characterize how coverage affects the usefulness of the indicators.

Distribution of the fraction of calibrated tokens per answer for MedGemma on the medical dataset

Figure 14. Distribution of the fraction of calibrated tokens per answer for MedGemma on the medical dataset. Most answers have 70–80% of their tokens calibrated.

In Figure 15, stars indicate statistically significant improvements for the comparisons shown. For MedGemma, the gains become statistically significant at the higher calibrated-token coverage threshold (TH=0.85T_H = 0.85) for the indicated comparisons. This result suggests that the contribution of calibrator-based indicators depends on coverage and should be interpreted conditionally, rather than as a uniform improvement across all medical examples.

Gain in balanced accuracy as a function of the minimum calibrated-token fraction

Figure 15. Gain in balanced accuracy (%) as a function of the minimum calibrated-token fraction (threshold THTH) kept in the training folds, for MedGemma. TH=0TH = 0 means no filtering. “T3” is three traditional indicators ({sˉ,eˉ,std⁡(e)}\{\bar{s}, \bar{e}, \operatorname{std}(e)\}), “T8” is all eight traditional indicators ({sˉ,eˉ,std⁡(s),std⁡(e),Es,PPs,Gˉs,Gˉe}\{\bar{s}, \bar{e}, \operatorname{std}(s), \operatorname{std}(e), E_s, PP_s, \bar{G}_s, \bar{G}_e\}), “W[recv]” and “W[lowctx]” denote attention-weighted versions, and pp, prejp_{rej} and pcombp_{comb} denote the probabilities of acceptance, rejection and the combined probability. Stars mark statistically significant improvements.

Transferability of classifiers

For a subset of indicators, we evaluate the transferability of all trained MLP-based classifiers across all ontology–model combinations. Figure 16 and Figure 17 compares the classifiers’ transfer across ontologies in two settings: using the set of traditional indicators with one replaced by our pˉ\bar{p} and using the traditional indicators only; the same number of indicators is therefore used in both settings. As the figures show, replacing Gˉs\bar{G}_s with pˉ\bar{p} improves the transfer quality in most cases, while in the cases where the traditional indicators perform better, the maximum difference in their favor is only 0.036 ROC AUC (0.052 F1).

Aggregated transfer results for ROC AUC

Figure 16. (a) {pˉ,sˉ,eˉ,std⁡(s),std⁡(e),Es,PPs,Gˉe}\{\bar{p}, \bar{s}, \bar{e}, \operatorname{std}(s), \operatorname{std}(e), E_s, PP_s, \bar{G}_e\}. (b) Difference between mean ROC AUC scores of {pˉ,sˉ,eˉ,std⁡(s),std⁡(e),Es,PPs,Gˉe}\{\bar{p}, \bar{s}, \bar{e}, \operatorname{std}(s), \operatorname{std}(e), E_s, PP_s, \bar{G}_e\} and mean F1 scores of {Gˉs,sˉ,eˉ,std⁡(s),std⁡(e),Es,PPs,Gˉe}\{\bar{G}_s, \bar{s}, \bar{e}, \operatorname{std}(s), \operatorname{std}(e), E_s, PP_s, \bar{G}_e\}. Figure 16: Aggregated transfer results (method IDs as in Table 1). Each of the 20 classifiers from 20-fold cross-validation is transferred to the whole data of each ontology; we report the mean and standard deviation of the ROC AUC score. In both heatmaps, rows denote the training ontology and columns the test ontology. Left: classifiers using the indicators given in the subcaption. Right: difference in mean ROC AUC between classifiers on {pˉ}∪I\{\bar{p}\} \cup I and on {Gˉs}∪I\{\bar{G}_s\} \cup I (traditional indicators only), where I={sˉ,eˉ,std⁡(s),std⁡(e),Es,PPs,Gˉe}I = \{\bar{s}, \bar{e}, \operatorname{std}(s), \operatorname{std}(e), E_s, PP_s, \bar{G}_e\}; 25 of 49 (51 %) transfers favor the indicators with our pˉ\bar{p}.

Aggregated transfer results for F1 score

Figure 17. (a) {pˉ,sˉ,eˉ,std⁡(s),std⁡(e),Es,PPs,Gˉe}\{\bar{p}, \bar{s}, \bar{e}, \operatorname{std}(s), \operatorname{std}(e), E_s, PP_s, \bar{G}_e\}. (b) Difference between mean F1 scores of {pˉ,sˉ,eˉ,std⁡(s),std⁡(e),Es,PPs,Gˉe}\{\bar{p}, \bar{s}, \bar{e}, \operatorname{std}(s), \operatorname{std}(e), E_s, PP_s, \bar{G}_e\} and mean F1 scores of {Gˉs,sˉ,eˉ,std⁡(s),std⁡(e),Es,PPs,Gˉe}\{\bar{G}_s, \bar{s}, \bar{e}, \operatorname{std}(s), \operatorname{std}(e), E_s, PP_s, \bar{G}_e\}. Figure 17: Aggregated transfer results (method IDs as in Table 1). Each of the 20 classifiers from 20-fold cross-validation is transferred to the whole data of each ontology; we report the mean and standard deviation of the F1 score. In both heatmaps, rows denote the training ontology and columns the test ontology. Left: classifiers using the indicators given in the subcaption. Right: difference in mean F1 between classifiers on {pˉ}∪I\{\bar{p}\} \cup I and on {Gˉs}∪I\{\bar{G}_s\} \cup I (traditional indicators only), where I={sˉ,eˉ,std⁡(s),std⁡(e),Es,PPs,Gˉe}I = \{\bar{s}, \bar{e}, \operatorname{std}(s), \operatorname{std}(e), E_s, PP_s, \bar{G}_e\}; 26 of 49 (53 %) transfers favor the indicators with our pˉ\bar{p}.

However, using more calibrator-based indicators does not necessarily improve transfer quality. Figure 18 provides the results for classifier transfer using the first 12 features ({pˉ,sˉ,eˉ,std⁡(p),std⁡(s),std⁡(e),PCC,SCC,Ep,Es,PPp,PPs}\{\bar{p}, \bar{s}, \bar{e}, \operatorname{std}(p), \operatorname{std}(s), \operatorname{std}(e), PCC, SCC, E_p, E_s, PP_p, PP_s\}), calibrator-only indicators ({pˉ,std⁡(p),Ep,PPp,Gˉp}\{\bar{p}, \operatorname{std}(p), E_p, PP_p, \bar{G}_p\}), and calibrator-only and mixed indicators ({pˉ,std⁡(p),PCC,SCC,Ep,PPp,Gˉp}\{\bar{p}, \operatorname{std}(p), PCC, SCC, E_p, PP_p, \bar{G}_p\}). The results show that the indicator sets provided in Figure 18 have lower transferability than those provided in Figure 16, despite the fact that Figure 16a contains only one calibrator probability.

Aggregated transfer results heatmaps

Figure 18. (a) The first 12 indicators. (b) Calibrator-only indicators. (c) Calibrator-only and mixed indicators. Aggregated transfer results (method IDs as in Table 1). Each of the 20 classifiers from 20-fold cross-validation is transferred to the whole data of each ontology; we report the mean and standard deviation of the ROC AUC score. In all heatmaps, rows denote the training ontology and columns the test ontology.

OntologyBFMathMedicine
Data for building calibratorsCustom 433,688 pairs of (program, output)Open-source 5,000 pairs of (problem, solution) – batch 1Open-source 12,369 pairs of (problem, answer)
ExpertBF compilerDeepSeek-R1GPT-OSS-120B
Student (N params) if not mentioned in model nameCustom Transformer (22M)Qwen3-8BMedGemma (4B) Qwen3-8B Qwen3-0.6B Qwen3.5-0.8B
Unique tokens818,08938,926 29,481 27,783 29,826
Unique calibrated tokens8808851 1,061 1,058 1,010
Classifiers20-fold cross-validation (V1)Total: 10,000 1s: 3,818 0s: 6,182Two concatenated batches (batch 1 and batch 2) – Total: 6,845 LLM-Judge (Qwen2.5-32B) 1s: 6,453 0s: 392 ProcessBench (DeepSeek-V3.2) 1s: 3,452 0s: 3,393All data from 12,369 question-answer pairs, successfully labeled with ProcessBench (DeepSeek-V3.2) Total: 5,978 1s: 3,919 0s: 2,059 Total: 3,207 1s: 2,326 0s: 881 Total: 3,663 1s: 564 0s: 3,099 Total: 1,954 1s: 595 0s: 1,359
ID for transfer experimentAB CD E F G
Train/test (V2)-Train – batch 1 Total: 3,493 1s: 3,200 0s: 293 1s: 1,029 0s: 2,464 Test – batch 2 Total: 3,352 1s: 3,253 0s: 99 1s: 2,423 0s: 929- - - -

Table 1. Experimental setups, naming convention, and the statistics on the built calibrators and the classifier data for all ontologies. In the classifiers category, we indicate the total number of considered responses with labels of correctness (denoted as “Total”), the number of correct (“1s”) and incorrect (“0s”) responses. “-” means the absence of an experiment for an ontology.

Additional classifiers' results

Our objective is broader than response-correctness prediction alone: we aim to construct ontology-specific, token-level typicality indicators with finite-sample guarantees, and then test whether their aggregation helps predict response correctness. A direct probe addresses the downstream prediction task, but it does not provide the same token-level statistics or acceptance/rejection bounds. Nevertheless, it is an important complementary baseline, and we added a SAPLMA-style comparison.

A SAPLMA-style probe [3] is a supervised classifier that predicts response correctness from the model’s hidden activations at the last answer token. Unlike the original, which uses a small feed-forward network and compares several layers, our probe is a Logistic Regression classifier (standardized inputs and class weighting, i.e., the same classifier family as ours) trained on the last-layer hidden state, with fixed hyperparameters and no layer, pooling or model selection. The last-layer state is the input of the LM head, the same representation that our method reads, but our method reads it at every answer token, whereas the probe reads it only at the last one. The probe is trained on the same MedGemma student answers, with the same correctness labels and the same 20-fold stratified cross-validation as our classifier.

We have also added a comparison of indicators computed from the lower bounds on the probabilities of correct acceptance (pp) and correct rejection (prejp_{rej}), and from their combination (pcombp_{comb}). Results are in Table 5. The SAPLMA-style probe ranks among the top seven methods judged by balanced accuracy; however, unlike our method, it provides no guarantees on the probabilities of correct acceptance and rejection. Moreover, our method yields token-level statistics that reflect how typical each generated token is, and their aggregation reflects the correctness of the whole generation. The SAPLMA-style probe, as proposed, reads the activation of a single token and returns one response-level score, so it provides no per-token characteristics.

Probability typeIndicator groupIndicatorsBalanced Accuracy
Probability of rejectionIndividualpˉrej\bar{p}_{rej}0.5189 ± 0.0210
Probability of rejectionIndividualstd⁡(prej)\operatorname{std}(p_{rej})0.5412 ± 0.0263
Probability of rejectionIndividualEprejE_{p_{rej}}0.6668 ± 0.0367
Probability of rejectionIndividualPPprejPP_{p_{rej}}0.6674 ± 0.0413
Probability of rejectionIndividualGˉprej\bar{G}_{p_{rej}}0.5479 ± 0.0239
Probability of rejectionIndividual{pˉrej,std⁡(prej),Eprej,PPprej,Gˉprej}\{\bar{p}_{rej},\operatorname{std}(p_{rej}),E_{p_{rej}},PP_{p_{rej}},\bar{G}_{p_{rej}}\}0.6764 ± 0.0390
Probability of rejectionIndividual{pˉrej,std⁡(prej),Eprej,PPprej,Gˉprej,PCC,SCC}\{\bar{p}_{rej},\operatorname{std}(p_{rej}),E_{p_{rej}},PP_{p_{rej}},\bar{G}_{p_{rej}},PCC,SCC\}0.6787 ± 0.0331
Probability of rejectionMixedPCCPCC0.5866 ± 0.0255
Probability of rejectionMixedSCCSCC0.5546 ± 0.0305
Probability of rejectionMixed12 indicators0.7218 ± 0.0301
Probability of rejectionMixed15 indicators0.7292 ± 0.0260
Probability of acceptanceIndividualpˉ\bar{p}0.5248 ± 0.0318
Probability of acceptanceIndividualstd⁡(p)\operatorname{std}(p)0.5484 ± 0.0275
Probability of acceptanceIndividualEpE_p0.6665 ± 0.0356
Probability of acceptanceIndividualPPpPP_p0.6665 ± 0.0413
Probability of acceptanceIndividualGˉp\bar{G}_p0.5488 ± 0.0296
Probability of acceptanceIndividual{pˉ,std⁡(p),Ep,PPp,Gˉp}\{\bar{p},\operatorname{std}(p),E_p,PP_p,\bar{G}_p\}0.6690 ± 0.0377
Probability of acceptanceIndividual{pˉ,std⁡(p),Ep,PPp,Gˉp,PCC,SCC}\{\bar{p},\operatorname{std}(p),E_p,PP_p,\bar{G}_p,PCC,SCC\}0.6695 ± 0.0378
Probability of acceptanceMixedPCCPCC0.5280 ± 0.0327
Probability of acceptanceMixedSCCSCC0.5272 ± 0.0336
Probability of acceptanceMixed12 indicators0.7211 ± 0.0321
Probability of acceptanceMixed15 indicators0.7271 ± 0.0217
Combined probability pcomb=pp+(1−prej)p_{comb}=\frac{p}{p+(1-p_{rej})}Individualpˉcomb\bar{p}_{comb}0.5313 ± 0.0187
Combined probability pcomb=pp+(1−prej)p_{comb}=\frac{p}{p+(1-p_{rej})}Individualstd⁡(pcomb)\operatorname{std}(p_{comb})0.5537 ± 0.0262
Combined probability pcomb=pp+(1−prej)p_{comb}=\frac{p}{p+(1-p_{rej})}IndividualEpcombE_{p_{comb}}0.6662 ± 0.0364
Combined probability pcomb=pp+(1−prej)p_{comb}=\frac{p}{p+(1-p_{rej})}IndividualPPpcombPP_{p_{comb}}0.6669 ± 0.0413
Combined probability pcomb=pp+(1−prej)p_{comb}=\frac{p}{p+(1-p_{rej})}IndividualGˉpcomb\bar{G}_{p_{comb}}0.5298 ± 0.0177
Combined probability pcomb=pp+(1−prej)p_{comb}=\frac{p}{p+(1-p_{rej})}Individual{pˉcomb,std⁡(pcomb),Epcomb,PPpcomb,Gˉpcomb}\{\bar{p}_{comb},\operatorname{std}(p_{comb}),E_{p_{comb}},PP_{p_{comb}},\bar{G}_{p_{comb}}\}0.6779 ± 0.0378
Combined probability pcomb=pp+(1−prej)p_{comb}=\frac{p}{p+(1-p_{rej})}Individual{p_{comb},\operatorname{std}(p_{comb}),E_{p_{comb}},PP_{p_{comb}},\bar{G}_{p_{comb}},PCC,SCC}0.6758 ± 0.0350
Combined probability pcomb=pp+(1−prej)p_{comb}=\frac{p}{p+(1-p_{rej})}MixedPCCPCC0.5853 ± 0.0299
Combined probability pcomb=pp+(1−prej)p_{comb}=\frac{p}{p+(1-p_{rej})}MixedSCCSCC0.5395 ± 0.0329
Combined probability pcomb=pp+(1−prej)p_{comb}=\frac{p}{p+(1-p_{rej})}Mixed12 indicators0.7233 ± 0.0333
Combined probability pcomb=pp+(1−prej)p_{comb}=\frac{p}{p+(1-p_{rej})}Mixed15 indicators0.7284 ± 0.0251
Several probabilitiesMixed22 indicators (traditional + all probabilities)0.7286 ± 0.0244
Several probabilitiesMixed{pˉrej,std⁡(prej),Eprej,PPprej,Gˉprej\{\bar{p}_{rej},\operatorname{std}(p_{rej}),E_{p_{rej}},PP_{p_{rej}},\bar{G}_{p_{rej}} pˉ,std⁡(p),Ep,PPp,Gˉp}\bar{p},\operatorname{std}(p),E_p,PP_p,\bar{G}_p\}0.6858 ± 0.0326
Several probabilitiesMixed21 indicators (all with prejp_{rej}, pp, and pcombp_{comb})0.6924 ± 0.0333
TraditionalIndividualeˉ\bar{e}0.6123 ± 0.0243
TraditionalIndividualstd⁡(e)\operatorname{std}(e)0.6579 ± 0.0235
TraditionalIndividualGˉe\bar{G}_e0.6079 ± 0.0340
TraditionalIndividualsˉ\bar{s}0.5907 ± 0.0265
TraditionalIndividualstd⁡(s)\operatorname{std}(s)0.6113 ± 0.0222
TraditionalIndividualEsE_s0.6767 ± 0.0367
TraditionalIndividualPPsPP_s0.6747 ± 0.0418
TraditionalIndividualGˉs\bar{G}_s0.5952 ± 0.0241
TraditionalMixed{sˉ,eˉ,std⁡(s),std⁡(e),Es,PPs}\{\bar{s},\bar{e},\operatorname{std}(s),\operatorname{std}(e),E_s,PP_s\}0.7211 ± 0.0325
TraditionalMixed{sˉ,eˉ,std⁡(s),std⁡(e),Es,PPs,Gˉs,Gˉe}\{\bar{s},\bar{e},\operatorname{std}(s),\operatorname{std}(e),E_s,PP_s,\bar{G}_s,\bar{G}_e\}0.7291 ± 0.0245
Traditional + OursMixedBest combination: {sˉ,eˉ,std⁡(s),std⁡(e),Es,PPs,Gˉs,Gˉe,PCC(prej)}\{\bar{s},\bar{e},\operatorname{std}(s),\operatorname{std}(e),E_s,PP_s,\bar{G}_s,\bar{G}_e,PCC(p_{rej})\}0.7319 ± 0.0260
BaselinesSAPLMA0.7247 ± 0.0202
BaselinesMSP0.6637 ± 0.0339
BaselinesLM Perplexity0.5977 ± 0.0245
BaselinesMax Token Entropy0.6648 ± 0.0259
BaselinesMean Token Probability0.5911 ± 0.0264
BaselinesMin Token Probability0.6376 ± 0.0353
BaselinesGeomean Token Probability0.5959 ± 0.0221
BaselinesConst = 10.5000 ± 0.0000
BaselinesConst = 00.5000 ± 0.0000
BaselinesRandom – fair coin0.5018 ± 0.0304
BaselinesRandom – pp of major class0.4935 ± 0.0320

Table 5. Mean ± standard deviation of balanced accuracy of Logistic Regression across 20 folds for MedGemma. Top-1 scores are in bold, top-2 in bold underlined, and top-3 in bold italic.

Moreover, it is necessary to isolate the contribution of calibrator-based indicators from that of traditional confidence indicators. To address this concern, we conducted an additional ablation study comparing three feature sets: (1) the eight traditional indicators, (2) the five calibrator-based indicators together with the two mixed indicators, and (3) the complete set of 15 indicators used in the submitted paper. For each setting, we report the best-performing feature combination under the experimental selection procedure. This comparison separates the performance of traditional indicators alone from that of calibrator-derived and combined indicators. Table 6 presents the mean and standard deviation of balanced accuracy obtained by an MLP across 20 folds for all seven student/domain settings.

MedicineBFMath, V1
MedGemmaQwen3-8BQwen3-0.6BQwen3.5-0.8BCustom TransformerLLM-JudgeProcess Bench
Best combination among eight traditional indicators0.7068±0.01060.7259±0.01590.8556±0.01010.6971±0.03600.6238±0.13390.6357±0.20820.7128±0.2361
eˉ,Gˉe,sˉ,Es\bar{e}, \bar{G}_{e}, \bar{s}, E_{s}std⁡(e),Gˉe,std⁡(s),Es\operatorname{std}(e), \bar{G}_{e}, \operatorname{std}(s), E_{s}std⁡(e),Gˉe,std⁡(s),Es\operatorname{std}(e), \bar{G}_{e}, \operatorname{std}(s), E_{s}std⁡(e),Gˉe,std⁡(s),Es\operatorname{std}(e), \bar{G}_{e}, \operatorname{std}(s), E_{s}eˉ,std⁡(e),Gˉs,Gs\bar{e}, \operatorname{std}(e), \bar{G}_{s}, G_{s}eˉ,Gˉe,std⁡(s)\bar{e}, \bar{G}_{e}, \operatorname{std}(s)eˉ,std⁡(e),Gˉs\bar{e}, \operatorname{std}(e), \bar{G}_{s}
Best combination among five calibrator indicators + two mixed0.6724±0.01350.6744±0.0340.8514±0.0190.5827±0.0290.6323±0.01640.6236±0.19540.6891±0.2167
std⁡(p),Ep,PPp\operatorname{std}(p), E_{p}, P P_{p}pˉ,Ep,PCC,SCC\bar{p}, E_{p}, P CC, S CCstd⁡(p),Ep,PPp\operatorname{std}(p), E_{p}, P P_{p}PPp,GˉpP P_{p}, \bar{G}_{p}pˉ,std⁡(p),Gˉp\bar{p}, \operatorname{std}(p), \bar{G}_{p}std⁡(p),PPp,p,PCC\operatorname{std}(p), P P_{p}, p, P CCpˉ,Ep,PPp,p,PCC,SCC\bar{p}, E_{p}, P P_{p}, p, P CC, S CC
Best combination among all 15 indicators (from our submitted paper)0.7141±0.02860.7284±0.04170.8604±0.03340.7035±0.05570.8299±0.11300.6389±0.21160.7153±0.2354
sˉ,eˉ,std⁡(s),Ep,PPp,PPs,Gˉe\bar{s}, \bar{e}, \operatorname{std}(s), E_{p}, P P_{p}, P P_{s}, \bar{G}_{e}sˉ,eˉ,std⁡(s),Ep,Es,PPs,Gˉs,Gˉe\bar{s}, \bar{e}, \operatorname{std}(s), E_{p}, E_{s}, P P_{s}, \bar{G}_{s}, \bar{G}_{e}pˉ,std⁡(p),eˉ,std⁡(e),sˉ,Es,Gˉp,Gˉs\bar{p}, \operatorname{std}(p), \bar{e}, \operatorname{std}(e), \bar{s}, E_{s}, \bar{G}_{p}, \bar{G}_{s}sˉ,std⁡(e),Ep,PPs,s,Gˉp\bar{s}, \operatorname{std}(e), E_{p}, P P_{s}, s, \bar{G}_{p}pˉ,std⁡(p),std⁡(s),std⁡(e),PCC,Ep,Es,PPs,Gˉs,Gˉe\bar{p}, \operatorname{std}(p), \operatorname{std}(s), \operatorname{std}(e), P CC, E_{p}, E_{s}, P P_{s}, \bar{G}_{s}, \bar{G}_{e}sˉ,eˉ,PCC,SCC,Ep,PPp,Gˉe\bar{s}, \bar{e}, P CC, S CC, E_{p}, P P_{p}, \bar{G}_{e}pˉ,std⁡(p),std⁡(s),Ep,Es,PPp,PPs,Gˉs,Gˉe\bar{p}, \operatorname{std}(p), \operatorname{std}(s), E_{p}, E_{s}, P P_{p}, P P_{s}, \bar{G}_{s}, \bar{G}_{e}

Table 6. Mean ± standard deviation of balanced accuracy of MLP across 20 folds for all students. Top-1 scores are in bold, top-2 in bold underlined.

The results show that traditional indicators alone provide strong baselines, while calibrator-based indicators alone generally achieve lower performance. During training, the softmaxes are configured so that the overall generation is correct. Obviously, ours do not have to be correct, because we focus on typicality, not correctness. When combined, there is a cumulative effect that traditional indicators do not show. Where there is ground truth (BF), correctness is linked to typicality, and our metrics are better than the traditional ones. These results suggest that the calibrator-based indicators provide complementary information to traditional confidence indicators, rather than simply replacing them. The combined feature set consistently achieves higher mean balanced accuracy than the best combination of traditional indicators alone.

Licenses on used data, models and software

In the paper the following models, software and licences are used:

  1. Qwen-2.5 – Apache 2.0 license;

  2. DeepSeek V3.2 – MIT license;

  3. MedGemma-2.5-4B – health-ai-developer-foundations license;

  4. SGLang inference server – Apache 2.0 license;

  5. XGBoost algorithm – Apache 2.0 license;

Societal impacts

The proposed framework aims to improve the reliability of generative AI systems by providing lightweight indicators of atypical and potentially incorrect outputs, which could be valuable in high-stakes ontologies such as medicine, software engineering and decision support. If used appropriately, such methods may highlight fluent but unreliable generations and help route unreliable cases to stronger verification pipelines. At the same time, the method should not be interpreted as a guarantee of factual correctness: false negatives may induce false confidence, while false positives may suppress useful outputs. These risks are particularly important in medical ontology, where detector scores should serve only as additional evidence rather than as expert judgment. Careful ontology-specific calibration, transparent reporting of detector non-confidence, and validation under distribution shift are necessary before deployment.

References

  1. [1]Vibhor Agarwal, Yulong Pei, Salwa Alamir, and Xiaomo Liu. Codemirage: Hallucinations in code generated by large language models. arXiv preprint arXiv:2408.08333, 2024. doi: 10.48550/arxiv.2408.08333. Published: 2024-08-14.DOI
  2. [2]Anonymous Authors. A statistical measure of trust in generative AI. https://anonymous.4open.science/r/statistical_trust_measure/, 2026. Anonymized repository for peer review.
  3. [3]Amos Azaria and Tom Mitchell. The internal state of an LLM knows when it’s lying. In Houda Bouamor, Juan Pino, and Kalika Bali (eds.), Findings of the Association for Computational Linguistics: EMNLP 2023, pp. 967–976, Singapore, December 2023. Association for Computational Linguistics. doi: 10.18653/v1/2023.findings-emnlp.68. URL https://aclanthology.org/2023.findings-emnlp.68/.DOI
  4. [4]Alexandra Bazarova, Aleksandr Yugay, Andrey Shulga, Alina Ermilova, Andrei Volodichev, Konstantin Polev, Julia Belikova, Rauf Parchiev, Dmitry Simakov, Maxim Savchenko, Andrey Savchenko, Serguei Barannikov, and Alexey Zaytsev. Hallucination detection in llms with topological divergence on attention graphs, 2025. URL https://arxiv.org/abs/2504.10063.
  5. [6]Dylan Bouchard and Mohit Singh Chauhan. Uncertainty quantification for language models: A suite of black-box, white-box, llm judge, and ensemble scorers. arXiv preprint arXiv:2504.19254, 2025.arxiv.org/abs/2504.19254
  6. [7]Richard C Bradley. Basic properties of strong mixing conditions. a survey and some open questions. Probability Surveys, 2:107–144, 2005.
  7. [8]Chao Chen, Kai Liu, Ze Chen, Yi Gu, Yue Wu, Mingyuan Tao, Zhihang Fu, and Jieping Ye. Inside: Llms’ internal states retain the power of hallucination detection. arXiv preprint arXiv:2402.03744, 2024.
  8. [9]Manuel Cossio. A comprehensive taxonomy of hallucinations in large language models. arXiv preprint arXiv:2508.01781, 2025. doi: 10.48550/arxiv.2508.01781. Published: 2025-08-03.
  9. [10]DeepSeek-AI. Deepseek-r1: Incentivizing reasoning capability in llms via reinforcement learning, 2025a. URL https://arxiv.org/abs/2501.12948.
  10. [11]DeepSeek-AI. Deepseek-v3.2: Pushing the frontier of open large language models. arXiv preprint arXiv:2512.02556, 2025b.arxiv.org/abs/2512.02556
  11. [12]A. Dvoretzky, J. Kiefer, and J. Wolfowitz. Asymptotic minimax character of the sample distribution function and of the classical multinomial estimator. Ann. Math. Statist., 27(3):642–669, 1956.
  12. [13]Yijun Feng. Counterfactual probing for hallucination detection and mitigation in large language models. arXiv preprint arXiv:2508.01862, 2025. doi: 10.48550/arxiv.2508.01862. Published: 2025-08-03.
  13. [14]Jinlan Fu, See Kiong Ng, Zhengbao Jiang, and Pengfei Liu. Gptscore: Evaluate as you desire. In Proceedings of the 2024 conference of the north american chapter of the association for computational linguistics: Human language technologies (volume 1: Long papers), pp. 6556–6576, 2024.arxiv.org/abs/2302.04166
  14. [15]Yarin Gal and Zoubin Ghahramani. Dropout as a bayesian approximation: Representing model uncertainty in deep learning. In international conference on machine learning, pp. 1050–1059. PMLR, 2016.arxiv.org/abs/1506.02142
  15. [16]Anish Gunjal, Jihan Yin, and Erhan Bas. Detecting and preventing hallucinations in large vision language models. arXiv preprint arXiv:2308.06394, 2023. doi: 10.48550/arxiv.2308.06394. Published: 2023-08-11.arxiv.org/abs/2308.06394
  16. [17]Daya Guo, Dejian Yang, Haowei Zhang, Junxiao Song, Peiyi Wang, Qihao Zhu, Runxin Xu, Ruoyu Zhang, Shirong Ma, Xiao Bi, et al. Deepseek-r1 incentivizes reasoning in llms through reinforcement learning. Nature, 645(8081):633–638, 2025.DOI
  17. [18]Abdolhossein Hoorfar and Mehdi Hassani. Inequalities on the lambert w function and hyperpower function. J. Inequal. Pure and Appl. Math, 9(2):5–9, 2008.
  18. [19]Bairu Hou, Yujian Liu, Kaizhi Qian, Jacob Andreas, Shiyu Chang, and Yang Zhang. Decomposing uncertainty for large language models through input clarification ensembling. arXiv preprint arXiv:2311.08718, 2023.arxiv.org/abs/2311.08718
  19. [20]L Huang, W Yu, W Ma, W Zhong, Z Feng, H Wang, Q Chen, W Peng, X Feng, B Qin, et al. A survey on hallucination in large language models: Principles, taxonomy, challenges, and open questions (arxiv: 2311.05232). arxiv, 2023.DOI
  20. [21]Florian A Huber and Roman Guggenberger. Ai msk clinical applications: spine imaging. Skeletal Radiology, 51(2):279–291, 2022.DOI
  21. [22]Saurav Kadavath, Tom Conerly, Amanda Askell, Tom Henighan, Dawn Drain, Ethan Perez, Nicholas Schiefer, Zac Hatfield-Dodds, Nova DasSarma, Eli Tran-Johnson, et al. Language models (mostly) know what they know. arXiv preprint arXiv:2207.05221, 2022.arxiv.org/abs/2207.05221
  22. [23]Minsuk Kahng, Ian Tenney, Mahima Pushkarna, Michael Xieyang Liu, James Wexler, Emily Reif, Krystal Kallarackal, Minsuk Chang, Michael Terry, and Lucas Dixon. Llm comparator: Interactive analysis of side-by-side evaluation of large language models. IEEE Transactions on Visualization and Computer Graphics, 2024.DOI
  23. [24]Junyi Li, Jie Chen, Ruiyang Ren, Xiaoxue Cheng, and Wayne Xin Zhao. The dawn after the dark: An empirical study on factuality hallucination in large language models. arXiv preprint arXiv:2401.03205, 2024. doi: 10.48550/arxiv.2401.03205. Published: 2024-01-06.DOI
  24. [25]Mengfei Liang, Archish Arun, Zekun Wu, Cristian Munoz, and Jonathan Lutch. Thames: An end-to-end tool for hallucination mitigation and evaluation in large language models. arXiv preprint arXiv:2409.11353, 2024. doi: 10.48550/arxiv.2409.11353. Published: 2024-09-17.DOI
  25. [26]Stephanie Lin, Jacob Hilton, and Owain Evans. Teaching models to express their uncertainty in words. Transactions on Machine Learning Research, 2022. ISSN 2835-8856. URL https://openreview.net/forum?id=8s8K2UZGTZ.arxiv.org/abs/2205.14334
  26. [27]Huan Ma, Jiadong Pan, Jing Liu, Yan Chen, Joey Tianyi Zhou, Guangyu Wang, Qinghua Hu, Hua Wu, Changqing Zhang, and Haifeng Wang. Semantic energy: Detecting llm hallucination beyond entropy. arXiv preprint arXiv:2508.14496, 2025.arxiv.org/abs/2508.14496
  27. [28]P. Massart. The tight constant in the Dvoretzky-Kiefer-Wolfowitz inequality. Ann. Probab., 18(3):1269–1283, 1990.DOI
  28. [29]Justus Mattern, Sami Jaghouar, Manveer Basra, Jannik Straube, Matthew Di Ferrante, Felix Gabriel, Jack Min Ong, Vincent Weisser, and Johannes Hagemann. Synthetic-1: Two million collaboratively generated reasoning traces from deepseek-r1, 2025. URL https://www.primeintellect.ai/blog/synthetic-1-release.
  29. [30]Niels Mündler, Jingxuan He, and Martin Vechev. Self-contradictory hallucinations of large language models: Evaluation, detection and mitigation. arXiv preprint arXiv:2305.15852, 2023. doi: 10.48550/arXiv.2305.15852. Published: 2023-05-25.
  30. [31]Michael Naaman. On the tight constant in the multivariate dvoretzky–kiefer–wolfowitz inequality. Statistics & Probability Letters, 173:109088, 2021.DOI
  31. [32]Maziyar Panahi. Medical-reasoning-sft-gpt-oss-120b datasets/OpenMed/Medical-Reasoning-SFT-GPT-OSS-120B. https://huggingface.co/datasets/OpenMed/Medical-Reasoning-SFT-GPT-OSS-120B, 2025. Hugging Face Dataset.
  32. [33]Qwen Team. Qwen3 technical report, 2025. URL https://arxiv.org/abs/2505.09388.
  33. [34]Qwen Team. Qwen3.5: Towards native multimodal agents, February 2026. URL https://qwen.ai/blog?id=qwen3.5.
  34. [35]Murray Rosenblatt. A central limit theorem and a strong mixing condition. Proceedings of the national Academy of Sciences, 42(1):43–47, 1956.pubmed.ncbi.nlm.nih.gov/16589813
  35. [36]Andrew Sellergren, Chufan Gao, Fershteh Mahvar, Timo Kohlberger, Fayaz Jamil, Madeleine Traverse, Alberto Tono, Bashir Sadjad, Lin Yang, et al. Medgemma 1.5 technical report. arXiv preprint arXiv:2604.05081, 2026.
  36. [37]Adi Simhi, Jonathan Herzig, Idan Szpektor, and Yonatan Belinkov. Constructing benchmarks and interventions for combating hallucinations in llms. arXiv preprint arXiv:2404.09971, 2024. doi: 10.48550/arxiv.2404.09971. Published: 2024-04-15.DOI
  37. [38]Linwei Tao, Yi-Fan Yeh, Minjing Dong, Tao Huang, Philip Torr, and Chang Xu. Revisiting uncertainty estimation and calibration of large language models. arXiv preprint arXiv:2505.23854, 2025.arxiv.org/abs/2505.23854
  38. [39]Qwen Team. Qwen2.5: A party of foundation models, September 2024. URL https://qwenlm.github.io/blog/qwen2.5/.
  39. [40]Hasimah Ibrahim Teo and Amilah Shari. Enhance fake review detection: A hybrid approach of implicit absa and imbalanced dataset handling. Journal of Theoretical and Applied Information Technology, 103(13), 2025.
  40. [41]Neeraj Varshney. A stitch in time saves nine: Detecting and mitigating hallucinations of llms by validating low-confidence generation. arXiv preprint arXiv:2307.03987, 2023. doi: 10.48550/arxiv.2307.03987. Published: 2023-07-08.DOI
  41. [42]Hongbin Ye, Tong Liu, Aijia Zhang, Wei Hua, and Weiqiang Jia. Cognitive mirage: A review of hallucinations in large language models. arXiv preprint arXiv:2309.06794, 2023. doi: 10.48550/arxiv.2309.06794.DOI
  42. [43]Ryozo Yokoyama. Moment bounds for stationary mixing sequences. Zeitschrift für Wahrscheinlichkeitstheorie und verwandte Gebiete, 52(1):45–57, 1980.DOI
  43. [44]Weizhe Yuan, Graham Neubig, and Pengfei Liu. Bartscore: Evaluating generated text as text generation. Advances in neural information processing systems, 34:27263–27277, 2021.arxiv.org/abs/2106.11520
  44. [45]Tal Zeevi, Rajesh Venkataraman, Lawrence H Staib, and John A Onofrey. Monte-carlo frequency dropout for predictive uncertainty estimation in deep learning. In 2024 IEEE International Symposium on Biomedical Imaging (ISBI), pp. 1–5. IEEE, 2024.DOI
  45. [46]Yue Zhang, Yafu Li, Leyang Cui, Deng Li Cai, and Lemao Liu. Siren’s song in the ai ocean: A survey on hallucination in large language models. arXiv preprint arXiv:2309.01219, 2023. doi: 10.48550/arxiv.2309.01219. Published: 2023-09-03.arxiv.org/abs/2309.01219
  46. [47]Yue Zhang, Yafu Li, Leyang Cui, Cai Deng, and Lemao Liu. Siren’s song in the ai ocean: A survey on hallucination in large language models. Computational Linguistics, 2025. doi: 10.1162/coli_a_16. Published: 2025-07-07.arxiv.org/abs/2309.01219
  47. [48]Chujie Zheng, Zhenru Zhang, Beichen Zhang, Runji Li, Keming Lu, Bowen Yu, Dayiheng Liu, Jingren Zhou, and Junyang Lin. Processbench: Identifying process errors in mathematical reasoning. In The 63rd Annual Meeting of the Association for Computational Linguistics, 2025.arxiv.org/abs/2412.06559

Paper details

vlnc:W_pjy2t7e9
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 7

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

generative AI tools

View statement
Looking for related papers…
Contents