AI / LLM Basics Interview Questions
What is the Attention Mechanism?
Attention is the mechanism that lets a model weigh how relevant each other word in the input is when processing a given word, rather than treating every word as equally important.
- Computes a relevance score between every pair of tokens in a sequence
- Uses those scores to build a weighted combination of information from the whole sequence for each token
- Lets the model connect related words even when they're far apart in a sentence, like a pronoun and the noun it refers to several words earlier
This is what replaced older, strictly sequential approaches to language modeling, and it's the single component most responsible for the Transformer's success.
More Related questions...