ReLIC: A Recipe for 64k Steps of In-Context Reinforcement Learning for Embodied AI

## Abstract

Abstract Intelligent embodied agents need to quickly adapt to new scenarios by integrating long histories of experience into decision-making. For instance, a robot in an unfamiliar house initially wouldn’t know the locations of objects needed for tasks and might perform inefficiently. However, as it gathers more experience, it should learn the layout of its environment and remember where objects are, allowing it to complete new tasks more efficiently. To enable such rapid adaptation to new tasks, we present ReLIC, a new approach for in-context reinforcement learning (RL) for embodied agents. With ReLIC, agents are capable of adapting to new environments using 64,000 steps of in-context experience with full attention while being trained through self-generated experience via RL. We achieve this by proposing a novel policy update scheme for on-policy RL called “partial updates” as well as a Sink-KV mechanism that enables effective utilization of a long observation history for embodied agents. Our method outperforms a variety of meta-RL baselines in adapting to unseen houses in an embodied multi-object navigation task. In addition, we find that ReLIC is capable of few-shot imitation learning despite never being trained with expert demonstrations. We also provide a comprehensive analysis of ReLIC, highlighting that the combination of large-scale RL training, the proposed partial updates scheme, and the Sink-KV are essential for effective in-context learning.
The code for ReLIC and all our experiments is at github.com/aielawady/relic .

## 1 Introduction

A desired capability of intelligent embodied agents is to rapidly adapt to new scenarios through experience.
An essential requirement for this capability is integrating a long history of experience into decision-making to enable an agent to accumulate knowledge about the new scenario that it is encountering.
For example, a robot placed in an unseen house initially has no knowledge of the home layout and where to find objects.
The robot should leverage its history of experiences of completing tasks in this new home to learn the home layout details, where to find objects, and how to act to complete tasks successfully.

To achieve adaptation of decision-making to new tasks, prior work has leveraged a technique called in-context reinforcement learning (RL) where an agent is trained with RL to utilize past experience in an environment (Wang et al., ; Team et al., ; Duan et al., ; Grigsby et al., ; Melo, ).
By using sequence models over a history of interactions in an environment, these methods adapt to new scenarios by conditioning policy actions on this context of interaction history without updating the policy parameters.
While in-context RL has demonstrated the ability to scale to a context length of a few thousand
agent steps (Team et al., ; Grigsby et al., ), this falls short of the needs of embodied AI where single tasks by themselves can span thousands of steps (Szot et al., ).
As a result, the agent cannot learn from multiple task examples because the context required for multiple tasks cannot be accommodated within the policy context.
Furthermore, prior work typically focuses on non-visual tasks (Grigsby et al., ; Melo, ; Ni et al., ), where larger histories are easier to incorporate due to the compact state representation.

In this work, we propose a new algorithm for in-context RL, which enables effectively utilizing and scaling to 64,000 steps of in-context experience in partially observable, visual navigation tasks.
Our proposed method called Reinforcement Learning In Context (ReLIC), achieves this by leveraging a novel update and data collection technique for training with long training contexts in on-policy RL.
Using a long context for existing RL algorithms is prohibitively sample inefficient, as the agent must collect an entire long context of experience before updating the policy.
In addition, the agent struggles to utilize the experience from long context windows due to the challenge of learning long-horizon credit assignment and high-dimensional visual observations.
To address this problem, we introduce “partial updates" where the policy is updated multiple times within a long context rollout over increasing context window lengths.
We also introduce Sink-KV to further increase context utilization by enabling more flexible attention over long sequences by adding learnable sink key and value vectors to each attention layer.
These learned vectors are prepended to the input’s keys and values in the attention operation.
Sink-KV stabilizes training by enabling the agent to not attend to low information observation sequences.

Figure: Figure 1: Overview of the ReLIC approach and problem setup. ReLIC learns a “pixels-to-actions" policy from reward alone via reinforcement learning capable of in-context adapting to new tasks at test time. The figure shows the trained ReLIC policy finding objects in an unseen house. In earlier episodes, the agent randomly explores to find the small target object since the scene is new. But after 64k steps of visual observations, ReLIC efficiently navigates to new target objects.
Refer to caption: x1.png

We test ReLIC in a challenging indoor navigation task where an agent in an unseen house operating only from egocentric RGB perception must navigate to up to 80 small objects in a row, which spans tens of thousands steps of interactions.
ReLIC is able to rapidly in-context learn to improve with subsequent experience, whereas state-of-the-art in-context RL baselines struggle to perform any in-context adaptation.
We empirically demonstrate that partial updates and Sink-KV are necessary components of ReLIC.
We also show it is possible to train ReLIC with 64k context length.
Surprisingly, we show ReLIC exhibits emergent few-shot imitation learning and can learn to complete new tasks from several expert demonstrations, despite only being trained with RL and never seeing expert demonstrations (which vary from self-generated experiences) during training.
We find that ReLIC can use only a few demonstrations to outperform self-directed exploration alone. In summary, our contributions are:

- 1.
We propose ReLIC for scaling in-context learning for online RL, which adds two novel components of partial updates and Sink-KV.
We empirically demonstrate that this enables in-context adaptation of over 64k steps of experience in visual, partially observable embodied AI problems, whereas baselines do not improve with more experience.
- 2.
We demonstrate ReLIC is capable of few-shot imitation learning despite only being trained with self-generated experience from RL.
- 3.
We empirically analyze which aspects of ReLIC are important for in-context learning and find that sufficient RL training scale, partial updates, and the Sink-KV modification are all critical.

## 2 Related Work

Meta RL. Prior work has explored how agents can learn to quickly adapt to new scenarios through experience.
Meta-RL deals with how agents can learn via RL to quickly adapt to new scenarios such as new environment dynamics, layouts, or task specifications.
Since Meta-RL is a large space, we only focus on the most relevant Meta-RL variants and refer the readers to Beck et al. () for a complete survey of Meta-RL.
Some Meta-RL works explicitly condition the policy on a representation of the task and adapt by inferring this representation in the new setting (Zhao et al., ; Yu et al., ; Rakelly et al., ).
Our work falls under the “in-context RL” Meta-RL paradigm where the policies implicitly infer the context by taking an entire history of interactions as input.
RL^2 Duan et al. () trains an RNN that operates over a sequence of episodes with RL and the agent implicitly learns to adapt based on the RNN hidden state.
Other works leverage transformers for this in-context adaptation (Team et al., ; Melo, ; Laskin et al., ).
Raparthy et al. (); Lee et al. () also address in-context learning for decision making, but do so via supervised learning from expert demonstrations, whereas our work only requires reward.
Most similar to our work is AMAGO (Grigsby et al., ), an algorithm for in-context learning through off-policy RL.
AMAGO modifies a standard transformer with off-policy loss to make it better suited for long-context learning, with changes consisting of: a shared actor and critic network, using Leaky ReLU activations, and learning over multiple discount factors.
Our work does not require these modifications, instead leveraging standard transformer architectures, and proposes a novel update scheme and Sink-KV for scaling the context length with on-policy RL.
Empirically, we demonstrate our method scaling to $8\times$ longer context length and on visual tasks, whereas AMAGO focuses primarily on state-based tasks.

