Revisiting Kernel Attention with Correlated Gaussian Process Representation

Long Minh Bui, Tho Tran Huu, Duy Dinh, Tan Minh Nguyen, Trong Nghia Hoang
2/27/2025
18 citations
cs.LGcs.AI
transformer-attentionbayesian

Official code: MinhLong210/CGP-Transformers (3 stars, Python, last commit 2024-10-26).

Abstract

Transformers have increasingly become the de facto method to model sequential data with state-of-the-art performance. Due to its widespread use, being able to estimate and calibrate its modeling uncertainty is important to understand and design robust transformer models.

Show full abstract

To achieve this, previous works have used Gaussian processes (GPs) to perform uncertainty calibration for the attention units of transformers and attained notable successes. However, such approaches have to confine the transformers to the space of symmetric attention to ensure the necessary symmetric requirement of their GP's kernel specification, which reduces the representation capacity of the model. To mitigate this restriction, we propose the Correlated Gaussian Process Transformer (CGPT), a new class of transformers whose self-attention units are modeled as cross-covariance between two correlated GPs (CGPs). This allows asymmetries in attention and can enhance the representation capacity of GP-based transformers. We also derive a sparse approximation for CGP to make it scale better. Our empirical studies show that both CGP-based and sparse CGP-based transformers achieve better performance than state-of-the-art GP-based transformers on a variety of benchmark tasks. The code for our experiments is available at https://github.com/MinhLong210/CGP-Transformers.

View on arXivView PDF

Code Implementations(1)

Code for the UAI 2024 paper "Revisiting Kernel Attention with Correlated Gaussian Process Representation"

30Python, ShellOct 26, 20242 years ago

Similar Papers

Cite this paper

@article{bui2025revisiting,
  title  = {Revisiting Kernel Attention with Correlated Gaussian Process Representation},
  author = {Long Minh Bui and Tho Tran Huu and Duy Dinh and Tan Minh Nguyen and Trong Nghia Hoang},
  year   = {2025},
  eprint = {2502.20525},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2502.20525v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2502.20525.svg)](https://codeofpaper.com/paper/2502.20525)

Discussion