What Would Bayes Do
for Next-Gen Neural Network Design?
What Would Bayes Do
for Next-Gen Neural Network Design?


Yingzhen Li


Images by me (2019) & by Nano Banana 2 (gemini-3.1-flash-image, 2026)
pre-ChatGPT (- 2022)
AGI (when?)
What’s the Future of Bayesian Deep Learning?
1
Build network architectures
with Bayesian principles
Build Bayesian procedures
on frontier models
Many of you have contributed wonderful works in these developments ☺
In-context learning & predictive resampling

Agentic AI: Bayesian pipeline

Bayesian NNs: weight/function-space posterior inference

NN layer design with Bayesian principles
MLSys work needed
(mostly absent now!)
”Modernization” via ”Bayesian LoRA” (?)
What Can Bayes Say about NN Arch Design?
Entrée: Uncertainty quantification
Main: Memory updates & maintenance
2
Naoki Kiyohara
Harrison Bo Hua Zhu
Riccardo El Hassanin




Wenlong Chen
Work led by my amazing current/former PhD students
Idea 1: Leverage probabilistic models to improve the “reliability” of attention-based Transformers (e.g., ”reliable uncertainty”)
Sparse Gaussian Process Attention
- a Deep GP tailored to Transformer architectures
Chen and Li, ICLR 2023,
Calibrating Transformers via Sparse Gaussian Processes.
3
Wenlong Chen

Attention in Transformers

Vaswani et al. Attention is all you need. NeurIPS 2017
Tsai et al. Transformer dissection: A unified understanding for transformer’s attention via the lens of kernel. EMNLP 2019
•Single head attention
Attention matrix
•Replace attention matrix with kernel matrix:
4
Kernel Attention as the Mean of an SVGP
Kernel Attention:
Recall posterior mean of SVGP:
Equivalent by identifying:
q (queries) = x (queried input locations)
k (keys) = z (inducing locations)
v (values) = (variational parameters)
similarity between and

Chen and Li. Calibrating Transformers via Sparse Gaussian Processes. ICLR 2023
5
is a free-parameter, is invertible
=> Can optimize as a free-parameter
Adding Covariance Function to Transformer

Chen and Li. Calibrating Transformers via Sparse Gaussian Processes. ICLR 2023

6
Amortized Inference for Self-Attention

Chen and Li. Calibrating Transformers via Sparse Gaussian Processes. ICLR 2023

7


Computation Reduction for Self-Attention
Chen and Li. Calibrating Transformers via Sparse Gaussian Processes. ICLR 2023
Cheng and Boots. Variational Inference for Gaussian Process Models with Linear Complexity. NIPS 2017


8



Chen and Li. Calibrating Transformers via Sparse Gaussian Processes. ICLR 2023
9
OOD Detection

ViTs trained on CIFAR10
Reflections on SGPA
●Kernel attention = mean of SVGP
●So can think about how GP methods inspire memory design
●SGPA = Deep Sparse GP modernised with Transformer arch.
●So still fall in the traditional BNN category
●Evaluations on calibration & OOD detection
●Frequentist methods are computationally simpler and competitive here

Chen and Li. Calibrating Transformers via Sparse Gaussian Processes. ICLR 2023
10
Idea 2:
Exploit the kernel interpretation of attention;
Introduce interdomain methods for ”memory maintenance”
Interdomain Attention
– a hybrid attention that implicitly approximate attention with recurrent memory
Kiyohara et al., In submission,
Interdomain Attention:
Beyond Token-Level Key-Value Memory.
11
Naoki Kiyohara
Harrison Bo Hua Zhu
Riccardo El Hassanin




Wenlong Chen
KV Cache 101
12
1. Prefill (parallel compute)
-Use the last output token as input
-Read from KV cache for
-Compute and write in KV cache, and compute with query , :
-The output propagates and leads to generated token
2. Decode (sequential compute)
LLM “inference” compute in two stages:
-User provides prompt token sequence
-Compute in parallel
-Cache as memory (KV cache)

Growing memory size…
A New Type of Memory
13
Consider approximating kernel as dot-product of features
The output of the attention procedure (with query ):
Idea in a nutshell:
Step 1: Construct memory for
Step 2: “reconstruct” from the memory
Step 3: Plug-in the “reconstructions” to perform attention
Steps 2 & 3 can be done together!
(no explicit reconstruction & attention)




Kiyohara et al. Interdomain Attention: Beyond Token-Level Key-Value Memory. In submission
A New Type of Memory
14
Key idea: function projection as memory
Step 1.1. Treat the keys and values as functions of time
Step 1.2. Project key features and values onto a set of basis functions :
Step 2 + 3 (virtual): Reconstruct the key features
+ perform attention (assume we have the values )
discretized sum (up to const.)
reconstruct




Kiyohara et al. Interdomain Attention: Beyond Token-Level Key-Value Memory. In submission
A New Type of Memory
15
Key idea: function projection as memory
Step 1.1. Treat the keys and values as functions of time
Step 1.2. Project key features and values onto a set of basis functions :
Step 2 + 3 (virtual): Reconstruct the key features
+ perform attention (denominator, optional)
discretized sum (up to const.)
reconstruct




Kiyohara et al. Interdomain Attention: Beyond Token-Level Key-Value Memory. In submission
A New Type of Memory
16
Key idea: function projection as memory
Step 1.1. Treat the keys and values as functions of time
Step 1.2. Project key features and values onto a set of basis functions :
Step 2 + 3: Implement reconstruction + approximate attention in one go!
query features
“KV” memory
Helper terms




