transformer token-efficiency pretraining inference-latency moe-models cross-entropy olmo mixture-of-loops
Abstract
Looped Transformers boost expressivity by reusing shared layers across loops, yet at the cost of efficiency. Pushing their expressivity-efficiency frontier requires rethinking the core mechanism connecting adjacent loops: What should be passed as a Transformer loops? We introduce Mixture-of-Loops Transformer (MoLT), whose Mixture-of-Loops Attention (MoLA) uses keys and values (KV) as memory for selective reuse across depths and loops. Under loop residual, MoLT-R retains the residual stream and reads local KV across loops for expressivity. Under loop KV, MoLT-KV instead restarts from embeddings and reads current-loop local KV with preceding-loop memory KV at earlier positions for efficiency. MoLT-KV eliminates same-position cross-loop dependence and, paired with loop forcing for parallel training, unlocks single-traversal Mixture-of-Loops (MoL) decoding beyond the training loop horizon. To balance efficiency and quality, we introduce U-shaped MoLT (U-MoLT), which separates memory construction from prediction readout and skips unused decoder traversals without changing predictions. In 400B-token pretraining, U-MoLT outperforms OLMo3 across 700M/1.5B dense and 3B MoE models, achieving 1.7x validation cross-entropy (CE) token efficiency at 700M while improving 3B MoE 10-domain perplexity by 0.75 and 10-task accuracy by 2.1 percentage points. In 100B-token continued pretraining of Qwen3.5-0.8B-Base, our U-MoLT adaptation lowers CE on all 11 domains over the matched baseline with 1.4x mean token efficiency. At inference, U-MoLT with MoL-Hybrid-2 matches non-looped OLMo3 latency at 996.6 vs. 1,000.6 ms on S-size (~113M) models. Code is available at https://github.com/hustvl/MoLT
한국어 요약
한 줄 요약
Mixture-of-Loops Transformer(MoLT)는 Transformer의 반복 구조를 효율적으로 활용해 성능과 토큰 효율성을 동시에 향상시킨다.
핵심 기여도
- Mixture-of-Loops Attention(MoLA)를 도입해 반복 루프 간 키-값(KV) 메모리의 선택적 재사용을 가능하게 함.
- MoLT-KV는 반복 간 동일 위치의 종속성을 제거하고, 병렬 훈련을 통해 루프 외 범위의 디코딩을 실현함.
- U-MoLT는 메모리 구성과 예측 출력을 분리하여 불필요한 디코더 순회를 건너뛰며 예측 정확도를 유지함.
- 400B 토큰 사전 훈련에서 3B MoE 모델의 10개 도메인 퍼플렉시티를 0.75 개선하고, 10개 태스크 정확도를 2.1% 포인트 향상시킴.
핵심 아이디어
기존 Looped Transformer는 공유된 레이어를 반복적으로 재사용해 표현력을 높이지만, 효율성 저하가 발생한다. MoLT는 반복 루프 간 연결 메커니즘을 재설계하여, KV 메모리를 기반으로 선택적 재사용을 수행한다. MoLT-R은 잔차 스트림을 유지하면서 반복 간 로컬 KV를 읽어 표현력을 확보하고, MoLT-KV는 임베딩에서 재시작하며 이전 루프의 메모리 KV를 활용해 효율성을 높인다. 이는 반복 간 종속성을 줄이고 병렬 디코딩을 가능하게 한다는 점에서 기존 접근과 차별화된다.
기술적 접근법
- **Mixture-of-Loops Attention(MoLA)**: 키-값(KV) 메모리를 기반으로 반복 루프 간 선택적 정보 재사용.
- **MoLT-R**: 잔차 스트림 유지 + 반복 간 로컬 KV 읽기.
- **MoLT-KV**: 임베딩 재시작 + 이전 루프 메모리 KV 활용.
- **Loop Forcing**: 병렬 훈련을 위한 기법.
- **U-MoLT**: 메모리 구성과 예측 출력 분리, 불필요한 디코더 순회 건너뛰기.
주요 결과
- 400B 토큰 사전 훈련에서 U-MoLT는 700M/1.5B 밀집 모델과 3B MoE 모델 모두에서 OLMo3를 초과함.
- 700M 모델에서 1.7x 토큰 효율성 향상.
- 3B MoE 모델에서 10개 도메인 퍼플렉시티 0.75 개선, 10개 태스크 정확도 2.1% 포인트 향상.
- Qwen3.5-0.8B-Base에서 100B 토큰 추가 훈련 시 11개 도메인 CE 점수 1.4x 향상.
- S-size(~113M) 모델에서 MoL-Hybrid-2 기반 U-MoLT는 OLMo3 대비 1,000.6 ms 대비 996.6 ms의 지연 시간을 기록함.
의의 및 한계
MoLT는 반복 Transformer의 표현력과 효율성을 균형 있게 향상시키는 새로운 메커니즘을 제시한다. 특히, U-MoLT는 메모리 구성과 예측 분리를 통해 불필요한 계산을 제거함으로써 대규모 모델의 훈련 및 추론 효율성을 동시에 개선한다. 그러나, 반복 구조의 복잡성은 모델 설계 및 디버깅에 추가적인 부담을 줄 수 있으며, 특정 도메인에서는 기존 모델 대비 성능 개선이 미미할 수 있다.
실용적 활용
MoLT는 대규모 언어 모델의 효율적인 사전 훈련과 추론에 적용 가능하며, 특히 토큰 수가 많고 병렬 처리가 필요한 산업용 NLP 시스템에서 유용할 수 있다. 또한, 메모리 효율적인 디코딩 기법은 실시간 응답이 필요한 챗봇 및 번역 시스템에도 활용 가능하다.