[논문 리뷰] Monarch Mixer: A Simple Sub-Quadratic GEMM-Based Architecture
Monarch Mixer (M2)는 Monarch 행렬을 사용하여 서브-제곱 혼합을 도입하고, 비-인과, 인과, 비전 태스크 전반에 걸쳐 파라미터 수가 적은 경우에도 변환기(Transformers)와 경쟁력 있거나 더 나은 성능을 달성합니다. 시퀀스 길이와 모델 차원 모두에서 서브-제곱 확장을 가능하게 하고 인과적 파라메터화를 제공합니다.
Machine learning models are increasingly being scaled in both sequence length and model dimension to reach longer contexts and better performance. However, existing architectures such as Transformers scale quadratically along both these axes. We ask: are there performant architectures that can scale sub-quadratically along sequence length and model dimension? We introduce Monarch Mixer (M2), a new architecture that uses the same sub-quadratic primitive along both sequence length and model dimension: Monarch matrices, a simple class of expressive structured matrices that captures many linear transforms, achieves high hardware efficiency on GPUs, and scales sub-quadratically. As a proof of concept, we explore the performance of M2 in three domains: non-causal BERT-style language modeling, ViT-style image classification, and causal GPT-style language modeling. For non-causal BERT-style modeling, M2 matches BERT-base and BERT-large in downstream GLUE quality with up to 27% fewer parameters, and achieves up to 9.1$ imes$ higher throughput at sequence length 4K. On ImageNet, M2 outperforms ViT-b by 1% in accuracy, with only half the parameters. Causal GPT-style models introduce a technical challenge: enforcing causality via masking introduces a quadratic bottleneck. To alleviate this bottleneck, we develop a novel theoretical view of Monarch matrices based on multivariate polynomial evaluation and interpolation, which lets us parameterize M2 to be causal while remaining sub-quadratic. Using this parameterization, M2 matches GPT-style Transformers at 360M parameters in pretraining perplexity on The PILE--showing for the first time that it may be possible to match Transformer quality without attention or MLPs.
연구 동기 및 목표
- 시퀀스 길이와 모델 차원 모두에서 확장되는 서브-제곱 아키텍처를 동기부여하고 개발합니다.
- Monarch 행렬이 넓은 범위의 선형 변환을 표현할 수 있으며 GPU에서 하드웨어 친화적임을 보입니다.
- M2의 비인과 언어 및 비전 태스크에서의 성능과 인과 언어 모델링에서의 성능을 입증합니다.
- Monarch 기반 계층의 인과적 파라미터화에 대한 이론적 기초를 제공합니다.
- Transformer 기준선과 비교한 처리량 및 파라미터 효율성을 벤치마킹합니다.
제안 방법
- Monarch 행렬을 블록 대각 요소들의 곱으로 정의하고 순열과 교차시키며 O(p N^{(p+1)/p}) 연산을 달성합니다.
- Monarch 블록과 원소별 연산으로 시퀀스 축과 임베딩 축을 따라 혼합하여 M2를 구성합니다.
- BERT-유사, ViT-유사, GPT-유사 설정에서 Transformer 어텐션과 MLP 블록을 M2 프리메티브로 대체합니다.
- 다변수 다항식 평가/보간을 통한 인과적 파라미터화를 제공하여 서브-제곱 인과 마스킹을 가능하게 합니다.
- M2 파라미터화에 대한 인과성 조건(정리 3)을 이론적으로 분석합니다.
- GPU에서의 구현 서술 및 하드웨어 활용 벤치마크를 제공합니다.
실험 결과
연구 질문
- RQ1서브-제곱 프리미티브(Monarch 행렬)가 시퀀스 길이와 모델 차원 모두에서 Transformer와 비슷하거나 더 나은 성능을 제공할 수 있을까요?
- RQ2Monarch 기반 계층을 서브-제곱 계산으로 인과적으로 만들 수 있을까요?
- RQ3파라미터를 줄이면서 비인과 언어, 인과 언어 및 비전 태스크에서 M2 변형이 Transformer의 성능에 맞거나 이를 초과합니까?
- RQ4dense MLP 및 어텐션과 비교했을 때 M2의 하드웨어 활용 특성은 무엇입니까?
- RQ5다항식 해석 뷰가 어떻게 M2에 대한 원칙적 인과 파라미터화를 가능하게 할 수 있습니까?
주요 결과
- M2는 비인과 언어 모델링에서 각각 27%와 24% 더 적은 파라미터로 BERT-base 및 BERT-large GLUE 품질에 해당합니다.
- 시퀀스 길이 4K에서 HuggingFace BERT 대비 최대 9.1×의 처리량을 달성합니다.
- ImageNet에서 M2-ViT-b는 ViT-b보다 파라미터의 절반으로 1% 더 잘 수행합니다.
- M2-GPT의 인과 파라미터화는 The PILE에서 어텐션/MLP 없이도 360M 파라미터에서 GPT-스타일 Transformer의 perplexity에 맞춥니다.
- 인과 설정에서 M2는 경쟁력 있는 perplexity를 달성하여 전혀 다른 아키텍처로도 Transformer 품질에 근접할 가능성을 보여줍니다.
- 벤치마크 전반에 걸쳐 M2는 dense 기준선 대비 FLOP 활용과 서브-제곱 확장 이점을 보입니다.
이 논문 읽기
누빈트 뷰어에서 원문을 열고, 읽으면서 궁금한 곳을 바로 물어보세요.
누빈트에서 이 논문 읽기이 리뷰는 AI가 논문 원문을 바탕으로 만들었습니다. 인용하기 전에 원문을 확인해 주세요.