4 ms·
At each new token processed (edit: either if the token comes from the user or has been generated), this dynamic internal state is updated via a formula based on
by GistNoesis 4y ago
At each new token processed (edit: either if the token comes from the user or has been generated), this dynamic internal state is updated via a formula based on the model parameters and latest processed token.
To make this more clear, if you process 1000 tokens the neural network will have gone through a sequence of 1000 states.
Each of these states can be probed and analysed, by training a classifier on top of this state, for the content they contain (whether thoughts or emotion : some states can be classified as "happy", "sad",...).
This is not yet mainstream view but viewed through this prism and anthropomorphising a little, it can been seen as a stream of proto-consciousness, where during the conversation the inner state of the neural network has gone through various thoughts and emotions.
At the end of the chat session, this internal state is not persisted (but could be recreated from the produced conversation as it is deterministic). This internal state size is big and proportional to the length of the context window (If you want to persist between sessions you can by simply keeping the last "context window size" tokens produced and recompute the features).
At the next session you start with a fresh new internal state.
The conversation produced is persisted for use as input for future training where good conversation will be encouraged and bad conversation will be discouraged via Reinforcement Learning with Human Feedback.
The dynamics of this internal state is what Large Language Models learn.
- fragsworth 4y ago> At the end of the chat session, this internal state is not persisted (but could be recreated from the produced conversation as it is deterministic) You're mistaken about internal state in a chat session. It loses all state after each response. There is internal state for a moment during a single response, but it's not persisted once it's done. Between messages, it has no memory of previous messages in your conversation. The way it's implemented is by the seemingly silly/expensive method of pre-pending the conversation history to your request to the LLM. The "internal state" is usually stored on your local machine.
- MacsHeadroom 4y agoI believe you misunderstood the comment you're replying to. It says the internal state could be recreated because it is deterministic, and this is correct. Assuming you have control of the parameters (seed etc.) you can reproduce the exact internal states by submitting the same tokens with the same parameters over again step-by-step. With GPT-4 you can do this in the OpenAI Dialogue Playground or via the API.
- fragsworth 4y ago> I believe you misunderstood the comment you're replying to. No, did you even read my quote? How did I misunderstand this: > At the end of the chat session, this internal state is not persisted It's misinformed at best, misleading at worst. The non-misleading truth is at the end of each message, the internal state is not persisted. I didn't disagree about how you can reproduce things. You have to do that to continue a conversation.
- MacsHeadroom 4y ago>I didn't disagree about how you can reproduce things. You have to do that to continue a conversation. You do not have to reproduce the internal states to continue a conversation. When prior parts of the conversation are loaded into context the hidden states which generated those prior tokens are not reproduced. They are only reproduced if resubmitted in a piecemeal fashion, which does not happen in normal conversation continuation. You seem to not understand what the internal state is or how it is differentiated from the external state of the overall conversation.
- fragsworth 4y agoOk, I agree! That one sentence of mine was wrong. You don't have to reproduce state to continue a conversation. I was just trying to throw a bone, but even that bone was bad. But then... doesn't that just point out that I was right on everything else? That there is absolutely no state between chat messages?
- GistNoesis 4y ago
- engineeringwoke 4y ago> To make this more clear, if you process 1000 tokens the neural network will have gone through a sequence of 1000 states. That isn't how transformer architectures work
- GistNoesis 4y ago^^ See above comment and "Transformers are RNNs" paper to convince yourself. There are various ways of seeing how transformer architectures work. For the past data, using a temporal causal mask, you can compute all past features as they would have been seen by applying the causal mask, which allows you to seemingly do all the past computations in parallel, which hide the sequential aspect of it. What I've described correspond to the the simpler subvariant figure 1 of "Attention is all you need" https://arxiv.org/pdf/2006.16236.pdf https://arxiv.org/pdf/2006.16236.pdf , of the transformer architecture in the case where you don't give the past as input to the input branch, put rather prepend it to the output, which is the what people usually do in practice (see llama) ). If you want to use both branches of the transformer architecture, so that you can do filtering and smoothing (aka not using a causal mask) for the past data, it creates a "bottleneck" in your architecture, as you synthesize all the past into a finite sized context vector that you then use in the right branch of the transformer. But alternatively you can loop along the time dimension first, and make the sequence more apparent. Due to how the (causally mask) transformer architecture is defined this gives exactly the same computation. It's just some loop reordering. For the generation part, the sequential aspect is more evident as token are produce one by one sequentially and feedback to the transformer for the next token prediction.