Embedding Graph Kernel Entropy (EGKE): Fine-grained Hallucination Detection for LLMs from Embeddings

arXiv:2610.14214 · cs.LG · Submitted 2026-10-09 · Read on arXiv

Listen

Radio episode about this paper

Transcript

Introduction to the show: ident: AI Radio. Generated commentary on the latest Artificial Intelligence papers.

Tom: I'm Tom.

Jane: And I'm Jane, here with Lu, Meng and our in-house large language model, Lalam.

Tom: Today's paper: "Embedding Graph Kernel Entropy (EGKE)".

Jane: The gist:

Tom: First, who's behind it and why it matters.

Title and authors: Tom: So we're talking about this paper today, "Embedding Graph Kernel Entropy (EGKE): Fine-grained Hallucination Detection for LLMs from Embeddings." It sounds a bit dense, but basically, it’s a new way to spot when an AI is making things up.

Jane: It looks like they are taking existing ideas from Kernel Language Entropy, or KLE, and changing how they measure that semantic similarity. The authors are Dilrangi Sankalpana and Pragatheeswaran Vipulanandan and Uthayasanker Thayasivam.

Lu: What's interesting is that instead of relying on a separate Natural Language Inference model to figure out if two responses entail each other, this method uses a Radial Basis Function kernel applied directly to the dense sentence embeddings generated by a BGE embedding model.

Meng: So it’s moving away from needing that extra NLI classifier for every pair of responses, which sounds like it would save a lot on compute time when you're dealing with large batches.

Lalam: I see they are replacing the discrete semantic clusters with a continuous similarity structure in their approach, which they call Kernel Language Entropy.

Tom: Exactly. So what this means for us is that instead of needing that separate NLI model to tell us if response A entails response B, we just compute a direct similarity score between their embeddings in a continuous space.

Jane: That sounds like a big shift from relying on those discrete cluster memberships, which the paper mentions as an issue with Semantic Entropy.

Lu: They are constructing a weighted semantic graph where the edge weights are based on pairwise semantic similarity scores derived from these embedding models, and then they derive a kernel matrix from that graph Laplacian.

Meng: And they estimate the final uncertainty using the von Neumann entropy of this resulting kernel, which is what they call EGKE.

The paper's summary: Tom: So to summarize what this paper is proposing with Embedding Graph Kernel Entropy, they are building a pipeline that goes from response preprocessing to a semantic uncertainty estimate. They take the generated responses and convert them into dense vectors using the BGE model first.

Jane: Then they build a fully connected weighted graph based on those embeddings, where each edge weight is determined by an exponential function involving the distance between the embedding vectors squared over two sigma squared.

Lu: This creates a RBF graph, which means it's fully connected, giving a smooth and globally consistent characterization of semantic relationships across all response pairs.

Meng: And then they compute the graph Laplacian L equals D minus W, where W is the weight matrix with those exponential similarity scores and D is the diagonal degree matrix.

Tom: From there they derive a heat kernel Kt which is essentially the matrix exponential of that scaled Laplacian, K t equals e to minus tL.

Jane: And finally, they normalize that heat kernel to get K hat where they estimate the semantic uncertainty using the von Neumann entropy of this normalized kernel, EGKE(K hat) equals negative sum i lambda i log lambda i.

Lalam: The key idea here is that instead of just looking at token sequences directly, they are focusing on semantic uncertainty computed over this heat-kernel representation to better distinguish genuine semantic disagreement from simple paraphrasing.

Lu: They state that the responses generated by the LLM are embedded using BGE model, transformed into an RBF-weighted graph, and then converted into a normalized heat kernel whose von Neumann entropy is used as the semantic uncertainty estimate, which is what they call EGKE(K hat) = negative sum i lambda i log lambda i (eigen decomposition).

Tom: So the core idea is this continuous similarity structure lets them see uncertainty in a different way than token-level measures.

The paper's improvements: Jane: So, where does EGKE actually improve things compared to what was already out there? The authors focus on three main areas of improvement.

Tom: First up is the removal of dependency on NLI models like DeBERTa for semantic comparison. They replace that pairwise entailment inference with an embedding-based semantic similarity mechanism using BGE representations and an RBF kernel, which they say is symmetric.

Lu: That symmetry is important because it avoids the asymmetric relation scores you get from pairwise entailment inference, where you have to run a separate cross evaluation for every response pair.

Meng: And second, they focus on the graph construction itself—they build a fully connected semantic graph from embedding-based response similarities and derive a heat kernel representation over that graph.

