言語モデルにおける段落記憶の局所化
Localizing Paragraph Memorization in Language Models
March 28, 2024
著者: Niklas Stoehr, Mitchell Gordon, Chiyuan Zhang, Owen Lewis
cs.AI
要旨
言語モデルが訓練データの全文を記憶し再生するために使用する重みとメカニズムを局所化することは可能か?本論文では、記憶が複数の層とモデルコンポーネントに分散している一方で、記憶された段落の勾配は非記憶例の勾配とは異なる空間パターンを示し、特に下位層で大きくなることを示す。さらに、記憶された例は、高勾配の重みのみをファインチューニングすることで「忘却」させることができる。我々は、段落の記憶に特に深く関与している低層のアテンションヘッドを特定した。このヘッドは、コーパスレベルのユニグラム分布において最も頻度の低い特徴的なレアトークンに主に注意を向けている。次に、プレフィックスのトークンを摂動させ、デコーディングに生じる変化を測定することで、記憶がトークン間でどの程度局所化されているかを調査した。プレフィックスの初期に現れる少数の特徴的なトークンが、しばしば続く部分全体を破壊する可能性がある。全体として、記憶された続きは、非記憶例に比べて忘却が難しいだけでなく、破壊することも困難である。
English
Can we localize the weights and mechanisms used by a language model to
memorize and recite entire paragraphs of its training data? In this paper, we
show that while memorization is spread across multiple layers and model
components, gradients of memorized paragraphs have a distinguishable spatial
pattern, being larger in lower model layers than gradients of non-memorized
examples. Moreover, the memorized examples can be unlearned by fine-tuning only
the high-gradient weights. We localize a low-layer attention head that appears
to be especially involved in paragraph memorization. This head is predominantly
focusing its attention on distinctive, rare tokens that are least frequent in a
corpus-level unigram distribution. Next, we study how localized memorization is
across the tokens in the prefix by perturbing tokens and measuring the caused
change in the decoding. A few distinctive tokens early in a prefix can often
corrupt the entire continuation. Overall, memorized continuations are not only
harder to unlearn, but also to corrupt than non-memorized ones.Summary
AI-Generated Summary