English

One for All: A Non-Linear Transformer can Enable Cross-Domain Generalization for In-Context Reinforcement Learning

Machine Learning 2026-05-12 v1 Artificial Intelligence

Abstract

A central challenge in reinforcement learning (RL) is to learn models that generalize beyond the tasks on which they are trained, a goal traditionally pursued through multi-task and meta RL. Recently, transformer architectures have emerged as a promising approach, enabling adaptation to new tasks via in-context learning without explicit parameter updates. From a functional perspective, a transformer can be viewed as a functional operator that maps a context to a task-specific function. It is thus fundamental to understand and design this operator to support stronger generalization in RL. In this work, we address this resulting question of generalization from a kernel-based perspective by establishing a connection between non-linear transformers and kernel-based temporal difference learning. By interpreting the transformer as performing regression in a Reproducing Kernel Hilbert Space (RKHS), we show that value functions from different domains can be represented using a shared set of weights, provided they lie within the same RKHS. Experiments on multiple MetaWorld domains support this interpretation, demonstrating convergence of the temporal-difference objective.

Keywords

Cite

@article{arxiv.2605.09727,
  title  = {One for All: A Non-Linear Transformer can Enable Cross-Domain Generalization for In-Context Reinforcement Learning},
  author = {Bowen He and Juncheng Dong and Lin Lin and Xiang Cheng},
  journal= {arXiv preprint arXiv:2605.09727},
  year   = {2026}
}
R2 v1 2026-07-22T07:02:39.757Z