Conceptio › Archive › Stack Exchange
Stack Exchange open access CC BY-SA

What exactly are keys, queries, and values in attention mechanisms?

Sean · 2019
Stack Exchange · Datasets · License: CC BY-SA · 2019
Open Source ↗
attentionmachine-translationneural-networks
How should one understand the keys, queries, and values that are often mentioned in attention mechanisms? I've tried searching online, but all the resources I find only speak of them as if the reader already knows what they are. Judging by the paper written by Bahdanau ( Neural Machine Translation by Jointly Learning to Align and Translate ), it seems as though values are the annotation vector $h$ but it's not clear as to what is meant by "query" and "key." The paper that I mentioned states that attention is calculated by $$c_i = \sum^{T_x}_{j = 1} \alpha_{ij} h_j$$ with $$ \begin{align} \alpha_{ij} & = \frac{e^{e_{ij}}}{\sum^{T_x}_{k = 1} e^{ik}} \\\\ e_{ij} & = a(s_{i - 1}, h_j) \end{align} $$ Where are people getting the key, query, and value from these equations? Thank you.
Conceptio Open Archive

Analyze & explore related research in Conceptio

Connect this record directly into your research workflow or AI agent. Explore citations across open repositories, query full text, and export structured proof bundles.

This document is indexed with metadata only: full text is not available in the archive for this record. Open the official source ↗

Related documents

Record · ID 787262
Retrieved via Conceptio: every document is proof-bundled with source, license, and retrieval metadata.
Bring this data into your agent: Connect via MCP or API · 20 free credits to start · no card required
Read the Docs → · View CLI source on GitHub · Conceptio Open Knowledge Archive