Back

8.28.2025

Dhruv Pai

Summary

There are many derivations of attention available, but I present my favorite from nonparametric regression. In this vignette, we demonstrate how the Nadaraya-Watson (NW) kernel regressor leads directly to softmax attention under mild assumptions, and pose a few interesting follow-up questions from a kernel smoothing perspective. 1

Back to Basics

To derive attention, we turn to a more classical problem: regression. The objective in vector-valued regression is to fit some function to map from input "x" vectors to response "y" vectors. This function, after being fit, can be queried on new input vectors to sample a new response vector.

To fit our function, we…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help