LSTM (Long Short-Term Memory) solves the RNN long-term dependency problem with “three gates and one state”. Forget gate
ft=σ(Wf[ht−1,xt]+bf), input gate
it=σ(Wi[ht−1,xt]+bi), candidate memory
c~t=tanh(Wc[ht−1,xt]+bc); cell state
ct=ft⊙ct−1+it⊙c~t, output gate
ot=σ(Wo[ht−1,xt]+bo), hidden state
ht=ot⊙tanh(ct) (
⊙ is elementwise product,
[ht−1,xt] concatenation). The key is that the cell state is an
additive path:
∂ct−1∂ct=ft is a scalar gate instead of a matrix chain product, so when the forget gate is near 1 the gradient passes through almost unchanged over long distances — the core defense against vanishing gradients. Gating costs 4 weight sets on
[ht−1,xt], i.e. roughly 4× the parameters of a vanilla RNN. xLSTM (2024) continues this line: sLSTM adds exponential gating with memory mixing, and mLSTM uses a matrix memory with a covariance update rule for higher capacity.