Context-Aware RL for Agentic and Multimodal LLMs

📄 arXiv: 2606.17053v1 📥 PDF

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

分类: cs.CL, cs.CV

发布日期: 2026-06-15

备注: 29 pages, 9 figures


💡 一句话要点

提出ContextRL以解决长时推理和多模态性能不足问题

🎯 匹配领域: 支柱二:RL算法与架构 (RL & Architecture) 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 长时推理 多模态学习 强化学习 上下文感知 视觉问答 数据增强 模型训练

📋 核心要点

  1. 现有大型语言模型在处理复杂上下文时,常常无法有效识别关键证据,导致推理能力不足。
  2. 本文提出的ContextRL方法通过上下文选择的强化学习策略,增强模型的长时推理和多模态理解能力。
  3. 实验结果表明,ContextRL在多个基准测试中显著提升了模型性能,验证了其有效性。

📝 摘要(中文)

大型语言模型(LLMs)在回答需要识别长或复杂上下文中的小而关键证据时常常失败,例如工具跟踪中的单行或图像中的细微细节。本文提出ContextRL,一种上下文感知的强化学习方法,通过间接辅助目标改善长时推理和多模态性能。ContextRL不仅监督最终答案,还通过提供查询、答案和两个高度相似的上下文,奖励模型选择支持查询-答案对的上下文,从而鼓励细粒度的基础。我们在两个领域构建了对比上下文数据:对于编码代理,轨迹作为上下文,生成了1000对;对于多模态推理,图像作为上下文,生成了7000对。ContextRL在5个长时基准上平均提升2.2%,在12个多样化视觉问答基准上提升1.8%。

🔬 方法详解

问题定义:本文旨在解决大型语言模型在长时推理和多模态任务中对关键证据识别不足的问题。现有方法往往只关注最终答案,忽视了上下文的重要性,导致推理能力受限。

核心思路:ContextRL通过引入上下文选择的强化学习机制,鼓励模型在给定查询和答案的情况下,选择最相关的上下文,从而提升推理的准确性和细致度。这样的设计旨在通过间接的辅助目标,促进模型对上下文的细粒度理解。

技术框架:ContextRL的整体架构包括数据构建、模型训练和评估三个主要阶段。在数据构建阶段,分别为编码代理和多模态推理生成对比上下文数据;在模型训练阶段,利用强化学习算法优化模型选择上下文的能力;最后在评估阶段,通过多个基准测试验证模型性能。

关键创新:ContextRL的主要创新在于其上下文选择的强化学习目标,这一目标与传统的直接监督学习方式有本质区别。通过奖励机制,模型能够更好地理解和利用上下文信息。

关键设计:在模型设计中,ContextRL采用了特定的损失函数来平衡奖励与惩罚,并通过条件过滤和生成编辑等技术手段构建对比上下文数据,确保数据的高质量和相关性。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果显示,ContextRL在5个长时基准测试中平均提升了2.2%,在12个视觉问答基准测试中提升了1.8%。与数据增强基线相比,ContextRL的改进主要源于其上下文选择目标,而非仅仅依赖对比数据。

🎯 应用场景

该研究的潜在应用领域包括智能助手、自动编码、视觉问答系统等。通过提升模型在复杂上下文中的推理能力,ContextRL可以在实际应用中提供更准确的答案和更好的用户体验,未来可能推动多模态AI的发展。

📄 摘要(原文)

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 \emph{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.