AI English Shift · Lessons / F06
Attention, transformers and long inputs
注意力、Transformer 与长输入
Open the interactive lesson · 打开互动课程A token's meaning in a sentence often depends on other tokens, such as the noun that a pronoun refers to.
一个 token 在句子中的含义,往往取决于其他 token,例如代词所指代的名词。
文中のトークンの意味は、代名詞が指す名詞のように、他のトークンに依存することがよくあります。
Attention is a family of computations that lets a model combine information from different positions using learned relevance scores.
注意力是一类计算方法,使模型能够利用学习得到的相关性分数,组合不同位置的信息。
注意機構は、学習された関連性のスコアを用いて、異なる位置の情報を組み合わせる計算方法の一群です。
In a simplified description, a query is compared with keys, and the resulting weights are used to combine values.
简化来说,系统会将查询(query)与键(key)进行比较,再用得到的权重组合值(value)。
簡略化して説明すると、クエリとキーを比較し、その結果の重みを用いてバリューを組み合わせます。
These terms name mathematical representations, not a search question and database keys in the ordinary application sense.
这里的术语指的是数学表示,并不是通常应用语境中的搜索问题和数据库键。
これらの用語は数学的な表現を指し、通常のアプリでいう検索質問やデータベースのキーとは異なります。
Transformer layers combine attention with other computations, including transformations applied to individual positions.
Transformer 层将注意力与其他计算结合起来,其中包括分别作用于各个位置的变换。
Transformerの層は、注意機構に加え、個々の位置に適用する変換など、他の計算も組み合わせます。
In a causal language model, masking prevents a position from using later tokens that should not yet be available for next-token prediction.
在因果语言模型中,掩码会阻止某个位置使用后面的 token,因为在预测下一个 token 时,这些后续信息本不应该可用。
因果的な言語モデルでは、マスクにより、次トークン予測でまだ利用できない後続トークンを参照できないようにします。
Calling this mechanism attention is convenient, but it does not establish that the model concentrates or understands in the same way as a person.
把这一机制称为“注意力”很方便,但这个名称并不能证明模型像人一样集中注意或理解事物。
この仕組みを注意と呼ぶのは便利ですが、人と同じように集中したり理解したりしていると証明するものではありません。
Similarly, displaying attention weights is not automatically a complete explanation of why the final answer was generated.
同样,展示注意力权重,也不自动等于完整解释了最终答案为什么会被生成。
同様に注意の重みを表示しても、最終回答が生成された理由を完全に説明できるとは限りません。
Dense self-attention can compare many pairs of positions, which helps explain why long sequences create computational challenges.
稠密自注意力可以比较许多位置对之间的关系,这有助于解释为什么长序列会带来计算上的挑战。
密な自己注意では多数の位置の組を比較するため、長い並びが計算上の課題になる理由の一つが分かります。
However, implementations and architectures differ, so a single textbook complexity expression should not be treated as every product's measured cost.
不过,实现方式和架构各不相同,因此不能把教科书中的某个复杂度表达式,当作所有产品的实测成本。
ただし実装や構造は異なるため、教科書上の一つの計算量の式を、すべての製品の実測費用とみなすべきではありません。
A context-window limit describes supported capacity, while effective use of evidence inside that window must be evaluated.
上下文窗口的上限描述的是系统支持的容量;系统能否有效利用窗口内的证据,则需要评估。
コンテキストウィンドウの上限は対応する容量を示しますが、その中の根拠を有効に使えるかは評価が必要です。
The 2023 Lost in the Middle study found position-sensitive performance on its tested retrieval and question-answering tasks.
2023 年的《Lost in the Middle》研究发现,在其测试的检索和问答任务中,性能会受到信息位置的影响。
2023年のLost in the Middleの研究では、検証した検索と質問応答の作業で、情報の位置による性能の違いが見られました。
This is evidence for testing information placement, not proof that every later model fails beyond a particular percentage of its window.
这项发现支持我们测试信息的放置位置,但不能证明所有后续模型都会在超过某个固定窗口占比后失效。
これは情報の配置を検証する根拠であり、その後のすべてのモデルが容量の特定の割合を超えると失敗するという証明ではありません。
To test a handbook assistant, keep the question and correct passage fixed while moving the passage among the beginning, middle, and end of longer inputs.
测试手册问答助手时,可以保持问题和正确段落不变,同时把该段落分别移到较长输入的开头、中间和末尾。
手引き用アシスタントを試すには、質問と正しい文章を固定し、長い入力の先頭、中央、末尾へ文章の位置を移します。
Also vary distractors and repeat the comparison, so that a single lucky answer does not determine the result.
还应改变干扰信息并重复比较,避免让一次碰巧答对决定测试结论。
関係のない情報も変えて比較を繰り返し、一度だけ正解した結果で判断しないようにします。
Removing irrelevant history may help, but removing the only relevant exception can make a shorter context worse.
删除无关的历史内容可能有帮助,但如果删掉了唯一相关的例外条件,较短的上下文反而可能更糟。
無関係な履歴の削除は役立つ可能性がありますが、唯一の関連する例外を削除すると、短いコンテキストの方が悪くなることがあります。
Good context design preserves the information the task needs and measures whether the chosen system can use it.
好的上下文设计会保留任务所需的信息,并测量所选系统能否利用这些信息。
良いコンテキスト設計は、作業に必要な情報を残し、選んだシステムがそれを使えるか測定します。
Key terms
- Next-token prediction: Estimating or selecting a next token conditional on an existing sequence.
- Context window: The model's supported capacity for processing a sequence, with input and output accounting defined by its interface.
- Embedding: A learned vector representation of an input, used within models or for tasks such as retrieval.
- Attention: A computation that combines information from positions using learned compatibility scores and weights.
- Transformer: A neural-network architecture family built around attention and other transformations of sequences or representations.