LLM/Model & Papers
Transformers are SSMs
Curiosity: Are Transformers and State Space Models fundamentally different? What happens when we discover their deep theoretical connections?
Transformers are SSMs: State Space Duality Framework
Curiosity: Are Transformers and State Space Models fundamentally different? What happens when we discover their deep theoretical connections?
This paper reveals that Transformers and State Space Models (SSMs) are closely related through structured semiseparable matrices. The State Space Duality (SSD) framework enables Mamba-2, which is 2-8ร faster than Mamba while remaining competitive with Transformers.
Resources:
- ๐ Paper: https://arxiv.org/abs/2405.21060
- ๐ Project Page: https://huggingface.co/papers/2405.21060
- ๐ป Code: Coming soon
The Discovery
Retrieve: Transformers and SSMs are more related than previously thought.
Key Finding: These model families are closely related through:
- Structured semiseparable matrices
- Various decomposition methods
- Theoretical connections between SSMs and attention variants
Performance Context
Retrieve: SSMs like Mamba have shown strong performance.
| Model Type | Performance | Scale |
|---|---|---|
| Transformers | Main architecture | All scales |
| SSMs (Mamba) | Match/outperform | Small-medium scale |
Question: How are they related?
State Space Duality Framework
Innovate: SSD framework reveals deep connections.
graph TB
A[Structured Semiseparable Matrices] --> B[SSMs]
A --> C[Attention Variants]
B --> D[State Space Duality]
C --> D
D --> E[Mamba-2]
E --> F[2-8ร Faster]
E --> G[Competitive with Transformers]
style A fill:#e1f5ff
style D fill:#fff3cd
style E fill:#d4edda
Mamba-2 Architecture
Retrieve: Mamba-2 improvements enabled by SSD framework.
Core Layer: Refinement of Mambaโs selective SSM
Improvements:
- 2-8ร faster than Mamba
- Remains competitive with Transformers
- Better theoretical understanding
- Unified framework
Theoretical Connections
Innovate: Rich framework connecting SSMs and attention.
Connections Through:
- Structured semiseparable matrices
- Various decomposition methods
- Attention variants
- State space representations
Impact: Unified understanding of both architectures.
Key Takeaways
Retrieve: The State Space Duality framework reveals that Transformers and SSMs are closely related through structured semiseparable matrices, enabling better architectures like Mamba-2.
Innovate: By understanding the theoretical connections between SSMs and attention, we can design more efficient architectures that combine the best of both worldsโMamba-2 achieves 2-8ร speedup while maintaining competitive performance.
Curiosity โ Retrieve โ Innovation: Start with curiosity about model architectures, retrieve insights from the SSD framework, and innovate by applying these theoretical connections to design better models.
Next Steps:
- Read the full paper
- Understand SSD framework
- Explore Mamba-2
- Apply to your models
๐งPaper Authors: Tri Daoโ1 and Albert Guโ2 1Department of Computer Science, Princeton University 2Machine Learning Department, Carnegie Mellon University
- 1๏ธโฃRead the Full Paper here: https://arxiv.org/abs/2405.21060
- 2๏ธโฃProject Page: https://huggingface.co/papers/2405.21060
- 3๏ธโฃCode: Coming ๐
Translate to Korean
๊ตฌ์กฐํ๋ ์ํ๊ณต๊ฐ ์ด์ค์ฑ์ ํตํ ์ผ๋ฐํ๋ ๋ชจ๋ธ๊ณผ ํจ์จ์ ์ธ ์๊ณ ๋ฆฌ์ฆ
ํธ๋์คํฌ๋จธ๋ ์ธ์ด ๋ชจ๋ธ๋ง์์ ๋ฅ ๋ฌ๋์ ์ฑ๊ณต์ ๋ท๋ฐ์นจํ๋ ์ฃผ์ ์ํคํ ์ฒ์์ง๋ง, ์ต๊ทผ์๋ Mamba์ ๊ฐ์ ์ํ ๊ณต๊ฐ ๋ชจ๋ธ(SSM)์ด ์ค์ ๊ท๋ชจ์์ ํธ๋์คํฌ๋จธ์ ๋๋ฑํ๊ฑฐ๋ ๋ ์ฐ์ํ ๊ฒ์ผ๋ก ๋ํ๋ฌ์ต๋๋ค. ์ฐ๋ฆฌ๋ ์ด๋ฌํ ๋ชจ๋ธ ๊ณ์ด์ด ์ค์ ๋ก ๋งค์ฐ ๋ฐ์ ํ๊ฒ ๊ด๋ จ๋์ด ์์์ ๋ณด์ฌ์ฃผ๋ฉฐ, ์ ์ฐ๊ตฌ๋ ๊ตฌ์กฐํ๋ ๋ฐ๋ถ๋ฆฌ ๊ฐ๋ฅํ ํ๋ ฌ ํด๋์ค์ ๋ค์ํ ๋ถํด๋ฅผ ํตํด ์ฐ๊ฒฐ๋ SSM๊ณผ ์ฃผ์ ๋ณํ ๊ฐ์ ์ด๋ก ์ ์ฐ๊ฒฐ์ ๋ํ ํ๋ถํ ํ๋ ์์ํฌ๋ฅผ ๊ฐ๋ฐํฉ๋๋ค. ์ํ ๊ณต๊ฐ ์ด์ค์ฑ(SSD) ํ๋ ์์ํฌ๋ฅผ ํตํด ํต์ฌ ๊ณ์ธต์ด 2-8๋ฐฐ ๋ ๋น ๋ฅธ Mamba์ ์ ํ์ SSM์ ๊ฐ์ ํ ์๋ก์ด ์ํคํ ์ฒ(Mamba-2)๋ฅผ ์ค๊ณํ๋ ๋์์ ์ธ์ด ๋ชจ๋ธ๋ง์์ Transformers์ ๊ณ์ ๊ฒฝ์ํ ์ ์์ต๋๋ค.
