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

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

Abstract

Grounding instructions in the environment is a key step in solving language-guided goal-reaching reinforcement learning problems. In automated reinforcement learning, a key concern is to enhance the model's ability to generalize across various tasks and environments. In goal-reaching scenarios, the agent must comprehend different parts of the instructions within the environmental context to complete the overall task successfully. In this work, we propose CAREL (Cross-modal Auxiliary REinforcement Learning) as a new framework to solve this problem using auxiliary loss functions inspired by video-text retrieval literature and a novel method called instruction tracking, which automatically keeps track of progress in an environment. The results of our experiments suggest superior sample efficiency and systematic generalization for this framework in multi-modal reinforcement learning problems.

Introduction

In language-guided Reinforcement Learning (RL), agents are tasked with executing complex commands such as "Pick up the red ball, then put it next to the blue box." Success in these environments hinges on solving the grounding problem: the agent must learn to associate visual pixels (e.g., a "red ball") with specific textual tokens in the instruction.

Current methodologies often struggle with two primary challenges:

  1. Alignment: Effectively linking visual states to textual tokens across varying granularities (e.g., matching a specific frame to a specific word).
  2. Focus: In multi-step tasks, agents can become "distracted" by already completed parts of an instruction, leading to redundant actions or failure to progress.

The CAREL Framework

The CAREL framework addresses these challenges through two primary innovations: a cross-modal auxiliary loss and an instruction tracking mechanism.

The CAREL framework architecture, highlighting the cross-modal auxiliary loss components and the Instruction Tracking mechanism.

1. Cross-modal Auxiliary Loss

Drawing inspiration from the X-CLIP model in video-text retrieval, CAREL incorporates an auxiliary contrastive loss into the standard RL objective. This loss is calculated exclusively for successful trajectories to avoid aligning failed actions with instructions. It employs a multi-grained similarity approach, calculating four types of alignment: Episode-Instruction, Episode-Word, Observation-Instruction, and Observation-Word. This ensures the agent learns both high-level goals and fine-grained object-word associations.

2. Instruction Tracking (IT)

Instruction Tracking acts as a dynamic "checklist" for the agent. As the agent interacts with the environment, the model monitors similarity scores between current observations and sub-tasks (e.g., "go to the red box"). When a similarity score for a sub-task spikes significantly, the system assumes completion and replaces those words in the instruction with a <masking> token. To handle initial noise, the probability of masking increases via a tanh function as the agent's confidence grows.

Experimental Evaluation

CAREL was evaluated on two major RL benchmarks: MiniGrid (a navigation and manipulation grid-world) and BabyAI (a complex platform for grounded language learning). Testing focused on difficult levels such as GoToSeq (sequences of commands), OpenDoorsOrder (ordered door opening), and Synth (complex synthesized instructions). Notably, CAREL is architecture-agnostic and can be integrated into any base RL model that utilizes separate vision and text encoders.

Results and Discussion

CAREL demonstrated substantial improvements in both sample efficiency and final success rates across all tested environments.

Success rates across various BabyAI tasks, comparing CAREL variants (attention and mean) with the baseline BabyAI model.

Key findings include:

  • Performance Gains: On the OpenDoorsOrderN4 task, CAREL achieved a 79% success rate within 3 million samples, compared to only 24% for the baseline BabyAI model.
  • State-of-the-Art Comparison: CAREL outperformed recent models like SHELM and LISA. For instance, on GoToSeqS5R2, CAREL reached a 93% success rate, significantly higher than LISA's 77%.
  • Generalization: Agents trained with CAREL showed superior ability to handle unseen combinations of colors and objects, indicating robust cross-modal grounding rather than simple memorization.
  • The Power of Masking: Results suggest that "forgetting" completed information via Instruction Tracking is as vital as learning new information, as it reduces the cognitive load on the agent's policy network.

Conclusion

CAREL provides a robust framework for improving instruction-guided RL through better grounding and focus. While currently dependent on structured instructions for sub-task splitting, future work may leverage Large Language Models (LLMs) to automate this process for more diverse, natural language instructions. Additionally, extending CAREL to 3D RGB environments remains a promising direction for future research.

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