Papers
Topics
Authors
Recent
Search
2000 character limit reached

mLSTM with Sigmoid Input Gate

Updated 3 March 2026
  • mLSTM with Sigmoid Input Gate is a gated recurrent neural network that leverages a multiplicative intermediate state and sigmoid activation to enable dynamic, context-sensitive memory updates.
  • The architecture simplifies recurrence by eliminating auxiliary states, reducing computation and memory overhead while achieving performance speedups of up to 30%.
  • Practical evaluations demonstrate that mLSTM variants excel in long-context language modeling, delivering competitive results in benchmarks with efficient compute and memory usage.

The multiplicative Long Short-Term Memory (mLSTM) architecture with sigmoid input gate is a gated recurrent neural network that synthesizes the expressive hidden-state transitions of multiplicative RNNs with the robust memory control mechanisms of LSTMs. Distinguished by its use of input-dependent multiplicative paths and a sigmoid-activated input gate, mLSTM—and its modern variants such as mLSTMsig—demonstrate enhanced modeling capabilities for sequence data, while enabling efficient implementation and kernel optimization for long-context scenarios (Krause et al., 2016, Beck et al., 18 Mar 2025).

1. Mathematical Formulation

The mLSTM family is characterized by the introduction of an intermediate multiplicative state mtm_t that modulates both the candidate cell update and all gating signals. The classic recurrence equations for a single-layer mLSTM with sigmoid input gate are: mt=(Wmx xt)⊙(Wmh ht−1)m_t = (W_{mx}\,x_t) \odot (W_{mh}\,h_{t-1})

h^t=Whx xt+Whm mt\hat{h}_t = W_{hx}\,x_t + W_{hm}\,m_t

it=σ(Wix xt+Wim mt)i_t = \sigma(W_{ix}\,x_t + W_{im}\,m_t)

ft=σ(Wfx xt+Wfm mt)f_t = \sigma(W_{fx}\,x_t + W_{fm}\,m_t)

ot=σ(Wox xt+Wom mt)o_t = \sigma(W_{ox}\,x_t + W_{om}\,m_t)

ct=ft⊙ct−1+it⊙tanh⁡(h^t)c_t = f_t \odot c_{t-1} + i_t \odot \tanh(\hat{h}_t)

ht=ot⊙tanh⁡(ct)h_t = o_t \odot \tanh(c_t)

with xt∈RNx_t \in \mathbb{R}^N, ht,ct,mt∈RHh_t, c_t, m_t \in \mathbb{R}^H, and mt=(Wmx xt)⊙(Wmh ht−1)m_t = (W_{mx}\,x_t) \odot (W_{mh}\,h_{t-1})0 the elementwise sigmoid. All gates are thus functions of both the input and a multiplicative interaction between the input and previous hidden state (Krause et al., 2016).

Modern efficient mLSTM variants such as mLSTMsig reformulate the cell state as a learned matrix memory mt=(Wmx xt)⊙(Wmh ht−1)m_t = (W_{mx}\,x_t) \odot (W_{mh}\,h_{t-1})1: mt=(Wmx xt)⊙(Wmh ht−1)m_t = (W_{mx}\,x_t) \odot (W_{mh}\,h_{t-1})2

mt=(Wmx xt)⊙(Wmh ht−1)m_t = (W_{mx}\,x_t) \odot (W_{mh}\,h_{t-1})3

mt=(Wmx xt)⊙(Wmh ht−1)m_t = (W_{mx}\,x_t) \odot (W_{mh}\,h_{t-1})4

mt=(Wmx xt)⊙(Wmh ht−1)m_t = (W_{mx}\,x_t) \odot (W_{mh}\,h_{t-1})5

Here, mt=(Wmx xt)⊙(Wmh ht−1)m_t = (W_{mx}\,x_t) \odot (W_{mh}\,h_{t-1})6 are linearly projected from mt=(Wmx xt)⊙(Wmh ht−1)m_t = (W_{mx}\,x_t) \odot (W_{mh}\,h_{t-1})7, and the plain sigmoid gating removes the need for auxiliary stabilizer states (Beck et al., 18 Mar 2025).

2. Distinguishing Features and Theoretical Implications