Jane: That gives them this continuous and globally consistent characterization of semantic relationships between the generated responses, which is better than just looking at sparse graphs based only on entailment.

Tom: Third is the uncertainty estimation itself—they use von Neumann entropy computed over the resulting heat kernel to estimate semantic uncertainty directly from the graph structure, which enables confabulation detection based on these semantic relationships.

Lu: They also found that the optimal RBF bandwidth sigma equals zero point one was consistently optimal across all their experiments for this method.

Tom: And they showed it performs very well, achieving the highest average AUROC of zero point seven nine three and AUARC of zero point five five three across all thirty model-dataset settings on five different question-answering benchmarks and six open-weight LLMs, according to the experimental results section.

Conclusion: Jane: So wrapping up this discussion on Embedding Graph Kernel Entropy, what is the main message for us? They are proposing a method that replaces NLI-based pairwise similarity estimation with an RBF kernel over dense sentence embeddings for hallucination detection.

Tom: It’s about making that process more efficient by encoding all responses to a question in a single batched forward pass and computing similarities in closed form from Euclidean distances.

Lu: So they show that this symmetric, continuously graded similarity structure is sufficient to construct a semantic graph that captures meaningful disagreement among sampled responses without the computational overhead of running a separately loaded cross-encoder over every response pair.

Meng: From my side, I’d say the uncertainty estimate using EGKE is powerful because it gives us a way to score confabulation directly from those semantic relationships encoded within the response graph.

Lalam: It shows that embedding-based similarity is a viable substitute for NLI, and their method achieves the highest average AUROC of zero point seven nine three and AUARC of zero point five five three across all compared methods, outperforming KLE in twenty-four out of thirty scenarios on AUROC and twenty-two out of thirty on AUARC.

Tom: So the authors are showing that this method is robust, even when you compare it against other semantic baselines like SE and DSE across datasets and models.

Jane: It’s a solid development in using embedding-based methods to detect hallucination, moving away from needing expensive external classifiers for every comparison.

Lu: For future work, they admit that the method relies heavily on the quality of the BGE embedding model as a proxy for semantic similarity, and they also note that for highly specialized domains like biomedical QA, a general-purpose sentence encoder might not capture those relationships as reliably as an NLI model fine-tuned on in-domain data.

Meng: And they mention that the RBF kernel introduces the hyperparameter sigma, which while consistent at zero point one, it might need tuning for new domains or model families.

Tom: So to put it plainly, this Embedding Graph Kernel Entropy paper is a solid way to get a symmetric measure of semantic disagreement without running expensive cross-encoder checks on every response pair.

Dilrangi Sankalpana, Pragatheeswaran Vipulanandan, Uthayasanker Thayasivam, Kamal Premaratne

Department of Computer Science and Engineering, University of Moratuwa · Department of Electrical and Computer Engineering, University of Miami

cs.LG

Submitted: 2026-10-09

Updated: 2026-10-09

Comments: Accepted for ICKG 2026

Code: https://github.com/Dilrangi-Sankalpana/Embedding-Graph-Kernel-Entropy

License: http://creativecommons.org/publicdomain/zero/1.0/

Importance score: 81/100

The gist: The gist: Embedding Graph Kernel Entropy (EGKE) proposes a variant of Kernel Language Entropy (KLE) that replaces its Natural Language Inference (NLI)-derived semantic graph with a Radial Basis

Key concepts

Kernel Language Entropy (KLE)
KLE is the original framework that uses semantic graphs to detect hallucinations. EGKE is an improved variant that replaces KLE's NLI-based graph construction with a method based on RBF kernels applied directly to sentence embeddings, aiming for better performance and efficiency.
Radial Basis Function (RBF) Kernel
The RBF kernel measures the similarity between two sentence embeddings based on their Euclidean distance. It creates a fully connected graph where edge weights smoothly decrease as the distance between response vectors increases, providing a continuous similarity structure instead of sparse NLI edges.
Von Neumann Entropy
This is a mathematical measure used to quantify uncertainty within the semantic kernel representation. By calculating the entropy of the heat kernel derived from the RBF graph, EGKE estimates how uncertain or inconsistent the model's generated responses are, which indicates potential hallucination.

Terminology

Summary

The gist: Embedding Graph Kernel Entropy (EGKE) proposes a variant of Kernel Language Entropy (KLE) that replaces its Natural Language Inference (NLI)-derived semantic graph with a Radial Basis Function (RBF) kernel applied to dense sentence embeddings, offering a symmetric and computationally efficient alternative for fine-grained hallucination detection in Large Language Models.

