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

summary

Video file (mp4)

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

In short

EGKE is a method for detecting hallucinations in Large Language Models by replacing Natural Language Inference (NLI) with a Radial Basis Function (RBF) kernel applied to dense sentence embeddings. It computes pairwise response similarities directly in embedding space, creating a symmetric graph structure. This structure is then used to calculate the von Neumann entropy of a heat kernel, providing a computationally efficient and consistent way to measure semantic uncertainty.

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 used across episodes

This episode discusses

The paper

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

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

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.

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.

More episodes

← Home