What is the query key value in transformers and how does it work?
- User
What is the query key value in transformers and how does it work?
Assistant
The query key value mechanism is fundamental to attention in transformers. It works as follows:
- Query (Q): Represents the input token we want to attend over. It is a vector representation of that token.
- Key (K): Represents the tokens in the input sequence we want to compare the query to. Each token has a key vector.
- Value (V): Represents the value associated with each key. Usually the value is the actual embedding of the key token.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.