Is Mamba Capable of In-Context Learning?

Riccardo Grazzi, Julien Siems, Simon Schrodi, Thomas Brox, Frank Hutter
2/5/2024
cs.LG

No official code found. Best implementation: automl/is_mamba_capable_of_icl (18 stars, last commit 2024-04-24).

Abstract

State of the art foundation models such as GPT-4 perform surprisingly well at in-context learning (ICL), a variant of meta-learning concerning the learned ability to solve tasks during a neural network forward pass, exploiting contextual information provided as input to the model. This useful ability emerges as a side product of the foundation model's massive pretraining. While transformer models are currently the state of the art in ICL, this work provides empirical evidence that Mamba, a newly proposed state space model which scales better than transformers w.r.t. the input sequence length, has similar ICL capabilities. We evaluated Mamba on tasks involving simple function approximation as well as more complex natural language processing problems. Our results demonstrate that, across both categories of tasks, Mamba closely matches the performance of transformer models for ICL. Further analysis reveals that, like transformers, Mamba appears to solve ICL problems by incrementally optimizing its internal representations. Overall, our work suggests that Mamba can be an efficient alternative to transformers for ICL tasks involving long input sequences. This is an exciting finding in meta-learning and may enable generalizations of in-context learned AutoML algorithms (like TabPFN or Optformer) to long input sequences.

View on arXivView PDF

Code Implementations(1)

182TeX, ShellApr 22, 20242 years ago

Similar Papers

Cite this paper

@article{grazzi2024mamba,
  title  = {Is Mamba Capable of In-Context Learning?},
  author = {Riccardo Grazzi and Julien Siems and Simon Schrodi and Thomas Brox and Frank Hutter},
  year   = {2024},
  eprint = {2402.03170},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2402.03170v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2402.03170.svg)](https://codeofpaper.com/paper/2402.03170)

Discussion