Text Generation
Transformers
Safetensors
deepseek_v2
moe-to-dense
distillation
pruning
research-artifact
conversational
custom_code
text-generation-inference
Instructions to use jhyuckkim/DeepSeek-V2-Lite-Dense-3B-CP-K6 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jhyuckkim/DeepSeek-V2-Lite-Dense-3B-CP-K6 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="jhyuckkim/DeepSeek-V2-Lite-Dense-3B-CP-K6", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("jhyuckkim/DeepSeek-V2-Lite-Dense-3B-CP-K6", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("jhyuckkim/DeepSeek-V2-Lite-Dense-3B-CP-K6", trust_remote_code=True, device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use jhyuckkim/DeepSeek-V2-Lite-Dense-3B-CP-K6 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "jhyuckkim/DeepSeek-V2-Lite-Dense-3B-CP-K6" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jhyuckkim/DeepSeek-V2-Lite-Dense-3B-CP-K6", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/jhyuckkim/DeepSeek-V2-Lite-Dense-3B-CP-K6
- SGLang
How to use jhyuckkim/DeepSeek-V2-Lite-Dense-3B-CP-K6 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "jhyuckkim/DeepSeek-V2-Lite-Dense-3B-CP-K6" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jhyuckkim/DeepSeek-V2-Lite-Dense-3B-CP-K6", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "jhyuckkim/DeepSeek-V2-Lite-Dense-3B-CP-K6" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jhyuckkim/DeepSeek-V2-Lite-Dense-3B-CP-K6", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use jhyuckkim/DeepSeek-V2-Lite-Dense-3B-CP-K6 with Docker Model Runner:
docker model run hf.co/jhyuckkim/DeepSeek-V2-Lite-Dense-3B-CP-K6
Align naming and results with the published arXiv version
Browse files
README.md
CHANGED
|
@@ -17,7 +17,7 @@ tags:
|
|
| 17 |
> **Research artifact, not a general-purpose model.**
|
| 18 |
> These weights are released so that the experiments in the paper *Pruning and
|
| 19 |
> Distilling Mixture-of-Experts into Dense Language Models* can be reproduced.
|
| 20 |
-
> Each student is distilled on a fixed, small token budget (
|
| 21 |
> Qwen3, 0.3B tokens for DeepSeek-V2-Lite and GPT-OSS) purely so that expert
|
| 22 |
> scoring and grouping methods can be compared under an equal budget. Absolute
|
| 23 |
> quality is therefore far below the teacher and below pretrained models of the
|
|
@@ -35,20 +35,20 @@ https://github.com/krafton-ai/moe-to-dense
|
|
| 35 |
|
| 36 |
## Results
|
| 37 |
|
| 38 |
-
Full comparison group for this architecture, DeepSeek-V2-Lite to dense, 0.3B-token distillation (paper Table
|
| 39 |
bold, and rows whose weights are also released link to them.
|
| 40 |
|
| 41 |
| Configuration | Wino | Hella | ARC-E | ARC-C | MMLU | Avg |
|
| 42 |
|---|---|---|---|---|---|---|
|
| 43 |
-
| [DO-AWP, K=6](https://huggingface.co/jhyuckkim/DeepSeek-V2-Lite-Dense-3B-DO-AWP-K6) | 60.3 | 41.0 | 53.7 | 28.2 | 28.7 | 42.39 |
|
| 44 |
-
| SF, K=12 | 56.9 | 41.1 | 54.8 | 28.4 | 24.6 | 41.16 |
|
| 45 |
-
| DO-AWP, K=12 | 59.0 | 41.5 | 51.7 | 26.2 | 26.9 | 41.07 |
|
| 46 |
-
| AWP, K=12 | 57.1 | 40.9 | 52.9 | 27.4 | 26.4 | 40.93 |
|
| 47 |
-
| CP, K=12 | 55.6 | 40.2 | 53.5 | 26.6 | 26.8 | 40.53 |
|
| 48 |
-
| [AWP, K=6](https://huggingface.co/jhyuckkim/DeepSeek-V2-Lite-Dense-3B-AWP-K6) | 56.8 | 38.6 | 51.0 | 27.5 | 28.1 | 40.37 |
|
| 49 |
| [SF, K=6](https://huggingface.co/jhyuckkim/DeepSeek-V2-Lite-Dense-3B-SF-K6) | 54.9 | 38.9 | 52.4 | 27.1 | 26.9 | 40.04 |
|
|
|
|
| 50 |
| **CP, K=6** | **53.0** | **36.9** | **49.4** | **25.7** | **25.3** | **38.07** |
|
| 51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
| Random initialization | 50.1 | 25.4 | 28.8 | 24.1 | 22.9 | 30.27 |
|
| 53 |
| Teacher (DeepSeek-V2-Lite) | 76.2 | 80.5 | 84.4 | 56.3 | 58.0 | 71.09 |
|
| 54 |
|
|
@@ -63,8 +63,8 @@ Downstream accuracy is Winogrande 5-shot, HellaSwag 10-shot, ARC-Easy 25-shot, A
|
|
| 63 |
| Distillation data | FineWeb-Edu (`sample-10BT`), 0.3B tokens |
|
| 64 |
| Expert scoring | CP |
|
| 65 |
| Experts kept (K) | 6 |
|
| 66 |
-
| Grouping | pure pruning
|
| 67 |
-
| Down-projection scaling |
|
| 68 |
|
| 69 |
## Usage
|
| 70 |
|
|
@@ -78,7 +78,7 @@ tok = AutoTokenizer.from_pretrained("jhyuckkim/DeepSeek-V2-Lite-Dense-3B-CP-K6",
|
|
| 78 |
```
|
| 79 |
|
| 80 |
`trust_remote_code=True` is required. The student keeps DeepSeek's own model
|
| 81 |
-
class so that MLA attention and the shared
|
| 82 |
`configuration_deepseek.py` / `modeling_deepseek.py` ship with the repo.
|
| 83 |
|
| 84 |
## Citation
|
|
|
|
| 17 |
> **Research artifact, not a general-purpose model.**
|
| 18 |
> These weights are released so that the experiments in the paper *Pruning and
|
| 19 |
> Distilling Mixture-of-Experts into Dense Language Models* can be reproduced.
|
| 20 |
+
> Each student is distilled on a fixed, small token budget (~4B tokens for
|
| 21 |
> Qwen3, 0.3B tokens for DeepSeek-V2-Lite and GPT-OSS) purely so that expert
|
| 22 |
> scoring and grouping methods can be compared under an equal budget. Absolute
|
| 23 |
> quality is therefore far below the teacher and below pretrained models of the
|
|
|
|
| 35 |
|
| 36 |
## Results
|
| 37 |
|
| 38 |
+
Full comparison group for this architecture, DeepSeek-V2-Lite to dense, 0.3B-token distillation (paper Table 17). This model's row is in
|
| 39 |
bold, and rows whose weights are also released link to them.
|
| 40 |
|
| 41 |
| Configuration | Wino | Hella | ARC-E | ARC-C | MMLU | Avg |
|
| 42 |
|---|---|---|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
| [SF, K=6](https://huggingface.co/jhyuckkim/DeepSeek-V2-Lite-Dense-3B-SF-K6) | 54.9 | 38.9 | 52.4 | 27.1 | 26.9 | 40.04 |
|
| 44 |
+
| SF, K=12 | 56.9 | 41.1 | 54.8 | 28.4 | 24.6 | 41.16 |
|
| 45 |
| **CP, K=6** | **53.0** | **36.9** | **49.4** | **25.7** | **25.3** | **38.07** |
|
| 46 |
+
| CP, K=12 | 55.6 | 40.2 | 53.5 | 26.6 | 26.8 | 40.53 |
|
| 47 |
+
| [ACP, K=6](https://huggingface.co/jhyuckkim/DeepSeek-V2-Lite-Dense-3B-ACP-K6) | 56.8 | 38.6 | 51.0 | 27.5 | 28.1 | 40.37 |
|
| 48 |
+
| ACP, K=12 | 57.1 | 40.9 | 52.9 | 27.4 | 26.4 | 40.93 |
|
| 49 |
+
| [DO-ACP, K=6](https://huggingface.co/jhyuckkim/DeepSeek-V2-Lite-Dense-3B-DO-ACP-K6) | 60.3 | 41.0 | 53.7 | 28.2 | 28.7 | 42.39 |
|
| 50 |
+
| DO-ACP, K=12 | 59.0 | 41.5 | 51.7 | 26.2 | 26.9 | 41.07 |
|
| 51 |
+
| Random FFN + teacher attn | 50.6 | 25.6 | 30.6 | 20.9 | 23.6 | 30.25 |
|
| 52 |
| Random initialization | 50.1 | 25.4 | 28.8 | 24.1 | 22.9 | 30.27 |
|
| 53 |
| Teacher (DeepSeek-V2-Lite) | 76.2 | 80.5 | 84.4 | 56.3 | 58.0 | 71.09 |
|
| 54 |
|
|
|
|
| 63 |
| Distillation data | FineWeb-Edu (`sample-10BT`), 0.3B tokens |
|
| 64 |
| Expert scoring | CP |
|
| 65 |
| Experts kept (K) | 6 |
|
| 66 |
+
| Grouping | pure pruning on the routed experts, 8 groups total (2 shared + 6 routed) |
|
| 67 |
+
| Down-projection scaling | shared experts copied unscaled, routed groups scaled by average conditional probability |
|
| 68 |
|
| 69 |
## Usage
|
| 70 |
|
|
|
|
| 78 |
```
|
| 79 |
|
| 80 |
`trust_remote_code=True` is required. The student keeps DeepSeek's own model
|
| 81 |
+
class so that MLA attention and the shared experts are preserved unchanged, and
|
| 82 |
`configuration_deepseek.py` / `modeling_deepseek.py` ship with the repo.
|
| 83 |
|
| 84 |
## Citation
|