Query (Q)
What is Query (Q)?
In one sentence: In attention, the query is a list of numbers that represents what a word is looking for in other words.
Each word creates a query, which is like a question: "Who is relevant to me?" The query is compared with every other word's key to find good matches. Better matches mean more attention.
What does Query (Q) look like?
For the word "it," the query might effectively ask "Which earlier noun am I talking about?"
Why does Query (Q) matter?
Queries are one-third of the Q, K, V system that powers attention.
Last updated · Fact-checked by The AI Math
Linking to this page from a lesson or article? <a href="https://getaimath.com/dictionary/query-q/">Query (Q), explained simply</a> (The AI Math Dictionary)