Scaling context length.
Another related area of research scaling the context length of transformers.
Prior work extend the context length using a compressed representation of the old context, either as a recurrent memory or a specialized token (Dai et al., ; Munkhdalai et al., ; Zhang et al., ).
Other work address the memory and computational inefficiencies of the attention method by approximating it (Beltagy et al., ; Wang et al., ) or by doing system-level optimization (Dao, ). Another direction is context extrapolation at inference time either by changing the position encoding (Su et al., ; Press et al., ) or by introducing attention sink (Xiao et al., ). Our work utilizes the system-level optimized attention (Dao, ) and extends attention sinks for on-policy RL in Embodied AI.

Embodied AI.
Prior work in Embodied AI has primarily concentrated on the single episode evaluation setting, where an agent is randomly initialized in the environment at the beginning of each episode and is tasked with taking the shortest exploratory path to a single goal specified in every episode (Wijmans et al., ; Yadav et al., ). In contrast, Wani et al. () introduced the multi-ON benchmark, which extends the complexity of the original task by requiring the agent to navigate to a series of goal objects in a specified order within a single episode. Here, the agent must utilize information acquired during its journey to previous goals to navigate more efficiently to subsequent locations. Go to anything (GOAT) (Chang et al., ), extended this to the multi-modal goal setting, providing a mix of image, language, or category goals as input. In comparison, we consider a multi-episodic setting where the agent is randomly instantiated in the environment after a successful or failed trial but has access to the prior episode history.

## 3 Method

We introduce Reinforcement Learning In Context (ReLIC) which enables agents to in-context adapt to new episodes without any re-training.
ReLIC is built using a transformer policy architecture that operates over a long sequence of multi-episode observations and is trained with online RL.
The novelty of ReLIC is changing the base RL algorithm to more frequently update the policy with increasingly longer contexts within a policy rollout and adding Sink-KV to give the model the ability to avoid attending to low-information context.
Section 3.1 provides the general problem setting of adapting to new episodes.
Section 3.2 details the transformer policy architecture.
Section 3.3 describes the novel update scheme of ReLIC.
Finally, Section 3.4 goes over implementation details.

### 3.1 Problem Setting

We study the problem of adaptation to new scenarios in the formalism of meta-RL (Beck et al., ).
We have a distribution of training POMDPs $\mathcal{M}_{i}\sim p(\mathcal{M})$, where each $\mathcal{M}_{i}$ is defined by tuple $\left(\mathcal{S}_{i},\mathcal{S}_{i}^{0},\mathcal{O}_{i},\mathcal{A},\mathcal
{T},\gamma,\mathcal{R}_{i}\right)$ for observations $\mathcal{O}_{i}$, states $\mathcal{S}_{i}$ which are not revealed to the agent, starting state distribution $\mathcal{S}_{i}^{0}$, action space $\mathcal{A}$, transition function $\mathcal{T}$, discount factor $\gamma$, and reward $\mathcal{R}_{i}$. In our setting, the states, observations, and reward vary per POMDP, while the action space, discount factor, and transition function is shared between all POMDPs.

From a starting state $s_{0}\sim\mathcal{S}_{i}^{0}$, a policy $\pi$, mapping observations to a distribution over actions, is rolled out for an *episode* which is a sequence of interactions until a maximum number of timesteps, or a stopping criteria.
We refer to a *trial* as a sequence of episodes within a particular $\mathcal{M}_{i}$. The objective is to learn a policy $\pi$ that maximizes the expected return of an episode.
At test-time the agent is evaluated on a set of holdout POMDPs.

### 3.2 ReLIC Policy Architecture

Similar to prior work (Grigsby et al., ; Team et al., ), ReLIC implements in-context RL via a transformer sequence model that operates over a history of interactions spanning multiple episodes.
At step $t$ within a trial, ReLIC predicts current action $a_{t}$ based on the entire sequence of previous observations $o_{1},\dots,o_{t}$ which may span multiple episodes.
In the embodied AI settings we study, the observation $o_{t}$ consists of an egocentric RGB observation from the robot’s head camera along with proprioceptive information and a specification of the current goal.
Each of these observation components are encoded using a separate observation encoding network, and the embeddings are concatenated to form a single observation embedding $e_{t}$.
A causal transformer network (Vaswani et al., ) $h_{\theta}$ inputs the sequence of embeddings $h_{\theta}(e_{1},\dots,e_{t})$.
From the transformer output, a linear layer then predicts the actions.

The transformer model $h_{\theta}$ thus bears the responsibility of in-context learning by leveraging associations between observations within a trial.
This burden especially poses a challenge in our setting of embodied AI since the transformer must attend over a history of thousands of egocentric visual observations.
Subsequent visual observations are highly correlated, as the agent only takes one action between observations.
Knowing which observations are relevant to attend to in deciding the current action is thus a challenging problem.
In this work, we build our architecture around full attention transformers using the same architecture as the LLaMA language model (Touvron et al., ), but modify the number of layers and hidden dimension size to appropriately reduce the parameter count for our setting.

We also introduce an architectural modification to the transformer called Sink-KV to improve the transformer’s ability to attend over a long history of visual experience from an embodied agent.
Building off the intuition that learning to attend over a long sequence of visual observations is challenging, we introduce additional flexibility into the core attention operation by prepending the key and value vectors with a per-layer learnable sequence of *sink KV vectors*.
Specifically, for an input sequence $X\in\mathbb{R}^{n\times d}$ of $n$ inputs of embedding dimension $d$, the attention operator projects $X$ to keys, queries and values notated as $K,Q,V$ respectively and all elements of $\mathbb{R}^{n\times d}$ where we assume all hidden dimensions are $d$ for simplicity.
The standard attention operation computes $\text{softmax}\left(\frac{QK^{\top}}{\sqrt{d}}\right)V$.
We modify calculating the attention scores by introducing learnable vectors $K_{s},V_{s}\in\mathbb{R}^{s\times d}$ where $s$ is the specified number of “sinks”.
We then prepend $K_{s},V_{s}$ to the $K,V$ of the input sequence before calculating the attention.
Note that the output of the attention operation is still $n\times d$, as in the regular attention operation, as the query vector has no added component.
We repeat this process for each attention layer of the transformer, introducing a new $K_{s},V_{s}$ in each attention operation.
Sink-KV only results in $n_{layers}\times s\times d$ more parameters, which is $0.046\%$ of the 4.5M parameter policy used in this work.

