Home › Glossary › Neural Networks › Attention

Intermediate · Neural Networks

Attention

Visual diagram · (in preparation) · Math · (in preparation) · Worked example · 3 difficulty levels.

TL;DR. Attention in neural networks highlights important parts of the input to improve predictions, like focusing on key words.

Technical Definition

Attention in neural networks highlights important parts of the input to improve predictions, like focusing on key words.

How it works

Attention is a mechanism in neural networks, particularly prominent in sequence models like Transformers, that allows the model to dynamically focus on specific parts of the input data when making a prediction. It assigns different weights to different input elements, effectively learning which parts are most relevant to the current task, thus improving efficiency and performance.

Related Concepts

  • Self-Attention — A mechanism where every token in a sequence attends to every other token to compute context-aware representations.
  • Natural language processing (NLP) — A field of AI enabling computers to understand, interpret, and generate human language.

Further Reading

  • Google ML Glossary