LSTM Gate Equations › The Input Gate

Michael BrenndoerferUpdated May 11, 20252 min read
Language AI HandbookAll chapters
Part 11 of 67Recurrent Neural Networks
Chapter 78LSTM Gate Equations › The Input Gate
Reading section 4 of 17 · The Input Gate · 2 minSection 4 of 17 · 2 min

Book contents

Section 4 of 17 · 2 min read

LSTM Gate Equations › The Input GateOne section · Sections in this chapter4 / 17 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

While the forget gate decides what to discard, the input gate addresses the complementary question: what new information deserves to be written into memory? Not every input is equally important. When reading text, some words determine the meaning ("The murderer was...") while others are grammatical scaffolding ("the", "was"). The input gate learns to recognize which incoming information warrants permanent storage.

The input gate works in tandem with a candidate cell state (which we'll examine next). Think of it as a two-stage process: the candidate proposes "here's what we could store," and the input gate decides "here's how much of that proposal to actually write." This separation of concerns allows the network to generate rich candidate updates while maintaining fine-grained control over what enters long-term memory.

The Gating Mechanism

Like the forget gate, the input gate examines the current input and previous hidden state to make context-dependent decisions:

it=σ(Wixt+Uiht−1+bi)\mathbf{i}_t = \sigma(\mathbf{W}_i \mathbf{x}_t + \mathbf{U}_i \mathbf{h}_{t-1} + \mathbf{b}_i)

where:

  • it∈Rh\mathbf{i}_t \in \mathbb{R}^h: the input gate activation vector, controlling write intensity per dimension
  • Wi∈Rh×d\mathbf{W}_i \in \mathbb{R}^{h \times d}: weight matrix that learns which input features signal "important, store this"
  • Ui∈Rh×h\mathbf{U}_i \in \mathbb{R}^{h \times h}: weight matrix that learns which processing contexts warrant new storage
  • bi∈Rh\mathbf{b}_i \in \mathbb{R}^h: bias vector setting the default write behavior

The structure is identical to the forget gate: a linear combination of the input and hidden state, followed by sigmoid. The difference lies entirely in the learned parameters. During training, the network discovers that certain input patterns should trigger forgetting while different patterns should trigger storage. The same architectural template serves opposite purposes through different learned weights.