Sink-KV gives the sequence model more flexibility on how to attend over the input.
Prior works observe that due to the softmax in the attention, the model is forced to attend to at least one token from the input (Miller, ; Xiao et al., ).
Sink-KV removes this requirement by adding learnable vectors to the key and value.
In sequences of embodied visual experiences, this is important as attention heads can avoid attending over any inputs when there is no new visual information in the current observations.
This flexibility helps the agent operate over longer sequence lengths.

### 3.3 ReLIC Learning

ReLIC is updated through online RL, namely PPO (Schulman et al., ).
However, for the agent to be able to leverage a long context window for in-context RL, it must also be trained with this long context window.
PPO collects a batch of data for learning by “rolling out” the current policy for a sequence of $T$ interactions in an environment.
To operate on a long context window spanning an entire trial, the agent must collect a rollout of data that consists of this entire trial.
This is challenging because, in the embodied tasks we consider, we seek to train agents on trials lasting over 64k steps, which consists of at least 130 episodes.
As typical with PPO, to speed up data collection and increase the update batch size we use multiple environment workers each running a simulation instance that the policy interacts with in parallel.
With 32 environment workers, this corresponds to $\approx 130k$ environment steps between every policy update.
PPO policies trained in common embodied AI tasks, such as ObjectNav, have only $128$ steps between updates and require $\approx 50k$ updates to converge (for 32 environment workers, 128 steps per worker between updates and 200M environment steps required for convergence) (Yadav et al., ). Executing a similar number of updates would require ReLIC to collect $\approx 6$ billion environment interactions.

ReLIC addresses this problem of sample inefficiency by introducing a *partial update scheme* where the policy is updated multiple times throughout a rollout.
First, at the start of a rollout of length $T$, all environment workers are reset to the start of a new episode.
Define the number of partial updates as $K$.
At step $i\in[0,T]$ in the rollout, the policy is operating with a context length of $i-1$ previous observations to determine the action at step $i$.
Every $T/K$ samples in the rollout, we update the policy.
Therefore, at update $N$ within the rollout, the agent has collected $NT/K$ of the $T$ samples in the rollout.
The agent is updated using a context window of size $NT/K$, however, the PPO loss is only applied to the final $T/K$ outputs.
The policy is changing every $T/K$ samples in the rollout, so the policy forward pass must be recalculated for the entire $NT/K$ window rather than caching the previous $(N-1)T/K$ activations.
In the last update in the rollout, after collecting the last $T/K$ steps, we update the policy with the loss applied on all steps in the rollout. We refer to this step as full update.
At the start of a new rollout, the context window is cleared and the environment workers again reset to new episodes.

### 3.4 Implementation Details

The transformer is modeled after the LLaMA transformer architecture (Touvron et al., ) initialized from scratch. Our policy uses a pretrained visual encoder which is frozen during training. A MLP projects the output of the visual encoder into the transformer.
We only update the parameters of the transformer and projection layers while freezing the visual encoder since prior work shows this is an effective strategy for embodied AI (Khandelwal et al., ; Majumdar et al., ).
For faster policy data collection, we store the transformer KV cache between rollout steps.
To fit long context during the training in limited size memory, we used low-precision rollout storage, gradient accumulation (Huang et al., ) and flash-attention (Dao, ).
After each policy update, we shuffle the older episodes in the each sequence and update the KV-cache.
Shuffling the episode serves as regularization technique since the agent sees the same task for a long time. It also reflects the lack of assumptions about the order of episodes, an episode should provide the same information regardless of whether the agent experiences it at the beginning or at the end of the trial.

We use the VC-1 visual encoder and with the ViT-B size (Majumdar et al., ).
We found the starting VC-1 weights performed poorly at detecting small objects, which is needed for the embodied AI tasks we consider.
We therefore finetuned VC-1 on a small objects classification task.
All baselines use this finetuned version of VC-1.
We provide more details about this VC-1 finetuning in Appendix D and details about all hyperparameters in Section B.2.

Figure: (a) Success Rate
Refer to caption: x2.png

## 4 Experiments

We first introduce the Extended Object Navigation (ExtObjNav) task we use to study in-context learning for embodied navigation. Next, we analyze how ReLIC enables in-context learning on this task and outperforms prior work and baselines. We then analyze ablations of ReLIC and analyze its behaviors. We also show ReLIC is capable of few-shot imitation learning. Finally, we show that ReLIC outperforms the methods in Lee et al. () on the existing Darkroom and Miniworld tasks.

### 4.1 ExtObjNav : Extended Object Navigation

To evaluate ICL capabilities for embodied agents, we introduce ExtObjNav, an extension of the existing Object Navigation (ObjectNav) benchmark. ExtObjNav assesses an agent’s ability to find a sequence of objects in a house while operating from egocentric visual perception. For each object, the agent is randomly placed in a house and must locate and navigate to a specified object category. The agent used is a Fetch robot equipped with a $256\times 256$ RGB head camera. Additionally, the agent possesses an odometry sensor to measure its relative displacement from the start of the episode. Navigation within the environment is executed through discrete actions: move forward 0.25 meters, turn left or right by 30 degrees, and tilt the camera up and down by 30 degrees. The agent also has a stop action, which ends the episode.

ExtObjNav uses scenes from the Habitat Synthetic Scenes Dataset (HSSD) (Khanna et al., ) along with a subset of the YCB object dataset (Calli et al., ) containing 20 objects types.
Note that ExtObjNav requires navigating to *small* objects unlike other ObjectNav variants that use large receptacles as goals (Team, ). This allows us to increase the dataset diversity by sampling objects randomly in the environment, unlike ObjectNav, where the receptacles are fixed parts of the scanned meshes. The random sampling also precludes the agent from using priors over object placements in scenes, forcing it to rely on the experience in its context.

ExtObjNav defines a *trial* as a sequence of episodes within a fixed home layout, where a home layout is defined by a combination of a floorplan, a furniture layout and set of object placements. A home layout contains on an average 22 objects where multiple object instances may be of the target category. Within an episode in the trial, a target object category is randomly selected and the agent is randomly placed in the house. The episode is successful if the agent calls the stop action within 2 meters of the object, with at least 10 pixels of the object in the current view. If the object is not found within $500$ steps the episode counts as a failure.

