언어 모델에서 문단 암기 현상의 지역화
Localizing Paragraph Memorization in Language Models
March 28, 2024
저자: Niklas Stoehr, Mitchell Gordon, Chiyuan Zhang, Owen Lewis
cs.AI
초록
언어 모델이 훈련 데이터의 전체 문단을 암기하고 재현하는 데 사용하는 가중치와 메커니즘을 특정할 수 있을까? 본 논문에서는 암기 현상이 여러 계층과 모델 구성 요소에 걸쳐 분포되어 있지만, 암기된 문단의 그래디언트는 비암기 예제의 그래디언트와 구별되는 공간적 패턴을 보이며, 특히 하위 모델 계층에서 더 크다는 것을 보여준다. 또한, 고 그래디언트 가중치만을 미세 조정함으로써 암기된 예제를 제거할 수 있다. 우리는 문단 암기에 특히 관여하는 것으로 보이는 하위 계층의 어텐션 헤드를 특정했다. 이 헤드는 코퍼스 수준의 단일어(unigram) 분포에서 가장 드물게 나타나는 독특한 토큰에 주로 주의를 집중한다. 다음으로, 접두사의 토큰들에 대한 암기의 국소화 정도를 연구하기 위해 토큰을 교란시키고 디코딩에 미치는 변화를 측정했다. 접두사 초반의 몇 가지 독특한 토큰이 종종 전체 후속 문장을 왜곡할 수 있다. 전반적으로, 암기된 후속 문장은 제거하기 어려울 뿐만 아니라, 비암기 예제에 비해 왜곡시키기도 더 어렵다.
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