How it works

The proposed method addresses the computational overhead of NLI-based semantic comparison by replacing it with direct similarity computation in a continuous embedding space Embedding Graph Kernel Entropy (EGKE), a variant of Kernel Language Entropy (KLE) that replaces its NLI-derived semantic graph with a Radial Basis Function (RBF) kernel applied to dense sentence embeddings generated by a BGE embedding model, while retaining KLE’s graph Laplacian, heat kernel, and von Neumann entropy formulation unchanged By computing similarities directly in a continuous embedding space, the proposed method provides a symmetric and computationally efficient alternative to NLI-based semantic comparison.

The methodology involves four main stages for estimating semantic uncertainty

(Response preprocessing)

Generated responses often differ in capitalization, punctuation, or other superficial lexical characteristics that do not alter their semantic meaning, so each response is normalized by converting all text to lowercase and removing punctuation. Since many question-answer datasets contain short answers whose meanings depend heavily on the associated question, the question is concatenated with the cleaned response before encoding.

(Sentence embedding generation)

Each preprocessed response s˜i is transformed into a dense semantic vector using the pretrained embedding model BAAI/bge-large-en-v1.5 [16]. All responses corresponding to a question are encoded in a single batch, producing an embedding matrix E = [e1,..., en] T ∈ R n×d, where ei ∈ R d represents the embedding of response si and d is the embedding dimension.

(RBF similarity graph construction)

A fully connected weighted graph G = (V, E) is constructed over the n responses, where each pair of nodes (i, j) is connected by an edge with weight wij = exp − ei − ej2 / 2σ2. The squared Euclidean distance ei − ej2 is computed directly from the embedding tensors, and the resulting weight lies in (0, 1], attaining its maximum value of 1 when two responses are identical in embedding space and decaying toward 0 as they diverge. Unlike the NLI-based approach, which produces a sparse graph (edges only where entailment is detected), the RBF graph is fully connected, providing a smooth and globally consistent similarity structure over all response pairs.

(Heat kernel and von Neumann entropy computation)

Given the RBF-weighted graph G, the graph Laplacian is computed as L = D − W, where W is the weight matrix with entries Wij = wij and D is the diagonal degree matrix with Dii = P Σj Wij. The heat kernel is then derived as the matrix exponential of the scaled Laplacian Kt = e − tL, where t is a diffusion length-scale parameter. The kernel is then normalised to unit trace via Kˆij = p Kij / (Kii · Kjj · 1n). Embedding Graph Kernel Entropy (EGKE) is defined as the von Neumann entropy of this semantic kernel, EGKE(Kˆ) = −Σi λi log λi.

Contributions

The main contributions of this work are as follows

(NLI removal)

We remove the dependency on NLI, such as DeBERTa, based inference stage with an embedding-based semantic similarity mechanism using BGE representations and an RBF kernel. Unlike pairwise entailment inference, which requires a separate cross evaluation for each response pair and produces asymmetric relation scores, the proposed approach computes similarities directly in embedding space, yielding a symmetric similarity measure.

(Graph construction)

We construct a fully connected semantic graph from embedding-based response similarities and derive a heat kernel representation over the graph. This provides a continuous and globally consistent characterization of semantic relationships between generated responses.

(Uncertainty estimation)

Semantic uncertainty is estimated using von Neumann entropy computed over the resulting heat-kernel representation. This enables confabulation detection directly from semantic relationships encoded within the response graph.

Experimental Results

The proposed method is evaluated across 30 experimental setups—covering multiple question-answer datasets and open-weight LLM families—on both AUROC and AUARC. The evaluation utilized five question-answering benchmarks spanning distinct domains: TriviaQA [17], SQuAD [18], Natural Questions (NQ) [19], SVAMP [20], and BioASQ [21]. Experiments were conducted on six open-weight LLMs, including Falcon-7B and LLaMA2-7B. The evaluation metrics reported are AUROC and AUARC.

Discussion

Embedding-based similarity is a viable substitute for NLI Our method achieves the highest average AUROC (0.793) and AUARC (0.553) across all 30 model–dataset settings, outperforming all compared baselines in aggregate. It also wins against most baselines in the majority of settings, with particularly strong gains over probabilistic baselines such as P(True) and ER, while remaining competitive with semantic baselines such as SE and DSE across datasets and models. A symmetric, distance-based measure in embedding space is therefore sufficient to construct a semantic graph that captures meaningful disagreement among sampled responses, while avoiding the computational overhead of running a separately loaded cross-encoder over every response pair. The RBF bandwidth σ = 0.1 is consistently optimal. A small σ is therefore better able to distinguish these two regimes by assigning near-zero weight to all but the closest response pairs.

