Calibrating Scientific Foundation Models with Inference-Time Stochastic Attention

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Yadav, Akash, Adebiyi, Taiwo A., Zhang, Ruda
Format: Preprint
Published: 2026
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866911671472095232
author Yadav, Akash
Adebiyi, Taiwo A.
Zhang, Ruda
author_facet Yadav, Akash
Adebiyi, Taiwo A.
Zhang, Ruda
contents Transformer-based scientific foundation models are increasingly deployed in high-stakes settings, but current architectures give deterministic outputs and provide limited support for calibrated predictive uncertainty. We propose Stochastic Attention, a sample average lightweight inference-time modification that randomizes attention by replacing softmax weights with normalized multinomial samples controlled by a single concentration parameter, and produces predictive ensembles without retraining. To set this parameter, we introduce a calibration objective that matches the stochastic attention output with the target, yielding an efficient univariate post-hoc tuning problem. We evaluate this mechanism on scientific foundation models for weather and time-series forecasting, as well as several regression tasks. Across benchmarks against uncertainty-aware baselines, we find that Sample Average Stochastic Attention achieves the strongest native calibration and the sharpest prediction intervals at comparable calibration, with adaptation costs nearly three orders of magnitude lower than the next-best baseline.
format Preprint
id arxiv_https___arxiv_org_abs_2604_19530
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle Calibrating Scientific Foundation Models with Inference-Time Stochastic Attention
Yadav, Akash
Adebiyi, Taiwo A.
Zhang, Ruda
Machine Learning
Computational Engineering, Finance, and Science
Transformer-based scientific foundation models are increasingly deployed in high-stakes settings, but current architectures give deterministic outputs and provide limited support for calibrated predictive uncertainty. We propose Stochastic Attention, a sample average lightweight inference-time modification that randomizes attention by replacing softmax weights with normalized multinomial samples controlled by a single concentration parameter, and produces predictive ensembles without retraining. To set this parameter, we introduce a calibration objective that matches the stochastic attention output with the target, yielding an efficient univariate post-hoc tuning problem. We evaluate this mechanism on scientific foundation models for weather and time-series forecasting, as well as several regression tasks. Across benchmarks against uncertainty-aware baselines, we find that Sample Average Stochastic Attention achieves the strongest native calibration and the sharpest prediction intervals at comparable calibration, with adaptation costs nearly three orders of magnitude lower than the next-best baseline.
title Calibrating Scientific Foundation Models with Inference-Time Stochastic Attention
topic Machine Learning
Computational Engineering, Finance, and Science
url https://arxiv.org/abs/2604.19530