Chorus: Shared N-gram Embeddings with Layer-wise Adaptation

Stephen Chung, Wenyu Du

arXiv:2611.23386 · 2026-11-19 공개 · arXiv · PDF

memory-efficiency embedding-projection n-gram-embeddings layer-wise-adaptation chorus factor-agram deepseek-agram table-optimizer

Abstract

Language models can gain capacity at little computational cost from n-gram embedding tables: large tables of learned vectors for short sequences of consecutive tokens, which are looked up and added to the model's input or to its intermediate layers. Recent designs commonly use a separate n-gram embedding table for each layer, which makes the tables costly in memory and prevents layers from sharing what they learn. Sharing a single table, however, gives every layer the same embedding and leaves no room for layer-wise preferences, and it performs poorly in practice. We propose Chorus, in which one set of n-gram embedding tables serves the whole network and every layer reads it in its own way. Each layer maps the refined embedding through its own projection layer, after rescaling its components by factors computed from its current hidden state. Chorus matches the quality of existing n-gram methods with 87% smaller tables: with 1.2B table parameters it predicts text better than FactorEngram and DeepSeek's Engram do with 9.6B. It outperforms Engram, TN-gram and FactorEngram in every setting where we compared them, across table sizes from 20M to 9.6B parameters. We also show that the recently proposed memory-efficient optimizer Ember works well with Chorus, saving 99.2% of table-optimizer memory compared with AdamW without degrading training performance. These results enable further scaling of n-gram embedding tables along the table-size axis by reducing memory use and allowing shared knowledge to be reused across layers.

한국어 요약

한 줄 요약

Chorus는 계층별로 n-gram 임베딩을 조정하면서 단일 테이블을 공유해 87% 더 작은 테이블로 기존 방법을 능가하는 새로운 n-gram 임베딩 설계를 제안한다.

핵심 기여도

핵심 아이디어

기존 n-gram 임베딩 방법은 각 계층마다 별도의 테이블을 사용해 메모리 사용량이 높고, 공유 학습이 불가능한 문제를 가졌다. Chorus는 이 문제를 해결하기 위해 단일 n-gram 테이블을 모든 계층에서 공유하고, 각 계층이 자신의 hidden state 기반으로 임베딩을 rescaling한 후 projection을 적용하는 방식을 제안한다. 이는 계층별로 다른 관심 영역을 반영하면서도 테이블 공유를 통해 메모리 효율성을 높인다.

Chorus는 토큰 임베딩과 n-gram 임베딩을 결합해 "refined embedding"을 생성하고, 각 계층은 이 벡터를 자신의 hidden state로 rescaling한 후 projection을 통해 계층별로 적응시킨다. 이는 동일한 벡터가 다양한 계층에서 다른 방식으로 활용될 수 있도록 하며, 기존의 고정된 임베딩 공유 방식의 한계를 극복한다.

기술적 접근법

주요 결과

의의 및 한계

Chorus는 n-gram 임베딩 테이블의 메모리 사용을 87% 절감하면서도 성능을 유지하거나 향상시켜, 대규모 테이블 확장이 가능하다는 점에서 학술적·실용적 의의가 있다. 특히, Ember 최적화기와의 호환성은 훈련 메모리 효율성을 극대화하며, 계층 간 지식 공유를 가능하게 한다는 장점이 있다.

그러나, Chorus는 추론 단계에서 계층별 projection 계산이 추가되어 복잡도가 증가할 수 있다. 또한, 일부 추론 중심 태스크(예: CommonsenseQA, Dyck languages)에서는 기존 baseline과 큰 차이가 없거나 오히려 약간 낮은 성능을 보이는 경우가 있어, 추론 능력에 대한 개선이 필요할 수 있다.

실용적 활용

Chorus는 메모리 효율적인 대규모 언어 모델 개발에 적합하며, 특히 테이블 기반 임베딩을 활용한 모델 확장 및 다층 구조의 지식 공유가 필요한 연구 분야에서 활용 가능하다. 또한, Ember 최적화기와의 호환성은 대규모 모델 훈련 시 메모리 부담을 줄이는 데 유용하다.