Pages and contents
Pages
On this page
CL1 — M
The space is designed to compress episodic memories to enhance sample efficiency as well as provide efficient improvement of the space that is to be introduced next chapter.
Experience
We can introduce a variable that describes a latent episode of experience, . This variable is a sequence of events, which can be encoded or decoded by the space.
Rather than storing arbitrary fixed windows of experience, stores episodes around meaningful anchor events. An anchor marks a timestep where something potentially important has occurred and a memory should begin forming. Define an anchor variable
For the initial model, an anchor can be triggered by reward, surprise, or a periodic fallback:
When , we open a pending episodic memory around timestep . The resulting experience is split into a context preceding the anchor and an outcome following it:
The context describes the state of the agent when the event occurred, while the outcome records what actions followed and what consequences resulted. The outcome can initially use a fixed maximum horizon , but may terminate earlier at another significant event or episode boundary. Once the continuation is complete, the full episode is encoded and written to memory:
This gives an event-centered structure:
which later allows the agent to retrieve situations similar to its current context and use their historical continuations as candidate plans.
Memory Read
We want to define a learned projection from to an attention-like retrieval space where and are MLPs.
k_i = \mathrm{norm}(K_M(p_i)) \\ q_t = \mathrm{norm}(Q_M(H_t, Z_t))
Then we use cosine similarity to read relevant historical trajectories.
Finally our read function
Learning
The memory encoder and decoder are trained as an autoencoder over recent experience windows.
We minimize a reconstruction loss over the components of :
where gradients through the target representations can be stopped so that learning does not distort the perceptual space.
The retrieval networks and are not trained by reconstruction. Instead, they learn through the downstream usefulness of retrieved memories. During training, we use differentiable retrieval
and pass the weighted retrieved memories into . The resulting loss propagates through the retrieval weights and therefore into and :
Thus learn how to store experience while learn which memories are useful to retrieve for forming reusable concepts.