Zero Labs
Industry News / AI

LSTMs: When One Hidden State Was No Longer Enough

Source · Towards AI By ABHISHEK S M

From the publisher’s feed, collected in the ZeroLabs newsroom.

A sentence is not merely a cluster of nearby words. It unfolds. Meaning accumulates. A condition may begin in one place and govern what happens much later. A subject may be introduced early, disappear into intermediate detail, and still determine the shape of what follows. The past does not merely sit behind the present; it presses into it. Each new word arrives inside a field already reshaped by the words before it, and in arriving, reshapes that field again. So the present word is never encountered alone. It is encountered through what the sequence has already become.Recurrent neural networks were the first serious attempt to model this directly. Instead of treating language as a fixed window of nearby words, an RNN moves through the sequence step by step, carrying forward a hidden state — an internal summary of what the sentence has become so far.One way to picture that hidden state is as a tinted lens.The model does not meet each new word from scratch. It meets it through a lens already colored by the words that came before. That visible coloring is the tint. If the sentence has already passed through “the cat,” then “sat” is not arriving into emptiness. It is arriving into a state already shaped by the existence of a subject. And if the sentence continues into “the cat sat on the mat,” then by the time the model reaches the second “the,” the sentence is no longer in the same condition it was at the beginning. The earlier words have changed what this new word can naturally mean.That was the beauty of the RNN.But it was also the beginning of a problem.Because in a plain RNN, all of that changing condition had to live in one evolving hidden state. The same state had to preserve what mattered from the past, absorb the current word, and remain useful for what came next. It had to remember, change, and speak all at once.That is where the strain began.The problem with a plain RNN was not that it had no memory. The problem was that its memory had no separation of roles. The same hidden state was being asked to be the place where the past survives, the place where the present rewrites that past, and the place from which the current step is expressed.That can work for a while.Then the sentence becomes more demanding.And one state is no longer enough.That is the moment where Long Short-Term Memory (LSTM) becomes necessary.Not as a decorative improvement.Not as extra machinery for its own sake.But as a recognition that carrying memory, changing memory, and exposing memory are three different acts.That is the real beginning of the LSTM.Why one hidden state starts to failTake a tiny sentence:the cat sat on the matAt the first “the,” the model is in a broad opening condition. A noun is likely to come next.At “cat,” that condition sharpens. A subject has appeared.At “sat,” the sentence now has a predicate. Something has been stated.Then comes “on.”And now the sentence changes again. Not just locally. Structurally.It is no longer only a subject followed by a verb. It has opened a phrase. A continuation is underway. By the time the model reaches the second “the,” that word should not be understood the same way as the first one. This second “the” appears after “sat on,” inside a different unfolding condition, and that changes what the model should expect next. It now leans naturally toward “mat.”A plain RNN tries to carry all of this through one evolving hidden state.That is the issue.One stream is being asked to do too many things at once:preserve the earlier subject,absorb the structural shift introduced by “on,”and remain the current visible state through which the next word will be interpreted.Sooner or later, the present update pulls too hard on what should have remained deeper and steadier.That is why the LSTM is not simply “better memory.”It is memory with structure.A clearer way to say the problemAs the sequence unfolds, the model is not just storing old words. It is carrying forward the sense of what the sentence has become so far. We can call that the carried condition.But at each step, not all of that carried condition is equally active. Some part of it is closer to the surface and directly shaping how the current word is being understood. We can call that the exposed condition.In a plain RNN, the same hidden state is trying to do both jobs at once. It is the main place where the carried condition lives, and at the same time it is the exposed condition active in the current step.That is the pressure point.And if we still want to keep the earlier image, then the tint is simply the felt coloring produced by that exposed condition. Tint is not another hidden object inside the model. It is the surface effect of the condition currently active now.So the problem becomes easier to name:the sequence has a carried conditionpart of that condition is exposed in the present stepand in a plain RNN, both are largely fused into the same single hidden stateLSTM begins when that fusion becomes too fragile.The first deeper moveLSTM begins with a hard-won insight:what should be carried forward is not exactly the same as what should be active right nowThat single realization changes everything.A sentence may need to preserve something quietly for several steps without making that thing the whole visible state of the current moment. Some structure must remain in a deeper line of continuity, while only part of it appears at the surface.So the LSTM does not reject the hidden state.It deepens the story.Instead of forcing all memory to live on one front-facing surface, it introduces a second line — a deeper carried state beneath the currently exposed one.In technical language:the deeper carried memory is the cell statethe currently exposed working state is the hidden stateNow we can say it cleanly:the cell state carries the deeper carried conditionthe hidden state is the more immediate exposed conditionand the tint is the surface coloring produced by that exposed condition (metaphorically)That is the decisive move.The model no longer forces all of memory to remain visible at once. Some of it can travel in a steadier inner line. Some of it can be exposed in the present moment. And the relation between the two can be learned.That is why the architecture suddenly becomes more mature.The LSTM in six actsOnce one state is no longer enough, the repair unfolds almost inevitably.Some of the old memory must be kept.The present moment must propose something new.Only part of that proposal should be admitted.The old and the newly admitted must be combined into a new deeper state.That deeper state must be shaped for present use.And only the chosen part of it should be revealed as the active state of the moment.That is the whole LSTM in six acts:keep, propose, admit, combine, shape, revealThese are not decorative steps.They are the repair.The model first keeps part of what still matters from before.It proposes new meaning from the present moment.It admits only part of that proposal.It combines old and new into an updated deeper state.It shapes that state for present use.And finally, it reveals only the part the current moment needs.So the LSTM is not a break from the RNN story.It is what that story becomes once memory is no longer allowed to remain one undivided thing.A tiny world is enough to see itWe do not need a giant corpus to understand why this matters.Suppose the vocabulary is:the, cat, dog, puppy, fox, sat, ran, slept, on, matAnd suppose the training corpus is:the cat satthe dog ranthe puppy sleptthe fox satthe cat sat on the matthe dog slept on the matThis tiny world already reveals the whole problem.Because the word “the” appears in two very different conditions.At the beginning of a sentence:the cat …the dog …the puppy …the fox …And later, inside a phrase:on the matSo the word “the” cannot be understood by itself.At sentence start, it points toward an animal noun.After “on,” the same word now points toward “mat.”So the real question is no longer only:What is the current word?It becomes:What has the sentence already become by the time this word arrives?That is exactly the kind of thing the LSTM was built to preserve more carefully than a plain RNN.Keep — why the old state should not be discarded blindlyThe first act of the LSTM is deceptively simple.Before asking what the present moment wants to add, the model first asks:What from the past still deserves to remain?That question is deeper than it looks.A weaker model treats memory badly in one of two ways. Either it lets the past dominate too heavily, so the present cannot reshape the sentence when it needs to. Or it lets each new word pull too hard, so whatever mattered earlier fades too easily. Both are failures of memory discipline.The LSTM refuses both.It begins by giving the old state a gate.Not a hard switch.Not a brutal decision of keep everything or erase everything.A proportion.Some of the old state may deserve to remain strongly.Some of it may deserve to fade.Some of it may no longer matter at all.This is the first repair.The past is not sacred simply because it is past. But neither is it disposable simply because something new has arrived.It must be filtered.That is what the forget gate really means.It is not the enemy of memory.It is memory learning restraint.Take the sentence again:the cat sat on the matBy the time the model reaches on, it has already built a meaningful condition. It knows there is a subject. It knows a verb has occurred. Some of that should remain. But not every earlier detail needs to stand at the same intensity forever. The model must decide what part of the old carried condition still deserves to travel forward.That is keep.Not blind preservation.Selective continuation.Propose — what the present moment is trying to addOnly after the old state has been filtered does the LSTM turn fully to the present.The current word arrives. The current exposed condition is already there. Together, they suggest something new.This is the second act:proposeThis is one of the most beautiful things about the architecture.The present is not allowed to rewrite memory directly. It first has to offer a proposal.That means the current moment is treated not as a command, but as a candidate update.Again, look at the sentence:the cat sat on the matWhen the word on appears, it is not merely another token to be absorbed. It is proposing a structural change in how the sentence should now be understood. It is suggesting:a phrase has opened,another “the” may come next,and “mat” is now moving into view.That suggestion is real. But the model still does not accept it blindly.The present must first speak. Only then can memory decide how much to believe it.That is why this act is so important.The current word does not simply overwrite the state. It makes a case.Admit — not everything proposed deserves entryNow comes the third act:admitThe present moment has proposed something. But the model still must decide:How much of that proposal deserves entry into deeper memory?This is the input gate.And here again the key is proportion.The proposal is not simply accepted or rejected. It is admitted in degree.A weak cue may enter only faintly. A strong structural cue may enter strongly.That is why the mixing-board intuition helps. Not because the LSTM is “really music,” but because the mixing board makes one fact obvious: these are continuous controls. You do not have to think in all or nothing. You can let in this much of the new line and hold back the rest.That is exactly what the LSTM learns.So when on appears in our sentence, the present is not just saying “please replace the old state.” It is saying “let this much of my new structure into the deeper line.”That is a far more mature kind of update.The present does not dominate by force. It enters by measure.Combine — the new state is neither just old nor just newNow the old and the new meet.The part of the old condition that was kept, and the part of the new proposal that was admitted, are brought together into a new deeper state.This is the fourth act:combineThis is the heart of the LSTM.Because the new deep memory is not merely the past. And it is not merely the present.It is:retained continuity + admitted changeThat is why the architecture feels composed instead of overwritten.A plain RNN is always in danger of making the new state feel like a fresh repainting of one surface. The LSTM changes the logic. The new deeper state is built from two clearly distinguished contributions:what still mattered from before,and what newly deserved to enter.That is a profound shift.Memory is no longer one stream endlessly rewritten. It becomes a process of conservation and revision.And now we can feel why the earlier metaphor of a single tinted lens was no longer enough. Because tint alone was too surface-level for what had to happen here. Something deeper had to continue beneath the visible state, and it had to be updated without being shattered.That is exactly what the cell state gives us.A tiny numerical walk-throughAt this point, it helps to make the motion concrete.Not with a wall of math. Just enough numbers to make the process visible.Suppose we are at the moment just after seeing on in:the cat sat on the matLet the old deep memory be:2.00This is only a toy number. It does not mean “the meaning of the sentence is 2.” It simply stands in for the amount of useful internal structure already being carried.KeepSuppose the model decides to keep:0.997of that old deep memory.Then the surviving old memory becomes:2.00 × 0.997 = 1.994 ≈ 1.99So almost all of the earlier structure survives.ProposeNow the present moment proposes a new contribution.Since on is structurally important, let the candidate contribution be:1.00Again, this is just a toy scalar. It simply says: this moment is suggesting something real.AdmitNow suppose the model admits:0.97of that proposed contribution.Then the admitted new part becomes:1.00 × 0.97 = 0.97So most of the new structural cue is allowed into deeper memory.CombineNow combine retained old memory and admitted new memory:1.99 + 0.97 = 2.96This becomes the new deep memory.That is the heart of the LSTM made visible.The new state is not just the past. And it is not just the present.It is:retained continuity + admitted new meaningThat is why the architecture feels composed instead of overwritten.Shape — the deeper state is still not the present-facing stateBut the story is still not finished.The new deep memory now exists.Yet the LSTM still does not say: “Fine — that is now simply the visible state of the moment.”Why not?Because what is carried deeply is not identical to what should be active on the surface right now.That is the fifth act:shapeThe updated deep state must first be turned into a present-facing form.This is a subtle point, but it matters enormously.The deep state is allowed to be richer and steadier. It carries continuity. It preserves structure. It may contain more than the current moment needs to fully expose. The present-facing state, by contrast, must be usable now. It must be bounded, active, and suitable for immediate interpretation.So the architecture performs another transformation. It shapes the deeper state into a possible current expression.In the standard LSTM, this shaping happens through tanh.So if the new deep memory was:2.96then the shaped present-facing version becomes:tanh(2.96) ≈ 0.99This is not yet the final hidden state. It is only a candidate for present use.That distinction is beautiful.The LSTM does not allow deep memory to leap straight to the surface. It must first be prepared for exposure.Reveal — only part of the shaped state becomes active nowEven now the architecture is not done.The deeper state has been updated. It has been shaped into a present-facing candidate.And still one question remains:How much of this shaped state should actually become active right now?This is the sixth act:revealThis is the output gate.And this gate encodes one of the deepest ideas in the whole architecture:what is inwardly carried is not identical to what should be outwardly active nowThe model may be carrying more than it needs to fully display at the current step. Some of that deeper structure may matter now only indirectly. Some of it may need to remain available for what is still coming. So the architecture again chooses in proportion.Not all of the shaped state must be exposed. Only the right amount.Continuing the numerical example:If the shaped state is:0.99and the model reveals:0.99of it,then the new hidden state becomes:0.99 × 0.99 = 0.9801 ≈ 0.98So the step ends with:new deep memory = 2.96shaped present-facing candidate = 0.99new hidden state = 0.98That is the full LSTM step.Keep.Propose.Admit.Combine.Shape.Reveal.Now return to the sentenceCome back to the contrast that has been carrying the whole article:the cat sat on the matThe first “the” appears at sentence opening. The second “the” appears after “cat sat on.”Those are not the same conditions.By the time the model reaches the second “the,” the architecture has already:kept what still mattered from before,admitted the structural cue introduced by “on,”combined old and new into an updated deeper state,shaped that state for the present,and revealed the right part of it as the new hidden state.So this “the” is no longer simply “the.”It is the after on. It is the inside a phrase already leaning toward mat.That is exactly what the LSTM was built to preserve more faithfully than a plain RNN.And if we still want to keep the earlier metaphor, then its tint is no longer the whole story. The tint of this moment is now just the surface coloring produced by a deeper carried condition and a more selective exposed condition.That is the addition the LSTM makes.A technical spotlight: the same story inside one LSTM cellAt this point, it helps to look once at the actual inner bookkeeping of a single LSTM step.The six-act story is still the main language of the article. But inside the cell, the same story appears in a more mechanical form:a gate controls how much of the old deep memory remainsa candidate new memory is formed from the current input and previous hidden stateanother gate controls how much of that candidate entersthe two are added into a new cell statethe new cell state is shaped through tanhand a final gate controls how much of that shaped state becomes the new hidden stateThat is not a second story.It is the same story written in the native machinery of the LSTM.The equations, now earnedWhat the LSTM really repairedPeople often say LSTMs solved vanishing gradients.That is true, and historically important.But it is only the outer description.At a deeper level, what the LSTM repaired was more conceptual.It repaired the confusion between three different acts:remembering,changing,and exposing.A plain RNN forced all three into one evolving state.An LSTM separated them.Something is carried more steadily. Something judges how the present should modify that carried condition. And something decides what part of the updated state should become active now.That is why the architecture feels more intelligent.Not because it merely stores more. But because it gives memory roles.It distinguishes:what is carried,what is changed,and what is revealed now.That is the real advance.Why this mattered so muchOnce this architecture appeared, recurrent sequence modeling became much more capable.It became easier for models to preserve useful structure across longer spans.It became easier for gradients to pass through time without collapsing so quickly.And the field gained a more mature picture of what sequence memory should be.Not residue.Not one stream endlessly rewritten.But an organized continuity.A carried condition.A selective update.A disciplined exposure.That is why LSTMs became so important.They did not merely strengthen recurrence.They refined what recurrence meant.The deepest answerSo how did models become better at remembering what matters?Not by storing more and more of the past as untouched trace.But by learning to regulate memory as a process with roles.To keep part of what already matters.To let in what is newly meaningful.To build a deeper state beneath the moment.To shape that state for the present.And to reveal only the right amount of it now.That was the repair.Reading the conventional LSTM diagram through our KEEP → REVEAL languageThe conventional LSTM diagram can look dense at first:arrows, gates, multiplications, additions, and two state paths crossing the cell. But underneath that visual complexity, it is doing something very disciplined. It is managing memory in stages.The standard diagram is the engineering view of the LSTM.Our KEEP → REVEAL version is the conceptual reading of that same machinery. So these are not two different stories. They are the same memory cell seen in two different languages.On the left, the forget gate asks what part of the old cell state should remain.That is our KEEP.In the middle, the tanh branch creates possible new content.That is PROPOSE.The input gate decides how much of that proposal may enter.That is ADMIT.The addition on the cell-state rail merges retained past and admitted present.That is COMBINE.On the right, tanh prepares the updated cell state for outward use.That is SHAPE.Then the output gate controls how much becomes visible as the hidden state.That is REVEAL.So the conventional diagram shows the mechanism, and our six-act overlay shows its meaning.One-line memory hookAn LSTM became powerful when sequence memory stopped being one changing state and became a disciplined inner process: keeping some of the past, letting in some of the present, shaping the result, and revealing only what the current moment needs.LSTMs: When One Hidden State Was No Longer Enough was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.