Sparse Modular Activation for Efficient Sequence Modeling

Liliang Ren, Yang Liu, Shuo Wang, Yichong Xu, Chenguang Zhu +1 more
2/12/2026

No official code found. Best implementation: renll/SeqBoat (40 stars, MIT, last commit 2023-12-02).

Abstract

Linear State Space Models (SSMs) have demonstrated strong performance in a variety of sequence modeling tasks due to their efficient encoding of the recurrent structure. However, in more comprehensive tasks like language modeling and machine translation, self-attention-based models still outperform SSMs. Hybrid models employing both SSM and self-attention generally show promising performance, but current approaches apply attention modules statically and uniformly to all elements in the input sequences, leading to sub-optimal quality-efficiency trade-offs. In this work, we introduce Sparse Modular Activation (SMA), a general mechanism enabling neural networks to sparsely and dynamically activate sub-modules for sequence elements in a differentiable manner. Through allowing each element to skip non-activated sub-modules, SMA reduces computation and memory consumption at both training and inference stages of sequence modeling. As a specific instantiation of SMA, we design a novel neural architecture, SeqBoat, which employs SMA to sparsely activate a Gated Attention Unit (GAU) based on the state representations learned from an SSM. By constraining the GAU to only conduct local attention on the activated inputs, SeqBoat can achieve linear inference complexity with theoretically infinite attention span, and provide substantially better quality-efficiency trade-off than the chunking-based models. With experiments on a wide range of tasks, including language modeling, speech classification and long-range arena, SeqBoat brings new state-of-the-art results among hybrid models with linear complexity and reveals the amount of attention needed for each task through the learned sparse activation patterns.

View on arXivView PDF

Code Implementations(1)

renll/SeqBoatCommunity61%
MIT

[NeurIPS 2023] Sparse Modular Activation for Efficient Sequence Modeling

401C, C++Jun 15, 20232 years agoMIT

Similar Papers

Cite this paper

@article{ren2026sparse,
  title  = {Sparse Modular Activation for Efficient Sequence Modeling},
  author = {Liliang Ren and Yang Liu and Shuo Wang and Yichong Xu and Chenguang Zhu and Chengxiang Zhai},
  year   = {2026},
  eprint = {2306.11197},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/pdf/2306.11197},
  journal = {NEURIPS 2023 2023}
}

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

Discussion