liveBook · Manning

Working memory

As explained in Natural Language Processing in Action, Second Edition

Short-term memory is a temporary store for information that remains available over a limited span of processing.

Working memory is a temporary store for information that remains available during a limited span of processing. In recurrent networks, it gives the model a structured place to retain recently processed tokens while longer-term meaning is stored separately. section 8.4 section 8.4.3

An LSTM represents working memory with its hidden state. The hidden state carries information about the most recently processed tokens, while the cell state carries longer-term information and is reused at the next token. section 8.4.3

LSTM gates regulate what working memory retains, updates, and exposes:

  • The forgetting gate ignores parts of the hidden layer to make room for future tokens. section 8.4.3
  • The input or update gate selects which parts of the hidden layer matter to the current output. section 8.4.3
  • The relevance or cell gate blocks information no longer relevant to the current output. section 8.4.3
  • The output gate selects what becomes the activation and hidden-state output used to predict the next token. section 8.4.3

LSTM state update

The recurrent update combines the previous cell state with candidate information: c = f*c + i*g, followed by h = o*tanh(c).

Figure 8.12 LSTMs add a forgetting gate and a cell output.
figure

Inspect how the forgetting gate and cell output fit into the LSTM architecture. section 8.4.3

How Natural Language Processing in Action, Second Edition covers it

How deep it goes
Explains hidden and cell states plus four LSTM gates and their update equations.
Examples
Uses LSTM gate equations, hidden-state vectors, cell-state vectors, and a gate-architecture figure.
What it assumes
Assumes familiarity with recurrent networks while defining hidden states, cell states, and memory gates.
What you can do after
Understand how LSTMs retain recent token information and regulate its update and output.
How it connects
Connects working memory to recurrent neural networks, LSTMs, hidden states, cell states, long-term memory, and gating.

Also explained in

Compare how 7 books explain working memory →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Natural Language Processing in Action, Second Edition. The section links point to the parts of the book it draws on.