Attend First, Consolidate Later: On the Importance of Attention in Different LLM Layers

要約

デコーダベースの LLM では、特定の層の表現には 2 つの目的があります。1 つは現在のトークンの計算中の次の層への入力としてです。
そして将来のトークンのアテンションメカニズムへの入力として。
この研究では、後者の役割の重要性が過大評価されている可能性があることを示しています。
それを示すために、前のトークンの表現を操作することから始めます。
例えば
ある層 k の隠れ状態をランダムなベクトルに置き換えることによって。
4 つの LLM と 4 つのタスクを使った実験では、この操作によりパフォーマンスがわずかに低下するか無視できる程度の低下が生じることが多いことがわかりました。
重要なのは、モデル k の上部で操作がレイヤーの最後の 30 ~ 50% にある場合に、これが発生するということです。
対照的に、以前の層で同じ操作を行うと、確率レベルのパフォーマンスが得られる可能性があります。
続けて、特定のトークンの非表示状態を、別のプロンプトからの他のトークンの非表示状態に切り替えます。
たとえば、「イタリアの首都はどこですか?」の単語「イタリア」を「フランス」に置き換えます。
モデルの上位 1/3 にこのスイッチを適用すると、モデルはそれを無視することがわかります (「ローマ」と答えます)。
ただし、前に適用すると、モデルはスイッチ (「パリ」) に準拠します。
私たちの結果は、トランスフォーマーベースの LLM における 2 段階のプロセスを示唆しています。最初の部分では以前のトークンからの入力を収集し、2 番目の部分では主にその情報を内部で処理します。

要約(オリジナル)

In decoder-based LLMs, the representation of a given layer serves two purposes: as input to the next layer during the computation of the current token; and as input to the attention mechanism of future tokens. In this work, we show that the importance of the latter role might be overestimated. To show that, we start by manipulating the representations of previous tokens; e.g. by replacing the hidden states at some layer k with random vectors. Our experimenting with four LLMs and four tasks show that this operation often leads to small to negligible drop in performance. Importantly, this happens if the manipulation occurs in the top part of the model-k is in the final 30-50% of the layers. In contrast, doing the same manipulation in earlier layers might lead to chance level performance. We continue by switching the hidden state of certain tokens with hidden states of other tokens from another prompt; e.g., replacing the word ‘Italy’ with ‘France’ in ‘What is the capital of Italy?’. We find that when applying this switch in the top 1/3 of the model, the model ignores it (answering ‘Rome’). However if we apply it before, the model conforms to the switch (‘Paris’). Our results hint at a two stage process in transformer-based LLMs: the first part gathers input from previous tokens, while the second mainly processes that information internally.

arxiv情報

著者 Amit Ben Artzy,Roy Schwartz
発行日 2024-09-05 15:33:24+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.CL パーマリンク