We evaluate the agents on unseen scenes from HSSD and report the success rate (SR) and Success-weighted by Path Length (SPL) metrics (Anderson et al., ). Specifically, we look at the SR and SPL of an agent as it accumulates more episodes in-context. Ideally, with more in-context episodes within a home layout, it should be more adept at finding objects and its SR and SPL should improve. See Appendix A for further details on the ExtObjNav.

Figure: (a) Learning vs. ICL
Refer to caption: x4.png

### 4.2 In-Context Learning on ExtObjNav

In this section, we compare the ability of ReLIC and baselines to in-context learn in a new home layout. We compare ReLIC to the following baselines:

- •
RL^2 Duan et al. (): Use an LSTM and keep the hidden state between trial episodes.
- •
Transformer-XL (TrXL) Dai et al. (): Use Transformer-XL and updates the constant-size memory recurrently. This is the model used in Team et al. () trained in our setting. Following Team et al. () we use PreNorm (Parisotto et al., ) and gating in the feedforward layers (Shazeer, ).
- •
ReLIC-No-IEA: ReLIC without Inter-Episode Attention (IEA). Everything else, including the update scheme is the same as ReLIC.
- •
Transformer-SE: A transformer-based policy operating over only a single episode (SE) and without the update schemes from ReLIC.

All baselines are trained for 500M steps using a distributed version of PPO (Wijmans et al., ). Methods that utilize multi-episode context are trained with a context length of 4k, and use 8k context length during inference (unless mentioned otherwise, e.g. in our long-context experiments). The results in Figure 2 demonstrate ReLIC achieves better performance than baselines on 8k steps of ICL, achieving $43\%$ success rate v.s. $22\%$ success rate achieved by the closest performing baseline (Transformer-SE).

Additionally, ReLIC is able to effectively adapt to new home layouts throughout the course of the trial. In the first episode of the trial, transformer-based baseline methods attain a similar base performance of around $20\%$ success rate. However, as more episodes arrive, the performance of ReLIC increases. The recurrent models, Transformer-XL and RL^2, have lower base performance at $10\%$ success rate and show no in-context learning.
The performance of RL^2 degrades with more in-context episodes, which is aligned with the inability of the LSTM to model long sequences.

After 15 episodes of in-context experience, the success rate of ReLIC increases from $23\%$ to $43\%$.
The baselines do not possess this same ICL ability and maintain constant performance with subsequent in-context episodes.
ReLIC also in-context learns to navigate faster to objects, as measured by the gap in SPL.
As the trial progresses, the agent is able to more efficiently navigate to objects in the house with the SPL of ReLIC increasing from $0.07$ to $0.188$.
The baselines are unable to improve efficiency in-context and maintain a SPL of $0.025$ to $0.075$ throughout the entire trial.

### 4.3 ReLIC Ablations and Analysis

We demonstrate that the partial updates in ReLIC and Sink-KV are crucial to learning with RL over long context windows and acquiring ICL capabilities. We run these ablations in the smaller ReplicaCAD (Szot et al., ) scenes to make methods faster to train, but other details of the task remain the same.
We then show that ICL emerges later in the training and the context length in ReLIC can be even further increased.

No Partial Updates. Firstly, we remove the partial updates in ReLIC and find that it performs poorly (Figure 3(b)), achieving $40\%$ lesser SR at the first episode. This model also shows little ICL abilities with the SR only increasing $5\%$ by the end of the trial versus a $25\%$ increase when using partial updates.

Sink-KV. Next, we demonstrate that using Sink-KV is necessary for sample-efficient in-context RL learning. We trained the model on ReplicaCAD with and without attention sinks. The learning curves in Figure 3(c) shows that learning is more stable and faster with Sink-KV which achieves 90% success rate at 200M steps. It also shows that Sink-KV performs similar to Softmax One (Miller, ), referred to as Sink $K_{0}V_{0}$.
Without attention sink mechanisms, learning is slow and achieves less than 40% success rate after 200M steps and reaching 64% at 300M steps. Using sink token (Xiao et al., ), the training becomes unstable, achieving 40% success rate at 200M steps training and reaching 80% success rate at 300M steps. The details of the different sink attentions, their implementations and how the attention heads use the Sink-KV can be found in Appendix E.

Training Steps v.s. ICL Abilities. We find that ReLIC only acquires ICL capabilities after sufficient RL training. As demonstrated in Figure 3(a), the agent is only capable of ICL after 157M steps of training. Models trained for 52M and 157M remain at constant success with more in-context experience. Further training does more than just increase the base agent performance in the first episode of the trial.
From 262M steps to 367M steps, the agent base performance increases by $2\%$, yet the performance after 15 episodes of ICL performance increases $10\%$.
This demonstrates that further training is not only improving the base capabilities of the agent to find objects, but also improving the agent’s ability to utilize its context across long trials spanning many episodes.

Context length generalization. Next, we push the abilities of ReLIC to in-context learn over contexts much larger than what is seen during training. In this experiment, we evaluate ReLIC model, trained with 4k context length, on 32k steps of experience, which is enough to fit 80 episode trials in context. Assuming that the simulator is operating at 10Hz, this is almost 1 hour of agent experience within the context window. Note that for this experiment, we use our best checkpoint, which is trained for 1B steps. The results demonstrate that ReLIC can generalize to contexts 8$\times$ larger at inference. Figure 4(a) shows ReLIC is able to further increase the success rate to over $55\%$ after 80 in context episodes and consistently maintains performance above $50\%$ after 20 in-context episodes.

64k steps trials. Finally, we investigate scaling training ReLIC with 64k context length. We use the same hyperparameters as Section 4.2, but increase the number of partial updates per rollout such that the policy is updated every 256 steps, the same number of steps used in ReLIC. Fig. 4(b) shows that the model can in-context learn over 175 episode and continue to improve success rate. More details are available at Section C.5.

In Section C.1 we analyze the performance of ReLIC per object type. In Section C.2 we qualitatively analyze what the agent attends to in successful and failure episodes. Finally, in Section C.3, we show that not shuffling episodes in the context during training leads to worse performance.

### 4.4 Emergent Few-Shot Imitation Learning

Figure: (a) Context Length Generalization
Refer to caption: x7.png

