[논문 리뷰] Differential Transformer
Differential Transformer introduces a differential attention mechanism that subtracts two softmax attention maps to cancel noise, yielding sparser, more relevant attention and better performance across scaling, long context, retrieval, and in-context learning tasks.
Transformer tends to overallocate attention to irrelevant context. In this work, we introduce Diff Transformer, which amplifies attention to the relevant context while canceling noise. Specifically, the differential attention mechanism calculates attention scores as the difference between two separate softmax attention maps. The subtraction cancels noise, promoting the emergence of sparse attention patterns. Experimental results on language modeling show that Diff Transformer outperforms Transformer in various settings of scaling up model size and training tokens. More intriguingly, it offers notable advantages in practical applications, such as long-context modeling, key information retrieval, hallucination mitigation, in-context learning, and reduction of activation outliers. By being less distracted by irrelevant context, Diff Transformer can mitigate hallucination in question answering and text summarization. For in-context learning, Diff Transformer not only enhances accuracy but is also more robust to order permutation, which was considered as a chronic robustness issue. The results position Diff Transformer as a highly effective and promising architecture to advance large language models.
연구 동기 및 목표
- 트랜스포머에서 어텐션 노이즈를 줄여 핵심 정보 검색과 맥락 이해를 향상시키려는 동기를 제시한다.
- 노이즈를 억제하는 한편 관련 맥락에 주의를 집중시키는 차등 어텐션 메커니즘을 제안한다.
- 다운스트림 작업과 인-컨텍스트 학습 시나리오 전반에 걸친 확장성, 긴 컨텍스트 능력, 강건성을 입증한다.
- 환각 완화 및 활성화 이상값 감소와 같은 실용적 이점을 탐구한다.
제안 방법
- 입력 투영을 두 그룹으로 나누어 두 개의 독립적인 쿼리와 키를 계산한다.
- 두 개의 소프트맥스 어텐션 맵을 계산하고 차이로 차등 어텐션을 형성한다.
- 두 어텐션 맵의 균형을 맞추기 위해 학습 가능한 스칼라 λ를 도입하고 안정한 학습을 위해 λ를 재매개변수화한다.
- 헤드별 정규화와 고정된 기울기 정렬 스케일링을 갖춘 다중 헤드 차등 어텐션을 적용한 뒤 SwiGLU 피드포워드 블록을 적용한다.
- 헤드와 계층 간의 학습 안정을 위해 RMSNorm과 GroupNorm을 사용한다.
- 표준 LLM 하이퍼파라미터와의 호환성을 가능하게 하는 잔여 연결과 LayerNorm과 유사한 정규화를 갖춘 디코더 스타일 아키텍처를 유지한다.
실험 결과
연구 질문
- RQ1차등 어텐션이 표준 어텐션에 비해 긴 맥락에서 핵심 정보를 검색하는 능력을 향상시키는가?
- RQ2적은 매개변수나 토큰으로도 Diff Transformer가 동등하거나 더 나은 언어 모델링 성능을 달성할 수 있는가?
- RQ3이 접근법이 어텐션 노이즈와 활성화 이상값을 줄여 양자화 및 긴 맥락 처리에서 더 나은 성능을 가능하게 하는가?
- RQ4차등 어텐션하에서 인-context 학습이 프롬프트 순서의 순열에 더 강건한가?
- RQ5요약 및 질의응답에서의 환각 완화에도 이점이 있는가?
주요 결과
| 모델 | ARC-C | ARC-E | BoolQ | HellaSwag | OBQA | PIQA | WinoGrande | 평균 |
|---|---|---|---|---|---|---|---|---|
| Diff -3B | 37.8 | 72.9 | 69.0 | 71.4 | 29.0 | 76.8 | 67.1 | 60.6 |
| OpenLLaMA-3B-v2 | 33.9 | 67.6 | 65.7 | 70.0 | 26.0 | 76.7 | 62.9 | 57.5 |
| StableLM-base-alpha-3B-v2 | 32.4 | 67.3 | 64.6 | 68.6 | 26.4 | 76.0 | 62.1 | 56.8 |
| StableLM-3B-4E1T | — | 66.6 | — | — | — | 76.8 | 63.2 | — |
- Diff Transformer는 확장성, 토큰 수, 컨텍스트 길이에 걸쳐 언어 모델링에서 Transformer를 능가하며, 비슷한 성능을 대략 매개변수나 토큰의 65% 수준으로 달성한다.
- 긴 컨텍스트 및 needle-in-a-haystack 과제에서 Diff Transformer는 Transformer보다 정확도가 높고 어텐션 노이즈가 현저히 적다.
- Diff Transformer는 요약 및 질의응답 데이터셋에서 컨텍스트 환각을 Transformer에 비해 줄인다.
- 여러 데이터셋에 걸쳐 Diff Transformer의 다샷 인컨텍스트 학습은 시연 순서에 대해 더 정확하고 Transformer보다 강건하다.
- Diff Transformer는 활성화 이상값이 더 적고 저비트 양자화에서도 성능을 유지하여 하드웨어 구현의 효율을 높인다.
- 64K 컨텍스트에서 핵심 정보의 안정적인 검색을 유지하며, 타깃 정보가 시퀀스 초기에 있을 때 특히 성능이 향상된다.
더 나은 연구,지금 바로 시작하세요
연구 설계부터 논문 작성까지, 연구 시간을 획기적으로 줄여보세요.
카드 등록 없음 · 무료 플랜 제공
이 리뷰는 AI가 만들고, 인간 에디터가 검토했습니다.