Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Hugging Face 21 min read Research hardMaster

Bamba: Inference-Efficient Hybrid Mamba2 Model

Bamba-9B is a hybrid Mamba2 language model from IBM, Princeton, CMU and UIUC, trained on 2.2T tokens of fully open data. It interleaves full attention layers with Mamba2 layers to keep KV-cache growth small. In vLLM on an H100, it reaches about 2.5x the throughput and 2x lower latency of Llama 3.1 8B at larger batch sizes and sequence lengths. On benchmarks it trails SOTA transformers mainly on math and MMLU, which the team attributes to fewer training tokens and no benchmark-aligned annealing data, and it beats Olmo 7B trained on the same token budget. Checkpoints, training recipes, a stateful data loader and support in transformers, TRL, vLLM and llama.cpp are released.

Related posts

  • Welcome Falcon Mamba: The first strong attention-free 7B model

    Hugging Face mediumAdept

    Falcon Mamba 7B from TII is a pure Mamba state space language model with extra RMS normalization layers for stable training at scale. Trained on roughly 5,500 GT of mostly RefinedWeb data, it matches or beats similarly sized transformers and hybrid SSM models on Open LLM Leaderboard benchmarks, averaging 15.04 on v2 and 64.09 on v1. Because an SSM keeps only a recurrent state, decoding runs at constant throughput and memory regardless of context length. Parallel prefill still makes memory grow with prompt length, but sequential or chunked prefill lets the model handle arbitrarily long prompts on a single 24GB A10. The model loads through Hugging Face transformers (>4.45.0) and supports 4-bit bitsandbytes quantization, torch.compile and an instruction-tuned variant.

  • Mamba-3

    Together AI hardMaster

    Mamba-3 is a state space model redesigned around inference efficiency rather than training speed. It adds an exponential-trapezoidal discretization that yields a more expressive recurrence, complex-valued state transitions implemented via data-dependent RoPE, and a MIMO variant that adds FLOPs to otherwise memory-bound decode steps at almost no latency cost. Architecture changes include BCNorm (QKNorm), removal of the short causal convolution and interleaved MLPs. At 1.5B scale on an H100, Mamba-3 SISO posts the fastest prefill+decode latency against Mamba-2, Gated DeltaNet and vLLM-served Llama-3.2-1B, and MIMO adds over 1 point of downstream accuracy at the cost of longer training. The open-sourced kernels combine Triton, TileLang and CuTe DSL.

  • Apriel-H1: The Surprising Key to Distilling Efficient Reasoning Models

    Hugging Face hardMaster

    ServiceNow converted its 15B Apriel reasoning model into a Mamba/attention hybrid via distillation, reaching 2.1x throughput with small benchmark shifts (MATH500 up, GPQA and AIME24 slightly down) using 76.8B tokens. The key finding is that distilling on the teacher's high-quality SFT reasoning traces works, while pretraining data or mixed data degrades reasoning. Reverse KL beat forward KL. A staged procedure does the conversion: leave-one-out layer importance for the first 25 layers, then a dynamic MIL-Mamba-Replacement loss heuristic to progressively reach 30–40 Mamba layers, with the 40-layer variant reaching 3.4x throughput. Training uses the open-source Fast-LLM framework, inference runs on Transformers and vLLM, and the authors warn that hybrid deployment tooling is still immature.

  • Llama 2 is here - get it on Hugging Face

    Hugging Face mediumAdept

    Meta's Llama 2 family (7B, 13B, 70B base and RLHF-tuned chat models) is released under a commercially usable license, trained on 40% more tokens than Llama 1 with 4k context and grouped-query attention for the 70B model, and is integrated across the Hugging Face ecosystem. Inference runs through transformers 4.31 or Text Generation Inference and Inference Endpoints, with recommended GPU sizes per model (A10G for 7B, A100 for 13B, 2-4x A100 for 70B). The 7B model can be fine-tuned on a single 16GB T4 using QLoRA and trl's SFTTrainer. The chat prompt format uses [INST] and <<SYS>> delimiters, and prompts must match the training template exactly for system prompts and multi-turn conversations to work.

  • 180B Parameters, 32GB of RAM: Pushing MoE Inference to the Limit with Transformers

    Hugging Face hardMaster

    Streaming MoE experts from SSD through a bounded device-side slot pool lets Transformers run Qwen3.8-Flash-Next (121 GB of experts) on a 32 GB MacBook M5 at ~13.9 tok/s, within 6% of the specialized Strata engine on decode and slightly faster on prefill. The key idea is a preallocated cache tensor shared across layers with a per-layer expert-id-to-slot table, so the stock grouped_mm kernel runs on cached experts unchanged; 3-bit experts, 8 I/O threads, router-based prefetch, and custom Metal kernels close most of the gap. A comparison with llama.cpp, vLLM and Accelerate offloading shows why existing approaches fail when experts don't fit in RAM, and the remaining gap is attributed to host-GPU round trips that PyTorch's MPS backend can't avoid today.

The quest for software engineering knowledge.

Look:
Layout: