English

Calibrating Transformers via Sparse Gaussian Processes

Machine Learning 2025-09-11 v4 Machine Learning

Abstract

Transformer models have achieved profound success in prediction tasks in a wide range of applications in natural language processing, speech recognition and computer vision. Extending Transformer's success to safety-critical domains requires calibrated uncertainty estimation which remains under-explored. To address this, we propose Sparse Gaussian Process attention (SGPA), which performs Bayesian inference directly in the output space of multi-head attention blocks (MHAs) in transformer to calibrate its uncertainty. It replaces the scaled dot-product operation with a valid symmetric kernel and uses sparse Gaussian processes (SGP) techniques to approximate the posterior processes of MHA outputs. Empirically, on a suite of prediction tasks on text, images and graphs, SGPA-based Transformers achieve competitive predictive accuracy, while noticeably improving both in-distribution calibration and out-of-distribution robustness and detection.

Keywords

Cite

@article{arxiv.2303.02444,
  title  = {Calibrating Transformers via Sparse Gaussian Processes},
  author = {Wenlong Chen and Yingzhen Li},
  journal= {arXiv preprint arXiv:2303.02444},
  year   = {2025}
}

Comments

Published at The Eleventh International Conference on Learning Representations (ICLR 2023). ECE updated, typo fixed

R2 v1 2026-06-28T09:01:26.702Z