mamba-architecture

Replace quadratic attention with Selective State Space Models for linear-time inference.

Updated Mar 16, 2026
One-click install
npx skills add https://github.com/arsity/scholar-tools --skill mamba-architecture-arsity
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mamba-architecture
Source: https://github.com/arsity/scholar-tools/tree/main/vendor/ai-research-skills/01-model-architecture/mamba
Command: npx skills add https://github.com/arsity/scholar-tools --skill mamba-architecture-arsity

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Replaces quadratic attention with a Selective State Space Model (SSM) to achieve linear-time sequence processing, enabling efficient long-context modeling.

Core Features & Use Cases

  • Hardware-aware SSM blocks: configurable state-space parameters and selective state updates for efficient inference.
  • Long-context modeling: scales to million-token sequences with reduced memory usage.
  • Scalable to large models: supports Mamba-1 and Mamba-2 architectures (d_state=16 and 128, multi-head).

Quick Start

Install the Mamba package and start building Mamba blocks with configured d_model and d_state

Frequently Asked Questions about mamba-architecture

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How does a Selective State Space Model solve O(n^2) attention bottlenecks?

A Selective State Space Model (SSM) solves O(n^2) attention bottlenecks by replacing quadratic attention with linear-time sequence processing, enabling efficient long-context modeling and memory-reduced deployment.

How do I configure Mamba blocks for long-context sequence modeling in PyTorch?

You configure Mamba blocks in PyTorch by setting core parameters like d_model, d_state, d_conv, and expand, enabling hardware-aware state-space updates for million-token sequence inference.

Does the Mamba architecture support both Mamba-1 and Mamba-2 variants?

Yes, the Mamba architecture supports both Mamba-1 and Mamba-2 variants within PyTorch workflows, scaling across model sizes from 130M to 2.8B parameters with configurable multi-head state spaces.

What is the best way to scale sequence models to million-token contexts without excessive memory usage?

Using hardware-aware Selective State Space Models is the best way to scale to million-token contexts, achieving linear-time inference and reduced memory usage compared to quadratic attention mechanisms.

Can I use linear-time SSMs for memory-efficient deployment across large parameter scales?

Yes, you can use linear-time SSMs for memory-efficient deployment across large parameter scales, supporting model architectures from 130M to 2.8B parameters with hardware-aware optimization.