Limitations

The proposed method relies on the quality of the BGE embedding mode as a proxy for semantic similarity. For highly specialised domains such as biomedical QA, a general-purpose sentence encoder may not capture domainspecific semantic relationships as reliably as an NLI model fine-tuned on in-domain data. Additionally, the RBF kernel introduces a hyperparameter σ that, while consistent across our experiments, may require tuning for new domains or model families. Unlike the entropy convergence plots proposed in [6] for the heat kernel, no analogous principled selection criterion currently exists for the RBF bandwidth in this setting.

Conclusion

We proposed an embedding-based hallucination detection method, a variant of Kernel Language Entropy (KLE) [6] that replaces NLI-based pairwise similarity estimation with an RBF kernel over dense sentence embeddings. Rather than running a cross-encoder for every pair of sampled responses, all responses to a question are encoded in a single batched forward pass, and pairwise similarities are computed in closed form from Euclidean distances in embedding space. This produces a symmetric, continuously graded similarity structure that is fed directly into a graph Laplacian, heat kernel, and von Neumann entropy pipeline for hallucination scoring. Evaluated across 30 experimental scenarios spanning five QA benchmarks and six open-weight LLMs, our method achieves the highest average AUROC and AUARC among all compared methods, outperforming the KLE in 24 of 30 scenarios on AUROC and 22 of 30 on AUARC, and dominating token-level and self-assessment baselines in the large majority of scenarios <ref:

Improvements for AI systems

  1. Bold semantic uncertainty estimation using EGKE: The system can estimate semantic uncertainty by computing von Neumann entropy of this semantic kernel, which is defined as EGKE(Kˆ) = −X i λ i log λ i. This provides a measure of whether the model's generated responses are semantically concentrated with low semantic uncertainty or show a more uniformly distributed eigenspectrum, reflecting greater semantic diversity among generated responses and therefore higher semantic uncertainty.

  2. Replace NLI dependency with continuous similarity: The system can compute pairwise similarities by using an RBF kernel applied to dense sentence embeddings generated by a BGE embedding model, which is described as providing a symmetric and computationally efficient alternative to NLI-based semantic comparison. This avoids the overhead of running a separate cross-encoder forward pass for every response pair.

  3. Leverage batched encoding for efficiency: The system can encode all responses corresponding to a question in a single batch, producing an embedding matrix E = [e1,..., en] (3), allowing pairwise distances are computed in closed form rather than relying on sequential inference.

  4. Optimize similarity weighting via bandwidth selection: The system can dynamically select the RBF bandwidth parameter σ, noting that the optimal bandwidth is dataset and model dependent, and using the result from Table I showing that σ = 0.1 consistently achieved the highest average performance.

  5. Improve selective prediction behavior: The system's uncertainty estimate can be used to achieve stronger selective prediction behavior compared to baselines, as shown by its superior AUARC win rate against Semantic Entropy (SE), which is noted as achieving a higher AUARC win rate without SE’s DeBERTa-based NLI component.

Abstract

Hallucination detection is critical for ensuring the reliability of Large Language Models (LLMs) in real-world deployments. While recent works, such as Semantic Entropy (SE) and Kernel Language Entropy (KLE), identify hallucinations by measuring semantic disagreement across multiple generated responses using Natural Language Inference (NLI) models, these methods depend on separately loaded NLI classifiers to estimate pairwise semantic similarity, introducing significant computational overhead. We propose Embedding Graph Kernel Entropy (EGKE), a variant of Kernel Language Entropy (KLE) that replaces its NLI-derived semantic graph with a Radial Basis Function (RBF) kernel applied to dense sentence embeddings generated by a BGE embedding model, while retaining KLE's graph Laplacian, heat kernel, and von Neumann entropy formulation unchanged. By computing similarities directly in a continuous embedding space, the proposed method provides a symmetric and computationally efficient alternative to NLI-based semantic comparison. We evaluate our approach across 30 experimental setups (covering multiple question-answer datasets and open-weight LLM families) using both AUROC and AUARC, and demonstrate that this RBF-based method achieves competitive hallucination detection performance against state-of-the-art methods.

Sources

Related papers