The fundamentals

Attention interview questions

The attention questions that keep coming up in AI engineer interviews. The first 3 come with full answers.

Updated 2026-09-05

01

In plain terms, what does self-attention let each token do?

Self-attention lets every token glance at all the other tokens in the sequence and pull in meaning from the ones most relevant to it — in a single step. Instead of reading a word in isolation, the model rebuilds each token's vector as a blend of the words it cares about, so “it” can absorb the meaning of “cat” however far back it sits. That context-mixing is the core trick behind the transformer.
02

Walk through the three steps — scoring, softmax, and mixing — that produce a token's new vector.

Three steps. Score: compare the token's Query against every token's Key with a dot product, then divide by the square root of the vector size so the numbers don't blow up. Softmax: push those scores through softmax so they become weights that add up to 1 — a clean distribution over “how much do I attend to each word?”. Mix: take a weighted sum of everyone's Values using those weights. The result is a fresh, context-aware vector for the token.
03

What are the Query, Key, and Value roles, and how are they made from a token's vector?

Each is a small vector made by multiplying the token's embedding by its own learned matrix (Wq, Wk, Wv). The Query is “what am I looking for?” — the question the token shops with. The Key is “what do I offer?” — its name-tag, matched against other Queries. The Value is “the actual information I'd hand over” if I'm chosen. Queries are matched to Keys to decide the weights; the Values are what actually get blended.

Also asked in interviews

These 3 run inside the bootcamp as recall drills and voice mock interviews. You answer, the AI grades.

Knowing an answer and saying it under pressure are two different days. Inside Skillumen you answer these out loud and get graded on the spot. Foundations is free.

Try it free →

The open-source companion list, Awesome AI Engineer Interview Questions, curates 105 of these on GitHub.