In addition to learning in-context from self-generated experience in an environment, ReLIC can also use its context to learn from demonstrations provided by an external agent or expert, despite never being trained on demonstrations and only learning from self-generated experience.
We consider the setting of few-shot imitation learning (Duan et al., ; Wang et al., ) where an agent is given a set of trajectories $\left\{\tau_{1},\dots,\tau_{N}\right\}$ demonstrating behavior reaching desired goals $\left\{g_{1},\dots,g_{N}\right\}$. The agent must then achieve a new $g_{N+1}$ in new environment configurations using these demonstrations.
ReLIC is able to few-shot imitation learn by taking the expert demonstration as input via the context. Specifically, we generate $N$ expert shortest path trajectories navigating to random objects from random start positions in an unseen home layout.
The success rate of these demos is around $80\%$ due to object occlusions hindering the shortest path agent from viewing the target object which is required for success.
These $N$ trajectories are inserted into the context of ReLIC and the agent is instructed to navigate to a new object in the environment.

In Figure 4(c) we show that ReLIC can utilize these expert demonstrations despite never seeing such shortest paths during training. Figure 4(c) shows the success rate of ReLIC in a single episode after conditioning on some number of shortest path demonstrations. More demonstrations cover more of the house and the agent is able to improve navigation success.
We also compare to the success rate of an agent that has $N$ episodes of experience in the house as opposed to $N$ demonstrations. Using the demonstrations results in better performance with $5\%$ higher success rate for $N=16$.

### 4.5 Darkroom and Miniworld

Figure: (a) Darkroom
Refer to caption: x10.png

In this section, we evaluate ReLIC on the Darkroom (Zintgraf et al., ) and Miniworld (Chevalier-Boisvert, ) environments and compare to the results from Lee et al. () to provide a comparison with existing baselines on these simpler benchmarks.
We directly take the numbers from Lee et al. () which include Decision-Pretrained Transformer (DPT), a supervised pretraining method for in-context meta-RL, Algorithm Distillation (AD) (Laskin et al., ), Proximal Policy Optimization (PPO) and RL^2.
ReLIC is trained with context length 512, which fits 10 Miniworld and 5 Darkroom episodes.
Policies are evaluated with 40 in-context episodes.
Full details are in Section B.3.

Darkroom. Figure 5(a) shows that ReLIC outperforms all previous methods in the Darkroom task. Specifically, ReLIC achieves base performance of 32 while the other methods have base performance lower than 2 returns. ReLIC reaches 89 returns after 10 in-context episodes which is higher than 75 achieved by DPT after 39 in-context episodes.

Miniworld. ReLIC has a higher base performance of 30 episode return compared to the best base performance of 10 as shown in Figure 5(b). It quickly reaches 42 returns after just 2 in-context episodes while DPT reaches the same result after 14 in-context episodes. ReLIC also shows stable performance as the number of episodes increase compared to DPT which shows oscillation in the performance.
In Section C.4, we also show the importance of Sink-KV and partial updates in both tasks.

## 5 Conclusion and Limitations

The ability of an agent to rapidly adapt to new environments is crucial for successful Embodied AI tasks. We introduced ReLIC, an in-context RL method that enables the agent to adapt to new environments by in-context learning with up to 64k environment interactions and visual observations. We studied the two main components of ReLIC: partial updates and the Sink-KV and showed both are necessary for achieving such in-context learning.
We showed that ReLIC results in significantly better performance on a challenging long-sequence visual task compared to the baselines.

Limitations of the approach are that we found for ICL to emerge, it requires a diverse training dataset on which the model can not overfit. There is no incentive for the model to learn to use the context if it can overfit the task. We were able to address that in the dataset generation by creating different object arrangements for each scene which made it challenging for the model to memorize the objects arrangements.
Another is that our study only focuses on several environments.
Future work can explore this same study in more varied environments such as a mobile manipulation task where an agent needs to rearrange objects throughout the scene.
Finally, ReLIC requires large amounts of RL training to obtain in-context learning capabilities.

## 6 Acknowledgements

This work was supported in part by NSF, ONR YIP, and ARO PECASE. The views and conclusions contained herein are those of the authors and should not be interpreted as necessarily representing the official policies or endorsements, either expressed or implied, of the U.S. Government, or any sponsor.

## Appendix A Additional ExtObjNav Details

Figure: (a) # Objects Per Episode
Refer to caption: x12.png

The ExtObjNav is a small object navigation task. We use the same training (37) and validation (12) scenes as Yenamandra et al. (). The data is generated by randomly placing objects from the 20 object types, a subset of the YCB Calli et al. () dataset, on random receptacles. The data is generated by sampling between 30 to 40 object instances and placing them on receptacles, and subsequent filtering of the objects that are not reachable by the agent. The filtering is done by placing the agent in front of the object and evaluating whether the agent can meet the success criteria. If the agent can meet the critera, we retain the object. Otherwise, we discard the object. The distribution of the objects and object types are in Figure 6.

The reward function is defined as follows:

- •
Change in geodesic distance to the closest object $r_{d}=-\Delta{d}$ where $d$ is the geodesic distance to the closest object. The closest object can change across the episode.
- •
Slack reward of $-0.001$.
- •
Succes reward of $2$.

The episode is considered a success if the agent selects the Stop action while it is within 2 meters of an instance of the target type and has 10 pixels of this instance in the view.

## Appendix B Additional Method Details

### B.1 Model training

In this section, we discuss the training setup for ReLIC experiment.

The workers and the batch size. We use 20 environment workers per GPU. Since we use 4 GPUs in parallel, there are 80 environment workers in total. The micro batch size is 1 and we accumulate the gradient for 10 micro batches on the 4 GPUs which makes the effective batch size 40.

RL algorithm. We use PPO Schulman et al. () to train the model with $\gamma=0.99$, $\tau=0.95$, entropy coefficient of 0.1 and value loss coefficient of 0.5.

Optimizer. We use Adam Kingma & Ba () optimizer to learn the parameters.

Learning rate schedule. We use learning rate warm up in the first 100,000 environment interactions. The learning rate starts with $LR_{0}=2e-7$ and reaches $LR=2e-4$ at the end of the warm up. Cosine decay Loshchilov & Hutter () is used after the warm-up to decay the learning rate to 0 0 after 1B environment interactions.

Precision. We use FP16 precision for the visual encoder and keep the other components of the model as FP32.

Rollout Storage. The rollout storage size is 4096. We store the observations and the visual embeddings in rollout in low-precision storage, specifically in FP16 precision.

Regularization. We follow Reed et al. () in using depth dropout Huang et al. () with value 0.1 as regularization technique. We also shuffle the in-context episodes after each partial updates.

Hardware Resources and Training Time. The model is trained for 1B steps on 4x Nvida A40 for 12 days.

### B.2 Hyperparameters

We list the hyperparameters for the different experiments discussed in section Section 4.2.

ReLIC: The hyperparameters used in ReLIC can be found in Table 1 and the hyperparameters of the transformer model used in the training can be found in Table 1.

