CAREL: Instruction-guided reinforcement learning with cross-modal auxiliary objectives

Armin Saghafian, Amirmohammad Izadi, Negin Hashemi Dijujin, Mahdieh Soleymani Baghshah

TL;DR

CAREL introduces a cross-modal contrastive auxiliary loss—inspired by video-text retrieval techniques—alongside a novel instruction tracking mechanism for language-guided reinforcement learning. By aligning environmental observations with textual instructions at multiple granularities and dynamically masking completed sub-tasks, CAREL significantly boosts both sample efficiency and systematic generalization in complex, multi-step environments.

What Problem Does This Paper Address?

In language-guided reinforcement learning (RL), agents must learn to map abstract textual instructions (e.g., "Go to the red box, then open the blue door") to concrete actions within an environment—a challenge known as grounding.

While standard goal-conditioned RL often focuses on reaching a final state, language instructions frequently imply a specific sequence of sub-tasks. Current agents struggle with two major issues in these scenarios:

  1. Sample Inefficiency: It takes millions of environment interactions to learn the alignment between text tokens and visual or symbolic states.
  2. Distraction and Repetition: Agents often lose track of their progress, repeating already completed sub-tasks or getting distracted by objects relevant only to past steps of the instruction.

Existing auxiliary losses in RL help improve internal representations but typically lack the cross-modal alignment properties needed to bridge the gap between vision/symbolic states and text.

Methods

The authors propose CAREL (Cross-modal Auxiliary REinforcement Learning), which introduces two main components to a standard RL baseline:

  1. Multi-Grained Cross-Modal Auxiliary Loss: Inspired by the X-CLIP model from video-text retrieval literature, CAREL applies a contrastive loss function exclusively to successful trajectories. It computes similarity scores across four distinct granularities: Episode-Instruction, Episode-Word, Observation-Instruction, and Observation-Word. This ensures that the agent's internal representations tightly couple the sequence of observations with the corresponding text tokens.
  2. Instruction Tracking (IT): To help the agent focus on the remaining parts of a task, CAREL tracks the fine-grained similarity scores between the partial episode and individual sub-tasks over time. When a sharp spike in similarity is detected for a specific sub-task (indicating completion), that part of the text is replaced with a <mask> token. To prevent premature masking early in training when representations are weak, the masking probability dynamically increases over time using a hyperbolic tangent (tanh) function.
Figure 1: Overall view of CAREL. In this figure, we showcase CAREL over a candidate baseline model from Chevalier-Boisvert et al. (2018). (Left) The blue box handles the (masked) instruction and its lo- cal/global representations, while the pink box contains the components related to observation. (Right) The purple box shows the calculation steps for the X-CLIP loss and tracks scores for instruction masking.

Datasets

The framework was evaluated on two popular grid-world benchmarks designed for language grounding:

  • BabyAI: A logically complex benchmark with procedurally generated levels. The authors tested on several challenging levels including GoToSeqS5R2, OpenDoorsOrderN4, PickupLoc, PutNextLocalS6N4, and the highly complex SynthS5R2.
  • MiniGrid: Used to evaluate CAREL on top of an RGB-based baseline (SHELM), specifically focusing on tasks like PutNear, GoToDoor, and GoToObject.

Key Insights and Ideas

  • Leveraging Video-Text Retrieval for RL: The core "aha" moment is realizing that a successful RL trajectory (a sequence of frames) paired with an instruction behaves exactly like a video-text retrieval pair. Techniques designed to align video frames to words can be directly mapped to RL to improve grounding.
  • Weak Supervision via Success Signals: Instead of forcing contrastive alignment on all trials (which fails when an agent blunders), CAREL filters for successful trajectories. This provides a clean, weakly supervised signal for representation learning.
  • Dynamic "Check-lists" via Masking: Rather than expecting a monolithic network to implicitly remember what it has done, explicitly masking completed sub-tasks acts like a dynamic checklist, preventing the agent from backtracking or getting confused by old instructions.

Key Results

CAREL demonstrated substantial improvements in success rates and sample efficiency across the board:

  • BabyAI Baseline Boost: On the OpenDoorsOrderN4 task at 3 million frames, the standard BabyAI baseline achieved a 24% success rate, whereas BabyAI + CAREL reached 79%. On the complex GoToSeqS5R2 task at 10 million frames, success jumped from 41% to 73%.
  • Instruction Tracking Synergy: Adding the Instruction Tracking (IT) mechanism yielded even higher performance on multi-step sequential tasks, accelerating convergence compared to vanilla CAREL.
Success rates over training frames on various BabyAI tasks, showing CAREL outperforming the baseline.
  • Compatibility with Modern Baselines: When applied on top of SHELM (a model utilizing pre-trained CLIP and Transformer-XL features), CAREL boosted the success rate on the GoToDoor task from 50% to 83% using 1.5 million frames.

Limitations and Future Work

While powerful, CAREL has a few notable limitations:

  • Instruction Format Dependency: It relies on environments that provide clear textual instructions. For the instruction tracking mechanism, the text must be parseable into sub-tasks (either via rule-based heuristics or external NLP tools like SpaCy/LLMs).
  • Architectural Constraints: The base RL model must utilize separate encoders for visual/symbolic observations and textual commands (a dual-encoder setup) to allow the contrastive loss to function.

For future work, the authors suggest validating CAREL in more complex, continuous multi-modal environments and exploring its utility in broader sequential decision-making agents.

Summary updated

BibTeX
@article{saghafian2025carel,
  author = {Armin Saghafian and Amirmohammad Izadi and Negin Hashemi Dijujin and Mahdieh Soleymani Baghshah},
  title = {{CAREL: Instruction-guided reinforcement learning with cross-modal auxiliary objectives}},
  journal = {Accepted by TMLR},
  year = {2025},
  url = {https://openreview.net/forum?id=zJUEYr5X1X},
}
Figure