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 ερωτήσεις, δείτε σκορ και βαθμίδα σε λίγα λεπτά και προκαλέστε έναν φίλο να σας ξεπεράσει.