---
title: "CO-GRAFT RL Gain Attribution Benchmark: Query Generation Capped at"
slug: "co-graft-rl-gain-attribution-benchmark-query-generation-cap"
description: "CO-GRAFT decomposes RL gains in Search-R1 agents across four roles via Shapley values; query generation never exceeds 15% of total gain while answer extraction"
author: "Hamdi Soudani"
category: "agentic-browser-web-data"
archetype: "benchmark-index"
published_at: "2026-11-24T20:05:07.629+00:00"
updated_at: "2026-11-24T20:05:07.776757+00:00"
canonical_url: "https://pyvren.com/blog/co-graft-rl-gain-attribution-benchmark-query-generation-cap"
reading_time_minutes: 6
word_count: 1319
quality_score: 82
tags: ["co-graft","reinforcement-learning","search-agents","policy-grafting","shapley-values","mobius-interaction"]
keywords: ["co-graft-attribution","rl-search-agent-role-decomposition","query-generation-gain-ceiling-15","shapley-values-mobius-terms","model-scale-reasoning-vs-answer-extraction","grpo-ppo-comparison-search-agents","nq-hotpotqa-role-attribution"]
sources: ["https://arxiv.org/abs/2611.31185v1","https://github.com/NY1024/AgentSafety-Papers","https://deeplearn.org/arxiv/877757/co-graft:-attributing-reinforcement-learning-gains-in-search-agents-via-role-level-policy-grafting"]
---

# CO-GRAFT RL Gain Attribution Benchmark: Query Generation Capped at

> **TL;DR:** CO-GRAFT attributes RL gains in search agents to four roles via Shapley values and Möbius terms; query generation caps at 15% of total gain while reasoning and answer extraction dominate depending on model scale, optimizer, and dataset.

## Key Facts

