Md. Asif Uddin
    I.10.X04

    The hidden state is not the memory

    counterexample▲▲△

    Two runs of an LSTM coordinate reach ct=0.5c_t=0.5 and ct=−0.5c_t=-0.5. At step tt the output gate is 0.010.01. At step t+1t+1 the gates are f=0.99f=0.99, i=0.01i=0.01, with candidate 00 and output gate 0.990.99. How far apart are the two hidden states at tt, and at t+1t+1? What does this say about reading the memory from hth_t?

    Hint

    The cell update at t+1t+1 writes nothing, so ct+1=0.99 ctc_{t+1}=0.99\,c_t.

    Solution

    At tt, h=0.01tanh⁡(±0.5)h=0.01\tanh(\pm0.5), a gap of 0.01⋅2tanh⁡(0.5)=0.0092420.01\cdot2\tanh(0.5)=0.009242. A readout of hth_t sees runs that are almost identical.

    At t+1t+1 the cells are ±0.495\pm0.495, and h=0.99tanh⁡(±0.495)h=0.99\tanh(\pm0.495), a gap of 0.9071880.907188. The difference was in the cell all along. The output gate hid it for one step and then exposed it.

    So hth_t is a view of the cell through a gate, not the memory itself. A probe or classifier trained on hth_t can miss information the network will use one step later. To ask what an LSTM remembers, look at ct\vec c_t.

    Draws on