Skip to main content
QUICK REVIEW

[Paper Review] DenseMamba: State Space Models with Dense Hidden Connection for Efficient Large Language Models

Wei He, Kai Han|arXiv (Cornell University)|Feb 26, 2024
Topic ModelingComputer Science5 citations
TL;DR

DenseMamba introduces DenseSSM, a dense hidden connection mechanism for State Space Models (SSMs) to improve information flow across layers, boosting performance of RetNet/Mamba-like architectures with minimal parameter and computation overhead.

ABSTRACT

Large language models (LLMs) face a daunting challenge due to the excessive computational and memory requirements of the commonly used Transformer architecture. While state space model (SSM) is a new type of foundational network architecture offering lower computational complexity, their performance has yet to fully rival that of Transformers. This paper introduces DenseSSM, a novel approach to enhance the flow of hidden information between layers in SSMs. By selectively integrating shallowlayer hidden states into deeper layers, DenseSSM retains fine-grained information crucial for the final output. Dense connections enhanced DenseSSM still maintains the training parallelizability and inference efficiency. The proposed method can be widely applicable to various SSM types like RetNet and Mamba. With similar model size, DenseSSM achieves significant improvements, exemplified by DenseRetNet outperforming the original RetNet with up to 5% accuracy improvement on public benchmarks. code is avalaible at https://github.com/WailordHe/DenseSSM

Motivation & Objective

  • Motivate the use of efficient sequence models (SSMs) as alternatives to Transformers for large language models.
  • Identify hidden state degradation across layers in SSMs and its impact on information flow.
  • Propose DenseSSM to densely connect shallow hidden states into deeper layers while preserving training/inference efficiency.
  • Demonstrate that DenseSSM improves performance on RetNet and Mamba variants on public benchmarks.
  • Provide practical, hardware-friendly implementation strategies for selective transition and hidden fusion modules.

Proposed method

  • Propose DenseSSM by densely connecting hidden states from the previous m layers into the current layer via a selective transition module φ and a hidden fusion module Fuse.
  • Use a projection+gate mechanism in φ to project shallow hidden states to the target subspace and select useful components.
  • Fuse selected shallow states with the current layer’s hidden state through an additive fusion (h_t^L = h_t^L + sum φ(h_t^{l-i})).
  • Extend DenseSSM to both recurrence (DenseRetNet) and convolution/GAU-like block variants to maintain parallelizable training and efficient autoregressive inference.
  • Apply DenseSSM to RetNet and Mamba architectures, creating DenseRetNet and DenseMamba with similar model sizes but improved performance.
  • Experiment with 56GB The Pile-derived data, 15B tokens, LLaMA tokenizer, and evaluate zero-shot and 4-shot capabilities on diverse QA/common-sense tasks.

Experimental results

Research questions

  • RQ1Does introducing dense hidden connections across SSM layers preserve or enhance information flow compared to traditional layer-limited hidden state propagation?
  • RQ2Can DenseSSM improve accuracy and perplexity for RetNet- and Mamba-based models without sacrificing training/inference efficiency?
  • RQ3How do selective transition and hidden fusion modules impact performance and parameter efficiency?
  • RQ4Are improvements consistent across zero-shot and few-shot (4-shot) evaluations on commonsense QA and reasoning benchmarks?
  • RQ5Is DenseSSM applicable across different SSM variants (e.g., RetNet, Mamba) with minimal architectural changes?

Key findings

  • DenseSSM enhances hidden information flow by densely connecting shallow-layer hidden states into deeper layers with a selective projection and gating mechanism.
  • DenseRetNet and DenseMamba show improved performance over baseline RetNet, Mamba, and Transformer-based models on public benchmarks under zero-shot and few-shot settings.
  • DenseRetNet achieves up to 5% accuracy improvement over original RetNet on public benchmarks as reported in the abstract.
  • DenseSSM maintains training parallelizability and autoregressive inference efficiency with only a slight increase in parameters.
  • Ablation studies indicate that using Identity projection with an MLP for the selective transition, and additive fusion, yields favorable trade-offs between performance and parameter count.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.