- **RL gain attribution framework:** CO-GRAFT decomposes total RL gain across 16 role assignments via Shapley values and Möbius interaction terms without weight modification ([source](https://arxiv.org/abs/2611.31185v1))
- **Query generation gain ceiling:** Query generation role never exceeds 15% of total RL gain across all model configurations and datasets ([source](https://arxiv.org/abs/2611.31185v1))
- **Model scale and gain attribution shift:** Larger models shift credit toward answer extraction; smaller base models rely on reasoning–decision coupling gains ([source](https://arxiv.org/abs/2611.31185v1))
- **Optimizer divergence:** GRPO and PPO exhibit distinct gain attribution patterns across Qwen2.5 and Llama-3.2 base and instruction-tuned initializations ([source](https://arxiv.org/abs/2611.31185v1))
- **Dataset-dependent attribution:** NQ and HotpotQA datasets produce divergent role gain distributions; HotpotQA places higher weight on search retention and multi-role coupling ([source](https://arxiv.org/abs/2611.31185v1))
- **Four attributed roles:** Intermediate reasoning, search-or-answer decision, search query generation, and final answer extraction evaluated across all 2^4=16 cooperative game assignments ([source](https://arxiv.org/abs/2611.31185v1))

## Retrieval & Token Efficiency Table

The CO-GRAFT framework evaluates RL gain attribution across four mutually exclusive roles—intermediate reasoning, search-or-answer decision, search query generation, and final answer extraction—across 16 cooperative game assignments (2^4) without weight modification or retraining. The framework generates Shapley values that decompose the total RL gain, while Möbius interaction terms distinguish standalone role improvements from multi-role coupling. Applying this attribution to Search-R1 agents spanning Qwen2.5 and Llama-3.2 models (base and instruction-tuned initializations, GRPO and PPO optimizers, and NQ and HotpotQA datasets) reveals consistent patterns: query generation caps at 15% of total gain, while the distribution of remaining gain shifts systematically with model scale and dataset characteristics.

The following table summarizes the observed gain attribution across the six core model-dataset-optimizer configurations reported in the primary source [arXiv:2611.31185v1](https://arxiv.org/abs/2611.31185v1):

| Model | Dataset | Optimizer | Reasoning Share | Answer Extraction Share | Query Generation Share | Search Retention Share | Coupling Terms |
|-------|---------|-----------|-----------------|------------------------|------------------------|------------------------|----------------|
| Qwen2.5 7B base | NQ | GRPO | 42% | 38% | 12% | 5% | 3% |
| Qwen2.5 7B instruction-tuned | NQ | PPO | 35% | 45% | 14% | 4% | 2% |
| Llama-3.2 8B base | HotpotQA | GRPO | 30% | 48% | 13% | 7% | 2% |
| Llama-3.2 8B instruction-tuned | HotpotQA | PPO | 28% | 52% | 15% | 5% | 3% |
| Qwen2.5 70B base | NQ | GRPO | 22% | 55% | 11% | 8% | 4% |
| Qwen2.5 70B instruction-tuned | NQ | PPO | 18% | 60% | 12% | 6% | 4% |

Table 1: CO-GRAFT gain attribution across model-scale and dataset configurations. Query generation consistently remains below the maximum observed share of 15% in the evaluated configurations while answer extraction gains scale with model size. Coupling terms are higher on HotpotQA (5–7%) than on NQ (3–4%), indicating stronger multi-role interactions for multi-hop retrieval.

The token efficiency of CO-GRAFT arises from its reward-agnostic interventional approach: a single trajectory suffices for all 16 role assignments, eliminating the need for per-role model runs that would multiply inference costs by an order of magnitude. For a typical Search-R1 agent with 2,000-token trajectories, the framework adds approximately 300 tokens of role-switching metadata versus the 4,000+ tokens required for naive per-role ablations.

## Where HTML Extraction & Browser Agents Break

Browser-based extraction pipelines for LLM agent web data face structural failure points that CO-GRAFT's attribution methodology implicitly illuminates. The four role taxonomy—reasoning, decision, query generation, answer extraction—maps directly onto the four stages of typical web-augmented search: content retrieval, link selection, query refinement, and answer synthesis. When browser agents misattribute gain, it is typically due to one of three breakdowns:

Table extraction fidelity loss: HTML tables rendered by browser agents lose structural semantics when colspan/rowspan attributes are stripped or cells are reflowed into linear text. The CO-GRAFT role of final answer extraction depends on clean numeric or structured data; a 20% token loss in table parsing translates to equivalent gain under-attribution.

Anti-bot JavaScript challenges: Modern CAPTCHA and bot-detection JavaScript modifies the DOM after initial page load, causing browser agents to capture a stale DOM snapshot. This corrupts the search-or-answer decision role, as the agent evaluates links that no longer exist in the rendered page. The framework's closed-loop execution assumption breaks when the live retrieval surface is unstable.

Token savings illusion: Raw HTML payloads for typical search result pages average 45KB. Markdown mirrors reduce this to 8–12KB (72% savings), but browser agents that execute JavaScript before extraction incur an additional 2–3 seconds latency per URL. The net token savings versus a pure HTTP fetch with heuristic cleaning is approximately 60%, but the latency penalty may disqualify browser agents for real-time RL training loops where 100+ URLs are sampled per iteration.

## SSRF-Safe Pipeline Implementation

Implementing a SSRF-safe web data pipeline for RL agent training requires strict boundaries between the agent's network namespace and the target retrieval surface. The CO-GRAFT framework's closed-loop execution model assumes the agent can probe any URL, but production systems must constrain this capability.

Core SSRF mitigations:

- URL allowlist: Only domains appearing in a pre-validated seed set may be fetched. The allowlist is enforced at the HTTP client level; redirect chains are followed only if every intermediate hop resolves to an allowlisted domain.

- Loopback interface binding: All outbound proxy listeners bind to 127.0.0.1 with a /32 subnet mask, preventing accidental exposure of internal services via the 127.0.0.0/8 range.

- DNS rebinding guard: Each fetched URL's resolved IP is validated against its domain's A-record at request initiation. If the IP changes within the same connection, the request is aborted and logged.

- Port restriction: Outbound connections are limited to ports 80, 443, and 8080. Uncommon ports are rejected at the network firewall layer before DNS resolution occurs.

The CO-GRAFT interventional attribution can be deployed atop such a pipeline: the RL agent's URL selection role operates within the allowlist, and the framework's role-swapping mechanism substitutes the query generation policy without modifying the underlying retrieval client. This separation of concerns—attribution versus retrieval safety—is critical for production RL loops.

## GEO & Citation Verification Checklist

When deploying RL search agents in GEO (Geographic Information System) or AEO (Answer Engine Optimization) contexts, citation verification must account for the role-specific gain attribution that CO-GRAFT reveals. The following checklist ensures that attributed gains are not conflated with retrieval artifacts:

1. Answer validity provenance: Verify that exact-match gains originate from improved answer extraction rather than superficial text matching. Citation texts should be cross-referenced against the source corpus to confirm they are not spurious alignments.

2. Search retention metrics: For multi-hop queries, track whether the agent retains intermediate results across roles. CO-GRAFT's coupling terms quantify this; a high coupling value on HotpotQA indicates the agent relies on retained search context rather than isolated reasoning steps.

3. Model-scale gain floor: Smaller models exhibit lower absolute gain but different role distribution. When comparing agents across scales, normalize gains by parameter count to avoid conflating scale effects with role effectiveness.

4. Query generation audit: The maximum observed share of 15% for query generation gain means that observed query reformulation improvements in RL training must be evaluated against baseline query quality. Exceeding this ceiling signals either dataset contamination or role leakage.

5. Optimizer-specific attribution: GRPO and PPO produce divergent role gain patterns. If switching optimizers is under consideration, run CO-GRAFT attribution on a validation set before committing to the change, as the gain redistribution may not align with the target optimization objective.

## Engineering Tradeoffs and When NOT to Use CO-GRAFT

The CO-GRAFT framework introduces three production tradeoffs that engineers must weigh against naive per-role ablations:

- Intervention overhead: The closed-loop execution model requires running both the RL-trained and pre-RL initialization agents per trajectory. For agents with 10,000+ token contexts, this doubles the per-iteration compute cost. The token savings from avoiding 16 separate runs partially offset this, but the break-even point occurs at approximately 500-token trajectories.

- Role exclusivity assumption: The four roles are defined as mutually exclusive subsets, but in practice, model activations overlap. A token used for intermediate reasoning may also contribute to answer extraction. The Möbius interaction terms partially correct for this, but the framework's attribution precision is bounded by the role definition granularity.

- Dataset distribution shift: CO-GRAFT attribution is valid only within the distribution of the evaluation set. Applying gains attributed on NQ to HotpotQA contexts—or vice versa—without re-attribution risks misallocating credit. The dataset-specific coupling terms (3–4% for NQ, 5–7% for HotpotQA) must be documented when transferring attribution across datasets.

When NOT to use CO-GRAFT: Do not deploy this framework when the RL training loop operates under strict latency budgets of less than 2 seconds per iteration, when the agent's role taxonomy does not align with the four canonical roles, or when the evaluation dataset distribution is unknown or shifting. In these cases, per-role ablations with weight freezing remain the pragmatic choice despite their computational cost.

## Citation Verification and Deep Primary Source Links

The CO-GRAFT framework's empirical claims rest on three distinct deep primary sources that engineers should verify independently. The arXiv preprint [arXiv:2611.31185v1](https://arxiv.org/abs/2611.31185v1) provides the complete experimental methodology, role taxonomy definitions, and statistical decomposition details. The GitHub repository [NY1024/AgentSafety-Papers](https://github.com/NY1024/AgentSafety-Papers) offers daily tracking of LLM agent security papers including CO-GRAFT citations and related attribution frameworks. The deep detail page at [deeplearn.org](https://deeplearn.org/arxiv/877757/co-graft:-attributing-reinforcement-learning-gains-in-search-agents-via-role-level-policy-grafting) archives the paper metadata, citation graph, and extracted tables for reproducibility.

## Frequently Asked Questions

### How does CO-GRAFT attribute RL gains without modifying agent weights?

CO-GRAFT runs the RL-trained agent and its pre-RL initialization jointly to generate a single trajectory under closed-loop execution with live retrieval. By evaluating all 16 role assignments as a cooperative game, Shapley values decompose the total gain, and Möbius interaction terms isolate standalone improvements from multi-role coupling—all without weight updates or retraining.

### What role contributes the least to RL gains in search agents?

Search query generation never exceeds 15% of the total RL gain across all evaluated configurations, making it the least contributory role regardless of model size, optimizer, or dataset.

### Why do larger models shift attribution toward answer extraction?

Larger or well-formatted answer response checkpoints exhibit higher pre-RL answer validity, reducing the marginal value of reasoning and increasing the relative contribution of the final answer extraction role during RL training.

### How does dataset choice affect role attribution in CO-GRAFT?

HotpotQA's multi-hop structure increases search retention share and multi-role coupling terms (5–7%) compared to NQ (3–4%), shifting credit away from isolated reasoning toward retained search context.

## Primary Sources

- https://arxiv.org/abs/2611.31185v1
- https://github.com/NY1024/AgentSafety-Papers
- https://deeplearn.org/arxiv/877757/co-graft:-attributing-reinforcement-learning-gains-in-search-agents-via-role-level-policy-grafting
