Opponent Modeling with In-context Search

Yuheng Jing, Bingyun Liu, Kai Li, Yifan Zang, Haobo Fu +3 more
2/3/2026

No official code found. Best implementation: Luzy2019/omis (1 star, last commit 2025-12-24).

Abstract

Opponent modeling is a longstanding research topic aimed at enhancing decision-making by modeling information about opponents in multi-agent environments. However, existing approaches often face challenges such as having difficulty generalizing to unknown opponent policies and conducting unstable performance. To tackle these challenges, we propose a novel approach based on in-context learning and decision-time search named O pponent M odeling with I n-context S earch ( OMIS ). OMIS leverages in-context learning-based pretraining to train a Trans-former model for decision-making. It consists of three in-context components: an actor learning best responses to opponent policies, an opponent imitator mimicking opponent actions, and a critic estimating state values. When testing in an environment that features unknown non-stationary opponent agents, OMIS uses pretrained in-context components for decision-time search to refine the actor’s policy. Theoret-ically, we prove that under reasonable assumptions, OMIS without search converges in opponent policy recognition and has good generalization properties; with search, OMIS provides improvement guarantees, exhibiting performance stability. Empiri-cally, in competitive, cooperative, and mixed environments, OMIS demonstrates more effective and stable adaptation to opponents than other approaches. See our project website at https://sites.google.com/view/nips2024-omis .

DOISemantic Scholar

Code Implementations(1)

Luzy2019/omisCommunity63%

source code from 【Opponent Modeling with In-context Search】

11HTML, ShellNov 20, 202510 months ago

Cite this paper

@article{jing2026opponent,
  title  = {Opponent Modeling with In-context Search},
  author = {Yuheng Jing and Bingyun Liu and Kai Li and Yifan Zang and Haobo Fu and Qiang Fu and Junliang Xing and Jian Cheng},
  year   = {2026},
  doi    = {10.52202/079017-1967},
  url    = {https://doi.org/10.52202/079017-1967},
  journal = {NEURIPS 2024 2024}
}

Discussion