How an LLM keeps the context (what has already been entered by the user) of a chat/thread?
For reference, in chat.openai.com, for each chat we create (or a Thread according to their API), the LLM remembers what we have already input to the model, when answering a new question.
I did some reading on the topic and found below possible ways:
- change the weights accordingly: but this seems not-practical for LLM given their size (even changing weights of the last layer seems an over-kill)
- output a context vector at each inference and re-use it for the next inference: this seems more likely. but I am not sure exactly how to do it.
It would be great if someone can help me with this.
Thanks.