Abstract
Document Relation Extraction (DocRE) requires identifying semantic relationships between entities across multiple sentences and paragraphs. Large Language Models (LLMs) often struggle with this task in few-shot settings due to instruction overload and the complexity of structured outputs. We introduce Graph-DPEP, a framework that decomposes the extraction process into single-type queries and employs a "Graph-of-Thoughts" reasoning mechanism. By using previously extracted relations as context, Graph-DPEP enables LLMs to infer missing links through logical and coreference reasoning. Experimental results on the RE-DocRED dataset demonstrate significant improvements in recall and Macro-F1 scores across various LLMs.
Introduction
Standard Document Relation Extraction involves identifying all (Subject, Relation, Object) triplets within a text. In datasets like RE-DocRED, models must navigate nearly 100 distinct relation types. When LLMs are tasked with extracting all relations simultaneously—an "ensemble prompt" approach—they frequently suffer from low recall and formatting errors. This is primarily due to the cognitive load of processing numerous relation definitions and the difficulty of maintaining structured output for dozens of triplets.
Methodology: The Graph-DPEP Framework
Graph-DPEP addresses these challenges through a three-stage "divide and conquer" strategy:
1. Decomposed Extraction (The "Plug")
Instead of a broad search, the model is prompted to identify only one specific relation type at a time. This allows for "Type-injection Explanations," where the prompt includes a natural language definition and contextual examples for that specific relation. This focused approach leverages the LLM's internal semantic knowledge more effectively.
2. Verification and Missingness Identification
A dedicated verifier module cleans the initial output by removing redundancies and irrelevant entities. Crucially, it identifies "missing query pairs"—entity pairs present in the document that were not assigned a relation in the first pass.
3. Graph-enhanced Ensemble-Play
For identified missing pairs, the system constructs a "reasoning relation graph" from successfully extracted triplets. This sub-graph serves as a "Graph-of-Thought," providing the LLM with a mental map of existing connections to facilitate logical inference (e.g., transitivity: if A is in B and B is in C, then A is in C).
Experimental Evaluation
The framework was evaluated on the RE-DocRED dataset, which contains 4,053 documents and 96 relation types. Testing was conducted using Llama2-7B, Llama3-8B, and Mistral-7B, with comparisons against ChatGPT and specialized baselines.
Key Results
- Recall and F1 Gains: Graph-DPEP consistently outperformed standard Chain-of-Thought (COT) prompting. On Llama3, the framework achieved a Macro-F1 of 42.45, significantly higher than ChatGPT (26.30) and standard COT (16.88).
- Reasoning Capabilities: The "Ensemble-Play" stage proved particularly effective in scenarios requiring logical and coreference reasoning, where traditional models often fail to connect disparate mentions of the same entity.
- Model Robustness: The framework showed a 14.36% gain over ChatGPT in "dense" document scenarios, highlighting its effectiveness in complex information environments.
Conclusion
Graph-DPEP demonstrates that specificity and structured reasoning are key to unlocking LLM performance in complex extraction tasks. By decomposing the problem and using extracted relations as reasoning context, the framework achieves state-of-the-art few-shot performance. Future work will explore grouping similar relations to reduce computational costs while maintaining high extraction accuracy.
Summary updated