Unlike standard LSTMs, which drive gating by additive combinations of input and previous hidden state, mLSTM employs an elementwise product, imparting each input symbol the potential to induce a unique hidden-to-hidden transition. This expands the effective capacity of the model's state space. The dependence of the input, forget, and output gates on mt=(Wmx xt)⊙(Wmh ht−1)m_t = (W_{mx}\,x_t) \odot (W_{mh}\,h_{t-1})8 introduces strong input-state interactions, which permit context-dependent modulation of memory writing and retention.

Sigmoid input gating constrains the valid update range to mt=(Wmx xt)⊙(Wmh ht−1)m_t = (W_{mx}\,x_t) \odot (W_{mh}\,h_{t-1})9, ensuring numerically stable input modulation and obviating the need for normalization or max-rescaling routines present in earlier exponential-gated architectures.

3. Comparison with Exponential-Gated and Other Linear RNNs

The transition from exponential-gated input (mLSTMexp) to sigmoid-gated input (mLSTMsig) eliminates two auxiliary states: the numerical normalizer and max state. This simplification yields several practical consequences:

  • Reduces the forward compute and memory footprint by 20–30% per chunk.
  • Simplifies the recurrence, removing the need for rescaling and auxiliary tracking in long-context runs.
  • Yields kernel designs that halve the number of global memory barriers and significantly decrease non-tensor-core compute (Beck et al., 18 Mar 2025).

Relative to linear RNNs omitting input gates (e.g., FlashLinearAttention), mLSTM with sigmoid input gate maintains a richer gating structure while retaining competitive computational properties.

4. Practical Performance and Implementation

Empirical results establish mLSTM and its variants as strong sequence modelers. Key benchmarks are:

  • On text8, character-level bits per char: h^t=Whx xt+Whm mt\hat{h}_t = W_{hx}\,x_t + W_{hm}\,m_t0.
  • On Hutter Prize: h^t=Whx xt+Whm mt\hat{h}_t = W_{hx}\,x_t + W_{hm}\,m_t1 bits/char (with h^t=Whx xt+Whm mt\hat{h}_t = W_{hx}\,x_t + W_{hm}\,m_t246M parameters).
  • On WikiText-2: character-level entropy h^t=Whx xt+Whm mt\hat{h}_t = W_{hx}\,x_t + W_{hm}\,m_t3 bits/char (byte-level), word-level perplexity h^t=Whx xt+Whm mt\hat{h}_t = W_{hx}\,x_t + W_{hm}\,m_t4—on par with optimized word-level LSTMs (Krause et al., 2016).
  • In next-token prediction tasks (DCLM) up to 1.4B parameters, mLSTMsig and mLSTMexp match perplexities to within h^t=Whx xt+Whm mt\hat{h}_t = W_{hx}\,x_t + W_{hm}\,m_t5 PPL for all head configs (Beck et al., 18 Mar 2025).

The resource-optimized TFLA kernel for mLSTMsig achieves:

  • Inference (65k tokens): h^t=Whx xt+Whm mt\hat{h}_t = W_{hx}\,x_t + W_{hm}\,m_t6 faster than mLSTMexp, up to h^t=Whx xt+Whm mt\hat{h}_t = W_{hx}\,x_t + W_{hm}\,m_t7 faster than FlashAttention 3 for h^t=Whx xt+Whm mt\hat{h}_t = W_{hx}\,x_t + W_{hm}\,m_t8.
  • Training: h^t=Whx xt+Whm mt\hat{h}_t = W_{hx}\,x_t + W_{hm}\,m_t9 faster than Mamba 2 for all it=σ(Wix xt+Wim mt)i_t = \sigma(W_{ix}\,x_t + W_{im}\,m_t)0, and it=σ(Wix xt+Wim mt)i_t = \sigma(W_{ix}\,x_t + W_{im}\,m_t)1–it=σ(Wix xt+Wim mt)i_t = \sigma(W_{ix}\,x_t + W_{im}\,m_t)2 faster than FlashAttention 3 at it=σ(Wix xt+Wim mt)i_t = \sigma(W_{ix}\,x_t + W_{im}\,m_t)3.
  • Memory–runtime trade-off: at it=σ(Wix xt+Wim mt)i_t = \sigma(W_{ix}\,x_t + W_{im}\,m_t)4, batch 8, embedding 4096, optimal chunking yields it=σ(Wix xt+Wim mt)i_t = \sigma(W_{ix}\,x_t + W_{im}\,m_t)5 lower GPU memory use than competing kernels, consistent with roofline/runtime analysis (Beck et al., 18 Mar 2025).

5. Kernel Design and Optimization

