Confidence-Based Response Abstinence: Improving LLM Trustworthiness via Activation-Based Uncertainty Estimation

Zhiqi Huang, Vivek V. Datla, Chenyang Zhu, Alfy Samuel, Daben Liu, Anoop Kumar, Ritesh SoniarXiv 2025 · OpenReview

Abstract

We propose a method for confidence estimation in retrieval-augmented generation (RAG) systems that aligns closely with the correctness of large language model (LLM) outputs. Confidence estimation is especially critical in high-stakes domains such as finance and healthcare, where the cost of an incorrect answer outweighs that of not answering the question. Our approach extends prior uncertainty quantification methods by leveraging raw feed-forward network (FFN) activations as auto-regressive signals, avoiding the information loss inherent in token logits and probabilities after projection and softmax normalization. We model confidence prediction as a sequence classification task, and regularize training with a Huber loss term to improve robustness against noisy supervision. Applied in a real-world financial industry customer-support setting with complex knowledge bases, our method outperforms strong baselines and maintains high accuracy under strict latency constraints. Experiments on Llama 3.1 8B model show that using activations from only the 16th layer preserves accuracy while reducing response latency. Our results demonstrate that activation-based confidence modeling offers a scalable, architecture-aware path toward trustworthy RAG deployment.

Introduction

In high-stakes industries like finance or healthcare, a wrong answer from an AI is often far more damaging than no answer at all. While Retrieval-Augmented Generation (RAG) helps ground models in factual data, "epistemic uncertainty"—where the model’s internal knowledge conflicts with or misinterprets the provided context—still leads to hallucinations or incorrect responses.

Existing solutions for measuring model confidence usually fall into two camps: sampling-based methods, which are prohibitively slow for real-time production, and logit-based methods. However, the process of projecting internal states into a vocabulary and applying softmax normalization "squashes" the signal, losing the fine-grained nuances that indicate a model is "unsure." This paper introduces a "white-box" approach that is fast enough for production but deep enough to capture the model's internal state of confusion.

The Proposed Method

The core innovation is treating the raw activations of the Feed-Forward Network (FFN) layers as an auto-regressive signal for a secondary confidence model. This approach avoids the information loss inherent in the model's decoder head.

The integrated RAG pipeline featuring the Confidence Model and Controller for response abstinence.

As shown in the pipeline above, the system generates an answer and then passes internal signals to a Confidence Model. The resulting score is evaluated by a Controller to decide whether to show the answer or abstain.

Architecture of the Confidence Probe

Instead of looking at final word probabilities, we extract hidden state vectors from a specific transformer layer. These activations are fed into a lightweight Long Short-Term Memory (LSTM) network. The LSTM treats the sequence of activations corresponding to the generated answer as a time-series, learning to recognize patterns that correlate with "correct" vs. "incorrect" outputs.

Detailed architecture of the confidence model using FFN activations as input to an RNN/LSTM.

To handle the noise inherent in real-world data, we utilized a Huber loss function for training. This provides a more robust signal than standard Cross-Entropy loss by being less sensitive to outliers. If the confidence score from the LSTM falls below a certain threshold, the system triggers "abstinence," masking the response from the user to preserve trust.

Data and Evaluation

The study utilized a proprietary financial knowledge corpus consisting of 8.5k documents and approximately 45k chunks of procedures and complex instructions. The training data included thousands of "thumbs-up/down" interactions from support agents, further validated by Subject Matter Experts (SMEs) to ensure labels for correctness were grounded in the provided context.

Results and Discussion

The proposed method significantly outperformed industry-standard baselines, achieving an AUROC of 0.772, compared to 0.590 for Vectara’s HHEM and 0.663 for standard logit-based methods. By masking roughly 30% of responses, the system reached a precision of 0.95, meaning that when the system does choose to show an answer, it is correct 95% of the time.

Efficiency was a key finding: extracting activations from the 16th layer (the middle of the Llama 3.1 8B model) performed nearly as well as the 32nd (final) layer. This allows the confidence check to happen earlier in the compute pipeline, reducing latency by approximately 42%. Overall, the confidence estimation added only a small overhead (approx. 127ms), making it viable for live customer support environments.

Conclusion

Activation-based confidence modeling provides a robust, low-latency solution for improving LLM trustworthiness in RAG systems. While it requires "white-box" access to model weights, it offers a significant performance leap over black-box or logit-based alternatives. Future work may involve integrating this estimation directly into the generation process to enable mid-sentence abstinence, further optimizing compute resources.

Summary updated

BibTeX
@misc{huang2025confidence,
  author = {Zhiqi Huang and Vivek V. Datla and Chenyang Zhu and Alfy Samuel and Daben Liu and Anoop Kumar and Ritesh Soni},
  title = {{Confidence-Based Response Abstinence: Improving LLM Trustworthiness via Activation-Based Uncertainty Estimation}},
  year = {2025},
  eprint = {2510.13750},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.13750},
}
Figure