RL^2: For implementing RL^2, we build on the default PPO-GRU baseline parameters in Habitat 3.0 Puig et al. (). We set the number of PPO update steps to 256, and the hidden size of the GRU to 512. The scene is changed every 4096 steps during training, and the hidden state is reset to zeros after every scene change.

ReLIC-No-IEA: We use the same model and hyperparameters as ReLIC. The only difference is that we set the attention mask to restrict the token to only access other tokens within the same episode.

Transformer-SE: We use the same model and hyperparameters as ReLIC. However, we limit the training sequence to a fixed size 385 old observations + 256 new observations. The choice of the old number of observations is made such that we never truncate an episode which is at most 500 steps. The attention mask is set to restrict the tokens to only access other tokens in the same episode.

Transformer-XL (TrXL) Dai et al. (): Use Transformer-XL and update the constant-size memory recurrently. We follow Team et al. () in that we use PreNorm Parisotto et al. () and use gating in the feedforward layers Shazeer (). We experiment with two values for the memory size, 256 and 1024, using TrXL without gating and found that the model is able to learn with 256 memory but is unstable with 1024 memory. We use 256 memory size which gives the agent context of size $L\times N_{m}=4\times 256=1024$ where $L$ is the number of layers. Except for the memory, we use the same number of layers and heads and the same hidden dimensions as ReLIC.

**Table 1: ReLIC and baseline hyperparameters**
| Hyperparameter | Value |
| --- | --- |
| # Layers | 4 |
| # Heads | 8 |
| Hidden dimensions | 256 |
| MLP Hidden dimensions | 1024 |
| # Sink-KV | 1 |
| Attention sink | Sink $KV_{0}$ |
| Episode index encoding | RoPE Su et al. () |
| Within-episode position encoding | Learnable |
| Activation | GeLU Shazeer () |
| Rollout size | 4096 |
| total # updates per rollout | 16 |
| # partial updates | 15 |
| # full updates | 1 |

### B.3 Darkroom and Miniworld Hyperparameters

We use smaller transformer for these two tasks described in Table 2. The ReLIC hyperparameters are provided in Table 2. For the visual encoder, we use the CNN model used in Lee et al. () and train it from scratch. The other hyperparameters are the same as described in Section B.2.

**Table 2: Hyperparameters for ReLIC and baselines in Miniworld and Darkroom.**
| Hyperparameter | Value |
| --- | --- |
| # Layers | 2 |
| # Heads | 8 |
| Hidden dimensions | 64 |
| MLP Hidden dimensions | 256 |
| # Sink-KV | 1 |
| Attention sink | Sink $K_{0}V_{0}$ |
| Episode index encoding | RoPE Su et al. () |
| Within-episode position encoding | Learnable |
| Activation | GeLU Shazeer () |
| Rollout size | 512 |
| # updates per rollout | 4 (Darkroom), 2 (Miniworld) |
| # partial updates | 3 (Darkroom), 1 (Miniworld) |
| # full updates | 1 |

## Appendix C More Experiments

### C.1 ReLIC per Object Type

In Figure 8(a), we analyze the ICL performance of ReLIC per object type. Specifically, we specify the same object type target for the agent repeatedly for 19 episodes. Similar to the main experiments, the agent is randomly spawned in the house. As Figure 8(a) illustrates, ReLIC becomes more capable at navigating to all object types in subsequent episodes. The agent is good at adapting to finding some objects such as bowls, cracker box, and apples. Other objects, such as strawberry and tuna fish can, remain difficult.
In Figure 8(b), we show that with 19 episodes of ICL, the agent is can reliably navigate to any object type in the house despite having different object types as target in the context. This demonstrates the agent is able to utilize information about other object targets from the context.

Figure: (a) Success Rate
Refer to caption: x15.png

Figure: (a) Fixed Object Type Per Trial
Refer to caption: x17.png

### C.2 Analyzing Attention Scores

Figure: (a) Intra-episode attn
Refer to caption: extracted/5899707/figures/results/intra-episode-attention.png

In this section, we show that the agent is able to utilize the in-context information by inspecting the attention scores patterns in the attention heads. We generate the data by letting the agent interact with an unseen environment for 19 episodes which produced a sequence of 2455 steps. A random object type is selected as a target in each episode. By inspecting the attention scores of the attention heads, we found 4 patterns shown in Figure 9.

- •
Intra-episode attention: In this pattern, the agent attends only to the running episode, Figure 9(a).
- •
Inter-episodes
attention: Inter-episodes attention is where the agent accesses the information from previous episodes, Figure 9(b).
- •
Episode-invariant attention: The agent is able to attend to certain tokens which do not change on changing the episode, Figure 9(c).
- •
Zero attention: Some heads have 0 attention scores for all tokens which would not be possible with the vanilla attention.

We further analyze the attention pattern between successful and failure episodes. We collect 2455 steps in a trial and then probe the agent’s attention scores by querying each object type by adding a new observation with the desired object type at the final step. Figure 14 shows that the agent is able to recall multiple instances of the target object types in its history.

Figure 15 shows the attention scores for all 20 object types when selected in the 1st step of a new episode after 19 episodes.

### C.3 Impact of Episode Shuffling

We ran ReLIC on ReplicaCAD with and without in-context episodes shuffling. Figure 10 shows that ReLIC marginally suffers at in-context learning (ICL) when not shuffling episodes in the context during training. Specifically, the final ICL performance has a 3% lower success rate and the ICL is less efficient. We believe that shuffling the episodes in the context during the training acts as regularization since it creates diverse contexts.

Figure: Figure 10: The effect of shuffling in-context episodes during the training
Refer to caption: extracted/5899707/figures/results/shuffle.png

### C.4 Ablations in Miniworld and Darkroom

Figure: (a) Darkroom
Refer to caption: x19.png

In this section, we run the partial udpate and Sink-KV ablations from Section 4.3 on the Darkroom and Miniworld tasks from Section 4.5.
The result shows that different components in ReLIC is crucial for different tasks while using ReLIC is as good as or better than ReLIC without its components. The ablation shows that Partial Updates is crucial for long horizon tasks like Darkroom and ExtObjNav as shown in Figs. 11(a) and 3(b), which have horizon of 100 and 500 steps respectively, but not important for short horizon tasks like Miniworld, which is 50 steps, as shown in Fig. 11(b). It also shows that Sink-KV is important for tasks with rich observations like Miniworld and ExtObjNav, which are visual tasks, compared to the Darkroom, which is a grid world task.

### C.5 Training with 64k Context Length

