TQL: Scaling Q-Functions with Transformers by Preventing Attention Collapse
Perry Dong, Kuo-Han Hung, Alexander Swerdlow, Dorsa Sadigh, Chelsea Finn
TL;DR
TQL addresses the core problem of scaling transformer-based value functions in reinforcement learning by diagnosing attention collapse as the key instability. It prevents collapse by directly regulating the entropy of attention scores with per-layer and per-token temperature terms toward a target entropy $\bar{H}$, while adding learnable modality embeddings and a compatible policy-extraction method. Empirically, TQL enables large transformers to scale in offline RL tasks, achieving state-of-the-art performance and a substantial scaling gain compared to baselines, with ablations confirming the importance of entropy guidance. The approach offers a simple, general mechanism to unlock the scalability of transformer-based value functions without architectural overhauls, making it practical for pretrained models and real-world offline RL deployments.
Abstract
Despite scale driving substantial recent advancements in machine learning, reinforcement learning (RL) methods still primarily use small value functions. Naively scaling value functions -- including with a transformer architecture, which is known to be highly scalable -- often results in learning instability and worse performance. In this work, we ask what prevents transformers from scaling effectively for value functions? Through empirical analysis, we identify the critical failure mode in this scaling: attention scores collapse as capacity increases. Our key insight is that we can effectively prevent this collapse and stabilize training by controlling the entropy of the attention scores, thereby enabling the use of larger models. To this end, we propose Transformer Q-Learning (TQL), a method that unlocks the scaling potential of transformers in learning value functions in RL. Our approach yields up to a 43% improvement in performance when scaling from the smallest to the largest network sizes, while prior methods suffer from performance degradation.
