Files
myWiki/concepts/sparsity-allocation.md

65 lines
2.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: "Sparsity Allocation (U-shaped Law)"
created: 2026-06-25
updated: 2026-06-25
type: concept
tags: ["sparsity", "scaling-law", "mixture-of-experts", "architecture"]
sources:
- "[[engram-conditional-memory-2026]]"
---
# Sparsity Allocation (U-shaped Law)
Sparsity Allocation 是 Engram 论文提出的形式化问题:在固定的总参数预算下,如何将稀疏容量在 MoE条件计算和 Engram条件记忆之间最优分配。
## 问题定义
给定三个参数度量:
- **P_tot**:总可训练参数
- **P_act**:每个 token 的激活参数(决定 FLOPs
- **P_sparse** = P_tot - P_act非活动参数"免费"预算)
分配比 ρ ∈ [0,1]MoE 占 P_sparse 的比例。
```
P_MoE(sparse) = ρ · P_sparse
P_Engram = (1-ρ) · P_sparse
```
- ρ = 1 → 纯 MoE所有非活动参数是路由专家
- ρ < 1 减少路由专家释放参数给 Engram 嵌入槽
## U 形缩放律
实验在两个计算规模下C=2e20 FLOPs, P_tot=5.7B; C=6e20 FLOPs, P_tot=9.9B),保持 P_tot/P_act 10
**关键发现**
1. **U 形验证损失曲线** MoE (ρ=1) 和极低 ρ 都不如中间值
2. **最优 ρ ≈ 75-80%**将约 20-25% 的稀疏预算分配给 Engram
3. **ρ=40% 仍可比肩 ρ=100%**Engram 在仅 46 个专家vs 106时性能接近纯 MoE
4. **最优值稳定**不同计算规模下5.7B vs 9.9B最优 ρ 保持在 75-80%
10B 级别验证损失从 1.7248 (ρ=1) 改善至 1.7109 (ρ0.8)Δ=0.0139。
## 结构含义
| 区域 | 现象 | 原因 |
|------|------|------|
| MoE-dominated (ρ1) | 次优 | 缺少专用记忆被迫用计算重建静态模式 |
| Engram-dominated (ρ0) | 恶化 | 失去条件计算能力无法处理动态推理 |
| Optimal (ρ0.75-0.80) | 最优 | 计算和记忆的互补性达到平衡 |
## 无限内存扩展
固定 MoE backbone (P_tot3B, P_act=568M),单独扩大 Engram 嵌入槽2.58e5 1e7额外 +13B 参数
- 验证损失遵循**严格幂律**log-log 线性
- Engram OverEncoding直接平均 N-gram 嵌入到词表释放大得多的扩展潜力
- 提供**可预测的扩展旋钮**更大内存持续产生收益无需额外计算
## 参考
- [[engram-conditional-memory-2026]]
- [[conditional-memory]]
- [[engram]]
- [[mixture-of-experts]]