00:00:00

Share Your Feedback 🏝️

Model, MoE | DeepSeek-v2

Model, MoE | DeepSeek-v2

MinWoo(Daniel) Park | Tech Blog

Read more
Previous: LoRA, Survey | LoRA Land Next: Semiparametric Token-Sequence

Model, MoE | DeepSeek-v2

  • Related Project: Private
  • Category: Paper Review
  • Date: 2024-05-05

DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Model

  • url: https://arxiv.org/abs/2405.04434
  • pdf: https://arxiv.org/pdf/2405.04434
  • html https://arxiv.org/html/2405.04434v1
  • github: https://github.com/deepseek-ai/DeepSeek-V2
  • abstract: We present DeepSeek-V2, a strong Mixture-of-Experts (MoE) language model characterized by economical training and efficient inference. It comprises 236B total parameters, of which 21B are activated for each token, and supports a context length of 128K tokens. DeepSeek-V2 adopts innovative architectures including Multi-head Latent Attention (MLA) and DeepSeekMoE. MLA guarantees efficient inference through significantly compressing the Key-Value (KV) cache into a latent vector, while DeepSeekMoE enables training strong models at an economical cost through sparse computation. Compared with DeepSeek 67B, DeepSeek-V2 achieves significantly stronger performance, and meanwhile saves 42.5% of training costs, reduces the KV cache by 93.3%, and boosts the maximum generation throughput to 5.76 times. We pretrain DeepSeek-V2 on a high-quality and multi-source corpus consisting of 8.1T tokens, and further perform Supervised Fine-Tuning (SFT) and Reinforcement Learning (RL) to fully unlock its potential. Evaluation results show that, even with only 21B activated parameters, DeepSeek-V2 and its chat versions still achieve top-tier performance among open-source models. The model checkpoints are available at this https URL.

DeepSeek-v1

Release Date: 2024.01

  • Scaling Law Insights
  • DeepSeek LLM Development
  • Superior Benchmark Performance
Learn More >
DeepSeek-v2

Release Date: 2023.05

  • Economical Training and Efficient Inference
  • Innovative Architectures: MLA and MoE
  • Superior Performance and Cost Savings
Learn More >

Contents

TL;DR


  1. DeepSeek-V2는 변형된 어텐션 메커니즘과 모듈화된 전문가 모델을 통해 언어 모델의 효율성과 경제성을 극대화합니다.
  2. 모델은 주의 깊게 설계된 아키텍처로, 대규모 데이터셋에서 우수한 성능을 보이면서도 비용 효율적인 트레이닝이 가능합니다.
  3. 이 모델은 고도의 최적화를 통해 질의 응답 및 오픈 도메인 대화에 있어 우수한 결과를 보여주며, 온라인 강화 학습을 통해 휴먼의 선호도에 맞춰 조정됩니다.

[개요 및 문제 인식]

최근 대규모 언어모델(Large Language Models, LLMs)은 인공 일반 지능(Artificial General Intelligence, AGI)의 새벽을 열어가고 있습니다. 이런 모델들은 파라미터 수가 증가할수록 지능이 향상되는 경향이 있으나, 이는 트레이닝과 인퍼런스에서 막대한 컴퓨팅 자원을 요구하는 문제를 야기합니다. 따라서, 효율적인 트레이닝과 빠른 인퍼런스 속도를 가능하게 하는 새로운 구조의 필요성이 대두되었습니다.

[방법: Multi-Head Latent Attention 및 DeepSeekMoE]

[Multi-Head Latent Attention (MLA)]

기존의 Multi-Head Attention (MHA)은 인퍼런스 시 키(Key)와 값(Value)의 저장 공간이 커서 인퍼런스 효율성을 저하시키는 주된 원인입니다. 이를 개선하기 위해, 저자들은 낮은 랭크의 키-값 공동 압축 방식을 도입한 MLA를 제안합니다. 이는 키와 값의 차원을 축소하여 필요한 캐시의 양을 대폭 줄이면서도 성능은 유지하게 설계되었습니다.

\[\text{K-V compresion: } c_{t} = W_{DKV} h_{t}, \quad k_{t} = W_U^K c_{KV,t}, \quad v_{t} = W_U^V c_{KV,t}\]

상기 식에서 \(W_{DKV}\), \(W_U^K\), \(W_U^V\)는 각각 다운 프로젝션 및 업 프로젝션 행렬입니다. 이를 통해, 모델은 저장 공간을 크게 절약하면서도 정보 손실을 최소화합니다.

[DeepSeekMoE]

MoE(Mixture of Experts) 아키텍처는 전문가 단위를 세분화하여 더욱 특화된 학습이 가능하게 합니다. DeepSeek-V2는 이 아키텍처를 통해 우수한 모델을 경제적 비용으로 트레이닝할 수 있습니다. 또한, 불필요한 통신 비용을 줄이기 위해 디바이스 제한 라우팅 기술을 적용하여 효율성을 높였습니다.

\[h'_t = u_t + \sum_{i=1}^{N_s} \text{FFN}^{(s)}_i(u_t) + \sum_{i=1}^{N_r} g_{i,t} \text{FFN}^{(r)}_i(u_t)\]

상기 식에서 \(N_s\), \(N_r\)은 각각 공유 전문가와 라우팅 전문가의 수입니다. \(g_{i,t}\)는 게이트 값으로, 각 토큰에 대한 전문가의 활성화 정도를 결정합니다.

[평가 및 결과]

DeepSeek-V2는 다양한 벤치마크에서 우수한 성능을 보여주며, 특히 언어 이해, 인퍼런스, 수학 및 코드 작성과 관련된 작업에서 우수한 결과를 제시합니다. 모델은 또한 다양한 언어로의 확장성을 보여주며, 특히 중국어에서 우수한 성능을 나타냅니다. 이는 모델이 대규모 데이터와 복잡한 작업 사이에서도 높은 일반화 능력을 갖추고 있음을 시사합니다.

[결론 및 미래 작업]

DeepSeek-V2는 고도로 최적화된 아키텍처를 통해 언어 모델의 새로운 가능성을 제시합니다. 추가적인 연구를 통해 휴먼의 선호도에 맞춘 더욱 정밀한 모델 조정이 가능할 것으로 기대됩니다.

Previous: LoRA, Survey | LoRA Land Next: Semiparametric Token-Sequence

post contain ""

    No matching posts found containing ""