atlas

Research map / Reinforcement learning / Visual and representation RL

Transformers Can Learn Temporal Difference Methods for In-Context Reinforcement Learning

ICLR 2025 · Reinforcement learning › Visual and representation RL · approach: Probabilistic and autonomous RL · 0 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Shows theoretically and empirically that linear-attention transformers trained with multi-task nonlinear TD on random policy-evaluation tasks learn to implement TD (and TD(λ), residual gradient, average-reward TD) in their forward pass, with an invariant-set analysis for the one-layer case.

Problem

Understanding how in-context reinforcement learning (ICRL) for policy evaluation arises from reinforcement pretraining, i.e., which algorithm a pretrained transformer implements in its forward pass and why TD-based pretraining produces it.

Approach

Constructs linear-attention transformer weights that exactly implement batch TD(0) (and other TD variants) layer by layer, then shows multi-task TD pretraining of the transformer on random Boyan-chain MRPs converges toward these weights, and proves a parameter set implementing in-context TD is invariant under the expected TD update for one layer.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
train with multi-task TD on randomly generated Boyan's chain policy-evaluation taskslinear transformer · Boyan's chainin-context TD emergenceHelped
use a task distribution with fixed transition probabilities or fixed featuresmulti-task TD pretraining · Boyan's chainin-context TD emergenceHurt
learn through multi-task TD pretraining rather than explicitly implementing residual gradientlinear transformer · Boyan's chain policy-evaluation taskslearned in-context algorithmMixed
use a normal transformer without parameter sharing (ablation)multi-task TD-pretrained transformer · policy-evaluation tasksin-context TD emergenceNo clear effect
use softmax-based attention instead of linear attention (ablation)multi-task TD-pretrained transformer · policy-evaluation tasksin-context TD emergenceNo clear effect
train on CartPole-based tasks instead of Boyan's chain-based tasks (ablation)multi-task TD-pretrained transformer · CartPolein-context TD emergenceNo clear effect

Surprising findings

Limitations

Experimental setup

Datasets: Boyan's chain (randomly generated MRPs) CartPole

Benchmarks: Boyan's chain CartPole

Metrics: value approximation error parameter convergence (P0, Q0) value difference implicit weight similarity sensitivity similarity

Baselines: residual gradient TD(lambda) average-reward TD

Builds on: in-context learning as gradient descent Boyan's chain TD(lambda) residual gradient

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy