Zubnet AIAprenderWiki › Mamba
Models

Mamba

Mamba Architecture
Una arquitectura selective state space model (SSM) diseñada como alternativa al Transformer. Creada por Albert Gu y Tri Dao, Mamba logra rendimiento competitivo de modelado de lenguaje con scaling lineal en longitud de secuencia (vs. el costo cuadrático de atención del Transformer). Procesa secuencias manteniendo un estado oculto comprimido que se actualiza selectivamente — la info importante se preserva, la info irrelevante decae.

Por qué importa

Mamba representa el desafío más creíble al dominio del Transformer. Si ella (o sus descendientes) cumple con la promesa de procesamiento de secuencias en tiempo lineal con resultados de calidad Transformer, las implicaciones son enormes: ventanas de contexto mucho más largas, inferencia más rápida, costos más bajos. La parte «selective» es clave — a diferencia de SSMs anteriores, Mamba hace sus transiciones de estado dependientes de la entrada, lo que le da la expresividad para igualar la atención.

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.

Conceptos relacionados

← Todos los términos
← Machine Aprendering Masked Language Modeling →