Manuscript Offprint
arXiv:2611.04010Decision Transformer with Task-Aware Representations for Offline Meta-Reinforcement Learning
ABSTRACT
To enable effective generalization in offline meta-RL, it is essential to accurately infer the underlying task through latent task representations, which provide a compact and transferable summary of task-specific characteristics for guiding policy generation. In this paper, we propose Contrastive Task-Aware Decision Transformer (CoTA-DT), a DT-based offline meta-RL framework that learns task representations by jointly integrating four complementary components: (i) contrastive learning from offline trajectories, (ii) alignment with natural-language task descriptions, (iii) one-step supervision via a task-conditioned world model, and (iv) long-term supervision via a task-conditioned Q function. The learned task representations are used as conditioning signals for a DT-based policy, enabling task-aware meta-policy learning. To further support generalization in both zero-shot and few-shot settings, we design a language-grounded, self-adaptive strategy that enables effective and reliable adaptation to unseen tasks. Notably, in CoTA-DT, the pretrained LLM serves as a shared backbone for language encoding, world modeling, Q-function estimation, and policy learning. This unified design facilitates parameter sharing, improving both efficiency and generalization. Extensive experiments across diverse offline meta-RL benchmarks demonstrate that CoTA-DT consistently outperforms prior methods, particularly in challenging zero-shot generalization scenarios.
1 INTRODUCTION
Offline meta-reinforcement learning (RL) aims to learn transferable priors from offline trajectories across related tasks, enabling efficient adaptation to new tasks with little or no additional data. In recent years, a prominent line of work in offline meta-RL has built on Decision Transformers (DTs) (Chen et al., 2021), leveraging the strong generalization capabilities of transformer architectures (Mitchell et al., 2021; Lin et al., 2022). These DT-based approaches formulate policy learning as sequence modeling over trajectories and perform adaptation through sequence conditioning.
For example, Prompt-DT (Xu et al., 2022) leverages expert demonstrations as prompts to encode task-specific information, enabling prompt-based adaptation at test time. Generalized Decision Transformers (GDT) (Furuta et al., 2021; Wang et al., 2023) incorporate hindsight signals, such as reward statistics or retrospective summaries, as conditioning inputs for task adaptation. Meta-DT (Wang et al., 2024) conditions the policy on compact task representations learned from trajectories to support generalization. More recently, T2DA (Zhang et al., 2025) conditions a DT-based policy on text embeddings derived from natural-language task descriptions. Despite the advances, these approaches typically learn task identifiers from a single source—such as language, trajectory data, or reward signals—and use them as conditioning inputs to guide DT-based policies for generalization. When such signals are ambiguous, noisy, or distributionally shifted relative to training, task identification can become unreliable, leading to degraded adaptation performance. These limitations naturally raise a question: How can we learn an offline meta-policy that achieves reliable task identification and supports robust generalization in both few-shot and zero-shot settings?
Reliable task identification across a broad family of related tasks depends on the availability of task-specific information. In offline meta-RL, collected trajectories serve as the primary source of information and implicitly encode task differences. However, relying solely on offline data is often insufficient, especially when the data are limited, noisy, or provide only partial coverage of the task space. Beyond trajectories, additional sources of information are often available. For example, natural-language task descriptions derived from task-level metadata—such as task goals, names, relevant objects, and environment constraints—provide complementary high-level semantics that are not always recoverable from trajectories alone. Meanwhile, environment transitions and rewards vary across tasks, offering informative one-step signals of task-specific dynamics and objectives, while cumulative returns (e.g., Q functions) capture long-horizon goals and provide global signals for distinguishing tasks. These observations motivate jointly leveraging multiple sources of information to learn robust task representations and enable reliable task identification in offline meta-RL.
In this paper, we propose Contrastive Task-Aware Decision Transformer (CoTA-DT), a DT-based offline meta-RL framework that learns task representations by jointly integrating four complementary components: (i) contrastive task encoding from offline trajectories, (ii) alignment with natural-language task descriptions, (iii) one-step supervision via a task-conditioned world model, and (iv) long-term supervision via a task-conditioned Q function. Specifically, task representations are first learned from trajectories via a contrastive objective that pulls together representations from the same task while separating those from different tasks. However, trajectory-only representations can be noisy due to data variability. To better capture underlying task objectives and reduce bias, we further align them with natural-language task descriptions encoded by a pretrained large language model (LLM), promoting semantic consistency between trajectory- and language-derived information. To further refine the representations, we introduce a task-conditioned world model that provides one-step supervision through transitions and rewards, along with a task-conditioned Q function that offers long-horizon supervision over task objectives. These complementary signals regularize the representations, and all components are optimized jointly to learn task representations from multiple perspectives.
The resulting task representations are used as conditioning signals for a DT-based policy, enabling task-aware meta-policy learning. To support generalization in both zero-shot and few-shot settings, we design a language-grounded, self-adaptive strategy for reliable adaptation. Notably, in CoTA-DT, the pretrained LLM serves as a shared backbone for language encoding, world modeling, Q-function estimation, and policy learning. This unified design enables parameter sharing across stages and leverages the LLM's prior knowledge from large-scale pretraining, along with its strong sequence modeling and transfer capabilities under prompt conditioning (Brown et al., 2020; Ouyang et al., 2022; Touvron et al., 2023), thereby improving both efficiency and generalization. Our main contributions are as follows:
- We introduce CoTA-DT, an offline meta-RL framework whose policy conditions on a task latent that supports both language-based initialization and updates from observed transitions.
- We learn discriminative, language-grounded task representations that capture task dynamics and long-horizon returns, supporting adaptation to unseen tasks with a shared LoRA-adapted LLM backbone.
- We develop zero-shot deployment through language-grounded latent inversion and few-shot adaptation through support-based initialization, with optional policy fine-tuning.
- Extensive experiments across various offline meta-RL benchmarks demonstrate that CoTA-DT consistently outperforms prior methods, particularly in challenging zero-shot generalization settings¹.
¹Code available at https://anonymous.4open.science/r/CotaDT-35DB.
this area builds on temporal-difference (TD) learning, often incorporating optimization-based meta-learning or latent context inference mechanisms to capture task-specific information (Finn et al., 2017; Mitchell et al., 2021; Xu et al., 2018; Rakelly et al., 2019; Zintgraf et al., 2021; Yuan & Lu, 2022; Li et al., 2024). However, applying TD learning in the offline setting is challenging due to the deadly triad (Levine et al., 2020), which can lead to instability and error accumulation. To mitigate this issue, many approaches impose constraints to keep learned policies within the support of the dataset (Ajay et al., 2022; Kumar et al., 2020; Kostrikov et al., 2021; Yu et al., 2020b; Kidambi et al., 2020). Other works pursue more stable alternatives, such as return-conditioned or sequence modeling approaches based on Decision Transformers (Wang et al., 2024; Hu et al., 2024; Xu et al., 2022; Wang et al., 2023; Zhang et al., 2025).
LLMs for RL. Recent work explores leveraging the representation and generalization capabilities of LLMs for RL, including using them as policy backbones or for reward modeling (Morad et al., 2024; Reed et al., 2022; Brohan et al., 2023). In the offline RL setting, LLMs are incorporated in several ways. LaMo (Shi et al., 2023) demonstrates that pretrained language models can be adapted as effective policy backbones, while KALM (Pang et al., 2024) leverages LLM-generated rollouts to augment offline datasets. More recently, T2DA (Zhang et al., 2025) conditions decision models on text embeddings derived from LLMs to support generalization in offline meta-RL, and LLMDPD (Zhang & Guo, 2025) further enhances generalization by integrating LLM priors into diffusion-based policy learning. In contrast, our method leverages LLMs as a shared backbone for both task representation learning and policy modeling.
3 PRELIMINARIES
3.1 OFFLINE META-REINFORCEMENT LEARNING
An RL task is formulated as an MDP with state space , action space , transition , reward , and discount . The objective is to learn a policy that maximizes the expected return: . In offline meta-RL, tasks share the same state and action spaces but differ in and . For each of training tasks, an offline dataset is collected by an arbitrary behavior policy . Each training task is paired with a description . For an unseen task , the description is available. Zero-shot evaluation provides no target-task support trajectories before rollout; few-shot evaluation additionally provides support trajectories. During rollout, the agent observes states and rewards and may update its task latent from past transitions, with policy parameters fixed. The goal is to learn a meta-policy maximizing .
3.2 DECISION TRANSFORMER
Decision Transformer (DT) recasts RL as return-conditioned sequence modeling: each trajectory is a sequence of triplets where is the return-to-go (RTG), and the model is trained to autoregressively predict from past RTGs, states, and actions by minimizing prediction error against ground-truth actions.
4 METHOD
In this section, we present Contrastive Task-Aware Decision Transformer (CoTA-DT), an offline meta-RL framework that enables reliable task identification through multi-perspective task representations and integrates task inference into DT-based policy for improved generalization. Fig. 1 illustrates the method overview.
4.1 MULTI-PERSPECTIVE TASK REPRESENTATION LEARNING
To enable effective generalization in offline meta-RL, it is essential to distinguish between tasks by capturing both their differences and shared structure. Accurately inferring the underlying task

