deepseek_v2_tiny
A Mixture-of-Experts language model with Multi-head Latent Attention and shared plus routed experts.
Language · 277 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Task
- Language
- Parameters
- 2.1M
- Operations
- 277
- Framework
- PyTorch
- Recurrent
- No
- Published
- 2024
- Cited by
- 1,533 (as of 11 November 2026)
- Authors
- DeepSeek-AI
- Source
- transformers 5.18.0
- License
- MIT
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m4157
- Graph hash
- fc5ee29d17425ab4bf86ed607f8823118eb9d032f316e2f4ab6ddee9deb79643
- Skeleton hash
- d123e3f0eadc3223d768fc53637b2536c81d19a97fd5166d9436be35e34fe03b
- Architecture hash
- 49ce44bd0bed825566fb01b932e6c5d0cc064082d63570f882ea33e5776a982d
- Diagram SHA-256
- c6b5443bdd1aee193da9b5c9c8d819faa2adcd6d2232cce807b05cdc16bf12d0
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
What it is
DeepSeek-V2 is a Mixture-of-Experts (MoE) language model designed for economical training and efficient inference. It changes two parts of the Transformer: the attention modules use Multi-head Latent Attention (MLA) and the feed-forward networks use DeepSeekMoE.
MLA compresses keys and values jointly into a low-rank latent vector, which reduces the key-value (KV) cache kept during generation. Because rotary position embedding (RoPE) is incompatible with this compression, the paper adds a decoupled RoPE strategy in which additional multi-head queries and a shared key carry the position information. In the feed-forward layers, DeepSeekMoE splits experts into finer pieces and keeps some shared experts apart from the routed experts.
The paper's full model comprises 236B total parameters, of which 21B are activated for each token, and supports a context length of 128K tokens. Compared with DeepSeek 67B, the paper reports that it saves 42.5% of training costs, reduces the KV cache by 93.3% and raises maximum generation throughput to 5.76 times. The paper also describes DeepSeek-V2-Lite, a smaller release with 27 layers and a hidden dimension of 2048. In DeepSeek-V2-Lite the queries are not compressed, and all feed-forward networks except for the first layer are replaced with MoE layers.
Key idea. DeepSeek-V2 combines Multi-head Latent Attention, which compresses the key-value cache into a latent vector, with DeepSeekMoE sparse expert layers to make training economical and inference efficient.
- deepseek-v2
- deepseek v2
- deepseek_v2
- deepseek-v2-lite
- deepseekmoe
- multi-head latent attention
- mla
- mixture-of-experts language model
- moe llm
- deepseek
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{deepseekai2024deepseekv2strongeconomicalefficient,
title={DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Model},
author={DeepSeek-AI and Aixin Liu and Bei Feng and Bin Wang and Bingxuan Wang and Bo Liu and Chenggang Zhao and Chengqi Dengr and Chong Ruan and Damai Dai and Daya Guo and Dejian Yang and Deli Chen and Dongjie Ji and Erhang Li and Fangyun Lin and Fuli Luo and Guangbo Hao and Guanting Chen and Guowei Li and H. Zhang and Hanwei Xu and Hao Yang and Haowei Zhang and Honghui Ding and Huajian Xin and Huazuo Gao and Hui Li and Hui Qu and J. L. Cai and Jian Liang and Jianzhong Guo and Jiaqi Ni and Jiashi Li and Jin Chen and Jingyang Yuan and Junjie Qiu and Junxiao Song and Kai Dong and Kaige Gao and Kang Guan and Lean Wang and Lecong Zhang and Lei Xu and Leyi Xia and Liang Zhao and Liyue Zhang and Meng Li and Miaojun Wang and Mingchuan Zhang and Minghua Zhang and Minghui Tang and Mingming Li and Ning Tian and Panpan Huang and Peiyi Wang and Peng Zhang and Qihao Zhu and Qinyu Chen and Qiushi Du and R. J. Chen and R. L. Jin and Ruiqi Ge and Ruizhe Pan and Runxin Xu and Ruyi Chen and S. S. Li and Shanghao Lu and Shangyan Zhou and Shanhuang Chen and Shaoqing Wu and Shengfeng Ye and Shirong Ma and Shiyu Wang and Shuang Zhou and Shuiping Yu and Shunfeng Zhou and Size Zheng and T. Wang and Tian Pei and Tian Yuan and Tianyu Sun and W. L. Xiao and Wangding Zeng and Wei An and Wen Liu and Wenfeng Liang and Wenjun Gao and Wentao Zhang and X. Q. Li and Xiangyue Jin and Xianzu Wang and Xiao Bi and Xiaodong Liu and Xiaohan Wang and Xiaojin Shen and Xiaokang Chen and Xiaosha Chen and Xiaotao Nie and Xiaowen Sun and Xiaoxiang Wang and Xin Liu and Xin Xie and Xingkai Yu and Xinnan Song and Xinyi Zhou and Xinyu Yang and Xuan Lu and Xuecheng Su and Y. Wu and Y. K. Li and Y. X. Wei and Y. X. Zhu and Yanhong Xu and Yanping Huang and Yao Li and Yao Zhao and Yaofeng Sun and Yaohui Li and Yaohui Wang and Yi Zheng and Yichao Zhang and Yiliang Xiong and Yilong Zhao and Ying He and Ying Tang and Yishi Piao and Yixin Dong and Yixuan Tan and Yiyuan Liu and Yongji Wang and Yongqiang Guo and Yuchen Zhu and Yuduan Wang and Yuheng Zou and Yukun Zha and Yunxian Ma and Yuting Yan and Yuxiang You and Yuxuan Liu and Z. Z. Ren and Zehui Ren and Zhangli Sha and Zhe Fu and Zhen Huang and Zhen Zhang and Zhenda Xie and Zhewen Hao and Zhihong Shao and Zhiniu Wen and Zhipeng Xu and Zhongyu Zhang and Zhuoshu Li and Zihan Wang and Zihui Gu and Zilin Li and Ziwei Xie},
year={2024},
eprint={2405.04434},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2405.04434},
}