atlas

Research map / Architectures and efficiency / Attention and transformers

Samba: Simple Hybrid State Space Models for Efficient Unlimited Context Language Modeling

ICLR 2025 · Architectures and efficiency › Attention and transformers · approach: State space and recurrent sequence models · 7 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Samba layer-wise interleaves Mamba, SwiGLU MLP, and sliding window attention to build a linear-time hybrid LM that scales to 3.8B parameters and extrapolates to long contexts.

Problem

Language models need both efficient linear-time processing of very long sequences and precise memory recall, but SSMs struggle with recall and attention is quadratic or extrapolates poorly in perplexity.

Approach

Layer-wise hybrid of Mamba (recurrent compression), sliding window attention (precise recall of recent context), and SwiGLU MLP (factual recall), with the SWA window fixed at 2048 so cost stays linear; pretrained at 4K and extrapolates to 1M perplexity, and fine-tuned for passkey/Phonebook retrieval up to 256K.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
combine Mamba, sliding-window attention, and MLP layers in Samba1.7B architecture trained on Phi-2 data · Phi-2 downstream suiteAverage accuracy: 52.31 -> 54.33Helped
combine Mamba with sliding-window attention and MLP layersSamba 1.3B · SlimPajama validation, 16384Perplexity: 7.00 -> 6.96Helped
remove rotary relative position embedding (ablation)Samba 421M · SlimPajama validation, 16384Perplexity: 9.57 -> 314.78Hurt
remove rotary relative position embedding (ablation)Samba 1.3B · SlimPajama validation, 16384Perplexity: 6.96 -> 326.17Hurt
replace Mamba layers with SwiGLU layers (ablation)Samba 1.3B · SlimPajama validation, 16384Perplexity: 6.96 -> 7.42Hurt
replace Mamba layers with Multi-Scale Retention (ablation)Samba 421M · SlimPajama validation, 16384Perplexity: 9.57 -> 9.87Hurt
replace Mamba layers with Gated Linear Attention (ablation)Samba 421M · SlimPajama validation, 16384Perplexity: 9.57 -> 9.92Hurt
use 6 query heads and 1 key-value head instead of 12 query heads and 2 key-value heads (ablation)Samba 426M · SlimPajama validationPerplexity: 10.09 -> 9.99; 9.68 -> 9.59; 9.60 -> 9.51Helped
add short convolution to SWA query, key, and value representations (ablation)Llama-2-SWA 438M · SlimPajama validation, 16384Perplexity: 10.57 -> 10.31Helped
add short convolution to GLA query, key, and value representations (ablation)Sliding GLA 438M · SlimPajama validation, 16384Perplexity: 9.92 -> 9.87Helped
add short convolution to RetNet query, key, and value representations (ablation)Sliding RetNet 446M · SlimPajama validation, 16384Perplexity: 9.87 -> 9.74Helped
fine-tune on 4K-length Passkey Retrieval examplesSamba 1.7B · Passkey Retrieval, up to 256K contextRetrieval accuracyHelped

Surprising findings

Limitations

Experimental setup

Datasets: Phi-3 pretraining data Phi-2 dataset SlimPajama Proof-Pile Passkey Retrieval (synthetic) Phonebook GovReport SQuALITY

Benchmarks: MMLU GSM8K HumanEval GovReport SQuALITY ARC-Easy ARC-Challenge PIQA WinoGrande SIQA HellaSwag BoolQ

Metrics: accuracy perplexity ROUGE-L pass@1 throughput (tokens/s)

Baselines: Phi-3-mini-4K Llama-3 Mistral Mamba Mamba-SWA-MLP Mamba-MLP Llama-2-SWA Sliding RetNet Sliding GLA SE-Llama-3

Builds on: Mamba FlashAttention 2 Self-Extend Griffin Phi-3

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy