Files
myWiki/concepts/head-structure-ssm.md

52 lines
1.4 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: "SSM 多头结构 (Head Structure for SSMs)"
created: 2026-06-18
updated: 2026-06-18
type: concept
tags: [ssm, attention, architecture, parallelism]
sources:
- dao-transformers-are-ssms-2024
---
# SSM 多头结构 (Head Structure for SSMs)
Dao & Gu (2024) 将 Transformer 的"多头"概念系统化引入 SSM 设计空间,形成了 Mamba 块结构的架构词汇。
## 三种 Head 结构
### MIS多输入 SSMMulti-Input SSM
- Mamba 的原始设计
- 等价于多值注意力MVA
- P 个独立 SSM 并行,共享输入但独立参数
### MVA多值注意力Multi-Value Attention
- 多头注意力的变体
- 与 MIS 等价——SSD 对偶的体现
### GVA分组值注意力Grouped-Value Attention
- Mamba-2 采用的结构
- 介于 MHA多头注意力和 MQA多查询注意力之间
- 更灵活的张量并行支持
## 对张量并行的意义
Mamba-2 通过 GVA 结构实现了:
- **所有数据依赖投影在块开头并行执行**
- **同步点从每块 2 个减少到 1 个**
- 支持 Megatron 风格的模型并行
## 设计空间
| 结构 | 参数效率 | 并行友好 | 代表 |
|------|:--:|:--:|------|
| MIS (MVA) | 中 | 一般 | Mamba |
| GVA | 高 | 最优 | Mamba-2 |
| MHA | 低 | 最优 | Transformer |
## 参考
- [[mamba-2|Mamba-2]]
- [[structured-state-space-duality|SSD]]
- [[mamba-ssm|Mamba]]
- [[dao-transformers-are-ssms-2024|论文]]