The Tiled Flash Linear Attention (TFLA) kernel for mLSTMsig adopts a two-level sequence parallelism:

  • Sequence is chunked (Level 1); each chunk's initial state is computed and materialized by a recurrent kernel.
  • Within the chunk (Level 2), matrix-multiply operations—it=σ(Wix xt+Wim mt)i_t = \sigma(W_{ix}\,x_t + W_{im}\,m_t)6 with it=σ(Wix xt+Wim mt)i_t = \sigma(W_{ix}\,x_t + W_{im}\,m_t)7 and chunk-initial it=σ(Wix xt+Wim mt)i_t = \sigma(W_{ix}\,x_t + W_{im}\,m_t)8—are block-tiled for efficient tensor-core utilization and SRAM management.

The absence of auxiliary normalizers/max-states in mLSTMsig enables fusion of intra- and inter-chunk computations. In Triton implementation, a thread block loads and processes blocks of it=σ(Wix xt+Wim mt)i_t = \sigma(W_{ix}\,x_t + W_{im}\,m_t)9, ft=σ(Wfx xt+Wfm mt)f_t = \sigma(W_{fx}\,x_t + W_{fm}\,m_t)0, and ft=σ(Wfx xt+Wfm mt)f_t = \sigma(W_{fx}\,x_t + W_{fm}\,m_t)1, applying sigmoid gates, and accumulates both attention-derived and memory contributions in a fully fused forward pass with fewer memory barriers (Beck et al., 18 Mar 2025).

6. Training Stability, Hyperparameters, and Best Practices

Experimental best practices for mLSTM recurrent architectures, including mLSTMsig:

  • Hidden dimension ft=σ(Wfx xt+Wfm mt)f_t = \sigma(W_{fx}\,x_t + W_{fm}\,m_t)2 (or up to ft=σ(Wfx xt+Wfm mt)f_t = \sigma(W_{fx}\,x_t + W_{fm}\,m_t)3 for large-scale models).
  • Embedding layer of size ft=σ(Wfx xt+Wfm mt)f_t = \sigma(W_{fx}\,x_t + W_{fm}\,m_t)4 preceding first-layer projections.
  • Adam optimizer, learning rate decaying from ft=σ(Wfx xt+Wfm mt)f_t = \sigma(W_{fx}\,x_t + W_{fm}\,m_t)5 to ft=σ(Wfx xt+Wfm mt)f_t = \sigma(W_{fx}\,x_t + W_{fm}\,m_t)6.
  • Scaled orthogonal initialization for recurrent matrices.
  • Initial forget-gate bias ft=σ(Wfx xt+Wfm mt)f_t = \sigma(W_{fx}\,x_t + W_{fm}\,m_t)7 (classic) or input-gate bias ft=σ(Wfx xt+Wfm mt)f_t = \sigma(W_{fx}\,x_t + W_{fm}\,m_t)8 (for mLSTMsig, to suppress early gradient spikes).
  • Truncated BPTT: length ft=σ(Wfx xt+Wfm mt)f_t = \sigma(W_{fx}\,x_t + W_{fm}\,m_t)9–ot=σ(Wox xt+Wom mt)o_t = \sigma(W_{ox}\,x_t + W_{om}\,m_t)0.
  • Variational dropout ot=σ(Wox xt+Wom mt)o_t = \sigma(W_{ox}\,x_t + W_{om}\,m_t)1–ot=σ(Wox xt+Wom mt)o_t = \sigma(W_{ox}\,x_t + W_{om}\,m_t)2 on embeddings and hidden paths; weight normalization on all recurrent matrices (Krause et al., 2016, Beck et al., 18 Mar 2025).

Both classical and sigmoid-gated mLSTM variants exhibit stable optimization and non-degrading accuracy up to large parameter and context scales.

7. Applications and Modeling Power

mLSTM with sigmoid input gate excels in character-level and byte-level language modeling due to the flexibility of input-dependent gating and the capacity to instantiate complex, context-sensitive transition functions. The architecture’s capacity for long-range dependency modeling is maintained through its extended gating structure. The expressiveness introduced by the multiplicative input path, without incurring additional instabilities of exponential gating, renders mLSTMsig a preferred primitive for efficient, scalable sequence modeling, particularly in long-context and high-throughput deployment scenarios (Krause et al., 2016, Beck et al., 18 Mar 2025).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (2)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to mLSTM with Sigmoid Input Gate.