Transformer attention is reinterpreted as Gaussian process inference, enabling uncertainty calibration but with high computational cost. This work proposes approximating the attention kernel with random Fourier features, reducing the complexity from cubic or quadratic in sequence length to linear.
The resulting RFF-GPA module is plug-and-play, and also extends to a correlated variant that relaxes symmetry constraints. Evaluations on image and text classification, including under distribution shift, show that the method improves calibration while maintaining accuracy, and achieves better runtime and memory scaling.