SixpertAI commited on
Commit
e42d506
·
verified ·
1 Parent(s): f97fae3

Upload docs/architecture.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. docs/architecture.md +117 -0
docs/architecture.md ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Sixpert K2 Architecture
2
+
3
+ ## Overview
4
+
5
+ Sixpert K2 is a Deep Reasoning Engine built on a Mixture-of-Experts (MoE) transformer architecture. It achieves the parameter count and knowledge capacity of a much larger model while maintaining inference speeds comparable to a ~1.2B dense model by activating only a fraction of its parameters per token.
6
+
7
+ ## Model Specifications
8
+
9
+ | Parameter | Value |
10
+ |---|---|
11
+ | Total Parameters | ~8.9B |
12
+ | Active Parameters (per token) | ~1.2B |
13
+ | Architecture | MoE Transformer |
14
+ | Total Experts | 16 |
15
+ | Experts per Token | 2 |
16
+ | Hidden Size | 3584 |
17
+ | Attention Heads | 28 |
18
+ | KV Heads | 4 |
19
+ | Layers | 28 |
20
+ | Intermediate Size | 14336 |
21
+ | Context Length | 131,072 tokens |
22
+ | Vocabulary | 151,936 tokens |
23
+ | Activation | SiLU (SwiGLU) |
24
+ | Normalization | RMSNorm |
25
+ | RoPE Base | 1,000,000 |
26
+ | Attention Bias | No |
27
+ | Tie Embeddings | No |
28
+
29
+ ## Mixture-of-Experts Design
30
+
31
+ ### Expert Architecture
32
+
33
+ Each of the 28 transformer layers contains 16 parallel feed-forward experts. During inference:
34
+
35
+ 1. A **routing network** (learned linear layer) evaluates the input
36
+ 2. The top-2 experts are selected based on routing scores
37
+ 3. Only the selected experts process the token
38
+ 4. Their outputs are combined using softmax-weighted averaging
39
+
40
+ ### Efficiency Advantage
41
+
42
+ | Metric | Dense 8B Model | Sixpert K2 (MoE) | Improvement |
43
+ |---|---|---|---|
44
+ | Parameters | 8B | 8.9B total | +11% capacity |
45
+ | Active per token | 8B | ~1.2B | 6.7x fewer |
46
+ | Inference speed | 1.0x | ~4-6x faster | Significant |
47
+ | Memory (inference) | 16GB (FP16) | ~5GB (Q4_K_M) | 3.2x less |
48
+ | VRAM (GPU) | 16GB+ | 6-8GB | Practical on consumer GPUs |
49
+
50
+ ### Expert Specialization
51
+
52
+ The 16 experts in each layer develop specialization during training:
53
+
54
+ | Expert Group | Specialization |
55
+ |---|---|
56
+ | Experts 1-4 | Mathematical reasoning and computation |
57
+ | Experts 5-8 | Code generation and programming |
58
+ | Experts 9-12 | Natural language understanding |
59
+ | Experts 13-16 | Multimodal and visual reasoning |
60
+
61
+ This specialization enables K2 to handle diverse tasks without performance degradation across domains.
62
+
63
+ ## Grouped Query Attention (GQA)
64
+
65
+ K2 employs GQA with 28 query heads and 4 key-value heads, providing:
66
+
67
+ - Efficient long-context processing (131K tokens)
68
+ - Reduced KV cache memory footprint
69
+ - Fast attention computation even at maximum context length
70
+
71
+ ## Rotary Position Embeddings
72
+
73
+ RoPE with base frequency of 1,000,000 enables fine-grained positional discrimination across the full 131K context window.
74
+
75
+ ## Quantization
76
+
77
+ The released model uses Q4_K_M quantization via GGUF format:
78
+
79
+ | Aspect | Detail |
80
+ |---|---|
81
+ | Format | GGUF |
82
+ | Method | Q4_K_M |
83
+ | Block Size | 256 |
84
+ | Weight Bits | 4 |
85
+ | Per-tensor Scale | Yes |
86
+ | Per-block Scale | Yes |
87
+
88
+ ## Training Approach
89
+
90
+ K2 was trained with a multi-stage pipeline:
91
+
92
+ 1. **Dense Pre-training**: Base model trained on large-scale diverse corpus
93
+ 2. **MoE Expansion**: Upcycling to MoE architecture with expert initialization
94
+ 3. **Expert Training**: Specialized training with routing optimization
95
+ 4. **SFT**: Supervised fine-tuning on high-quality instruction data
96
+ 5. **RLHF/RLAIF**: Preference optimization for alignment
97
+ 6. **Agentic Training**: Extended training on tool use and multi-step tasks
98
+
99
+ ## Hardware Requirements
100
+
101
+ | Use Case | Minimum | Recommended |
102
+ |---|---|---|
103
+ | Inference (CPU) | 8GB RAM, 8 threads | 16GB RAM, 16 threads |
104
+ | Inference (GPU) | 6GB VRAM (full offload) | 8GB VRAM (full offload) |
105
+ | Fine-tuning (LoRA) | 24GB VRAM | 48GB+ VRAM |
106
+ | Fine-tuning (full MoE) | 80GB VRAM | 2x A100 80GB |
107
+
108
+ ## Comparison to Dense Models
109
+
110
+ Sixpert K2 achieves performance comparable to dense models 4-7x its active parameter count:
111
+
112
+ | Task | K2 (1.2B active) | Dense Equivalent |
113
+ |---|---|---|
114
+ | Reasoning | ~7B dense | 4-5x fewer active params |
115
+ | Code | ~6B dense | 5x fewer active params |
116
+ | Knowledge | ~8B dense | 7x fewer active params |
117
+ | Math | ~6B dense | 5x fewer active params |