Skip to content
AI360Xpert
Glossary
Definition

Query (attention)

In the attention mechanism, a vector representing the current token's specific informational needs, used to search against the Keys of all other tokens.

Think of It Like This

Like a shopper handing a detailed grocery list to a clerk, hoping the clerk can match the requested items to the store's inventory.

The Query vector is generated by multiplying the input embedding by a learned weight matrix. It dictates what the model is 'looking for' at that specific sequence step. The dot product of the Query with every other token's Key determines the attention weights, defining how much information should be pulled from each token's Value.