AI IQ™
AI Glossary

Attention (Self-Attention)

A mechanism that lets a model weigh how relevant each part of the input is to every other part.

In self-attention, each token creates a query, a key and a value vector. The model compares each query with every key to get relevance scores, turns those into weights with a softmax, and uses them to mix the value vectors.

This lets the model focus on the words that matter for interpreting each word. Standard attention costs grow quadratically with sequence length, which is why long context windows are expensive.

💡 Example: In translation, attention helps the model line up each output word with the right input words.

Related terms

Think you know your AI terms? 🤓

Take the Medium quiz Back to glossary

Який у ВАС AI IQ™?

Пройдіть безкоштовний тест із 10 запитань, дізнайтеся свій бал і ранг за кілька хвилин і киньте виклик другові.