arXiv

Gradients with Respect to Semantics Preserving Embeddings Tell the Uncertainty of Large Language Models

Title: Uncertainty in Large Language Models Revealed by Gradients of Semantics-Preserving Embeddings

Abstract:

Given the propensity of Large Language Models (LLMs) to generate hallucinations, Uncertainty Quantification (UQ) serves as a critical mechanism for establishing their reliability. Current leading UQ techniques for free-form generation depend extensively on sampling, a process that introduces significant computational overhead and variance. To address these limitations, we introduce SemGrad, the inaugural gradient-based UQ approach for free-form generation that operates without sampling, thereby ensuring computational efficiency. While previous gradient-based methods tailored for classification tasks function within parameter space, our approach shifts the focus to semantic space. This strategy is grounded in the premise that a highly confident LLM will produce consistent output distributions even when subjected to input perturbations that are semantically equivalent. We define this stability through gradients in semantic space and develop a Semantic Preservation Score (SPS) to pinpoint the embeddings that most accurately encapsulate semantic meaning, serving as the basis for gradient calculations. Additionally, we present HybridGrad, a method that integrates the advantages of SemGrad with those of parameter gradients. Our experimental results indicate that both proposed methods deliver efficient and robust uncertainty estimates, outperforming state-of-the-art alternatives, especially in scenarios involving multiple valid responses.


Source: arXiv Generated at: 2026-06-02 00:00:00 UTC

Related Articles

Law’s Billable Hour Is Being Shredded by AI
Bloomberg

Law’s Billable Hour Is Being Shredded by AI

AI is dismantling the billable hour by automating routine legal tasks. This technological shift threatens the traditiona...

Iran War: Trump Tries to Stop Israel’s Lebanon Push | The Opening Trade 6/2/2026
Bloomberg

Iran War: Trump Tries to Stop Israel’s Lebanon Push | The Opening Trade 6/2/2026

SoftBank in Early Talks to Back $800 Million Agile Robots Round
Bloomberg

SoftBank in Early Talks to Back $800 Million Agile Robots Round

SoftBank is in early talks to back Agile Robots’ $800 million funding round. The Japanese tech giant is currently in pre...

Amundi Is Diversifying Risk Via Commodity Currencies, Gold
Bloomberg

Amundi Is Diversifying Risk Via Commodity Currencies, Gold

Amundi diversifies risk by investing in commodity-linked currencies and gold. This strategy hedges against market volati...

Reuters

Marvell Technology surges after Nvidia's Huang calls it 'next trillion-dollar company'

Marvell Technology shares surged after Nvidia CEO Jensen Huang labeled the firm the “next trillion-dollar company.”

Russia Says It Found Foreign Spyware on Top Officials’ Phones
Bloomberg

Russia Says It Found Foreign Spyware on Top Officials’ Phones

Russia’s FSB claims to have discovered foreign spyware on senior officials’ phones. Moscow attributes the intrusion to h...