|
|
|
|
|
by dullcrisp
46 days ago
|
|
For anyone here who understands this stuff, help me out because the article dropped me at the end when drawing the connection from memory to LLMs. For an LLM, the keys are the tokens in your context, and the values are … what exactly? |
|
Q = XW_q
K = XW_k
V = XW_v
From there, you can think of K and V like keys and values in a Python dictionary, and Q as the key you pass (e.g. d[Q] in Python to return some value V). The difference in an attention layer is that the query is matched to each key using a dot product, and rather than getting a single value back you get a weighted sum of values.