R1-RE: Cross-Domain Relationship Extraction with RLVR

Runpeng Dai, Tong Zheng, Run Yang, Hongtu ZhuarXiv 2025

Abstract

Relation extraction (RE) is a core task in natural language processing. Traditional approaches typically frame RE as a supervised learning problem, directly mapping context to labels—an approach that often suffers from poor out-of-domain (OOD) generalization. Inspired by the workflow of human annotators, we reframe RE as a reasoning task guided by annotation guidelines and introduce R1-RE, the first reinforcement learning with verifiable reward (RLVR) framework for RE tasks. Our method elicits the reasoning abilities of small language models for annotation tasks, resulting in significantly improved OOD robustness. We evaluate our approach on the public Sem-2010 dataset and a private MDKG dataset. The R1-RE-7B model attains an average OOD accuracy of approximately 70%, on par with leading proprietary models such as GPT-4o. Additionally, our comprehensive analysis provides novel insights into the training dynamics and emergent reasoning behaviors of the RLVR paradigm for RE.

Introduction

Relation Extraction (RE) involves identifying semantic relationships between entities in text, such as "Treatment-for" or "Cause-Effect." This task is fundamental for constructing Knowledge Graphs. However, standard RE models often exhibit a significant "generalization gap." While they may perform well on datasets similar to their training data (e.g., news articles), their performance typically degrades when applied to new domains (e.g., medical literature).

This failure stems from the nature of traditional Supervised Fine-Tuning (SFT), which encourages models to memorize specific surface patterns and labels rather than learning the underlying logic of the extraction task. In contrast, human annotators follow a systematic reasoning process: they consult guidelines, formulate hypotheses, and verify them against the context. R1-RE aims to bridge this gap by teaching small, open-source LLMs to emulate this human-like reasoning.

Methods

The R1-RE framework leverages Reinforcement Learning with Verifiable Reward (RLVR) using the Group Relative Policy Optimization (GRPO) algorithm. This approach shifts the model's objective from simple label prediction to a multi-step reasoning process.

Comparison of traditional classification, SFT, and the human-inspired reasoning process.

Key methodological components include:

  • Reasoning-Guided Prompting: Models are provided with full annotation guidelines and required to output their reasoning within <think> tags before providing a final answer in <answer> tags.
  • Multi-stage Reward Design: A Format Reward ensures adherence to the structured output format, while a Metric Reward provides feedback based on the correctness of the final relation classification.
  • Iterative Verification: The RL process encourages the model to identify entities and validate candidate relations against definitions, mimicking the expert human workflow.

The study evaluated R1-RE using the public SemEval-2010 Task 8 benchmark and a private Mental Disease Knowledge Graph (MDKG) dataset to rigorously test out-of-domain robustness.

Key Results

The R1-RE-7B model, based on the Qwen-2.5-7B architecture, demonstrated remarkable performance, particularly in cross-domain scenarios.

Performance comparison of R1-RE-7B against various model sizes and proprietary models.
  • Superior Generalization: R1-RE-7B achieved an average OOD accuracy of approximately 70% on the MDKG dataset, outperforming its base model (Qwen-2.5-7B-Instruct) by over 30 percentage points.
  • Competitive with Proprietary Models: Despite its smaller size, the 7B model achieved parity with giants like GPT-4o and GPT-4.1-mini on the private medical dataset.
  • Reasoning vs. Memorization: Analysis showed that as training progressed, the model's response length increased, correlating with more rigorous verification steps and higher accuracy. Unlike SFT, which often leads to "catastrophic forgetting" of general skills, R1-RE maintained or improved performance on general benchmarks like MATH-500.
  • Benchmark Integrity: The results suggest that proprietary models may benefit from benchmark leakage on public datasets like Sem-2010. The performance drop of these models on the private MDKG dataset highlights the importance of OOD testing on non-public data.

Conclusion

R1-RE demonstrates that RLVR can effectively elicit reasoning capabilities in small LLMs, leading to state-of-the-art out-of-domain performance in relation extraction. While currently focused on Relation Classification, future work will extend this framework to more complex tasks like Triplet Extraction, which involves simultaneous entity and relation identification. Scaling the R1-RE approach to larger model sizes also remains a promising avenue for further performance gains.

Summary updated

BibTeX
@misc{dai2025r,
  author = {Runpeng Dai and Tong Zheng and Run Yang and Hongtu Zhu},
  title = {{R1-RE: Cross-Domain Relationship Extraction with RLVR}},
  year = {2025},
  eprint = {2507.04642},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2507.04642},
}
Figure