Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,66 @@
|
|
1 |
-
---
|
2 |
-
license: apache-2.0
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
tags:
|
4 |
+
- moe
|
5 |
+
- llm
|
6 |
+
- efficient-inference
|
7 |
+
pipeline_tag: text-generation
|
8 |
+
---
|
9 |
+
|
10 |
+
# TC-MoE: Augmenting Mixture of Experts with Ternary Expert Choice
|
11 |
+
|
12 |
+
## Model Description
|
13 |
+
|
14 |
+
TC-MoE is a novel Mixture-of-Experts (MoE) architecture that enhances traditional MoE models through expert space expansion. By applying the ternary set {-1, 0, 1} to each original expert, TC-MoE achieves:
|
15 |
+
|
16 |
+
- **9% reduction** in activated experts compared to Top-K routing
|
17 |
+
- **1.1% average performance gain** on language understanding benchmarks
|
18 |
+
- Flexible efficiency-effectiveness trade-off via reward mechanism
|
19 |
+
|
20 |
+
Key innovations:
|
21 |
+
- 🎯 **Ternary Expert Expansion**: Creates parameter-sharing expert variants (-1, 0, +1) without significant computational overhead
|
22 |
+
- ⚖️ **Adaptive Load Balancing**: Novel load balance loss for expert workload distribution
|
23 |
+
- 🎮 **Reward-Driven Routing**: Dynamic control of expert activation ratios
|
24 |
+
|
25 |
+
## Model Overview
|
26 |
+
|
27 |
+
- **Architecture**: Decoder-only transformer based on LLaMA
|
28 |
+
- **Pretraining Data**:
|
29 |
+
- RedPajama (100B tokens)
|
30 |
+
- **Model Size**:
|
31 |
+
- Base (681M/2.3B params)
|
32 |
+
|
33 |
+
## Usage
|
34 |
+
|
35 |
+
```python
|
36 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
37 |
+
|
38 |
+
model = AutoModelForCausalLM.from_pretrained("stiger1000/TC-MoE")
|
39 |
+
tokenizer = AutoTokenizer.from_pretrained("stiger1000/TC-MoE")
|
40 |
+
|
41 |
+
inputs = tokenizer("The capital of France is", return_tensors="pt")
|
42 |
+
outputs = model.generate(**inputs, max_length=50)
|
43 |
+
print(tokenizer.decode(outputs[0]))
|
44 |
+
```
|
45 |
+
|
46 |
+
## Training Details
|
47 |
+
|
48 |
+
- **Optimizer**: AdamW (β₁=0.9, β₂=0.95)
|
49 |
+
- **Learning Rate**: 1e-4 with cosine decay
|
50 |
+
- **Batch Size**: 4M tokens
|
51 |
+
- **Loss Components**:
|
52 |
+
- Language Modeling Loss
|
53 |
+
- Load Balance Loss (α₁=0.01)
|
54 |
+
- Reward Loss (α₂=0.0)
|
55 |
+
|
56 |
+
## Citation
|
57 |
+
```bibtex
|
58 |
+
@inproceedings{yan2025tcmoe,
|
59 |
+
title={TC-MoE: Augmenting Mixture of Experts with Ternary Expert Choice},
|
60 |
+
author={Yan, Shen and Bin, Xingyan and Zhang, Sijun and Wang, Yisen and Lin, Zhouchen},
|
61 |
+
booktitle={The Thirteenth International Conference on Learning Representations},
|
62 |
+
year={2025}
|
63 |
+
}
|
64 |
+
```
|
65 |
+
|
66 |
+
📚 **Repository**: [GitHub](https://github.com/stiger1000/TC-MoE)
|