L’attention est un mécanisme de réseau neuronal qui attribue différents niveaux d’importance à des parties d’une entrée lors de la production d’une sortie. Elle aide les modèles à se concentrer sur les tokens, caractéristiques ou régions pertinents et constitue un élément central des architectures Transformer. L’attention peut réduire la nécessité de représenter toute l’information d’entrée de manière égale en pondérant le contexte selon sa pertinence pour la tâche.
A mechanism used in a neural network that indicates the importance of a particular word or part of a word. Attention compresses the amount of information a model needs to predict the next token/word. A typical attention mechanism might consist of a weighted sum over a set of inputs, where the weight for each input is computed by another part of the neural network. Refer also to self-attention and multi-head self-attention, which are the building blocks of Transformers. See LLMs: What's a large language model? in Machine Learning Crash Course for more information about self-attention.