Entry tags:
Let's understand Large Language Models better
This is a good starting point:
"A Mathematical Framework for Transformer Circuits", Dec 2021
transformer-circuits.pub/2021/framework/index.html
"A Mathematical Framework for Transformer Circuits", Dec 2021
transformer-circuits.pub/2021/framework/index.html
no subject
via https://twitter.com/NeelNanda5/status/1580782930304978944
no subject
29:36
um or model functionality as a sum of paths via the residual stream notion"
no subject
40:32
actually like the words reading and writing here because I think they can be pretty misleading but in particular
40:38
reading and writing intuitively feel like inverses or complementary operations but they're actually very
40:44
different so I prefer the word um project for read and embed for write"
no subject
45:34
MLP neurons as four times the residual stream width I don't know why but
45:39
everyone does it so you just memorize the number four"
no subject
no subject
no subject
footnote: "Some MLP neurons have very negative cosine similarity between their input and output weights, which may indicate deleting information from the residual stream. Similarly, some attention heads have large negative eigenvalues in their W_OW_V matrix and primarily attend to the present token, potentially serving as a mechanism to delete information. It's worth noticing that while these may be generic mechanisms for "memory management" deletion of information, they may also be mechanisms for conditionally deleting information, operating only in some cases."
no subject
~10:00 (anecdotally) an attempt to interpret small visual models on MNIST by Chris Olah did not work, but visual models became more interpretable when they got larger.
In Transformers, smaller models are easier to understand, but this is by no means obvious (says Neel Nanda in that lecture, but who knows how this would change eventually; in any case, the knowledge thus acquired does seem to be transferrable OK to larger models).
no subject
This is useless at inference, but this works great to parallelize training.
no subject
(So the bulk of computations are probably shallow, with a bit of "true deepness" sprinkled on top of it.)
no subject
(perhaps people who conjecture about "holographic storage" within residual stream are right, who knows; one can consider improving it in various ways: a) towards detangling, b) alternatively, towards better holography)
no subject
(but, actually, positions are meaningful, so there is still a bit of privileged structure in the residual stream, just (perhaps) not within the embedding vectors (but perhaps even there, if we look closely, who knows))
~37:50 spectrum of how privileged a basis is, rather than a binary privileged vs non-privileged
(the truth is there are traces of various privileges in the residual stream as well)
~39:30 even ADAM privileges everything it interacts with, because of its weirdness ("ADAM sucks" says Neel Nanda, but I don't think it's necessarily so, perhaps this artificial thing is good, who knows(!)).
no subject
that gives some crude proxy for what's going on
no subject
no subject
(but we need to see how this works with context length, it's not very transparent in the code, which is inconvenient; in MLP it is even less transparent than in the attention layer, where they have to write it explicitly in connection with splitting into attention heads)
no subject
no subject
no subject
1) Interestingly, what they seem to say is that splitting into attention heads is not just an efficiency device, but is semantically meaningful (it would be interesting to experiment with very small dimensions for attention heads, perhaps even as small as 1 (and also 2, etc)).
2) Interestingly, Neel Nanda thinks that using the tensor product formalism is a methodological mistake (it certainly does make the material more difficult to understand, but perhaps this might enable more powerful ways of thinking; anyway, this use of tensor products is, at least, optional).
no subject
no subject
we think you're grown up enough that you can figure out where it's useful to look and we're going to give you some
1:30:25
fraction of your premises I think it's like articles to attention something like uh
1:30:32
one-sixth of the parameters of the Transformer go to attention and we're like
1:30:37
these parameters to figure out where you should be moving information from what
1:30:42
does an intelligent worrying and an intelligent convolution look like and as we'll see later with induction
1:30:48
heads there can actually be like a pretty sophisticated and intelligent amount of computation
1:30:53
that goes into what this smart Dynamic convolution
1:30:58
looks like but yeah fundamentally attention is a generalized convolution where we allow
1:31:05
Transformers to compute how they ought to be moving information around for themselves"
no subject
generally, I would not assume their explanations are complete, even for these small models
it makes better sense to think about their approach as a viewpoint, and not as "The Truth"
(and especially listening to his caveats near 1:57:00)
no subject
And another frequent motif is that these things are good with fixing the weirdness of tokenizers
2:01:00 and for more complicated models, it is useful to think that attention heads are doing a lot of skip trigrams and doing other things on top of that
no subject
no subject
ATTENTION: The correction (bug fix) in calculation of compositions is a relatively recent addition: according to the Wayback Machine this correction has been added between May 21 and May 24, 2023
no subject
An interactive interface: https://transformer-circuits.pub/2021/framework/2L_HP_normal.html
no subject
But one should really study the next paper: https://transformer-circuits.pub/2022/in-context-learning-and-induction-heads/index.html
no subject
"Ultimately, our goal in this initial paper is simply to establish a foothold for future efforts on this problem. Much future work remains to be done.'
(The whole field is probably larger than what one person can even overview at this point, the trick is to navigate through this material in a fruitful way).