self-attention
Self-attention is a mechanism used in machine learning, particularly in natural language processing. It allows a model to weigh the importance of different words in a sentence when making predictions. By focusing on relevant words, the model can better understand context and relationships, improving its performance on tasks like translation or summarization.
In a self-attention layer, each word in a sequence is compared to every other word. This creates a set of attention scores that indicate how much focus each word should receive. The scores help the model determine which words are most significant for understanding the overall meaning of the text.