I use these notes to compare reinforcement-learning methods, from writing a small agent from a blank file to hierarchical options, latent-space augmentation, and flow-based value functions. They capture both techniques I want to try and the limits or unanswered questions I see in reported results.
I found it fun recently to “just open up a completely blank file” and write an RL agent from scratch without looking at prior code.
I now use “from scratch” for writing an agent with PyTorch, although I used to reserve the phrase for C with no libraries.
I said, “There is a point of scale where rewriting things from scratch is a bad idea”; I also consider being able to do it a blessing.
I said, “I’m going to try to at least skim one of the papers in my bookmarks each weekday for the rest of the month.”
I described a paper whose central method is that a generic LSTM meta-network processes environment data and opaque prediction vectors from the agent to generate targets, replacing traditional RL target-generation algorithms.
After training, I said the meta-network can be frozen and used like any other hard-coded target-generation algorithm, giving better performance than standard algorithms.
I highlighted transfer learning: the paper reports state of the art performance on ProcGen and other environments that it had never seen before, despite training the meta-network on Atari.
I noted that the meta-network is agnostic to the main agent network architecture, as long as the network outputs the right block of vectors.
I explained that the observation-conditioned prediction Y and action-conditioned prediction Z are These are the equivalents of classic V and Q functions, but of an arbitrary dimension instead of just being a scalar; Z is also conditioned on the observation, or more accurately the state, which may be recurrent.
I described Q and P as hard-coded auxiliary outputs for standard Q learning with Retrace targets, and next-step policy prediction; they do not directly affect policy learning or agent behavior, but let the base model learn additional features.
Including the Q and P auxiliary outputs increases agent performance by about 10%, though I thought they cluttered the paper’s main point.
I wondered whether allowing the same resources to be meta-learned alongside Y and Z would discover equally useful options.
All of the outputs are softmax normalized, and KL divergence between the predictions and targets is used to generate the loss.
The target-generating meta-network LSTM processes 29 multisteps at a time; the paper found it as effective as a transformer and more efficient.
An additional meta-RNN handles longer-term adaptation and slightly improves overall performance, although I thought it also cluttered the paper’s main point.
The ordinary hyperparameters—optimizer, learning rate, weight decay, and gradient clip point—were swept normally. I thought: Meta-optimizing these could probably piggy-back on the same meta architecture as the target meta learning, but the paper is clearer without it.
The best and worst still-plausible manually tuned hyperparameters differed by an order of magnitude difference in performance.
A normal training run with the frozen meta-network took 40% of the time that MuZero did because target generation was faster; I presumed it was slower than Muesli.
For Atari, the training setup used a supervised learning style warmup and cosine-decays learning rate, which I called a bit unusual.
Agent parameters were reset after mostly shorter trajectories like 20M, with only a few going for 200M, because most learning was observed to happen early; I questioned whether longer runs helped much or whether an equivalent algorithm could be learned with 20M or shorter sessions.
I noted that Google filed a patent application on aspects of this work and reacted, “Yikes!”
I have often noticed that our estimated Q values are higher than the observed returns, sometimes substantially so, and that this can’t be good for performance.
For policy decisions, only the relative values matter, but an offset negatively impacts bootstrapping; that was why I was excited to see a paper on Relative Value Learning.
After struggling with “the Banach space of bounded antisymmetric pairwise functions“, I realized the essential idea was subtracting two value functions.
I summarized the operational form as “Subtracting the mean TD error from the individual sample TD errors gives all the benefits of relative value learning.”
Although I could create examples where relative value learning should be valuable, it didn’t actually improve performance on my tasks; I still thought the investigation usefully narrowed down what was happening.
I argued that Bellman iteration naturally corrects toward a correct absolute value only when the bootstrap values are also training targets.
I explained: With Q-learning, you are often / mostly bootstrapping from a max-action that was not actually taken, so it never sees any downward Bellman pressure.
I observed that learning state value functions offline from a frozen policy without actions doesn’t seem to suffer from any value overestimation.
I noted that we don’t have a clear method to learn them from scratch, referring to RL options.
I described the paper’s Ant environment as designed to require two levels of planning.
I described the metacontroller as trainable at high-level switch points to much greater performance than the base pre-trained model.
I noted that the expert RL models were explicitly given one of four goals in each segment.
I judged the experiment’s classification task a vastly simpler problem than free form option discovery.
I didn’t see an explanation for the change from a State Space Model for complex Ant environments to a transformer for simpler grid-world environments.
I noted that the internal walls do not block movement; they just kill the ant when its center passes into them.
I said, “It doesn’t do any kind of partially observed or pixel based sensing.”
I said the experiments use massively parallel environments, avoiding harder online-learning challenges, and that success rates still were not great after a million episodes.
I would like to see this applied to Atari, using less capable experts or lower episode quantities and then attempting free form option discovery.
CLOP works by swapping all channels as a unit.
Unlike dropout, CLOP “doesn’t zero any channels out”; it moves them.
I said, “I’m going to give it a try,” referring to CLOP.
I cautioned against applying CLOP at a 2x2 level: there are only four possible permutations, and any of them disturb half the spatial information.
I noted that they tuned the swap chance per-game.
I said, “The results on pure supervised learning tasks weren’t noteworthy.”
I said value-based RL is most naturally addressed with an MSE loss.
I said the flow model plausibly makes it easier to represent complex mappings.
I said the odds are good that your original task performance will be almost back to random after training on another task for a few million optimizer steps.
I’m not sure what the training dynamics would be if you had to co-learn a CNN feature extractor with the flow model.
The paper compares its flow model with an 8x ensemble of value functions and a ResNet with 8x the layers, and reports that the flow model is notably superior.
I noted that an ensemble of models trained on the same sequence of samples doesn’t help much in RL.
I wonder if you could train the deeper res-net with similar supervision at multiple interior points.
I noted that the initial input-noise range is a sensitive parameter on some of the benchmarks.
I noted that using a scalar time also worked poorly.
I have been meaning to learn more about flow models, and this paper was a good prod.
My proposed Atari direction connects these questions to atari reinforcement learning.
Related: online and offline learning, selective gradient updates, atari reinforcement learning