In the main experiment, we showed that we can train on 4k steps and inference for 32k steps. In this experiment, we show that our method ReLIC is able to train with 64k sequence length. We used the same hyperparameters in the main experiment, except the training sequence length which we set to 64k and the number of updates per rollout is increased so that we do updates every 256 steps, same as the main experiment.
The result in Figure 7 shows that the model is able to learn and generalize on 64k sequence length.

## Appendix D Visual encoder finetuning

Figure: Figure 12: Sample of the finetuning data
Refer to caption: x21.png

We finetuned the visual encoder on a generated supervised task before freezing it to be used in our experiments.
Each sample, Figure 12, in the data is generated by placing the agent in front of a random object then the RGB sensor data is used as input $X$. The output $y$ is a binary vector of size 20, the number of available object types, where each element represents whether the corresponding object type is in the image or not. The object type is considered in the image if there is an instance of this object in the image with more than 10 pixels.
21k samples are generated from the training scenes and object arrangements. The 21k samples are then split to training and validation data with ratios 90% to 10%.

The VC-1 model is finetuned using the Dice loss Sudre et al. () by adding a classification head to the output of ‘[CLS]’ token using the generated data. The classification head is first finetuned for 5 epochs with $LR=0.001$ while the remaining of the model is frozen. Then the model is unfrozen and finetuned for 15 epochs with $LR=0.00002$.

## Appendix E Sink KV

Figure: (a) Different patterns of Sink $KV$ scores for 1k input tokens.
Refer to caption: x22.png

We introduce Sink $KV$, a modification to the attention calculation in the attention layers.
We first describe the vanilla attention Vaswani et al. (), the issue and the motivation to find a solution. Then we discuss the proposed solutions and introduce the Sink-KV technique. Finally, we anlayze different variants of Sink-KV.

### E.1 Motivation

The vanilla attention is the component responsible for the interaction between the tokens in the sequence. The output for each token is calculated by weighting the value of all tokens.
The input to the attention layer is the embeddings of the input tokens $E\in\mathbb{R}^{n\times d}$ where $n$ is the number of input tokens and $d$ is the dimension of the embeddings.

First the embeddings $E$ are linearly projected to the Key $K$, Value $V$ and Query $Q$. Then the attention scores are calculated using $S=\text{Softmax}(QK^{T}/\sqrt{d_{k}})$ where $d_{k}$ is the dimensions of the keys. The output $A$ is calculated as a weighted sum of the values $V$, $A=SV$.

The calculation of the attentions scores $S$ using the Softmax forces the tokens to attend to values $V$, even if all available values do not hold any useful information, since the sum of the scores is 1 (Miller, ). This is especially harmful in cases where the task requires exploration. As the agent explores more, a more useful information may appear in the sequence. If the agent is forced to attend to low information tokens at the beginning of the exploration, it will introduce noise to the attention layers.

### E.2 Solutions

Softmax One from Miller () addresses this issue by adding $1$ to the denominator of the Softmax, $\text{Softmax}_{1}(x_{i}):=\exp(x_{i})/(1+\sum_{j}{\exp(x_{j})})$, which is equivalent to having a token with $k=0$ and $v=0$. This gives the model the ability to have 0 attention score to all tokens, we refer to Softmax One as Sink $K_{0}V_{0}$.

Sink tokens from Xiao et al. () are another approach to address the same issue by prepending learnable tokens to the input tokens $E=[E_{s}\circ E_{input}]$ where $E$ is the input embedding to the model and $[A\circ B]$ indicates concatenation along the sequence dimension of the $A$ and $B$ matrices .

Sink-KV is a generalization of both approaches. It modifies the attention layer by adding a learnable Key $K_{s}\in\mathbb{R}^{n\times d_{k}}$ and values $V_{s}\in\mathbb{R}^{n\times d}$. In each attention layer, we simply prepend the learnable $K_{s}$ and $V_{s}$ to the vanilla keys $K_{v}$ and values $V_{v}$ to get the $K=[K_{s}\circ K_{v}]$ and $V=[V_{s}\circ V_{v}]$ used to calculate the attention scores then the attention output.

In the case $K_{s}=0$ and $V_{s}=0$, Sink-KV becomes equivalent to Softmax One. It can also learn the same $K$s and $V$s corresponding to the Sink Token since our model is casual and the processing of the Sink Token is not affected by the remaining sequence.

### E.3 Sink-KV variants

We tried a variant of Sink-KV where the either the Value or the Key is set to 0, referred to as Sink $KV_{0}$ and Sink $K_{0}V$ respectively. All variants perform similarly in terms of the success rate as shown in Figure 13(b).

Figure 13(a) shows different patterns the model uses the Sink $KV_{0}$. The model can assign all attention scores to the Sink $KV_{0}$, which yields a zero output for the attention head, or assign variable scores at different time in the generation. For example, one the attention heads is turned off during the 1st episode of the trial by assigning all attention score to the Sink $KV_{0}$ then eventually move the attention to the input tokens in the new episodes. The model is also able to ignore the Sink $KV_{0}$ by assigning it 0 attention scores as shown in the figure.

Figure: Figure 14: Visualization of an inter-episode attention head, see Section C.2. The colored curves are the trajectories of previous episodes. The blue circle is the agent’s position. The green Xs are the instances of the target object type. The black lines represent the agent’s attention when the target is the object type mentioned above the image. The lines connect the agent with the point in history that it attends to, the opacity of the line represents the attention score. The overlaid image is visual observation with the highest attention score.
Refer to caption: x24.png

Figure: Figure 15: Attention scores of the object detection head described in Section C.2. The colored curves are the trajectories of previous episodes. The blue circle is the agent’s position. The black lines represent the agent’s attention when the target is the type in above the image. The lines connect the agent with the point in history that it attends to, the opacity of the line represents the attention score. The two images with highest attention score are shown in the 3rd row.
Refer to caption: x25.png

## Peer Reviews

