DeepSeek Model Architecture Deep Dive
Deep understanding of DeepSeek's core technical innovations: MoE (Mixture of Experts), MLA (Multi-head Latent Attention), MTP (Multi-Token Prediction), FP8 mixed-precision training. From principles to code, from architecture to performance, fully master the DeepSeek technology stack.
Start ExploringDeepSeek Model Architecture Panorama
Technical architecture panorama of DeepSeek V3 and R1. 671B total parameters, 37B activated parameters, multiple world-class innovations.
DeepSeek V3 Architecture Overview
DeepSeek V3 adopts the MoE (Mixture of Experts) architecture as its core design. The total parameter count is 671B, but only 37B parameters are activated per token during inference. This is thanks to its sparse activation mechanism: each token is routed to only a small number of expert subnetworks, rather than activating all parameters.
The core components of the V3 architecture include:
| Architecture Component | Technical Description | Key Parameters |
|---|---|---|
| Transformer Backbone | Decoder-only architecture based on Transformer | 61-layer Transformer |
| DeepSeekMoE | Fine-grained expert segmentation + shared expert isolation | 256 routed experts + 8 shared experts |
| MLA | Multi-head Latent Attention, low-rank KV compression | KV Cache compressed to 1/5~1/10 of original |
| MTP | Multi-Token Prediction, predicts next N tokens simultaneously | Depth M = 1 (predicts 1 extra token) |
| FP8 Training | First validation of FP8 training on ultra-large-scale models | Training cost $5.57 million |
V3 vs R1 Architecture Comparison
V3 and R1 share the same underlying architecture (MoE + MLA), but differ in training strategy and objectives:
| Comparison Dimension | DeepSeek V3 | DeepSeek R1 |
|---|---|---|
| Base Architecture | 671B MoE + MLA | Based on V3 architecture (671B) |
| Training method | Supervised pre-training + SFT | Reinforcement learning (RL) + cold-start SFT |
| Core capabilities | General conversation, writing, translation, knowledge Q&A | Reasoning, math, programming, logical thinking |
| Inference mode | Direct answer generation | Chain-of-Thought reasoning |
| Context window | 160K | 160K (671B) / 128K (distilled version) |
671B Parameter Overview
The parameter distribution of DeepSeek V3's 671B is as follows:
Embedding Layer
Vocabulary size 128K, embedding dimension 7168. Multi-head latent attention compresses KV into a low-dimensional latent space, significantly reducing parameter count.
- Vocabulary embedding: 128K x 7168
- Positional encoding: RoPE (Rotary Position Embedding)
Transformer Layers
61 Transformer layers, each containing an MLA attention module and a DeepSeekMoE FFN module. The first 3 layers use dense FFN (non-MoE).
- 61-layer Decoder-only
- 58 MoE layers + 3 Dense FFN layers
MoE Expert Layers
256 routed experts + 8 shared experts. Each token activates 8 routed experts + 1 shared expert. Each expert is a small FFN network.
- 256 routed experts + 8 shared experts
- Top-8 gating routing
Activated Parameters
37B activated parameters per token. Through sparse activation, only 5.5% of parameters participate in each inference computation, greatly reducing computational overhead.
- 37B / 671B = 5.5% activation rate
- Inference cost reduced by 90%+
MoE 混合专家架构详解
MoE(Mixture of Experts)是 DeepSeek 的核心架构创新。671B 参数中仅激活 37B,大幅降低推理成本。
专家路由机制
在传统 Transformer 中,每个 token 都经过相同的 FFN 层处理。MoE 架构将 FFN 层替换为多个「专家」子网络,每个 token 通过门控网络(Gate)选择最相关的专家进行计算。
DeepSeek V3 的 MoE 设计如下:
- 总专家数:256 个路由专家(Routed Expert)+ 8 个共享专家(Shared Expert)
- 每 Token 激活:8 个路由专家 + 1 个共享专家 = 9 个专家参与计算
- 门控策略:Top-K Gating,K = 8(从 256 个专家中选择得分最高的 8 个)
- 共享专家:8 个专家对所有 token 始终激活,捕获通用知识
Top-K 门控机制
门控网络是一个线性层,将 token 的隐藏状态映射到 256 维的专家得分向量。然后选择得分最高的 K 个专家,通过 softmax 归一化计算各专家的权重:
gate_logits = Linear(hidden_states) # [batch, seq, 256]
topk_weights, topk_indices = topk_softmax(gate_logits, k=8) # 选择 Top-8 专家
expert_output = sum(weight * expert[expert_idx](hidden_states) for each selected expert)
shared_output = shared_expert(hidden_states) # 共享专家始终激活
final_output = expert_output + shared_output
其中 topk_softmax 先选择 Top-K 专家,再在选中专家间做 softmax,未被选中的专家不参与计算。
Auxiliary-Loss-Free 负载均衡
传统 MoE 模型通常使用辅助损失(auxiliary loss)来鼓励专家负载均衡,防止「专家坍塌」——即大部分 token 被路由到少数几个专家,其余专家闲置。但辅助损失会增加训练复杂度,且可能影响模型性能。
DeepSeek 提出了一种创新的 auxiliary-loss-free 负载均衡策略:
- Expert Bias 动态调整:每个专家维护一个偏置项(bias),训练过程中根据专家负载动态调整。负载过高的专家降低其偏置,负载过低的专家提高偏置。
- Sequence-level 辅助损失:在序列级别而非 token 级别施加轻微平衡约束,确保每个序列内的专家使用分布均匀。
- 互补调度:当某个专家负载过高时,系统自动将部分 token 路由到次优但可用的专家。
为什么 MoE 高效?
MoE 架构的核心优势在于 稀疏激活。671B 的总参数提供了海量知识容量,但每次推理仅激活 37B(5.5%),使得计算量远低于同规模的密集模型。
Reduced Computation
The dense 671B model requires computing all 671B parameters for each inference. MoE only computes 37B activated parameters, reducing computation to about 1/18 of the dense model.
- FLOPs reduced by ~94%
- Inference latency reduced by ~90%
Knowledge Capacity Maintained
Although only a small number of parameters are activated each time, the total parameter scale of 671B allows the model to store far more knowledge than a dense model, with different experts specializing in different domains.
- 671B total knowledge capacity
- Expert specialization
Training Cost Optimization
Sparse activation + FP8 mixed-precision training reduces DeepSeek V3's training cost to $5.57 million, only 1/10 to 1/20 of comparable dense models.
- Total cost of $5.57 million
- H800 GPU cluster
MLA Multi-head Latent Attention Mechanism
Multi-head Latent Attention (MLA) is DeepSeek's attention innovation, which significantly reduces inference memory usage through low-rank KV compression.
Problems with Traditional MHA
In standard Multi-Head Attention (MHA), each token needs to cache its Key and Value vectors to support autoregressive generation of subsequent tokens. For long sequences, the memory usage of KV Cache grows rapidly:
KV_Cache = 2 * num_layers * num_heads * d_head * seq_len * batch_size
# For DeepSeek V3 (128 heads, 128 dim, 61 layers, 128K context):
# KV Cache per token is approximately 61 * 2 * 128 * 128 = 1,998,848 floats = 7.6 MB
# KV Cache for 128K context is approximately 7.6 MB * 128K ≈ 973 GB (unacceptable)
Core Idea of MLA: Low-Rank KV Compression
The core innovation of MLA is to project Key and Value into a low-dimensional latent space before attention computation. Specifically:
- KV Compression Projection: Compress the original high-dimensional Key/Value into a low-dimensional latent vector
c_KV(dimension much smaller than original) using a down-projection matrix. - Cache Latent Vector: During inference, only cache the low-dimensional latent vector
c_KV, not the full Key and Value matrices. - Up-Projection Restoration: During attention computation, restore the latent vector to full Key and Value using an up-projection matrix.
# 1. Compression projection (executed during both training and inference)
c_KV = W_down_KV @ hidden_states # [batch, seq, d_latent] d_latent << d_model
# 2. Cache latent vector (inference only)
KV_Cache = c_KV # Only cache low-dimensional latent vector
# 3. Up-projection restoration (during attention computation)
k = W_up_K @ c_KV # Restore to full Key
v = W_up_V @ c_KV # Restore to full Value
# 4. Standard attention computation
q = W_q @ hidden_states
attention = softmax(q @ k^T / sqrt(d_head)) @ v
output = W_o @ attention
RoPE Decoupling Design
RoPE (Rotary Position Embedding) is a widely used positional encoding method in modern Transformers. However, RoPE conflicts with low-rank compression: RoPE operates on Key vectors, while MLA compresses the joint representation of Key and Value.
DeepSeek's solution is RoPE decoupling: split both Query and Key into two parts each — one part processed by RoPE (capturing positional information), the other not (preserving content information). The RoPE part is handled separately and does not participate in KV compression.
# Query split
q_rope = W_qr @ hidden_states # Position part, through RoPE
q_rope = RoPE(q_rope)
# Key split
k_content = W_kc @ c_KV # Content part, restored from latent vector
k_rope = W_kr @ hidden_states # Position part, computed separately
k_rope = RoPE(k_rope)
# Concatenate and compute attention
q = concat(q_content, q_rope)
k = concat(k_content, k_rope)
attention = softmax(q @ k^T / sqrt(d_head)) @ v
Memory Savings Calculation
MLA's KV Cache compression effect is significant. Assume latent dimension is d_latent, original KV dimension is d_model:
MLA Compression Effect
In DeepSeek V3, d_latent = 512, while traditional MHA has KV dimension of 128 * 128 = 16384. Compression ratio is about 32:1.
- Latent dimension: 512
- Original KV dimension: 16384
- Compression ratio: ~32x
Actual Effect
Under 128K context window, MLA reduces KV Cache from about 973 GB to about 40 GB, making long-context inference possible on a single GPU.
- Traditional MHA: ~973 GB
- MLA: ~40 GB
- Savings: ~96%
Throughput Improvement
Smaller KV Cache means less memory read/write and higher throughput. MLA improves long-sequence inference throughput by 3-5 times.
- Memory bandwidth savings: ~90%
- Throughput improvement: 3-5x
MTP Multi-Token Prediction Mechanism
Multi-Token Prediction (MTP) allows the model to predict multiple future tokens simultaneously, improving training efficiency and inference quality.
How MTP Works
Traditional autoregressive models predict only the next token at each step. MTP allows the model to predict the next N tokens simultaneously at each step (in DeepSeek V3, M = 1, i.e., predict 1 additional token, total 2 tokens).
The core idea of MTP is: after the model's backbone network outputs hidden states, multiple independent "Prediction Heads" are used to predict tokens at positions t+1, t+2, ..., t+M respectively.
# Main model forward
hidden = transformer(input_tokens) # Main model output
# First prediction head (predict t+1, standard next-token prediction)
logits_1 = lm_head(hidden) # Predict next token
loss_1 = cross_entropy(logits_1, tokens[:, 1:])
# Second prediction head (predict t+2)
hidden_2 = MTP_Module(hidden, embedding(tokens[:, :-1])) # MTP module
logits_2 = mtp_head(hidden_2) # Predict next token
loss_2 = cross_entropy(logits_2, tokens[:, 2:])
total_loss = loss_1 + lambda * loss_2 # Weighted combination
MTP Module Design
The MTP module is a lightweight Transformer layer that takes the main model's hidden states and the current token's embedding as input, and outputs predictions for future tokens:
- Input Fusion: Concatenate the main model's hidden states with the current token's embedding, and fuse through a linear layer.
- Transformer Block: A standard Transformer layer (including attention and FFN) to further process the fused representation.
- Output Head: A shared LM Head maps the processed representation to the vocabulary distribution.
Training Efficiency Improvement
MTP provides stronger learning signals during training. The model not only needs to predict the next token but also subsequent tokens, forcing the model to learn longer-term dependencies.
Stronger Training Signal
Multiple prediction targets provide richer gradient signals, helping the model converge faster. Each training step obtains twice the information of traditional methods.
- Convergence speed improved by ~30%
- Better performance with equal data
Long-term Planning Ability
MTP forces the model to "think ahead", improving modeling of long-range dependencies. This is also one of the important reasons for R1's enhanced reasoning ability.
- Improved long-range dependency modeling
- Enhanced reasoning coherence
Inference Phase: MTP Module Can Be Discarded
An important design of MTP is: the MTP module can be completely discarded during inference. During inference, only the standard next-token prediction of the main model is used; the MTP module does not participate in inference computation, so it does not affect inference speed.
The inference acceleration brought by MTP is mainly reflected in: due to learning better representations during the training phase, the main model (without the MTP module) has higher inference quality and requires fewer inference steps for the same task.
FP8 Mixed Precision Training Technology
DeepSeek has for the first time verified the feasibility of FP8 training on ultra-large-scale models, reducing training cost to $5.57 million.
FP8 vs BF16 vs FP32
Comparison of commonly used data precisions in deep learning training:
| Precision Format | Total Bits | Exponent Bits | Mantissa Bits | Dynamic Range | Memory Usage |
|---|---|---|---|---|---|
| FP32 | 32 | 8 | 23 | 3.4 x 10^38 | 4 bytes / parameter |
| BF16 | 16 | 8 | 7 | 3.4 x 10^38 | 2 bytes / parameter |
| FP8 E4M3 | 8 | 4 | 3 | 448 | 1 byte / parameter |
FP8 uses only half the memory of BF16 and a quarter of FP32, but has a smaller dynamic range (E4M3 format), requiring extremely high training stability.
Block-wise Quantization
DeepSeek adopts a block-wise quantization strategy to address the insufficient dynamic range of FP8:
- Blocking strategy: Activations and weights are grouped into blocks of 128x128, and each block independently computes a scale factor.
- Online scaling: The scale factor is dynamically calculated based on the maximum absolute value of the current block, ensuring quantization accuracy.
- High-Precision Accumulation: Accumulation in matrix multiplication is performed in FP32 precision to avoid accumulation of quantization errors.
# Forward pass: FP8 matrix multiplication
for each block (128x128) in activation_matrix:
scale = max(abs(block)) / 448 # E4M3 max is 448
block_fp8 = round(block / scale) # Quantize to FP8
output_block = block_fp8 @ weight_fp8 # FP8 matrix multiplication
output_block = output_block * scale # Dequantize
# Backward pass: gradients computed in BF16 precision
gradient = backward(output, loss) # BF16 gradients
Training Stability Guarantees
Using FP8 training at 671B scale is extremely challenging. DeepSeek has adopted multiple stability measures:
Mixed Precision Strategy
Forward pass uses FP8 computation (GEMM operations), while gradient computation and optimizer states use BF16/FP32. Critical paths (such as softmax, layernorm) maintain high precision.
- Forward GEMM: FP8
- Gradients/Optimizer: BF16/FP32
- Critical operations: High precision
Dynamic Gradient Scaling
Dynamically adjusts gradient scaling factor during training to prevent underflow and overflow in FP8.
- Adaptive scaling factor
- Overflow detection and fallback
Total Cost of $5.57 Million
FP8 training halves memory requirements and increases training speed by about 40%. DeepSeek V3 was trained on 2048 H800 GPUs for about 2 months, with a total cost of only $5.57 million.
- Memory: Reduced by 50%
- Training speed: Increased by 40%
- Total cost: $5.57 million
DeepSeekMoE Architecture Optimization Details
Fine-grained expert segmentation, shared expert isolation, dynamic routing – the three core optimizations of DeepSeekMoE.
Fine-grained Expert Segmentation
Traditional MoE models typically use a small number of large experts (e.g., 8 experts, each being a complete FFN). DeepSeekMoE further splits each large expert into multiple smaller experts, achieving finer specialization:
- Segmentation Strategy: Split 1 standard FFN expert (e.g., 8x intermediate dimension) into 2 fine-grained experts (each 4x intermediate dimension), with each expert focusing on finer-grained knowledge patterns.
- Routing Flexibility: More experts mean more flexible combinations. Different tokens can select different expert subsets, enabling more precise knowledge activation.
- Load Balancing Advantage: Fine-grained segmentation makes expert load more even, reducing the parameter size of each expert and lowering the risk of individual expert overload.
Shared Expert Isolation
DeepSeekMoE introduces the concept of "shared experts," separated from routed experts:
Always-Active General Knowledge
8 shared experts are always active for all tokens, capturing cross-domain general knowledge (such as syntax, common sense, basic reasoning). They do not compete in routing, ensuring baseline capabilities.
- 8 shared experts
- Always active, not routed
- Capture general knowledge
On-Demand Specialized Knowledge
256 routed experts are selectively activated via Top-8 gating, with each expert specializing in specific domains (such as mathematics, programming, medicine, law, etc.).
- 256 routed experts
- Top-8 selective activation
- Domain-specialized knowledge
Dynamic Routing and Expert Load Statistics
DeepSeekMoE's routing system dynamically adjusts during training to ensure expert load balancing:
# Update expert bias after each training step
for expert in range(num_experts):
load = expert_token_count[expert] / total_tokens
if load > target_load * 1.2:
expert_bias[expert] -= learning_rate # Reduce bias for popular experts
elif load < target_load * 0.8:
expert_bias[expert] += learning_rate # Increase bias for unpopular experts
# Add bias during routing
gate_logits = Linear(hidden_states) + expert_bias
topk_weights, topk_indices = topk_softmax(gate_logits, k=8)
This dynamic bias mechanism automatically balances expert load during training without requiring additional auxiliary loss functions, avoiding potential negative impact of auxiliary loss on model performance.
DeepSeek R1 Reasoning Architecture Explained
A reasoning-enhanced model based on reinforcement learning. GRPO algorithm, chain-of-thought emergence, knowledge distillation—a comprehensive overview of R1's core technologies.
RL Training Pipeline
The training of DeepSeek R1 is divided into multiple stages, ultimately forming powerful reasoning capabilities:
| Stage | Method | Purpose |
|---|---|---|
| Stage 1: Cold Start SFT | Fine-tune with a small amount of high-quality chain-of-thought data | Give the model basic reasoning format and chain-of-thought patterns |
| Stage 2: Reasoning RL | Use GRPO reinforcement learning on reasoning tasks | Improve math, programming, and logical reasoning abilities |
| Stage 3: Rejection Sampling | Sample from the RL model and filter high-quality outputs | Construct a high-quality SFT dataset |
| Stage 4: Full-domain SFT | Mix reasoning data + general data for fine-tuning | Restore general capabilities while maintaining reasoning ability |
| Stage 5: Full-domain RL | Use RLHF alignment on all tasks | Improve helpfulness, safety, and harmlessness |
GRPO (Group Relative Policy Optimization)
GRPO is a reinforcement learning algorithm proposed by DeepSeek, an improved version of PPO (Proximal Policy Optimization). The core idea is:
- Relative advantage within group: Generate multiple candidate responses (a group) for each question, and compute relative advantage using the group's average reward as baseline, instead of using absolute reward values.
- No Critic model needed: Traditional PPO requires a Critic (value) model of the same scale as the policy model. GRPO eliminates the need for a Critic model through within-group comparison, saving about 50% of training resources.
- KL divergence constraint: Estimate KL divergence directly in the loss function to limit the magnitude of policy updates, preventing the model from deviating too far from the reference policy.
# For each question, generate G candidate responses
group_responses = [model.generate(question) for _ in range(G)]
group_rewards = [reward_model(question, r) for r in group_responses]
# Relative advantage within group (subtract mean, divide by std)
mean_reward = mean(group_rewards)
std_reward = std(group_rewards)
advantages = [(r - mean_reward) / std_reward for r in group_rewards]
# Policy gradient update
loss = -mean(advantages * log_prob_ratio - beta * kl_divergence)
model.update(loss)
Reward Modeling
R1's reward model includes two core dimensions:
Accuracy Reward
For math problems, check if the final answer is correct; for programming problems, check if the code passes test cases; for reasoning problems, check if the conclusion is logically consistent.
- Answer correctness verification
- Code test pass rate
- Logical consistency check
Format Reward
Encourage the model to place the reasoning process in dedicated tags, ensuring standardized and readable output format. This helps the model form structured chain-of-thought.
- Standardized reasoning process format
- Structured chain-of-thought output
Emergence of Chain-of-Thought
The most amazing feature of R1 is the "emergence of chain-of-thought." In pure RL training (R1-Zero), the model autonomously learned, without human-annotated reasoning steps:
- Self-verification: Check whether its intermediate steps are correct during reasoning.
- Reflection and backtracking: When a reasoning error is detected, automatically backtrack to previous steps and re-reason.
- Multi-path exploration: Try multiple reasoning paths and select the most reasonable result.
- "Aha Moment": The model exhibits moments similar to human "insight" during reasoning, re-evaluating and correcting previous reasoning paths.
Knowledge Distillation to Smaller Models
DeepSeek distills R1 671B's reasoning capabilities into smaller models (1.5B to 70B) using 800k carefully selected reasoning samples:
Data Selection
Select 800k high-quality reasoning samples from R1 671B's outputs, covering multiple domains such as mathematics, programming, and scientific reasoning.
- 800k selected samples
- Multi-domain coverage
- High-quality filtering
Target Models for Distillation
Distill based on Qwen-2.5 (1.5B/7B/14B/32B) and Llama-3.1/3.3 (8B/70B), enabling smaller models to acquire powerful reasoning abilities.
- Qwen-2.5 series
- Llama-3.1/3.3 series
- Full coverage from 1.5B to 70B
Core Module Code Implementation
Core module implementations based on DeepSeek-V3 open-source code, using real variable names and structures.
MoE Forward Propagation
MLA Attention Implementation
MTP Module Implementation
DeepSeek Model Performance Analysis
FLOPs utilization, memory bandwidth, communication overhead, scaling efficiency—the full performance picture of DeepSeek.
FLOPs Utilization
| Metric | DeepSeek V3 | Description |
|---|---|---|
| Theoretical Peak FLOPs | ~990 TFLOPS (H800 FP8) | Theoretical FP8 peak of a single H800 GPU |
| Actual Achieved FLOPs | ~580 TFLOPS | Actual computational throughput during training |
| FLOPs Utilization | ~58.6% | Far above industry average (usually 30-45%) |
DeepSeek achieves extremely high FLOPs utilization through carefully designed compute kernels and communication overlap strategies. The 58.6% utilization is top-tier among MoE models (MoE models typically have lower utilization than dense models due to sparse activation and all-to-all communication).
Memory Bandwidth Analysis
Model Weights
671B parameters, stored in FP8 format. Total weight memory is about 671 GB (FP8), and about 1342 GB in BF16 format.
- FP8: ~671 GB
- BF16: ~1342 GB
- Using FP8 saves 50%
KV Cache (MLA)
MLA compresses the KV Cache to 1/32 of traditional methods. The KV Cache for 128K context is about 40 GB.
- Traditional MHA: ~973 GB
- MLA: ~40 GB
- Savings: ~96%
Optimizer State
The AdamW optimizer requires storing momentum and variance (FP32), about 8 bytes per parameter. Optimizer state is about 5.4 TB (FP32).
- Momentum: 671B * 4 bytes
- Variance: 671B * 4 bytes
- Total: ~5.4 TB
Communication Overhead
Distributed training of MoE models involves two communication patterns:
- All-Reduce (Data Parallelism): Synchronizes gradients across all GPUs, communication volume scales with the number of GPUs. DeepSeek uses 2048 H800 GPUs and employs an efficient Ring All-Reduce algorithm.
- All-to-All (Expert Parallelism): Sends tokens from the current GPU to the GPU where the corresponding expert resides. This is a communication overhead unique to MoE models, and DeepSeek minimizes it through uniform expert distribution and communication overlap strategies.
Scaling Efficiency
| Number of GPUs | Time per Step | Scaling Efficiency | Notes |
|---|---|---|---|
| 256 H800 | ~8.0 seconds | 100% (baseline) | Strong scaling baseline |
| 512 H800 | ~4.5 seconds | ~89% | Increased communication overhead |
| 1024 H800 | ~2.6 seconds | ~77% | Significant All-to-All communication overhead |
| 2048 H800 | ~1.5 seconds | ~67% | Training configuration, scaling efficiency still acceptable |
DeepSeek V3 achieves approximately 67% scaling efficiency on 2048 H800 GPUs. For a 671B-parameter MoE model, this is a quite impressive result. Compared to dense models, MoE's All-to-All communication is the main bottleneck for scaling efficiency, and DeepSeek minimizes this impact through communication overlap and expert distribution optimization.
DeepSeek Related Resources
Dive deeper into DeepSeek models, from usage to deployment to developer ecosystem.
Complete Guide to DeepSeek Model
Complete introduction to all DeepSeek models: V3, R1, Coder, Janus, VL2, Prover. One-stop guide for download, deployment, and usage.
- Complete list of model series
- Ollama download and deployment
- Benchmark performance comparison
List of DeepSeek Open-Source Models
Complete list of 6 major series, 20+ models. All specifications, parameter counts, and use cases for V3, R1, Coder, Janus, VL2, Prover.
- 6 major model series
- Quick comparison table
- Use case guide
DeepSeek Model Deployment Tutorial
Four deployment solutions: Ollama, Docker, vLLM, Dify. From single machine to cluster, with complete commands and hardware configuration references.
- Ollama one-click deployment
- Docker Compose orchestration
- vLLM high-performance inference
How to Use DeepSeek Models
Hands-on teaching of four usage methods: official App, Ollama local deployment, API calls, third-party platforms. Even beginners can learn.
- Official App usage tutorial
- Ollama local running
- Python/JS API calls
DeepSeek Model Architecture FAQ
References and Further Reading
The technical content on this page is based on DeepSeek's official papers and technical reports, which can be verified independently.
- DeepSeek-V3 Technical Report -- Complete technical report on MoE/MLA/MTP/FP8
- DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning -- R1 reasoning architecture and GRPO algorithm
- GitHub -- deepseek-ai/DeepSeek-V3 -- Open-source code and model weights
- GitHub -- deepseek-ai/DeepSeek-R1 -- R1 open-source code and distilled models
- DeepSeekMoE: Towards Ultimate Expert Specialization in Mixture-of-Experts Language Models -- DeepSeekMoE architecture paper
- DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Model -- Original paper on MLA attention mechanism