# Retrieval-Augmented Decision Transformer: External Memory for In-context RL

Source: [Retrieval-Augmented Decision Transformer: External Memory for In-context RL](<https://www.sota2.com/research/paper/68fa7a991e209131cea8423b>)

Collection index: [llms.txt](<https://www.sota2.com/research/llms.txt>)

Data updated: 2025-10-26T05:23:58.707Z

Authors: Thomas Schmied, Fabian Paischer, Vihang Patil, Markus Hofmarcher, Razvan Pascanu, Sepp Hochreiter

Published: 2024-10-09T17:15:30.000Z

## Abstract

In-context learning (ICL) is the ability of a model to learn a new task by observing a few exemplars in its context. While prevalent in NLP, this capability has recently also been observed in Reinforcement Learning (RL) settings. Prior in-context RL methods, however, require entire episodes in the agent's context. Given that complex environments typically lead to long episodes with sparse rewards, these methods are constrained to simple environments with short episodes. To address these challenges, we introduce Retrieval-Augmented Decision Transformer (RA-DT). RA-DT employs an external memory mechanism to store past experiences from which it retrieves only sub-trajectories relevant for the current situation. The retrieval component in RA-DT does not require training and can be entirely domain-agnostic. We evaluate the capabilities of RA-DT on grid-world environments, robotics simulations, and procedurally-generated video games. On grid-worlds, RA-DT outperforms baselines, while using only a fraction of their context length. Furthermore, we illuminate the limitations of current in-context RL methods on complex environments and discuss future directions. To facilitate future research, we release datasets for four of the considered environments.

## Recorded benchmark results

A research result applies to its stated dataset, split, metric and evaluation configuration. Compare like-for-like settings, preserve the metric's unit and direction, and distinguish paper-reported results from independent reproduction. The best result recorded here is not a claim of exhaustive, current global coverage.

- [Offline Reinforcement Learning on D4RL (MuJoCo M/MR/ME & Adroit/Kitchen Subset)](<https://www.sota2.com/research/sota/offline-reinforcement-learning-on-d4rl-mujoco-m-mr-me-and-adroit-kitchen-subset.md>): Offline Reinforcement Learning; D4RL; Walker2d (Medium Expert) Score: 107.8.

## Original sources and implementation

[Original paper](<https://arxiv.org/abs/2410.07071>)

[PDF](<https://arxiv.org/pdf/2410.07071.pdf>)