confidence: 3
contribution: 3
initial_rating: 6
presentation: 3
questions: 1. Scalability and Practical Applications: Given the high computational requirements (12 days on 4 A40 GPUs), what approaches have you considered to make ReLIC more practically applicable? Could techniques like model distillation or more efficient architectures reduce these requirements while maintaining performance?
2. Beyond Navigation: The current work focuses on discrete action spaces in navigation tasks. Have you explored how ReLIC could be extended to continuous action spaces or more complex tasks like manipulation? What modifications would be needed to handle such scenarios?
3. Emergent Few-shot Learning: The emergence of few-shot imitation learning capabilities without explicit training is intriguing. What mechanisms in ReLIC enable this capability, and how could it be enhanced? Have you analyzed how the quality of demonstrations affects performance?
soundness: 3
strengths: 1. Strong Empirical Results: The method achieves substantial improvements over baselines, nearly doubling the success rate (43% vs 22%) in challenging navigation tasks. The results are thoroughly validated across multiple environments (EXTOBJNAV, Darkroom, Miniworld) with comprehensive ablation studies.
2. Scalability: The paper demonstrates impressive scaling capabilities, showing that their method can handle up to 64,000 steps of context - a significant improvement over previous approaches. More importantly, they show that models trained on shorter contexts (4k steps) can generalize to much longer contexts (32k steps) at inference time.
summary: The paper introduces ReLIC (Reinforcement Learning In Context), a new approach that enables embodied AI agents to adapt to new environments using up to 64,000 steps of in-context experience. ReLIC addresses two key challenges in scaling in-context reinforcement learning: efficiently training with long context windows and effectively utilizing visual information from multiple episodes. To solve these challenges, the authors introduce "partial updates," a novel policy update scheme that allows more frequent learning during long rollouts, and "Sink-KV," a modification to transformer attention that helps the model selectively attend to relevant information in long sequences.

The authors evaluate ReLIC on an extended version of object navigation where agents must find multiple objects in unseen house layouts. ReLIC significantly outperforms baseline approaches, achieving a 43% success rate compared to 22% from the closest baseline after 15 episodes of in-context experience. The method also demonstrates an unexpected capability for few-shot imitation learning despite never being trained with expert demonstrations. Through extensive ablation studies, the authors show that both partial updates and Sink-KV are crucial for effective learning, and that sufficient training scale is necessary for in-context learning capabilities to emerge. The approach also performs well on existing benchmarks like Darkroom and Miniworld tasks, showing better and faster adaptation compared to prior work.
weaknesses: 1. Limited Success Rate: Despite significant improvements over baselines, the absolute performance (43% success rate) is still relatively low for practical applications. The paper doesn't thoroughly discuss why this ceiling exists or potential paths to improve it.

2. Computational Cost: The method requires substantial computational resources - 12 days of training on 4 NVIDIA A40 GPUs. This high computational requirement could limit the practical applicability and accessibility of the approach, especially for researchers with limited resources.

3. Task Limitation: The evaluation focuses primarily on navigation tasks with discrete action spaces. There's no exploration of how the method might extend to continuous action spaces or more complex tasks like manipulation, limiting our understanding of the approach's broader applicability.

4. Missing Related work: 
Retrieval-Augmented Decision Transformer: External Memory for In-context RL, Schmied et.al
	 - Work is quite similar to yours. It would be interesting if the authors could point out the differences in the related work section. This will improve the paper.

---

confidence: 3
contribution: 2
initial_rating: 3
presentation: 2
questions: *  See weakness.
*  In the Darkroom and miniwork experiment, all baselines have very low performance (0 success rate) with no context while ReLIC has higher performance (30% success rate). Is it normal? And DPT can get a very higher improvement with 20 in-context episodes.
soundness: 3
strengths: *  The problems proposed by the paper are meaningful. Generalization is a long-term goal for embodied AI. In context learning with longer prompts may be a potential solution.
*  This paper is well-structured, conducts rich experiments and achieves great performance.
summary: * This paper proposes a new in-context RL approach with 64K historied steps. They introduce partial update schemes to solve sample inefficiency problems and Sink-KV mechanism to address long observation history.
weaknesses: *  The description for "partial update" is confusing. Providing pseudocode would be good for understanding.
*  The contributions of the paper are confusing. This paper proposes two ways to solve long in-context RL: partial update and SINK-KV. "Partial update" is more like a training trick and "Sink-KV" is proposed by previous works. In the appendix, the paper explaints "Sink-KV" will help the policy for exploration. This is interesting and it should be place in the main paper.
*  Lack of some comparisons. Like transformer with multi episodes and DPT in ExtObjNav. 
*  Environments used in experiments are too simple and they are all navigations tasks. It would be interesting to include manipulation benchmarks like MetaWorld.
*  Inefficient and large GPU memory for long context length. What is the inference speed for ReLIC and other baselines?
*  This paper emphasise 64K in the title and introduction. But in the experiment sections, all results are evaluated under small context length.

---

confidence: 3
contribution: 2
initial_rating: 5
presentation: 2
questions: See above
soundness: 2
strengths: 1. The paper is generally well-written and easy-to-understand.
2. Experiments show that the proposed approach is effective.
3. Hyperparameters and algorithm details are provided for reproducity.
summary: The paper introduces ReLIC, a framework designed to extend in-context learning capabilities to embodied AI agents. ReLIC focuses on enabling agents to utilize up to 64,000 steps of contextual experience, aiming to allow rapid adaptation in unseen environments, especially for multi-object navigation tasks. This is achieved through two components: (1) Partial Updates, a policy update scheme that incrementally adjusts the policy within rollouts, and (2) Sink-KV, a mechanism for efficient attention management in transformers, which optimizes long-sequence processing by adding learnable sink key-value vectors in attention layers.
weaknesses: 1. The two major novel components of the paper as claimed by the authors are the partial updates and Sink-KV. For the former one, if I understand correctly, it is a very common technique used in common RL training (I don't if it's the same case for in-context RL as I'm not familiar with its literature), namely, update the policy/value in the middle of an episode to increase training frequency. For Sink-KV, it seems to be interesting but I'm not familiar with the literature exploring the architecture of transformer so I don't how novel this is, but one thing that is not clear to me is that, why this design especially helps in-context RL training? What makes it special compared to using it in vision/language tasks?

2. For the experiments, the author mainly compared their method to meta-rl baselines and different variants of their method - while this is good, I would expect to see how the proposed method compared to other in-context RL baselines. 

3. The emergent imitation learning results are not that surprising to me - a lot of recent work  do pretraining with imitation learning and then rl finetuning, the proposed scheme here is like first pretraining with rl then finetuning with imitation learning. This setting is also a little bit strange as in the real world case, if we have the expert demonstrations, pretraining on that usally greatly speed up RL.

4. std/error bar not included in the darkroom result plot and miniworld result plot

Meta-review: The paper presents an approach for using large context transformers to attend to large amounts of experience. The reviewers have a split opinion on this paper, which was not fully resolved during the discussion phase. Hence I have taken a closer look at the paper. On the positive side, I tend to agree with reviewer e3Wg that using large context for transformers is quite interesting. However, the weaknesses of limited applicability is quite apparent. A key motivation of the paper is robotics. But it seems like there are no robot experiments even with relatively simple navigation tasks. It is hence unclear the larger impact the core ideas in the work can have.

Decision: Reject