logoalt Hacker News

bilsbietoday at 9:49 PM1 replyview on HN

Can you explain this more, maybe dumb it down a little? Sounds important. I have t quite been able to get the attention section to click for me.


Replies

andblactoday at 10:17 PM

Look at this poster [1] (its low-res, full res is paid). Also see this video for context [2] - it talks about deepseek's innovation, but explains attention well. Above I was pointing to the moment where multiplication AV happens. In normal Dense layer in MLPs when you go through the layer you compute y=Wx, where x is an input and y is output (before gactivation) and W is a weight matrix. This W is usually what's produced through training process. This multiplication AV looks like Wx. If we take one column from matrix V in the poster and call it v, we can pretend for one moment that W=A and x=v [3]. So this multiplication Av works like linear transformation in ordinary network Wx. But in case of attention heads A is not trained directly but produced during inference, and is not trained directly like W is in ordinary network. In this case network is trained to produce A during inference.

[1] https://www.welchlabs.com/store/mladeepseek-attention-poster...

[2] https://www.youtube.com/watch?v=0VLAoVGf_74

[3] When multiplying A by V, we perform the same linear transform Av_i for each i-th column of V.