Zubnet AIApprendreWiki › Mamba
Models

Mamba

Mamba Architecture
Une architecture de selective state space model (SSM) conçue comme alternative au Transformer. Créée par Albert Gu et Tri Dao, Mamba atteint une performance de modélisation de langage compétitive avec un scaling linéaire en longueur de séquence (vs. le coût quadratique de l'attention du Transformer). Elle traite les séquences en maintenant un état caché compressé qui se met à jour sélectivement — l'info importante est préservée, l'info non pertinente décroît.

Pourquoi c'est important

Mamba représente le défi le plus crédible à la dominance du Transformer. Si elle (ou ses descendants) livre sur la promesse du traitement de séquences en temps linéaire avec des résultats de qualité Transformer, les implications sont énormes : fenêtres de contexte bien plus longues, inférence plus rapide, coûts plus bas. La partie « selective » est clé — contrairement aux SSM précédents, Mamba rend ses transitions d'état dépendantes de l'entrée, ce qui lui donne l'expressivité pour égaler l'attention.

Deep Dive

Classical state space models maintain a fixed-size hidden state that gets updated at each timestep via learned matrices A (state transition), B (input projection), and C (output projection). Mamba's innovation is making B and C input-dependent — the model learns to selectively focus on or ignore different parts of the input based on content, not just position. This selectivity is what earlier SSMs lacked and what prevented them from matching Transformer performance on language tasks.

The Hardware Story

Mamba's other contribution is a hardware-aware implementation. The selective scan operation is rewritten to minimize memory transfers between GPU HBM and SRAM, using kernel fusion and recomputation to avoid materializing the full state expansion in memory. This engineering makes the theoretical linear complexity translate to actual wall-clock speedups, not just asymptotic improvements that get eaten by constant factors.

Mamba-2 and Hybrids

Mamba-2 simplified the architecture by showing that the selective state space model can be viewed as a structured form of attention, unifying the SSM and Transformer perspectives mathematically. This led to hybrid architectures (like Jamba from AI21, Zamba from Zyphra) that interleave Mamba layers with attention layers, getting the efficiency of SSMs for most of the sequence processing while using attention for the tasks where global token interaction is essential. The debate isn't "SSM vs. Transformer" anymore — it's about finding the optimal mix.

Concepts liés

← Tous les termes
← Machine Apprendreing Masked Language Modeling →