TL;DR
R1-SGG is an end-to-end framework that uses Group Relative Policy Optimization (GRPO) to teach Multimodal Large Language Models (M-LLMs) how to generate structured scene graphs directly from raw images. By designing rule-based, graph-centric rewards aligned directly with scene graph evaluation metrics, R1-SGG slashes structural formatting failure rates to near-zero and significantly outperforms both traditional decoupled pipelines and standard supervised fine-tuning—particularly on rare, long-tail visual relationships.
What Problem Does This Paper Address?
Scene Graph Generation (SGG) aims to convert an image into a structured graph consisting of entities (nodes with bounding boxes) and their pairwise interactions (directed relation edges, e.g., $\langle \text{person}, \text{riding}, \text{horse} \rangle$).
Traditional SGG frameworks decouple this task into separate object detection and relation classification stages. Consequently, they tend to overfit heavily to training distributions, collapsing toward dominant "head" relationships (e.g., classifying almost everything as "on" or "of").
While modern M-LLMs have strong visual and linguistic reasoning capabilities, applying them to end-to-end SGG is notoriously difficult:
- Formatting and grounding failures: Zero-shot M-LLMs frequently fail to output valid JSON, hallucinate bounding box coordinates, or repeat object tokens endlessly.
- The limitation of Supervised Fine-Tuning (SFT): SFT treats all tokens equally via cross-entropy loss. It offers no direct mechanism to optimize non-differentiable structured metrics, such as bounding box Intersection over Union (IoU) thresholds or relational triplet recall.
Methods
The authors introduce R1-SGG, an end-to-end training framework combining visual instruction tuning (SFT) with Group Relative Policy Optimization (GRPO):
- Supervised Warm-Start (SFT): Fine-tunes the base model (Qwen2-VL-2B / 7B) on image-graph pairs to learn basic schema output formatting and entity detection.
- Reinforcement Learning with GRPO: Samples multiple candidate scene graph predictions per image and computes advantage relative to group performance—avoiding the overhead of a separate critic network.
- Reward Engineering:
- Format Consistency Reward: A binary reward ensuring the model produces the
<think>...</think><answer>...</answer>structure containing proper JSON keys ("objects"and"relationships"). - Graph-Centric Rewards: The authors evaluate three formulations:
- Hard Recall (Primary): A triplet is rewarded only if subject, predicate, and object classes match ground truth and both bounding boxes have $\text{IoU} > 0.5$.
- Hard Recall + Relax: Softens exact label matching by incorporating cosine similarity over semantic text embeddings.
- Soft Recall: Computes dense matching via bipartite graph matching (inspired by DETR), penalizing bounding box $L_1$ distance and label embedding discrepancy.
[ Input Image + Prompt ]
│
▼
[ M-LLM Policy π_θ ]
│ (Samples G candidates)
▼
┌─────────────────────────────┐
│ Rule-Based Rewards │
│ ├─ Format Reward (JSON/Tags)│
│ └─ Hard Recall (IoU > 0.5) │
└──────────────┬──────────────┘
│
▼
[ GRPO Policy Update ]
Datasets
The authors benchmarked R1-SGG on two established standard SGG datasets without introducing new benchmarks:
- VG150 (Visual Genome benchmark): 150 object classes and 50 relation predicates. Comprises 56,224 training pairs and 5,000 validation pairs under the standard Scene Graph Detection (
SGDET) protocol. - PSG (Panoptic Scene Graph): Built on COCO, covering 80 "thing" classes, 53 "stuff" classes, and 56 relations (46,563 training images, 2,186 test images).
Key Insights and Ideas
- Metric Alignment Trumps Reward Density: Counterintuitively, the sparse Hard Recall reward outperformed denser alternatives (Soft Recall and Relaxed Recall). While dense rewards offer smoother policy gradients, directly optimizing the strict, discrete evaluation target prevents reward hacking and aligns model behavior directly with downstream benchmarks.
- RL Radically Eliminates Formatting Failures: On VG150 with a 2B model, SFT still suffered from a massive 72.42% structural failure rate. RL training drove the failure rate down to 0.10% (and 0.08% for the 7B model), enforcing strict syntax adherence.
- The SFT-RL Initialization Trade-Off: Initializing RL from an SFT checkpoint (R1-SGG) yields the highest in-domain recall and detection precision. However, training with RL from scratch (R1-SGG-Zero) demonstrated better cross-dataset generalization (e.g., VG150 $\rightarrow$ PSG), because SFT causes the model to overfit to dataset-specific vocabulary distributions.
- Removing KL Divergence Regularization Helps: Setting the KL coefficient $\beta = 0$ stabilized training and accelerated failure rate reduction compared to standard PPO-style KL constraints.
Key Results
Under the standard SGDET evaluation setting (predicting bounding boxes, categories, and predicates simultaneously from scratch):
- VG150 Benchmark:
- R1-SGG (7B) attained 19.47 AP@50, 23.75% Recall, and 11.43% mean Recall (mRecall), with only a 0.08% failure rate.
- In contrast, Qwen2-VL-7B + SFT achieved only 9.62% Recall, 3.30% mRecall, and had a 39.54% failure rate.
- Proprietary M-LLMs (GPT-4o, Gemini 2.0 Flash) failed completely in zero-shot
SGDETsettings (0.00% to 0.10% Recall). - Traditional specialized detectors (e.g., MOTIFS at 7.84% mRecall, OvSGTR at 5.83% mRecall) were substantially outperformed in mRecall, indicating that R1-SGG successfully recovers rare, long-tail relations.
- PSG Benchmark:
- R1-SGG (7B) achieved 43.48% Recall and 33.71% mRecall (compared to SFT's 24.73% Recall and 17.11% mRecall), reducing the formatting failure rate to 0.00%.
Limitations and Future Work
- Failure to Naturally Induce Chain-of-Thought (CoT): Simply providing
<think>tags and rule-based rewards was insufficient to trigger natural intermediate visual reasoning; models often skipped generating reasoning traces. The authors note that explicit SFT on CoT-annotated data is likely required. - Sampling Length Bottlenecks: Expanding sampling lengths from 1,024 to 2,048 tokens did not improve accuracy and expanded the search space unnecessarily, echoing known test-time scaling limits.
- Computational Cost: RL training required substantial compute (16 NVIDIA GH200 GPUs with vLLM acceleration).
- Prompt Dependency: Providing predefined label sets directly inside the input prompt remains necessary to guide model outputs toward closed-world evaluation protocols.
Summary updated