Context-Aware RL for Agentic and Multimodal LLMs

Peiyang Xu, Bangzheng Li, Sijia Liu, Karthik R. Narasimhan, Pramod Viswanath, Prateek Mittal, Xingyu Fu

arXiv:2606.17053 · 2026-06-20 공개 · arXiv · PDF

reinforcement-learning grpo coding-agents data-augmentation multimodal-reasoning long-horizon-reasoning visual-question-answering context-aware-rl

Abstract

Large language models (LLMs) often fail when answering requires identifying a small but decisive piece of evidence within a long or complex context, such as a single line in a tool trace or a subtle detail in an image. We propose ContextRL, a context-aware reinforcement learning (RL) method that improves long-horizon reasoning and multimodal performance through an indirect auxiliary objective. Instead of supervising only the final answer, ContextRL presents the model with a query, an answer, and two highly similar contexts, and rewards it for selecting the context that supports the query--answer pair, thereby encouraging fine-grained grounding. We construct contrastive context data in two domains: for coding agents, trajectories serve as contexts, yielding 1k pairs built via condition filtering; for multimodal reasoning, images serve as contexts, yielding 7K pairs built via generative editing and similarity search. ContextRL achieves average gains of +2.2% over standard GRPO on 5 long-horizon benchmarks, and +1.8% across 12 diverse visual question answering benchmarks. To disentangle the effect of the proposed objective from that of additional data, we compare against data-augmentation baselines that repurpose the same contrastive contexts as standard query--context--answer examples. These baselines provide little to no improvement, showing that the gains arise from the proposed context-selection objective rather than from the contrastive data alone.

한국어 요약

한 줄 요약

ContextRL은 강화학습에 문맥 선택 목적을 추가하여 LLM의 장기적 추론과 멀티모달 성능을 개선하는 방법이다.

핵심 기여도

핵심 아이디어

기존 강화학습은 최종 답변만을 최적화하지만, ContextRL은 모델이 답변을 지지하는 문맥을 선택하도록 보상하는 보조 목적을 추가함. 이는 모델이 복잡한 문맥 내에서 결정적인 증거를 식별하도록 유도한다. 특히, 두 개의 매우 유사한 문맥 중 하나를 선택하도록 훈련함으로써, 모델이 세부적인 문맥 정착 능력을 향상시킨다. 이 접근법은 기존의 데이터 증강 방식과 구별되며, 훈련 목적 자체가 성능 향상의 핵심임을 보여준다.

기술적 접근법

주요 결과

의의 및 한계

ContextRL은 복잡한 문맥 내에서 결정적인 증거를 식별하는 능력을 향상시키는 간단한 보조 목적을 제시함. 이는 기존 강화학습에서 간과되었던 문맥 정착 문제를 해결하는 학술적 기여로, 특히 대규모 인간 라벨링 없이도 효과적임. 그러나 본 연구는 특정 벤치마크와 모델에 국한된 실험을 기반으로 하며, 다른 도메인이나 아키텍처에 대한 일반화 가능성은 명시되지 않음.

실용적 활용

ContextRL은 코드 생성 에이전트나 멀티모달 질문 답변 시스템과 같은 복잡한 정보 처리 환경에서 적용 가능하다. 특히, 정확한 문맥 기반 결정이 필요한 산업 분야(예: 의료, 법률, 자동화된 시스템 디버깅)에서 유용할 수 있다.