Mixture-of-Experts Meets In-Context Reinforcement Learning

Wen-Hao Wu, Fu-Hong Liu, Hao-Ru Li, Zi-Can Hu, Dao-Yi Dong +2 more
6/1/2025
16 citations
moerl

No official code found. Best implementation: NJU-RL/T2MIR (34 stars).

Abstract

In-context reinforcement learning (ICRL) has emerged as a promising paradigm for adapting RL agents to downstream tasks through prompt conditioning. However, two notable challenges remain in fully harnessing in-context learning within RL domains: the intrinsic multi-modality of the state-action-reward data and the diverse, heterogeneous nature of decision tasks.

Show full abstract

To tackle these challenges, we propose T2MIR (Token- and Task-wise MoE for In-context RL), an innovative framework that introduces architectural advances of mixture-of-experts (MoE) into transformer-based decision models. T2MIR substitutes the feedforward layer with two parallel layers: a token-wise MoE that captures distinct semantics of input tokens across multiple modalities, and a task-wise MoE that routes diverse tasks to specialized experts for managing a broad task distribution with alleviated gradient conflicts. To enhance task-wise routing, we introduce a contrastive learning method that maximizes the mutual information between the task and its router representation, enabling more precise capture of task-relevant information. The outputs of two MoE components are concatenated and fed into the next layer. Comprehensive experiments show that T2MIR significantly facilitates in-context learning capacity and outperforms various types of baselines. We bring the potential and promise of MoE to ICRL, offering a simple and scalable architectural enhancement to advance ICRL one step closer toward achievements in language and vision communities. Our code is available at https://github.com/NJU-RL/T2MIR.

View on arXivView PDF

Code Implementations(1)

NJU-RL/T2MIRCommunity100%

[NeurIPS 2025] Official codebase for T2MIR: Mixture-of-Experts Meets In-Context Reinforcement Learning.

342

Similar Papers

Cite this paper

@article{wu2025mixtureofexperts,
  title  = {Mixture-of-Experts Meets In-Context Reinforcement Learning},
  author = {Wen-Hao Wu and Fu-Hong Liu and Hao-Ru Li and Zi-Can Hu and Dao-Yi Dong and Chun-Lin Chen and Zhi Wang},
  year   = {2025},
  eprint = {2506.05426},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2506.05426},
  url    = {https://doi.org/10.48550/arXiv.2506.05426},
  journal = {Neural Information Processing Systems}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2506.05426.svg)](https://codeofpaper.com/paper/2506.05426)

Discussion