跳到主要内容Skip to main content

注意力机制Attention

Attention

  • 核心概念Core concepts
  • 第四站 · 看懂Station 4 · Under the Hood
解决什么问题What problem it solves

让模型在处理一个词时,自动看向句子里最相关的其他词。When processing one word, the model automatically looks at the most relevant other words in the sentence.

这是什么What it is

计算每个词与句中所有其他词的关联程度,据此加权聚合信息。

「Transformer 里的注意力」与「模型注意力不集中」是同一个词的不同含义。前者是算法组件,后者是行为描述。

Computing how related each word is to every other word, and aggregating information weighted by that.

"Attention" inside a Transformer and "the model isn't paying attention" in everyday speech are the same word meaning different things.

为什么需要知道Why it matters

它解释了为什么模型能理解长句里的指代关系。它也是上下文长度受限的技术根源之一。It explains why models can resolve references across a long sentence — and is one technical root of the context length limit.

出处Sources
  • Attention Is All You Need(论文)Attention Is All You Need (paper) ↗
  • Bahdanau 注意力论文(ICLR 2015)Bahdanau Attention (Neural Machine Translation) ↗