Fix Where It Fails: Root-Cause-Guided Agentic Harness Optimization for Scene Graph Generation

Jee Eun Kim, Donghyeon Choi, Sangjune An, Hae Beom Lee, Kyong Hwan JinarXiv 2026

TL;DR

Instead of retraining massive, expensive Scene Graph Generation (SGG) models when they underperform, why not just fix the code surrounding them? This paper introduces RoHa-SGG, an agentic system that uses one LLM to diagnose exactly where a model is failing (the "Root-Cause Analysis" agent) and another to write a custom "harness"—a wrapper of post-processing code and external tools—to fix it. It’s a "don't retrain, just repair" approach that boosts performance by up to 26 points while searching for solutions three times faster than unguided methods.

What Problem Does This Paper Address?

Scene Graph Generation (SGG) is the art of turning an image into a structured map of "triplets": (subject, predicate, object), like (man, riding, horse). It’s a complex pipeline involving object detection, classification, and relationship prediction.

The headache for researchers is that when a model’s accuracy drops, it’s hard to tell why. Did it miss the bounding box? Did it misidentify the object? Or did it just fail to realize those two objects were related? Standard metrics tell you that the model failed, but not which component dropped the ball.

Usually, the fix is to retrain the whole model with a new loss function or more data—a "blunt instrument" approach that is computationally expensive and often fails to address the specific bottleneck. The authors argue that we should treat the model as a frozen "black box" and instead optimize the harness: the inference code that prepares inputs, calls the model, and post-processes the results.

Methods

The authors propose RoHa-SGG (Root-cause-guided Harness optimization for SGG), which employs two specialized LLM agents in a feedback loop:

  1. The RCA (Root-Cause Analysis) Agent: This is the "doctor." It looks at the model's failures and uses Shapley values to attribute the loss in recall to five specific components: bounding boxes, object names, pair proposals, predicates, and final ranking. It then runs "interventions" (like temporarily giving the model ground-truth boxes) to confirm its diagnosis.
  2. The Proposer Agent: This is the "mechanic." Armed with the RCA's diagnosis, it searches a "harness space"—a library of potential fixes like adding external detectors (e.g., Grounding DINO), applying repeat penalties, or debiasing predicate priors. It writes candidate Python code to implement these fixes.
Figure 2. RoHa-SGG overview. (1) The RCA agent corrects components of the frozen model M’s output with ground truth and splits the missed ground-truth triplets over the components. It tests each cause with an intervention. (2) In each iteration, the proposer agent writes three candidate harnesses, at least two of which target diagnosed causes. (3) Each is reviewed, checked and scored on search images. The best harness is re-diagnosed every four iterations. (4) The harness selected on selection images is deployed around the unchanged model.

The system iterates, re-diagnosing the "best" harness found so far to see what errors remain, effectively peeling back layers of failure until the performance plateaus.

Datasets

The authors evaluated RoHa-SGG across five combinations of models and datasets:

  • Visual Genome (VG150): The standard, albeit noisy, benchmark for SGG.
  • Panoptic Scene Graph (PSG): A more recent dataset focusing on high-quality, dense relationship annotations.
  • Models: They tested three distinct architectures: REACT++ (two-stage), EGTR (one-stage), and R1-SGG (a multimodal LLM-based approach).

Key Insights and Ideas

  • Failure is Model-Specific: One of the most striking findings is how differently models fail. As shown in the heatmap below, Multimodal LLMs (MLLMs) like R1-SGG lose a massive amount of points at the box component—they are great at "talking" about relationships but struggle with precise localization. In contrast, classic models like REACT++ fail most often at the pair and rank components.
Figure 3. Where the baselines miss ground-truth triplets. Each cell gives the GC R@20 or mR@20 points that the baseline loses at that component, i.e. its Shapley share (Eq. (2)) of the gain of correcting all components with ground truth. A triplet that needs several corrections is split equally among them. VG150 uses 3,000 search and check images, and PSG uses the 790 search images with ground-truth triplets. All cells share one color scale, and bold marks the largest value per row. Each row sums to the gain of correcting all components, within about 1 point of 100 −R@20 for GC R@20.
  • The "Harness" is Powerful: You don't always need a better brain; sometimes you just need better tools. For the MLLM, the "fix" was often as simple as the Proposer agent deciding to call an external object detector to provide better boxes, rather than relying on the MLLM's internal (and flawed) coordinates.
  • Diagnosis Speeds Up Discovery: By telling the Proposer agent exactly what to fix (e.g., "the model is failing at predicate classification because of head-class bias"), the search reaches high-performing code up to 3x faster than a "blind" search that just tries random code snippets.

Key Results

RoHa-SGG improved every metric across all tested model-dataset combinations without a single gradient update to the underlying models:

  • MLLM Boost: On VG150, the multimodal LLM (R1-SGG) saw its Mean Recall (mR@100) jump by 15.2 points and its Recall (R@100) by 14.6 points.
  • Classic Model Gains: Two-stage and one-stage models saw solid improvements too, with gains of up to 10.1 points in Mean Recall.
  • Efficiency: The RCA-guided search often found the "final" best score in just 4 or 5 iterations, whereas unguided searches were still struggling at iteration 12.

Limitations and Future Work

  • API Costs: While cheaper than retraining, running high-end LLMs (like Claude 3.5 Opus) for the agents still costs between $260 and $380 per search.
  • Inference Overhead: Some fixes involve calling external models (like SAM or Grounding DINO), which can slow down inference time from milliseconds to a few seconds per image.
  • Static Evaluation: The current work focuses on the "SGDet" setting (where the model must find everything from scratch). The authors note that extending this to "PredCls" (where boxes are given) is a natural next step.
  • Single-Run Variance: The authors acknowledge that because LLM outputs can vary, the results reflect a single search run rather than a statistical average over many runs.

Summary updated

Abstract

Scene graph generation (SGG) aims to detect objects in an image and predict the relationships between them. The standard PredCls, SGCls, and SGDet settings show how much performance drops without ground-truth boxes and labels, but not where or why a model fails. Knowing this would allow fixing a model where it fails, without retraining. We propose RoHa-SGG (Root-cause-guided Harness optimization for SGG), which extends agentic harness optimization to SGG. It optimizes the harness, the inference code around a frozen SGG model. RoHa-SGG has two main LLM agents. A root-cause analysis (RCA) agent finds the components where the model fails and diagnoses why, and a proposer agent searches for a harness that fixes these causes. We evaluate RoHa-SGG on Visual Genome and PSG with representative two-stage, one-stage, and multimodal-LLM SGG models. The analysis shows that the components where ground-truth triplets are lost differ across models and datasets. RoHa-SGG improves every metric on all five model-dataset combinations. Graph-constrained R@100 and mR@100 rise by up to 15.8 and 26.4 points for the multimodal LLM and by up to 3.6 and 10.1 points for the two-stage and one-stage models. With root-cause guidance, the harness search reaches the final score of an unguided search up to three times faster.
BibTeX
@misc{kim2026fix,
  author = {Jee Eun Kim and Donghyeon Choi and Sangjune An and Hae Beom Lee and Kyong Hwan Jin},
  title = {{Fix Where It Fails: Root-Cause-Guided Agentic Harness Optimization for Scene Graph Generation}},
  year = {2026},
  eprint = {2611.27529},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.27529},
}
Figure