How Effective are State Space Models for Machine Translation?

Hugo Pitorro, Pavlo Vasylenko, Marcos Treviso, André F. T. Martins
7/7/2024
cs.CL

No official code found. Best implementation: deep-spin/ssm-mt (3 stars, last commit 2025-02-08).

Abstract

Transformers are the current architecture of choice for NLP, but their attention layers do not scale well to long contexts. Recent works propose to replace attention with linear recurrent layers -- this is the case for state space models, which enjoy efficient training and inference. However, it remains unclear whether these models are competitive with transformers in machine translation (MT). In this paper, we provide a rigorous and comprehensive experimental comparison between transformers and linear recurrent models for MT. Concretely, we experiment with RetNet, Mamba, and hybrid versions of Mamba which incorporate attention mechanisms. Our findings demonstrate that Mamba is highly competitive with transformers on sentence and paragraph-level datasets, where in the latter both models benefit from shifting the training distribution towards longer sequences. Further analysis show that integrating attention into Mamba improves translation quality, robustness to sequence length extrapolation, and the ability to recall named entities.

View on arXivView PDF

Code Implementations(1)

deep-spin/ssm-mtCommunity100%
30Python, Jupyter NotebookJul 5, 20241 years ago

Similar Papers

Cite this paper

@article{pitorro2024effective,
  title  = {How Effective are State Space Models for Machine Translation?},
  author = {Hugo Pitorro and Pavlo Vasylenko and Marcos Treviso and André F. T. Martins},
  year   = {2024},
  eprint = {2407.05489},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2407.05489v1}
}

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/2407.05489.svg)](https://codeofpaper.com/paper/2407.05489)

Discussion