[Paper Review] MambaByte: Token-free Selective State Space Model
MambaByte is a token-free byte-level language model based on selective state space models, achieving competitive performance with subword Transformers and faster, scalable generation.
Token-free language models learn directly from raw bytes and remove the inductive bias of subword tokenization. Operating on bytes, however, results in significantly longer sequences. In this setting, standard autoregressive Transformers scale poorly as the effective memory required grows with sequence length. The recent development of the Mamba state space model (SSM) offers an appealing alternative approach with a fixed-sized memory state and efficient decoding. We propose MambaByte, a token-free adaptation of the Mamba SSM trained autoregressively on byte sequences. In terms of modeling, we show MambaByte to be competitive with, and even to outperform, state-of-the-art subword Transformers on language modeling tasks while maintaining the benefits of token-free language models, such as robustness to noise. In terms of efficiency, we develop an adaptation of speculative decoding with tokenized drafting and byte-level verification. This results in a $2.6 imes$ inference speedup to the standard MambaByte implementation, showing similar decoding efficiency as the subword Mamba. These findings establish the viability of SSMs in enabling token-free language modeling.
Motivation & Objective
- Motivate token-free language modeling to mitigate tokenization bias and robustness issues.
- Develop a byte-level model that scales efficiently to long sequences without patching.
- Leverage Mamba's selective state space architecture to enable linear-time sequence processing.
- Assess compute- and parameter-matched performance against Transformers, MegaByte, and SSM baselines.
- Demonstrate generation efficiency advantages in byte-wise autoregressive settings.
Proposed method
- Adapt the Mamba selective state space model to operate directly on byte sequences.
- Discretize continuous-time SSM dynamics with input-selective B, C, and Delta as functions of the input.
- Use parallel scans to compute the linear recurrences efficiently during training.
- Embed the SSM layer into a gated network architecture for language modeling.
- Conduct compute- and parameter-matched experiments on long-form text datasets (PG19, Stories, Books, ArXiv, Code).
- Compare against byte-level Transformers, SSMs, MegaByte, and subword baselines.

Experimental results
Research questions
- RQ1Can token-free byte-level models match or surpass tokenized subword Transformers in long-form language modeling?
- RQ2Do selective state space models offer computational and generation-speed advantages for byte sequences?
- RQ3How does MambaByte perform under compute- and parameter-matched comparisons with existing byte-level and subword architectures?
Key findings
- MambaByte consistently outperforms MegaByte across multiple long-form datasets under the same FLOPs-per-byte budget.
- A smaller MambaByte (353M) outperforms byte-level Transformers and PerceiverAR in BPB on average.
- With 972M parameters, MambaByte achieves competitive or superior perplexity to state-of-the-art subword models on PG19 when trained for substantial bytes.
- MambaByte exhibits faster generation than MegaByte due to its recurrent, state-space-based design.
- In compute-matched settings, MambaByte reaches Transformer-like loss with less compute and data.
- Token-free byte models can be viable alternatives to tokenizer-dependent models for long-context language tasks.
![Figure 2 : Illustration of the Mamba SSM. (a) The discrete-time input $x[k]$ , along with input-selective $\Delta[k]$ . (b) The continuous-time signal $x(t)$ . (c) Mathematically, the SSM transforms the continuous-time $x(t)$ through an $n$ -dimensional hidden state (here, $n=4$ ) using parameters $](https://ar5iv.labs.arxiv.org/html/2401.13660/assets/x2.png)
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.