Remix.run Logo
stared 6 hours ago

I am curious what's the actual formula.

I mean, there so many headers and layers, it is tricky to make a choice that will resonate with our intuition . Is it some weighted average? Or maybe ablation test?

ifz 6 hours ago | parent | next [-]

It's really simple, basically just the magnitude of the value vector, weighted by QK dot product, summed across all attention heads and layers.

When I started, I expected I'd have to experiment a lot to find something comprehensible. But this simple computation can already show some patterns.

stared 6 hours ago | parent [-]

Nice! Sometimes the simplest approaches work the best.

visarga 6 hours ago | parent | prev [-]

If you want quick access look at google images for "transformer attention formula" there are some interesting depictions