PALMER · Reinforcement learning
Can an agent remember what it saw?
At a fork in a corridor, the correct choice depends on an object the agent saw at the entrance. I led a UCL team project testing whether two kinds of memory could help a reinforcement learning agent use that earlier observation.
- Setting
- UCL COMP0258 · Group 10
- My role
- End-to-end project responsibility
- Implementation
- PyTorch · CleanRL · MiniGrid
Interactive task
What can you remember at the fork?
Take the agent’s place. Remember the cue, follow the corridor and use what you saw to choose a destination. This browser illustration lets you make the decisions yourself.
Your observation
At the entrance
The starting cue is a circle. Remember its shape before entering the corridor.
You control this illustrated task. The project evaluated trained policies separately on MiniGrid.
Read the task walkthrough
A cue at the entrance supplies the goal. Travelling down the corridor removes it from view. At the fork, the two shapes tell you which exits are available. To select the matching exit you must also remember the symbol you saw earlier. PALMER studies how a policy can retain and use that information.
Model architecture
How does an old observation reach a new decision?
The model has to carry information across time. PALMER gives the current observation two ways to reach a later decision, then learns to weight the information from each.
- Encode once
- The observation encoder turns each frame into a feature vector. Both memory modules receive that same vector, so their inputs describe the same moment.
- Keep two memory states
- The LSTM updates a running state at each step. In parallel, the Transformer attends to stored representations from earlier steps through a memory mask.
- Learn the blend
- The network normalises both outputs and computes a separate mixing weight for each feature. The implementation sets a floor of 0.2 on the Transformer weight. The policy uses the blended features to choose an action, and the critic estimates its expected return.
Evaluation
Where did the hybrid memory help?
We compared PALMER with two PPO baselines, one using an LSTM and one using Transformer-XL, on four MiniGrid memory tasks. We tracked the fraction of episodes that reached the goal and the mean number of steps per episode.
MemoryS13 · Fixed corridor
Fast early learning, then fluctuations
PALMER made early progress on the fixed task. Later, its success rate fluctuated and the LSTM baseline finished episodes in fewer steps on average.
MemoryS17Random · Randomised corridor
No consistent lead on both measures
The late success curves overlap. PALMER continued to take more steps per episode than the LSTM baseline. The result depends on both the environment and the measure of performance.
The reported runs also cover MemoryS11 and MemoryS13Random. The gate logs show how the model weighted the two pathways. Isolating the benefit of learning those weights would require a separate comparison with a fixed gate.
Project ownership & next experiment
From the research question to the comparison.
My contribution
I was responsible for the project end to end within UCL Group 10, from framing the memory question and building the architecture through running the experiments and interpreting the comparisons. Our PPO implementation builds on CleanRL.
What I would test next
I would give the learned gate and a fixed-gate version the same training budget, repeat both across random seeds, and report success, episode length and training time together. That would help separate the gate’s effect from variation between runs and its computational cost.