Kiyohara et al. Interdomain Attention: Beyond Token-Level Key-Value Memory. In submission
Connection to Interdomain Inducing Points in SVGPs
Lázaro-Gredilla and Figueiras-Vidal. Inter-domain Gaussian Processes for Sparse Inference using Inducing Features. NIPS 2009
17
How to construct this function projection in an online manner?
SVGP approximate posterior mean:
is a free-parameter, is invertible
=> Can optimize as a free-parameter
Interdomain inducing points: projections on orthogonal basis functions:
(RFF approx.)
Plug-in to the mean computation, with :
(reconstruct )
()
(rewrite matrix-vector product)
HiPPO - An Online Representation of Sequential Data
Legendre polynomial
“Memorising” a function via projection to finite basis:
u – coefficients of projected to
-Can be viewed as a finite-dim memory for a function (infinite-dim object)
18

Fig: wikipedia
Gu et al. Recurrent Memory with Optimal Polynomial Projections. NeurIPS 2020

HiPPO - An Online Representation of Sequential Data
“Memorising” a function via projection to finite basis:
– coefficients of projected to
Rescaled Legendre polynomial
0
t
1/t
0
-Can be viewed as a finite-dim memory for a function (infinite-dim object)
-Memory “evolves” when increases!
19
Gu et al. Recurrent Memory with Optimal Polynomial Projections. NeurIPS 2020
•: -th coefficient
•: Target function for
•: Normalised & scaled -th basis
•: Normalised measure (mask)
HiPPO - An Online Representation of Sequential Data
20
20
Gu et al. Recurrent Memory with Optimal Polynomial Projections. NeurIPS 2020
The evolution of over time follows linear ODE:
We can obtain the coefficients
as a summary of the function up to time t in an online manner.
Input sequence to memorize
Specific matrix and vector corresponding to function basis and measure
Gu et al. Recurrent Memory with Optimal Polynomial Projections. NeurIPS 2020
HiPPO - An Online Representation of Sequential Data
21
Gu et al. Recurrent Memory with Optimal Polynomial Projections. NeurIPS 2020
HiPPO - An Online Representation of Sequential Data
22
Interlude: Recurrent Memory for GPs!



23

Chen et al. Recurrent Memory for Online Interdomain Gaussian Processes. NeurIPS 2025
Interlude: Recurrent Memory for GPs!



24
Chen et al. Recurrent Memory for Online Interdomain Gaussian Processes. NeurIPS 2025
Bui et al. Streaming Sparse Gaussian Process Approximations. NIPS 2017
KV cache ⇔ growing number of data-space inducing points
Recurrent memory ⇔ interdomain inducing points (fixed state dim. = fixed #basis)
Interdomain Attention
25




Kiyohara et al. Interdomain Attention: Beyond Token-Level Key-Value Memory. In submission

Interdomain Attention
26




Kiyohara et al. Interdomain Attention: Beyond Token-Level Key-Value Memory. In submission
Yang et al. Gated Linear Attention Transformers with Hardware-Efficient Training. ICML 2024
Gu et al. On the Parameterization and Initialization of Diagonal State Space Models. NeurIPS 2022
Practical Implementation (with deep learning magic 🪄)
1. Kernel feature: + RoPE
•Tried RFF with (learnable) frequencies, didn’t work well
2. Apply RMSNorm to and before entering the recurrent memory
•Mainly to stabilise the recurrent memory updates
• in SVGPs are “free parameters” anyway
3. Complex S4D as the recurrent memory module
•Several gating and selective update mechanism tried
4. Optional: construct from input with non-linear projection
•Combined with (2): the kernel now becomes asymmetric
Extensive amount of engineering for GPU kernel implementations!
(our implementation is still sub-optimal even with chunking)

IA Empirical Performances: Text
27




Kiyohara et al. Interdomain Attention: Beyond Token-Level Key-Value Memory. In submission
Perplexity = exp(avg. NLL)
IA Empirical Performances: Text
28




Kiyohara et al. Interdomain Attention: Beyond Token-Level Key-Value Memory. In submission
Downstream tasks (reasoning) performance
IA Empirical Performances: Genomics
29




Kiyohara et al. Interdomain Attention: Beyond Token-Level Key-Value Memory. In submission
Downstream tasks performance
IA Empirical Performances: Ablations
30




Kiyohara et al. Interdomain Attention: Beyond Token-Level Key-Value Memory. In submission
Query-conditioned read-out
is the main improvement factor
Some deep learning magic 🪄
also helps
Reflections on Interdomain Attention
●Recurrent memory interdomain inducing points
●So can think about how GP methods inspire memory design
●Think about sequence layers as online learners
●Now can think about network layer design in a “statistical modelling” way!
●Bayes can already say quite something for NN design:
●“knowledge adaptation” online learning + memory management
31
●Engineering & MLSys work may feel less “pleasant”:
●We had to throw away some “elegant ideas”
●But what if: hardware info should enter in your “prior beliefs” of models?




Kiyohara et al. Interdomain Attention: Beyond Token-Level Key-Value Memory. In submission
What Would Bayes Do
for Next-Gen Neural Network Design?
Uncertainty quantification?
Memory updates & maintenance?
Maximally “squeezing” out the “value” of each token?
How to build a hierarchy of features?
Your thoughts?
Thank you!
Innovations are from my great students, errors are mine :)
Questions? Ask now, or contact
PhD & Postdoc positions available on Bayesian deep learning
Naoki Kiyohara
Harrison Bo Hua Zhu
Riccardo El Hassanin




Wenlong Chen