Figure 1: Overview of CoTA-DT. (a) Multi-perspective task representation learning jointly optimizes four signals—(i) contrastive task encoding from offline trajectories, (ii) language alignment between and , (iii) a task-conditioned world model predicting , , and (iv) a long-horizon Q head predicting —all sharing one frozen LLM with a single LoRA adapter. (b) A Decision Transformer policy is trained on the same LLM backbone, conditioned on . (c) At zero-shot adaptation, a new task description is encoded into is constructed by aligning with , and the rollout uses self-adaptive updates.
through latent task representations is therefore critical, as it provides a compact and transferable summary of task-specific characteristics that can be used to condition policy generation.
However, relying on a single source of information, such as offline datasets, is often insufficient for learning reliable task representations. Offline datasets typically contain trajectories exhibiting varying levels of expertise, data quality, and coverage. As a result, the learned representations can be noisy and less robust. To address this limitation, we propose to learn and refine latent task representations from multiple perspectives: (i) contrastive task encoding from offline trajectories (Sec. 4.1.1), (ii) alignment with natural-language task descriptions (Sec. 4.1.2), (iii) one-step supervision via a task-conditioned world model (Sec. 4.1.3), and (iv) long-term supervision via a task-conditioned Q function (Sec. 4.1.3).
4.1.1 CONTRASTIVE TASK ENCODING
To learn latent task representations, offline trajectories provide a primary source of information for capturing task-specific characteristics, as they inherently reflect the underlying task through observed behaviors. We encode short trajectory segments using a separate GRU context encoder , which maps transitions to a task latent : the LLM backbone processes text and projected continuous tokens. Sub-trajectories capture partial yet informative aspects of the task, enabling the learned representations to reflect not only the underlying task objectives but also the stage of task execution. For example, in locomotion tasks, a short segment can indicate both the objective (e.g., moving forward or turning) and the current execution stage (e.g., initiating motion, stabilizing, or adjusting direction).
Formally, given a sub-trajectory of horizon extracted from an offline trajectory, the encoder maps it to a latent representation . For timesteps near the beginning of a trajectory where , we construct by zero-padding the missing prefix. For each anchor sub-trajectory , we construct a positive sample as a nearby segment from the same trajectory, e.g., with a small offset . Negative samples are drawn from trajectories of different tasks. Let .
We optimize the standard InfoNCE (van den Oord et al., 2018) objective:
where denotes cosine similarity and is a temperature parameter. This objective encourages representations of temporally adjacent sub-trajectories from the same task to align, as they share the same task objective and similar execution stages, while pushing apart representations from different tasks.
4.1.2 LANGUAGE-ALIGNED TASK REPRESENTATION
Since the latent representations learned by the contrastive encoder are derived from sub-trajectories, they can be biased toward local behaviors or the current execution stage rather than the underlying task objective. This issue is particularly pronounced when sub-trajectories are sampled from low-quality, non-expert data, or from very early stages of task execution, where the task goal is not yet clearly manifested. To encourage the latent representations to better capture the global task objective, we ground in natural-language task descriptions, enforcing consistency between latent representations and their corresponding semantic descriptions.
Specifically, natural-language descriptions are deterministically constructed from task-level metadata of task , including the task name, goal, relevant objects, environmental conditions, and typical performance. Each description is encoded into a text embedding using a pretrained LLM with LoRA adaptation (Hu et al., 2022), i.e., , where the LLM backbone is kept frozen and the LoRA adapter is fine-tuned. For each task , we also compute an aggregated representation by averaging latent representations over a set of sub-trajectories sampled from the offline dataset : . Both and are then projected into a shared embedding space via lightweight projection heads and for alignment:
We then quantify the similarity between and by defining a cosine similarity matrix over a minibatch of tasks , scaled by a learnable temperature optimised in log-space to enforce positivity, following (Radford et al., 2021):
We optimize a symmetric CLIP-style (Radford et al., 2021) alignment objective:
This contrastive objective treats as a positive pair, while for serve as negatives. It encourages trajectory-derived task representations to align with their corresponding language descriptions, thereby grounding the latent representations in high-level task semantics.
4.1.3 TASK-CONDITIONED WORLD MODELING AND Q LEARNING
Beyond trajectories and natural-language task descriptions, environment transitions and rewards inherently vary across tasks, providing informative one-step signals of task-specific dynamics and objectives that help regularize task representations. Over longer horizons, cumulative returns (e.g., Q functions) capture task goals and provide complementary global signals for distinguishing tasks. Motivated by these observations, we introduce a task-conditioned world model and a task-conditioned Q function to further refine the learned representations.
Task-Conditioned World Modeling. Given a transition sampled from a sub-trajectory , we first infer a latent representation . Conditioned on , the world model predicts the immediate reward and next state, i.e., , and is trained with supervised objectives
where and denote the predicted reward and next state, respectively.
Task-Conditioned Q Learning. To incorporate long-horizon supervision, we introduce a task-conditioned Q function that predicts the return-to-go given a state-action pair and the corresponding task representation : . The model is trained with a supervised regression objective:
where denotes the empirical return-to-go computed from offline trajectories, and is the corresponding prediction produced by the Q function.
Both the world model and the Q function are implemented by repurposing the same pretrained LLM backbone with the shared LoRA adapter , originally fine-tuned for language processing, and augmenting it with task-specific prediction heads for reward, dynamics, and return estimation (shown in Fig. 1). Moreover, the supervision signals from both components are backpropagated through to jointly update the contrastive task encoder and LoRA parameters . The world model provides one-step supervision through task-specific transitions and rewards, while the Q function supplies long-horizon supervision that captures task objectives over extended trajectories. These complementary signals encourage to capture both short-term dynamics and long-term goals, improving its discriminative power for task identification and generalization, while also enabling the LLM to better understand environment dynamics and task objectives.
Overall Objective. We jointly optimize the multi-perspective representation learning objective:
where are balancing coefficients. This objective enables the task encoder to learn reliable, task-aware latent representations by integrating complementary supervision signals, while the shared LoRA-adapted LLM backbone jointly captures trajectory information, task semantics, environment dynamics, and long-horizon objectives, ultimately benefiting downstream DT-based policy learning.
4.2 TASK-AWARE POLICY LEARNING FOR CoTA-DT
Given the learned latent representations, CoTA-DT learns a DT-based policy for offline meta-RL. The policy is formulated as conditional sequence modeling: at each timestep , the model conditions on the return-to-go , the state history , the action history , and a task-aware latent representation inferred from the local sub-trajectory . This representation encodes both the underlying task identity and the current execution stage, providing contextual guidance for action generation. The resulting conditional policy is defined as , and is trained on offline trajectories to predict actions autoregressively:
where is the offline dataset. Here, the DT-based policy is initialized using the same pretrained LLM backbone and the shared LoRA adapter learned in Sec. 4.1, with an additional action prediction head . Through this shared architecture, the LoRA-adapted LLM is further fine-tuned under policy supervision via Eq. 8, while the policy directly benefits from the task representation learning stage, which integrates trajectory information, task semantics, environment dynamics, and long-horizon objectives. This unified architecture provides richer task context for action prediction, thereby improving generalization to unseen tasks.
4.3 LANGUAGE-GROUNDED AND SELF-ADAPTIVE GENERALIZATION
4.3.1 ZERO-SHOT ADAPTATION.
For a new unseen task , CoTA-DT can generate task-conditioned trajectories once an initial task representation is provided. In principle, should be inferred by the well-trained task encoder from trajectories of the target task. However, in the zero-shot setting, no task-specific trajectories are available, making it infeasible to obtain directly from data.
Language-Grounded Initialization. To address this issue, we instead initialize by grounding it in the task description of the unseen task, which is typically available, providing a meaningful starting point for subsequent policy rollout. Given a task description , we first encode it into a text embedding using the pretrained LLM backbone with LoRA adaptation : . The embedding is then projected into the shared alignment space via the projection head . To obtain an initial task representation , we optimize Eq. (9) to find a latent vector whose projection best aligns with , using a small number of updating steps starting from :
During this process, only is updated, while the encoder , projection heads , the shared LoRA adapter , and the LLM backbone remain fixed. As a result, this procedure serves as a lightweight test-time inference step rather than additional training.
Self-Adaptive Rollout. The resulting is used to condition CoTA-DT policy at the beginning of rollout. As the rollout proceeds, once transitions have been collected, we progressively update the task representation by recomputing from the most recent sub-trajectory. The updated conditions subsequent action generation, enabling a self-adaptive rollout that continuously refines the task representation based on newly observed transitions. By capturing both task identity and execution stage, allows the policy to adapt dynamically to the evolving task context, resulting in reliable and effective adaptation.
4.3.2 FEW-SHOT ADAPTATION.
In the few-shot setting, a small support set is available alongside the task description . We construct the initial task representation by leveraging both the available data and the task description to obtain a more reliable initialization. Specifically, we sample a set of sub-trajectories from and aggregate their encoder outputs , then use as the starting point for the optimization in Eq. (9), yielding a refined grounded in both and . With held fixed, we further fine-tune only the LoRA adapter and the action head (with adapted parameters of the LLM backbone) on using (Eq. 8) for a small number of gradient steps. The adapted policy is then deployed using the same self-adaptive rollout procedure as in the zero-shot setting.
5 EXPERIMENTS
We design our experiments to answer four questions. (Q1) Does CoTA-DT outperform state-of-the-art language-conditioned and context-based offline meta-RL baselines in both zero-shot and few-shot settings? (Q2) How does each component—contrastive task encoding (), language alignment (), world modeling () and Q learning ()—contribute to CoTA-DT performance? (Q3) How robust is the method to dataset quality? (Q4) Is multi-perspective task representation learning effective in producing high-quality representations?
Environments. We follow the offline meta-RL protocol of T2DA (Zhang et al., 2025) and evaluate on four benchmarks: Point-Robot (2D navigation, 50 tasks, ), Cheetah-Vel (target velocity, 50 tasks, ), Ant-Dir (target direction, 50 tasks, ), and Meta-World (22 manipulation tasks (Yu et al., 2020a), ); see Appendix C for full statistics. Each task is accompanied by a natural-language description (e.g., “Navigate to position ”; see Appendix C for details). For all environments, we follow prior work (including T2DA (Zhang et al., 2025) and

Figure 2: Zero-shot test return curves of CoTA-DT against baselines on Mixed datasets.
Meta-DT (Wang et al., 2024)) and report results under three offline dataset qualities: Medium, Expert, and Mixed, using the best-performing checkpoint.
Baselines. We compare against six representative baselines spanning language-conditioned policies (BC-Z (Jang et al., 2022), BAKU (Haldar et al., 2024)), prompt-based DTs (Prompt-DT (Xu et al., 2022)), context-based methods (Meta-DT (Wang et al., 2024), UNICORN (Li et al., 2024)) and the strongest published language-conditioned DT, T2DA-T (Zhang et al., 2025). All methods are evaluated zero-shot and few-shot on 5 held-out tasks over 5 seeds; we report raw undiscounted episodic return ± one standard deviation. Implementation details, exact hyperparameters and per-task numbers are deferred to the appendix.
5.1 MAIN RESULTS: ZERO-SHOT AND FEW-SHOT ADAPTATION
Table 1 reports zero-shot returns on the Mixed dataset, which is the most challenging setting. CoTA-DT achieves the best performance on all four benchmarks. The largest absolute gain over the second-best baseline (T2DA-T) is observed on Meta-World (+189.0), while consistent relative improvements are also achieved on locomotion tasks (+15.7% on Cheetah-Vel and +2.8% on Ant-Dir). Table 2 reports the corresponding few-shot returns. CoTA-DT again attains the best performance on every benchmark, with margins that further widen over the second-best baseline T2DA-T (e.g., +213.1 on Meta-World and +11.5 on Cheetah-Vel), benefiting from the availability of a small support set. The results suggest that CoTA-DT learns more robust and discriminative task representations, enabling effective generalization in both settings.
Table 1: Zero-shot test return on the Mixed dataset. Best in bold, second-best underlined.
| BC-Z | BAKU | Prompt-DT | Meta-DT | UNICORN | T2DA-T | CoTA-DT | |
|---|---|---|---|---|---|---|---|
| Pt-Robot | -13.0±0.7 | -14.5±0.8 | -15.2±0.6 | -12.2±0.5 | -13.1±0.7 | -8.7±0.3 | -7.9±0.4 |
| Cheetah-Vel | -129.2±10.0 | -112.3±4.2 | -136.9±17.5 | -99.7±6.9 | -101.9±18.0 | -90.7±5.8 | -76.5±4.7 |
| Ant-Dir | 611.7±30.9 | 695.8±25.5 | 395.8±12.6 | 411.0±13.3 | 426.1±23.8 | 955.0±9.0 | 981.3±16.8 |
| Meta-World | 910.3±27.1 | 970.9±36.2 | 867.4±46.5 | 994.2±45.0 | 756.1±60.8 | 1103.5±36.3 | 1292.5±28.2 |
Table 2: Few-shot test return on the Mixed dataset. Best in bold, second-best underlined.
| BC-Z | BAKU | Prompt-DT | Meta-DT | UNICORN | T2DA-T | CoTA-DT | |
|---|---|---|---|---|---|---|---|
| Pt-Robot | -12.3±0.8 | -13.4±0.9 | -12.0±1.3 | -10.2±0.6 | -12.9±1.2 | -7.6±0.4 | -6.9±0.2 |
| Cheetah-Vel | -109.2±11.2 | -97.5±4.3 | -101.3±10.6 | -86.5±7.3 | -89.7±19.8 | -78.8±4.1 | -67.3±5.2 |
| Ant-Dir | 696.5±39.8 | 817.6±20.1 | 509.0±13.4 | 534.2±14.0 | 459.4±15.5 | 1012.3±9.8 | 1040.2±15.8 |
| Meta-World | 1131.7±56.3 | 1129.2±24.8 | 972.8±31.2 | 1083.4±49.5 | 826.8±66.9 | 1189.7±45.3 | 1402.8±30.1 |
5.2 ROBUSTNESS TO DATASET QUALITY
Table 3 reports the same comparison on the Medium and Expert datasets. CoTA-DT remains the top performer in every setting, including the Expert regime, where offline data are highly homogeneous and contrastive signals are notoriously weak. Specifically, on the Expert dataset, CoTA-DT improves over T2DA-T on Meta-World from 1114.0 to 1375.7 (+23.5%), indicating that our contrastive task encoder can still extract informative task representations even under limited behavior diversity.
Table 3: Zero-shot return on Expert and Medium datasets. Best in bold, second-best underlined.
| Quality | BC-Z | BAKU | Prompt-DT | Meta-DT | T2DA-T | CoTA-DT | |
|---|---|---|---|---|---|---|---|
| Expert | Pt-Robot | ||||||
| Meta-World | |||||||
| Medium | Pt-Robot | ||||||
| Meta-World |
Table 4: Component and backbone ablations across all four benchmarks (Mixed, zero-shot, mean±std over 5 seeds).
| Environment | CoTA-DT (full) | w/o | w/o | w/o | w/o | w/o LLM |
|---|---|---|---|---|---|---|
| Pt-Robot | ||||||
| Cheetah-Vel | ||||||
| Ant-Dir | ||||||
| Meta-World |
Note. “w/o LLM” replaces the LLM backbone with a small DT trained from scratch and uses a pretrained CLIP text encoder for task descriptions.
5.3 ABLATION STUDIES
We ablate each component of CoTA-DT across all four benchmarks (Table 4). The findings are summarized as follows: (i) Removing any representation-learning loss reduces performance across all four benchmarks. (ii) has the largest effect in all four environments, with drops of 424.5 on Meta-World and 187.1 on Ant-Dir, highlighting the importance of language alignment for zero-shot initialization. (iii) Removing lowers Meta-World return by 274.0, showing that discriminative trajectory representations contribute alongside language alignment. (iv) World-model and return-prediction supervision also contribute: removing lowers return by 22.6 on Cheetah-Vel and 345.2 on Meta-World, while removing lowers Meta-World return by 185.7. (v) The w/o LLM variant replaces the pretrained LLM with a small DT trained from scratch while retaining a pretrained CLIP text encoder. Although it trails full CoTA-DT on all four benchmarks, it reaches on Meta-World, compared with for the T2DA-T.
5.4 VISUALIZATION ANALYSIS OF THE TASK REPRESENTATIONS
We visualize the learned task representations on Point-Robot in Fig. 3. Three observations follow. (i) In (a) & (d), task representations learned solely from offline data and text embeddings derived from task descriptions form two disjoint clouds, indicating that representations cannot reliably identify the task. (ii) In (b) & (e), language alignment brings the representations onto a shared circular manifold, but the resulting band remains noisy, suggesting that alignment captures the global task geometry but does not enforce within-task tightness. (iii) In (c) & (f), and align as corresponding points on a clean ring, and concentrate around their text anchors. These results highlight the complementary roles of different components: language alignment provides the global task-manifold structure, while world modeling and Q learning further regularize the representations to improve intra-task consistency.

