4 ms·
> surely has a rich understanding of more than just the next token it wants to predict > the last hidden layer is obviously super rich in semantic information
by versteegen 2y ago
> surely has a rich understanding of more than just the next token it wants to predict
> the last hidden layer is obviously super rich in semantic information
I don't agree that this is obvious, and think it's likely wrong (see the sibling thread [1]). The model has to at some point compress down its prediction for the entire future string of text to a prediction for a single token. There's no prior reason to assume it does this mostly in the final "LM head" linear layer, and the inputs to it don't have to predict anything other than the very next token so there's no reason it should (which is what I think psb217 was getting at), but I'm not familiar with what research has been done into it. On the other hand, processing seems to typically be concentrated in the central layers.
[1] https://news.ycombinator.com/item?id=42379167 https://news.ycombinator.com/item?id=42379167
- danielmarkbruce 2y agoThe last hidden layer outputs a vector which is then used to predict the probabilities of every token in the vocabulary, by a single layer (and, in practice now in llama models, this layer is the transpose of the embedding layer). That vector has a lot of information in it, it's not a debatable thing. As noted above in parens, look at the llama 3.x models. The space is already shared in some sense. It's called "tied embedding".
- versteegen 2y ago> That vector has a lot of information in it, it's not a debatable thing. Encoding the next token is the minimum possible amount of information it might contain; that's not much information (the distribution over the next token is just a projection from the embedding space). E.g. it would be useless for any classification task.
- danielmarkbruce 2y agoVarious models in production are doing exactly that - training a layer which takes the vector out of the last hidden layer, for classification, in place of the language head. I even have one in production right now doing regression using the output of the last hidden layer.... In the case of llama 3 its 4096 * 16 bit = 8192 bytes of information...that's like 8192 characters of ascii. More than enough for most classification tasks... and if you jsut spend any time thinking about encoding the logits for a vocab of 128k... you'll come to the conclusion it's likely to require at least several hundred bytes (maybe 1000?) to do it in any way that will actually work in practice.