English static mirror for SEO/GEO · AI-assisted translation · Read Chinese original

ContextRL: Why LLMs Get Answers Right Without Knowing Which Evidence Supports Them

Forum topic · 小凯 · 2026-06-21

Summary

A Princeton and UC Davis paper (arXiv:2606.17053) identifies "context unawareness" in large language models: models frequently produce correct answers without anchoring them in the supporting evidence present in their context. Using a contrastive context probing test built from 200 agentic code-editing trajectory pairs and 200 VQA image pairs, the authors show closed-source models (GPT-5.4, Claude Opus 4.7) reliably select supporting context, while open-source models like Qwen-3/3.5 8B perform near random (~50%), a gap of up to 40 percentage points despite strong benchmark scores. ContextRL addresses this by adding a logit-level context-awareness contrastive loss to standard GRPO reinforcement learning, training models to bind answers to evidence without adding inference cost. On SWE-Bench, LiveCodeBench, LongBench v2, and Needle-in-Haystack, ContextRL yields average gains of +3.2% (Klear-AgentForge-8B) and +1.5% (Qwen3-8B), letting an 8B model outperform 30B+ models. Crucially, data-augmentation baselines (SFT, outcome-only RL) on identical contrastive data fail or collapse, showing gains stem from the training objective, not extra data.

ContextRL: Why LLMs Get Answers Right Without Knowing Which Evidence Supports Them

> Xu, P. et al. *Context-Aware RL for Agentic and Multimodal LLMs.* arXiv:2606.17053, 2026. > Princeton University, UC Davis.

Key points

  • Problem — Context Unawareness: LLMs often answer correctly without grounding predictions in the correct evidence in their context (e.g., editing the wrong code location, or answering an image question correctly while missing the decisive visual detail).
  • Diagnosis — Contrastive Context Probing: For each query and candidate answer, the model must choose between a supporting context (C+) and a highly similar distractor context (C−). Closed-source models (GPT-5.4, Claude Opus 4.7) pass reliably; Qwen-3 (VL) 8B and Qwen-3.5 9B score ~50% (near random) despite strong benchmark performance — a gap of up to 40 points.
  • Method — ContextRL: Standard GRPO RL on final outcomes, plus an auxiliary context-awareness loss: with randomized A/B ordering of C+ and C−, compute Δ = l+ − l− and L_CA = −log σ(clip(Δ, −c, c)). Joint objective: L = E[L_GRPO] + λ * E[L_CA] with λ = 0.005 optimal. The loss is computed via teacher forcing at the logit level, so inference cost is unchanged.
  • Data: 1k contrastive agent trajectories filtered from 66k SWE-Smith traces (1.5% survival) via four-level filtering (same repo/commit, file, function, semantically related but distinct issues), with patches masked as <PATCH_MASKED>; 7k multimodal pairs — ~700 edited natural images via GPT-5.4 instructions + Nano Banana 2 editing with strict artifact verification (~35% survival) and 6.3k structured-image pairs retrieved with Qwen3-VL-Embedding at cosine similarity ≥ 0.85 (~3% survival from 200k candidates).
  • Results

    | Benchmark | Type | ContextRL gain | |---|---|---| | SWE-Bench Verified / Lite | Code repair | +3.2% (Klear-AgentForge-8B) | | LiveCodeBench v6 | Competitive coding | Improved | | LongBench v2 | Long-context QA | Significant, stronger on long inputs | | Needle-in-Haystack | Retrieval | Standard GRPO degrades; ContextRL beats baseline | | 12 multimodal benchmarks | Charts, geometry, science | +2.0% (Qwen2.5-VL-7B), +1.6% (Qwen3-VL-8B) |

  • Klear-AgentForge-8B trained with ContextRL surpasses Qwen3-32B and Qwen3-Coder-30B on SWE-Bench — a targeted context-awareness objective compensates for a large scale gap.
  • Decisive ablation: on identical contrastive data, SFT augmentation collapses solve rates to 0%, and outcome-only RL shows almost no gain. Only ContextRL's context-selection objective produces consistent improvements — the gains come from the objective, not the data.
  • Technical insights

  • Indirect supervision: the auxiliary objective never tells the model the answer; it asks which evidence supports a given answer, forcing answer–evidence binding without extra inference cost and with better generalization.
  • Why baselines fail: SFT overfits the near-duplicate contrastive samples; outcome-only RL cannot distinguish lucky guesses from genuine grounding. ContextRL forces the model to find the decisive differing feature between two nearly identical contexts.
  • Modality-agnostic: the same contrastive-data + joint-RL recipe works for text agent trajectories and multimodal images, suggesting context awareness is a general cognitive capability.
  • Limitations

  • Contrastive data construction is expensive (1.5–3% survival rates, heavy GPT-5.4 verification and human review).
  • The closed-source/open-source gap raises unresolved questions about whether probing data could have leaked into closed-model training.
  • Gains of +2–3% are academically significant but may be modest for high-stakes applications; no detailed error analysis is provided.
  • Selecting the correct context does not prove genuine understanding — the model may exploit statistical shortcuts; finer attribution analysis would help.
  • Takeaway

    ContextRL surfaces a flaw hidden by benchmark scores and fixes it with a lightweight objective: don't just supervise whether the answer is right — supervise whether the model knows which evidence makes it right. For anyone building agentic, multimodal, or long-context applications: don't just look at final accuracy; ask whether your model knows *why* its correct answers are correct.

    References

  • Xu, P. et al. (2026). Context-Aware RL for Agentic and Multimodal LLMs. *arXiv:2606.17053*. Princeton University.
  • SWE-Smith: https://github.com/SWE-Smith
  • Qwen3-VL-Embedding: https://huggingface.co/Qwen

Tags

#contextrl#reinforcement-learning#grpo#llm-evaluation#agentic-ai#multimodal#contrastive-learning#benchmarks

This page is an English static mirror generated for search and AI citation. It may be a full translation or structured summary of the Chinese original. Canonical interactive discussion lives on the Chinese page: https://zhichai.net/topic/178203238