cs.LGApr 10, 2026

Uncertainty-Aware Transformers: Conformal Prediction for Language Models

Authors: Abhiram Vellore, Niraj K. Jha

Organizations: Department of Electrical and Computer Engineering, Princeton University

Abstract

Transformers have had a profound impact on the field of artificial intelligence, especially on large language models and their variants. However, as was the case with neural networks, their black-box nature limits trust and deployment in high-stakes settings. For models to be genuinely useful and trustworthy in critical applications, they must provide more than just predictions: they must supply users with a clear understanding of the reasoning that underpins their decisions. This article presents an uncertainty quantification framework for transformer-based language models. This framework, called CONFIDE (CONformal prediction for FIne-tuned DEep language models), applies conformal prediction to the internal embeddings of encoder-only architectures, like BERT and RoBERTa, while enabling hyperparameter tuning. CONFIDE uses either [CLS] token embeddings or flattened hidden states to construct class-conditional nonconformity scores, enabling statistically valid prediction sets with instance-level explanations. Empirically, CONFIDE improves test accuracy by up to 4.09% on BERT-tiny and achieves greater correct efficiency (i.e., the expected size of the prediction set conditioned on it containing the true label) compared to prior methods, including NM2 and VanillaNN. We show that early and intermediate transformer layers often yield better-calibrated and more semantically meaningful representations for conformal prediction. In resource-constrained models and high-stakes tasks with ambiguous labels, CONFIDE offers robustness and interpretability where softmax-based uncertainty fails. We position CONFIDE as a framework for practical diagnostic and efficiency/robustness improvement over prior conformal baselines.

Figures & tables

Appendix figures & tables30 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. Beyond Surface Statistics: Robust Conformal Prediction for LLMs via Internal Representations

    Apr 17, 2026Yanli Wang, Peng Kuang, Xiaoyu Han +2Confidence Estimation in Language ModelsConformal Prediction

  2. U-Space: Uncovering When and Why Uncertainty Arises in Language Models

    Oct 6, 2026Tobias Braun, Nils Loose, Alexander Herzog +4LLM Uncertainty EstimationConfidence Estimation in Language Models

  3. Improved Confidence Estimates for Black-Box Large Language Models

    Aug 19, 2026Sokhna Diarra Mbacke, Mouloud Belbahri, Gabriel Loaiza-GanemConfidence Estimation in Language ModelsLLM Uncertainty Estimation