Optimal Dynamic Regret by Transformers for Non-Stationary Reinforcement Learning
Baiyuan Chen, Shinji Ito, Masaaki Imaizumi
TL;DR
This paper addresses learning in non-stationary reinforcement learning settings by showing that transformers trained in an in-context manner can achieve near-optimal dynamic regret. It introduces a transformer architecture that can approximate non-stationary operation schemes and provides a regret bound decomposed into approximation, pretraining, and base algorithm components, with a corollary giving rate-optimal performance under sufficient data. The core contributions include a new proof technique that interprets the transformer's hidden state as maintaining multiple hypothesis policies, a demonstration that windowed scheduling and restart mechanisms can be effectively emulated by a transformer, and empirical results in a linear bandit setting showing competitive performance with established expert algorithms. The work highlights the practical significance of in-context learning for adaptive RL and lays groundwork for extending to broader non-stationary environments and richer benchmarks.
Abstract
Transformers have demonstrated exceptional performance across a wide range of domains. While their ability to perform reinforcement learning in-context has been established both theoretically and empirically, their behavior in non-stationary environments remains less understood. In this study, we address this gap by showing that transformers can achieve nearly optimal dynamic regret bounds in non-stationary settings. We prove that transformers are capable of approximating strategies used to handle non-stationary environments and can learn the approximator in the in-context learning setup. Our experiments further show that transformers can match or even outperform existing expert algorithms in such environments.