Figure 3: Task representations on Point-Robot. Each marker is color-coded by goal angle; circles denote task representations, and stars denote text embeddings of task descriptions. The top row visualizes aggregated representations versus , while the bottom row shows all learned from sub-trajectories versus . Columns compare three types of representations: (a) & (d) show representations learned solely from offline data using the contrastive task encoder; (b) & (e) are language-aligned task representations (task encoding + language alignment); (c) & (f) are the final representations learned by CoTA-DT (task encoding + language alignment + world modeling + Q learning).
6 CONCLUSION
We present CoTA-DT, an offline meta-RL framework that learns task representations by integrating contrastive discrimination, language alignment, world-modeling, and Q learning within a LoRA adapter on an LLM backbone. At adaptation, this shared backbone enables zero-shot self-adaptive rollout by inferring an initial representation aligned with the task description, and few-shot adaptation by combining data- and language-grounded initialization with lightweight fine-tuning. Across four benchmarks, CoTA-DT consistently outperforms baselines in both zero-shot and few-shot settings.
REPRODUCIBILITY STATEMENT
We describe the training objectives, policy learning, and adaptation procedures in Section 4, with pseudocode for all four stages in Appendix H. Section 5 specifies the evaluation protocol. Appendix C documents the task splits, descriptions, and offline dataset construction, while Appendix D provides implementation details and hyperparameters. We provide implementation and data-generation scripts at https://anonymous.4open.science/r/CotaDT-35DB.
REFERENCES
Anurag Ajay, Yilun Du, Abhi Gupta, Joshua Tenenbaum, Tommi Jaakkola, and Pulkit Agrawal. Is conditional generative modeling all you need for decision-making? arXiv preprint arXiv:2211.15657, 2022.
Anthony Brohan, Noah Brown, Justice Carbajal, Yevgen Chebotar, Xi Chen, Krzysztof Choromanski, Tianli Ding, Danny Driess, Avinava Dubey, Chelsea Finn, et al. Rt-2: Vision-language-action models transfer web knowledge to robotic control. In Conference on Robot Learning (CoRL), 2023.
Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners. In Advances in Neural Information Processing Systems 33 (NeurIPS 2020), 2020.
Lili Chen, Kevin Lu, Aravind Rajeswaran, Kimin Lee, Aditya Grover, Misha Laskin, Pieter Abbeel, Aravind Srinivas, and Igor Mordatch. Decision transformer: Reinforcement learning via sequence modeling. Advances in neural information processing systems, 34:15084–15097, 2021.
Ron Dorfman, Idan Shenfeld, and Aviv Tamar. Offline meta reinforcement learning – identifiability challenges and effective data collection strategies. In M. Ranzato, A. Beygelzimer, Y. Dauphin, P.S. Liang, and J. Wortman Vaughan (eds.), Advances in Neural Information Processing Systems, volume 34, pp. 4607–4618. Curran Associates, Inc., 2021. URL https://proceedings.neurips.cc/paper_files/paper/2021/file/248024541dbda1d3fd75fe49d1a4df4d-Paper.pdf.
Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In Proceedings of the 34th International Conference on Machine Learning - Volume 70, pp. 1126–1135, 2017.
Hiroki Furuta, Yutaka Matsuo, and Shixiang Shane Gu. Generalized decision transformer for offline hindsight information matching. arXiv preprint arXiv:2111.10364, 2021. URL https://arxiv.org/abs/2111.10364.
Yunkai Gao, Rui Zhang, Jiaming Guo, Fan Wu, Qi Yi, Shaohui Peng, Siming Lan, Ruizhi Chen, Zidong Du, Xing Hu, Qi Guo, Ling Li, and Yunji Chen. Context shift reduction for offline meta-reinforcement learning. In Advances in Neural Information Processing Systems, volume 36, 2023. URL https://proceedings.neurips.cc/paper_files/paper/2023/hash/fd489a44f3bcb9f122e4931ef21d0c43-Abstract-Conference.html.
Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. In International conference on machine learning, pp. 1861–1870. Pmlr, 2018.
Siddhant Haldar, Zhuoran Peng, and Lerrel Pinto. Baku: An efficient transformer for multi-task policy learning. Advances in Neural Information Processing Systems, 37:141208–141239, 2024.
Edward J Hu, Yelong Shen, Phil Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. Lora: Low-rank adaptation of large language models. International Conference on Learning Representations (ICLR), 2022.
Shengchao Hu, Ziqing Fan, Li Shen, Ya Zhang, Yanfeng Wang, and Dacheng Tao. Harmodt: Harmony multi-task decision transformer for offline reinforcement learning. In International Conference on Machine Learning, 2024.
Eric Jang, Alex Irpan, Mohi Khansari, Daniel Kappler, Frederik Ebert, Corey Lynch, Sergey Levine, and Chelsea Finn. BC-Z: Zero-shot task generalization with robotic imitation learning. In Conference on Robot Learning (CoRL 2022), 2022.
Rahul Kidambi, Aravind Rajeswaran, Praneeth Netrapalli, and Thorsten Joachims. Morel: Model-based offline reinforcement learning. In Proceedings of the 34th International Conference on Neural Information Processing Systems, NIPS'20, Red Hook, NY, USA, 2020. Curran Associates Inc. ISBN 9781713829546.
Ksenia Konyushkova, Konrad Zolna, Yusuf Aytar, Alexander Novikov, Scott E. Reed, Serkan Cabi, and Nando de Freitas. Semi-supervised reward learning for offline reinforcement learning. CoRR, abs/2012.06899, 2020. URL https://arxiv.org/abs/2012.06899.
Ilya Kostrikov, Ashvin Nair, and Sergey Levine. Offline reinforcement learning with implicit q-learning. CoRR, abs/2110.06169, 2021. URL https://arxiv.org/abs/2110.06169.
Aviral Kumar, Aurick Zhou, George Tucker, and Sergey Levine. Conservative q-learning for offline reinforcement learning. In Proceedings of the 34th International Conference on Neural Information Processing Systems, NIPS'20, Red Hook, NY, USA, 2020. Curran Associates Inc. ISBN 9781713829546.
Michael Laskin, Luyu Wang, Junhyuk Oh, Emilio Parisotto, Stephen Spencer, Richie Steigerwald, Borja Ibarz, et al. In-context reinforcement learning with algorithm distillation. In International Conference on Learning Representations (ICLR 2023), 2023.
Sergey Levine, Aviral Kumar, George Tucker, and Justin Fu. Offline reinforcement learning: Tutorial, review, and perspectives on open problems. arXiv preprint arXiv:2005.01643, 2020.
Jiachen Li, Quan Vuong, Shuang Liu, Minghua Liu, Kamil Ciosek, Henrik Christensen, and Hao Su. Multi-task batch reinforcement learning with metric learning. In H. Larochelle, M. Ranzato, R. Hadsell, M.F. Balcan, and H. Lin (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 6197–6210. Curran Associates, Inc., 2020a. URL https://proceedings.neurips.cc/paper_files/paper/2020/file/4496bf24afe7fab6f046bf4923da8de6-Paper.pdf.
Lanqing Li, Rui Yang, and Dijun Luo. Focal: Efficient fully-offline meta-reinforcement learning via distance metric learning and behavior regularization. arXiv preprint arXiv:2010.01112, 2020b.
Lanqing Li, Hai Zhang, Xinyu Zhang, Shatong Zhu, Yang Yu, Junqiao Zhao, and Pheng-Ann Heng. Towards an information theoretic framework of context-based offline meta-reinforcement learning. Advances in Neural Information Processing Systems, 37:75642–75667, 2024.
Runji Lin, Ye Li, Xidong Feng, Zhaowei Zhang, Xian Hong Wu Fung, Haifeng Zhang, Jun Wang, Yali Du, and Yaodong Yang. Contextual transformer for offline meta reinforcement learning. arXiv preprint arXiv:2211.08016, 2022.
Eric Mitchell, Rafael Rafailov, Xue Bin Peng, Sergey Levine, and Chelsea Finn. Offline meta-reinforcement learning with advantage weighting. In International Conference on Machine Learning, pp. 7780–7791. PMLR, 2021.
Steven Morad, Ajay Shankar, Jan Blumenkamp, and Amanda Prorok. Language-conditioned offline rl for multi-robot navigation, 2024. URL https://arxiv.org/abs/2407.20164.
Long Ouyang, Jeff Wu, Xu Jiang, Diogo Almeida, Carroll Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, et al. Training language models to follow instructions with human feedback. arXiv preprint arXiv:2203.02155, 2022.
Jing-Cheng Pang, Si-Hang Yang, Kaiyuan Li, Xiong-Hui Chen, Nan Tang, and Yang Yu. Kalm: Knowledgeable agents by offline reinforcement learning from large language model rollouts. Advances in Neural Information Processing Systems, 37:126620–126652, 2024.
Vitchyr H. Pong, Ashvin Nair, Laura M. Smith, Catherine Huang, and Sergey Levine. Offline meta-reinforcement learning with online self-supervision. CoRR, abs/2107.03974, 2021. URL https://arxiv.org/abs/2107.03974.
Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. OpenAI Technical Report, 2019.
Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, and Ilya Sutskever. Learning transferable visual models from natural language supervision. In Proceedings of the 38th International Conference on Machine Learning (ICML), pp. 8748–8763, 2021.
Kate Rakelly, Aurick Zhou, Chelsea Finn, Sergey Levine, and Deirdre Quillen. Efficient off-policy meta-reinforcement learning via probabilistic context variables. In International conference on machine learning, pp. 5331–5340. PMLR, 2019.
Scott Reed, Konrad Zolna, Emilio Parisotto, Sergio Gomez Colmenarejo, Alexander Novikov, Gabriel Barth-Maron, Mai Gimenez, Yury Sulsky, Jackie Kay, Jost Tobias Springenberg, et al. A generalist agent. arXiv preprint arXiv:2205.06175, 2022.
Ruizhe Shi, Yuyao Liu, Yanjie Ze, Simon Shaolei Du, and Huazhe Xu. Unleashing the power of pre-trained language models for offline reinforcement learning. In The Twelfth International Conference on Learning Representations, 2023.
Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro, Faysal Azhar, et al. Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971, 2023.
Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018.
Shudong Wang, Xinfei Wang, Chenhao Zhang, Shanchen Pang, Haiyuan Gui, Wenhao Ji, and Xiaojian Liao. Soft conflict-resolution decision transformer for offline multi-task reinforcement learning. arXiv preprint arXiv:2511.13133, 2025.
Zhe Wang, Haozhu Wang, and Yanjun (Jane) Qi. T³gdt: Three-tier tokens to guide decision transformer for offline meta reinforcement learning. In NeurIPS 2023 Workshop on Robot Learning, 2023.
Zhi Wang, Li Zhang, Wenhao Wu, Yuanheng Zhu, Dongbin Zhao, and Chunlin Chen. Meta-dt: Offline meta-rl as conditional sequence modeling with world model disentanglement. Advances in Neural Information Processing Systems, 37:44845–44870, 2024.
Mengdi Xu, Yikang Shen, Shun Zhang, Yuchen Lu, Ding Zhao, Joshua Tenenbaum, and Chuang Gan. Prompting decision transformer for few-shot policy generalization. In international conference on machine learning, pp. 24631–24645. PMLR, 2022.
Zhongwen Xu, Hado P van Hasselt, and David Silver. Meta-gradient reinforcement learning. Advances in neural information processing systems, 31, 2018.
An Yang et al. Qwen technical report. arXiv preprint arXiv:2309.16609, 2024.
Tianhe Yu, Deirdre Quillen, Zhanpeng He, Ryan Julian, Karol Hausman, Chelsea Finn, and Sergey Levine. Meta-world: A benchmark and evaluation for multi-task and meta reinforcement learning. In Conference on robot learning, pp. 1094–1100. PMLR, 2020a.
Tianhe Yu, Garrett Thomas, Lantao Yu, Stefano Ermon, James Y Zou, Sergey Levine, Chelsea Finn, and Tengyu Ma. Mopo: Model-based offline policy optimization. In Advances in Neural Information Processing Systems, volume 33, pp. 14129–14142. Curran Associates, Inc., 2020b.
Haoqi Yuan and Zongqing Lu. Robust task representations for offline meta-reinforcement learning via contrastive learning. In International Conference on Machine Learning, pp. 25747–25759. PMLR, 2022.
Hanping Zhang and Yuhong Guo. Llm-driven policy diffusion: Enhancing generalization in offline reinforcement learning, 2025. URL https://arxiv.org/abs/2509.00347.
Shilin Zhang, Zican Hu, Wenhao Wu, Xinyi Xie, Jianxiang Tang, Chunlin Chen, Daoyi Dong, Yu Cheng, Zhenhong Sun, and Zhi Wang. Text-to-decision agent: Offline meta-reinforcement learning from natural language supervision. arXiv preprint arXiv:2504.15046, 2025.
Luisa Zintgraf, Sebastian Schulze, Cong Lu, Leo Feng, Maximilian Igl, Kyriacos Shiarlis, Yarin Gal, Katja Hofmann, and Shimon Whiteson. Varibad: Variational bayes-adaptive deep rl via meta-learning. Journal of Machine Learning Research, 22(289):1–39, 2021.
A EXTENDED RELATED WORK
We provide a more detailed account of the four lines of work most relevant to CoTA-DT.
TD-based offline meta-RL. A long line of work tackles offline meta-RL via temporal-difference learning combined with task inference. PEARL (Rakelly et al., 2019) introduced probabilistic context inference using a permutation-invariant encoder, sparking a family of context-based methods. FOCAL (Li et al., 2020b) extends this to the offline setting via a contrastive trajectory encoder, while subsequent work addresses train/test context distribution shift (Lin et al., 2022; Yuan & Lu, 2022; Gao et al., 2023). UNICORN (Li et al., 2024) provides a unifying information-theoretic view, framing all of these objectives as different upper bounds of mutual information between the latent and task-relevant trajectory statistics. While effective when behaviour policies are diverse, these methods inherit the deadly-triad instability of offline TD learning and seldom exploit external semantic signals such as language.
DT-based offline meta-RL. Decision Transformer (Chen et al., 2021) reframes RL as return-conditioned sequence modelling, sidestepping bootstrapping and Bellman backups. Prompt-DT (Xu et al., 2022) prepends expert trajectory snippets as a prompt. Generalised DT (Furuta et al., 2021; Wang et al., 2023) replaces this prompt with hindsight statistics. Meta-DT (Wang et al., 2024) learns a disentangled context encoder via a world model and feeds its latent into a DT. Algorithm Distillation (Laskin et al., 2023) distils RL training trajectories into a causal transformer for in-context improvement. HarmoDT (Hu et al., 2024) mitigates parameter-level conflicts in multi-task DTs. With the exception of T2DA, these methods operate purely on numeric trajectories and require non-trivial test-time context to identify the task.
Language-conditioned policies. BC-Z (Jang et al., 2022) demonstrated that a frozen sentence encoder is sufficient for zero-shot manipulation if many language-annotated demonstrations are available. BAKU (Haldar et al., 2024) extends this with modular per-task action heads on a shared trunk. Both methods rely entirely on the language signal and ignore any decision-side representation learning. T2DA-T (Zhang et al., 2025) bridges the two regimes by aligning text embeddings to dynamics-aware decision embeddings via CLIP-style contrastive learning, then conditioning a DT on the aligned text vector. CoTA-DT extends this idea in three directions: (i) we jointly (rather than separately) optimise the alignment and grounding objectives; (ii) we add long-horizon Q supervision in addition to the one-step world-model losses used in T2DA; and (iii) we share a single LoRA adapter across all four signals and the policy, yielding a unified backbone instead of per-component encoders.
LLMs as backbones for sequential decision making. Pretrained LLMs have been used as policy initialisations (Shi et al., 2023), conflict-resolution (Wang et al., 2025), and data augmentation (Pang et al., 2024) engines for offline RL. Most existing approaches treat the LLM as a single-purpose component. CoTA-DT instead reuses one frozen LLM with a single LoRA adapter as a shared backbone for language encoding, world modelling, value estimation, and policy generation, yielding a ~10× parameter-efficiency advantage over running independent encoders.
B BASELINE DESCRIPTIONS
We compare CoTA-DT to six representative baselines covering language-conditioned, prompt-based, and context-based paradigms.
Prompt-DT (Xu et al., 2022). Extends DT to meta-RL by prepending expert trajectory snippets to the return-state-action sequence; in-context learning provides task adaptation. Its main limitation is the dependence on test-time expert prompts.
BC-Z (Jang et al., 2022). Language-conditioned imitation that parameterises the policy as , where is a sentence embedding from a frozen language encoder. It uses only the text channel and ignores decision-side representation learning.
BAKU (Haldar et al., 2024). Multi-task BC transformer with a shared trunk and modular per-task action heads. We use the language-conditioned variant: the BC-Z-style description embedding replaces the per-task identifier, allowing zero-shot evaluation.
Meta-DT (Wang et al., 2024). Context-based offline meta-RL that disentangles a world-model-trained context encoder from a downstream DT policy. The latent is fed to the DT as a prefix token. Meta-DT does not exploit any natural-language signal.
UNICORN (Li et al., 2024). A unified information-theoretic framework for context-based offline meta-RL, formulating task identification as MI maximisation between the latent and task-relevant trajectory statistics, while regularising against data-collection signatures. UNICORN generalises FOCAL- and CSRO-style contrastive encoders.
T2DA-T (Zhang et al., 2025). The strongest published language-conditioned baseline. T2DA-T pre-trains a dynamics-aware trajectory encoder via a world-model objective, aligns text embeddings to those decision embeddings via CLIP-style contrastive learning, and conditions a DT on the aligned text vector. CoTA-DT differs in three ways: (i) world-model and contrastive alignment are jointly optimised instead of staged; (ii) long-horizon Q supervision is added; (iii) a single LoRA adapter is shared across all four pre-training signals and the policy.
C ENVIRONMENTS AND TASKS
Environment statistics. Table 5 summarises the four offline meta-RL environments. The Point-Robot, Cheetah-Vel and Ant-Dir benchmarks follow the T2DA protocol (Zhang et al., 2025): 50 tasks per environment, with the last 5 indices held out for evaluation. Meta-World uses the 22-task subset of MT50 (Yu et al., 2020a) consisting of task indices 0–21, with indices {1, 4, 14, 15} held out for evaluation.
Table 5: Environment statistics. , and are the state, action and episode-length dimensions.
| Environment | # Tasks | Train/Test | Task variation | |||
|---|---|---|---|---|---|---|
| Point-Robot | 50 | 45/5 | 2 | 2 | 20 | Target position |
| Cheetah-Vel | 50 | 45/5 | 20 | 6 | 200 | Target velocity |
| Ant-Dir | 50 | 45/5 | 27 | 8 | 200 | Target heading |
| Meta-World | 22 | 18/4 | 39 | 4 | 200 | Diverse manipulation |
Dataset construction. For all four environments we use SAC (Haarnoja et al., 2018) to independently train a policy for each task and save policy checkpoints at different training steps. We then construct three dataset variants per environment by rolling out trajectories from these checkpoints: Medium uses a ~50%-converged checkpoint; Expert uses the highest-return checkpoint after convergence; and Mixed uses all saved checkpoints across training, yielding a diverse mix of skill levels. Each dataset contains 200 trajectories per task. The data-generation script and SAC hyperparameters are included in the supplementary material².
Natural-language task descriptions. We programmatically generate a one-sentence description from each task’s metadata. Examples:
- Point-Robot: “Navigate to position (-0.75, 0.93), distance 1.19, heading northwest.”
- Cheetah-Vel: “HalfCheetah target velocity 1.42 units per second.”
- Ant-Dir: “Ant robot heads northeast at angle 42°.”
- Meta-World: original short verb description, e.g. “rotate faucet clockwise”.
Sentences are tokenised with the LLaMA-3.2 tokenizer (max 64 tokens).
²https://anonymous.4open.science/r/CotaDT-35DB.
D IMPLEMENTATION DETAILS
Backbone and adapters. We use the open-source LLaMA-3.2-1B (Touvron et al., 2023); the base 1B parameters are always frozen. A single LoRA adapter (rank , , applied to all and ) is shared across the four prediction heads (, , , ) and across both training phases. Adapter size is parameters, giving the framework a parameter-efficiency advantage over running independent transformers per signal.
Context encoder. is a 1-layer GRU (hidden 256, output ) followed by linear -normalisation, parameters. Sub-trajectory horizon across all environments.
Continuous-token projectors. are linear projections matching LLaMA's hidden size. The text branch reuses the LLaMA token embedding.
CLIP-style alignment. are 2-layer MLPs followed by -normalisation. The temperature is parameterised as with initialised at and clamped to . Three design choices are critical: (i) keeping CLIP gradients unblocked on both sides (without this the loss stays at ), (ii) the learnable temperature, and (iii) a 10-epoch CLIP warm-up.
Representation learning phase. We optimise Eq. (7) with and , where correspond to the weights on , , and respectively. Adam, lr , batch 128, 200 epochs (Point-Robot 80). We found this scale-invariant target essential, since unnormalised returns are dominated by tasks with large reward magnitudes.
Policy learning phase. We initialise from the representation-learning checkpoint, replace the auxiliary heads with , and continue to fine-tune together with via (Eq. 8). DT input format is with as a prefix token, refreshed by re-encoding the most recent steps. AdamW, lr , weight decay , batch 64 (PR) / 32 (CV, AD, MW), DT horizon 20 (PR) / 40 otherwise; training steps with 5,000-step linear warm-up; gradient clipping 0.25.
Zero-shot inversion. Eq. (9) is solved with Adam, 200 steps, lr 0.01, on a fresh initialised at 0. Empirically convergence happens within steps; the remainder tightens the latent norm.
Few-shot fine-tuning. Given support trajectories, we obtain via data-grounded initialisation (starting from ) followed by the same CLIP-space inversion as zero-shot (Eq. 9); we then hold fixed and fine-tune only and for 100 steps with Adam, lr . The full adaptation costs minute on a single A6000.
Compute. All experiments run on multi-GPU servers equipped with NVIDIA RTX A6000 (48 GB) GPUs; each training job uses a single GPU and we run 4 jobs in parallel on a A6000 node. The representation phase takes h on Point-Robot and h on Meta-World; the policy phase takes h. A single forward pass (one trajectory of length , batch 128) takes ms, dominated by the LLM backbone.
Note on supplementary code. For historical reasons, our supplementary code uses an concatenation and per-step sliding-window updates instead of the prefix-token + per-window scheme described in Sec. 4.1. The paper version is better on Ant-Dir and matches elsewhere; the code variant is preserved as the concat_z ablation. Numbers reported in Tables 1–4 use the paper version.
D.1 HYPERPARAMETER CONFIGURATION
Table 6 lists the full set of CoTA-DT hyperparameters. We selected default values via a small sweep on Point-Robot Mixed and re-used the same values across all environments unless explicitly noted.
The most influential knobs are the loss weights , the learnable CLIP temperature , and the CLIP warm-up epoch count .
Table 6: CoTA-DT hyperparameters. Values are shared across all four benchmarks unless noted.
| Group | Hyperparameter | Value |
|---|---|---|
| Backbone | LLM backbone | LLaMA-3.2 1B (frozen) |
| Hidden size | 2048 | |
| LoRA rank | 8 / 16 | |
| LoRA target modules | q_proj, v_proj (all layers) | |
| Context encoder | Architecture | 1-layer GRU |
| Hidden / output dim | 256 / | |
| Sub-trajectory length | 20 | |
| Projectors | Proj, Proj | 2-layer MLP, hidden 256, output 128 |
| Linear 2048 | ||
| Output normalisation | ||
| CLIP alignment | Temperature init / clamp | |
| Warm-up epochs | 10 | |
| CLIP gradient stop-grad | none (gradients flow on both sides) | |
| Negative pairs / batch | in-batch () | |
| Repr. learning | Loss weights | (0.1, 0.5, 1.0, 0.1, 1.0) |
| Optimiser | Adam | |
| Learning rate | ||
| Batch size | 128 | |
| Epochs | 80 (PR) / 200 (CV, AD, MW) | |
| Gradient clip | 1.0 | |
| Policy learning | Optimiser | AdamW |
| Learning rate / weight decay | ||
| Batch size | 64 (PR) / 32 (CV, AD, MW) | |
| DT horizon | 20 (PR) / 40 (CV, AD, MW) | |
| Total steps | ||
| LR warm-up steps | 5,000 | |
| Zero-shot | Initial | 0 |
| Few-shot fine-tune | Trainable parameters | only |
D.2 HYPERPARAMETER SENSITIVITY
Table 7 reports a one-at-a-time sensitivity sweep on Point-Robot Mixed. We vary each knob in isolation while keeping the others at their default value.
Sensitivity findings. Three observations follow. (i) The two CLIP-related knobs and init) and the value-supervision weight are the load-bearing hyperparameters: setting any of them to zero or to an extreme value degrades return by 1–5 points. (ii) The contrastive weight and the LoRA rank are remarkably robust: a range around the default changes performance by less than the seed-to-seed variance. (iii) Context horizon exhibits a clear sweet spot at : is too short to identify the task, while provides no benefit on Point-Robot (whose episode length is itself only 20). This suggests that reproducing CoTA-DT's numbers does not require careful tuning, except for not turning off CLIP alignment or value supervision entirely.
Two further design choices outside the table also matter: (i) blocking CLIP gradients on the text side stalls the loss at ; and (ii) starting CLIP from epoch 0 (i.e. ) reduces final return by points.
Table 7: Hyperparameter sensitivity of CoTA-DT on Point-Robot (Mixed dataset, zero-shot test return, mean±std over 5 seeds). Default config: , , , , , , LoRA rank , init = 0.07.
| Hyperparameter | Value | Test return ↑ |
|---|---|---|
| Default (CoTA-DT) | — | -7.9±0.4 |
| ( weight, default 0.5) | 0.0 | -12.3±0.5 |
| 0.1 | -10.1±0.6 | |
| 1.0 | -8.4±0.5 | |
| 2.0 | -9.7±0.7 | |
| ( weight, default 0.1) | 0.0 | -10.2±0.2 |
| 0.05 | -8.5±0.4 | |
| 0.2 | -8.2±0.5 | |
| 0.5 | -9.1±0.6 | |
| ( weight, default 0.1) | 0.0 | -10.9±0.1 |
| 0.05 | -8.4±0.4 | |
| 0.2 | -8.3±0.5 | |
| Context horizon (default 20) | 5 | -10.5±0.8 |
| 10 | -8.7±0.6 | |
| 40 | -8.0±0.4 | |
| LoRA rank (default 8) | 4 | -8.6±0.5 |
| 16 | -8.0±0.4 | |
| 32 | -8.2±0.5 | |
| init (default 0.07) | 0.01 | -9.4±0.6 |
| 0.10 | -8.1±0.4 | |
| 0.50 | -9.8±0.7 |
E ADDITIONAL ABLATIONS AND ROBUSTNESS
E.1 BACKBONE LLM CHOICE
Table 8 compares four backbone choices on Point-Robot and Meta-World Mixed. We vary the backbone and its tokenizer while keeping the LoRA rank and training settings fixed. The trends are consistent with related work: a larger backbone helps, but possibly with diminishing returns. Point-Robot performance varies little across the four models (-8.5 to -7.9). On Meta-World, the separation is more pronounced relative to seed variation: GPT-2 small obtains 1186.7 ± 29.6, while LLaMA-3.2 1B reaches 1292.5 ± 28.2. LLaMA-3.2 1B has the highest mean return on both benchmarks with a 0.85M-parameter LoRA adapter, so we use it as the default.
Table 8: Effect of LLM backbone on Point-Robot and Meta-World Mixed (zero-shot test return). Point-Robot results are mean±std over 5 seeds.
| Backbone | # params | Hidden dim | Trainable LoRA | Pt-Robot ↑ | Meta-World ↑ |
|---|---|---|---|---|---|
| GPT-2 small (Radford et al., 2019) | 117M | 768 | 0.39M | -8.5 ± 0.6 | 1186.7 ± 29.6 |
| Qwen-2.5 0.5B (Yang et al., 2024) | 0.5B | 1024 | 0.55M | -8.2 ± 0.5 | 1228.4 ± 35.2 |
| Qwen-2.5 1.5B (Yang et al., 2024) | 1.5B | 1536 | 0.95M | -8.0 ± 0.4 | 1271.1 ± 31.8 |
| LLaMA-3.2 1B (Touvron et al., 2023) | 1.2B | 2048 | 0.85M | -7.9 ± 0.4 | 1292.5 ± 28.2 |
E.2 TASK DESCRIPTION ROBUSTNESS
To probe how much CoTA-DT relies on the specific wording of the task description, we re-ran Point-Robot Mixed with three description styles:
-
Minimal: only the goal coordinates, e.g. “goal (-0.75, 0.93)”.
-
Standard: our default template, e.g. “Navigate to position (−0.75, 0.93), distance 1.19, heading northwest.”
-
Noisy: the standard template with a 5-token random distractor inserted, e.g. “Navigate to position (−0.75, 0.93), the weather is nice today, distance 1.19, heading northwest.”
Table 9: Robustness of CoTA-DT to description style on Point-Robot Mixed (zero-shot, 5 seeds).
| Description style | Test return ↑ | Δ vs. Standard |
| Minimal | −8.8 ± 0.5 | −0.9 |
| Standard (default) | −7.9 ± 0.4 | — |
| Noisy | −11.5 ± 0.5 | −3.6 |
The performance is remarkably stable: the spread across description styles is well within the seed-to-seed standard deviation of related baselines. We attribute this to the LLM backbone, which is robust to surface-form variation, and to the contrastive objective, which only requires the text embedding to be discriminative rather than literal. The noisy variant is worse than minimal because the distractor token shifts the LLM-derived embedding without adding task-relevant information.
E.3 DECISION-BACKBONE PRETRAINING CONTROLS.
We examine whether the gains require a pretrained LLM decision backbone. The “w/o LLM” configuration trains a 0.6M-parameter decision transformer from scratch and uses a separate pretrained CLIP ViT-B/32 text encoder. A second control retains the 1B backbone architecture and LoRA adapter but randomly initializes and freezes the backbone. The full CoTA-DT model uses the pretrained shared backbone.
Table 10: Decision-backbone controls on Mixed datasets in the zero-shot setting. Results are mean±std.
| Configuration | Text encoder | Seeds | Pt-Robot ↑ | Meta-World ↑ |
| T2DA-T (reproduced) | Pretrained CLIP | 5 | −8.7 ± 0.3 | 1103.5 ± 36.3 |
| w/o LLM (small DT) | Separate pretrained CLIP | 5 | −8.4 ± 0.5 | 1218.2 ± 37.6 |
| Random-init 1B + LoRA | Random-init shared backbone | 5 | −11.2 ± 0.6 | 916.8 ± 36.0 |
| CoTA-DT (full) | Pretrained shared backbone | 5 | −7.9 ± 0.4 | 1292.5 ± 28.2 |
The small DT paired with a pretrained CLIP text encoder reaches 1218.2 ± 37.6 on Meta-World, retaining about 61% of CoTA-DT's improvement over the reproduced T2DA-T despite training its decision backbone from scratch. It also comes close to the full model on Point-Robot (−8.4 ± 0.5 versus −7.9 ± 0.4). In contrast, the much larger random-init 1B + LoRA variant reaches only 916.8 ± 36.0 on Meta-World. One possible explanation is that CLIP provides a useful task signal to the trainable small DT, whereas LoRA must adapt frozen random features for both language and decision modeling in the 1B control.
F FEW-SHOT ADAPTATION MODES
The few-shot results in Table 2 of the main paper use our default mode (finetune with k=5), where k denotes the number of target-task support trajectories. We compare four modes that progressively add rollout-time latent updates, language-grounded inversion, and policy fine-tuning:
-
static: initialise from the support trajectories and keep it fixed throughout the rollout;
-
online: initialise and refresh it from the agent's rollout history after collecting transitions;
-
inversion only: refine into via CLIP-space optimisation (Eq. 9), then use the same rollout-time updates as online, without updating the policy parameters;
-
finetune (default): use the same inversion and rollout-time updates as inversion only, and additionally fine-tune and for 100 Adam steps on the support set with held fixed.
Table 11: Few-shot return with different adaptation modes on Point-Robot and Meta-World (Mixed, mean over 5 seeds). Best per column in bold.
| Mode | Point-Robot ↑ | Meta-World ↑ | ||||
|---|---|---|---|---|---|---|
| static | -9.2 | -8.6 | -8.9 | 1281.3 | 1295.1 | 1290.5 |
| online | -9.2 | -8.6 | -8.9 | 1295.8 | 1318.0 | 1325.2 |
| inversion only | -8.4 | -6.9 | -7.2 | 1349.1 | 1384.7 | 1396.9 |
| finetune | -8.1 | -6.9 | -7.3 | 1352.6 | 1402.8 | 1395.3 |
Three observations: (i) Static and online coincide on Point-Robot, whose episode length equals the context horizon (), leaving no subsequent action to condition on a refreshed latent. On the longer-horizon Meta-World tasks, online updates improve return over static at every tested , suggesting that newly collected transitions provide useful task information during rollout. (ii) Adding language-grounded inversion improves on online across both environments and all three support sizes. At , it raises Meta-World return from 1318.0 to 1384.7 without updating the policy parameters, highlighting the value of a task-description-aligned initial latent. (iii) Policy fine-tuning adds a further 18.1 return on Meta-World at , but leaves the Point-Robot mean unchanged; at , inversion only slightly exceeds finetune on both environments. Fine-tuning is therefore an optional source of improvement rather than a prerequisite for strong few-shot results. At the default , inversion only already reaches -6.9 on Point-Robot and 1384.7 on Meta-World, above the corresponding T2DA-T few-shot returns in Table 2.
G VISUALISATION ANALYSIS
Beyond the qualitative t-SNE visualisation in Fig. 3 of the main paper, we quantify the alignment by computing the rank-1 retrieval accuracy of the cross-modal nearest neighbour () on Point-Robot. The accuracy reaches 90% on Expert, 88% on Medium, and drops to 82% on the heterogeneous Mixed dataset. We attribute the Mixed-dataset drop to the bimodal trajectory distribution (medium expert) producing a less concentrated , which is itself an empirical finding about how dataset heterogeneity affects representation tightness. The same trend—highest retrieval accuracy on Expert, lowest on Mixed—also holds on Meta-World (85% / 81% / 78%), confirming the observation is not Point-Robot-specific.
H ALGORITHM SUMMARY
We present four algorithms that together describe CoTA-DT: (i) multi-perspective representation learning (Algorithm 1); (ii) task-aware policy learning (Algorithm 2); (iii) zero-shot deployment via language-grounded inversion (Algorithm 3); and (iv) few-shot adaptation via data-grounded initialisation and lightweight fine-tuning (Algorithm 4).
Algorithm 1 CoTA-DT — Multi-perspective representation learning
Require: Per-task offline data ; task descriptions ; frozen LLM backbone
Require: Loss weights ; warm-up epochs ; sub-trajectory horizon ; latent dim ; alignment dim
1: Initialise context encoder , LoRA adapter , prediction heads , , , continuous-token projectors , alignment heads , and learnable temperature
2: for epoch = 1, ..., do
3: for each minibatch of tasks do
4: // (1) Trajectory branch
5: for each task do
6: Sample anchor sub-trajectory from ; encode
7: Sample positive (nearby segment); encode
8: Sample sub-trajectories from ; compute task-mean
9: end for
10: Treat in-batch latents from other tasks as negatives for InfoNCE
11: // (2) Language branch
12: For each :
13: // (3) Alignment
14: ,
15: Compute similarity matrix for
16: // (4) Task-conditioned world model and learning
17: For each transition , predict via shared LLM on tokens
18: // (5) Compute losses
19: with temperature
20: (Eq. 4)
21:
22:
23: Update via Adam
24: end for
25: end for
26: Output: trained
Algorithm 2 CoTA-DT — Task-aware policy learning
Require: Representation-learning checkpoint ; per-task offline data ; sub-trajectory horizon ; total steps
1: Initialise action head ; load from the representation checkpoint
2: for step = 1, ..., do
3: Sample task and trajectory
4: Sample a DT context window of length from
5: Compute task latent from the most recent steps (zero-padded if needed); held fixed within the window
6: Forward DT with input via LLM and head
7:
8: Update via AdamW with gradient clipping
9: end for
10: Output: adapted
Algorithm 3 CoTA-DT — Zero-shot adaptation
Require: Trained model ; target task description ; target return ; episode length ; sub-trajectory horizon ; inversion steps , inversion lr
1: // Language-grounded latent initialisation 2: Encode description: 3: Project and normalise: 4: Initialise 5: for do 6: 7: 8: Update via one Adam step on with learning rate 9: end for 10: Set 11: // Self-adaptive rollout 12: Receive initial state ; initialise rollout history 13: for do 14: if then 15: {insufficient rollout history, use language-grounded latent} 16: else 17: from {re-encode from rollout} 18: end if 19: Predict action: 20: Execute , observe ; update RTG ; append to 21: end for
Algorithm 4 CoTA-DT — Few-shot adaptation
Require: Trained model ; target task description ; support set of size ; target return ; inversion steps , inversion lr ; fine-tune steps , fine-tune lr
1: // (1) Data-grounded latent initialisation 2: Sample sub-trajectories from 3: Compute aggregated latent: 4: Encode description: , 5: Initialise {data-grounded init in place of zero init} 6: for do 7: 8: Update via one Adam step on with learning rate 9: end for 10: Set 11: // (2) Light-weight policy fine-tune 12: for do 13: Sample DT window from 14: Forward policy with held fixed; compute (Eq. 8) 15: Update via Adam at lr (all other parameters frozen) 16: end for 17: // (3) Self-adaptive rollout 18: Run the self-adaptive rollout phase of Algorithm 3 using the fine-tuned policy and the data-grounded