NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

LLM with Relation Classifier for Document-Level Relation Extraction

Xingzuo Li, Kehai Chen, Yunfei Long, Min Zhang · DOI

Abstract

Large Language Models (LLMs) have demonstrated remarkable capabilities across various natural language processing tasks but continue to lag behind specialized BERT-based models in Document-Level Relation Extraction (DocRE). This performance gap is primarily attributed to the extreme data distribution skew in DocRE datasets, where over 96% of entity pairs share no relation (NA), causing LLMs to suffer from "attention dispersion." We propose LMRC (LLM with Relation Classifier), a two-stage framework that utilizes a lightweight neural classifier to filter out irrelevant entity pairs before performing fine-grained classification with a fine-tuned LLM. Our approach significantly improves performance, achieving an F1 score of 60.69 on the DocRED benchmark and 72.93 on Re-DocRED, effectively narrowing the gap with state-of-the-art specialized architectures.

Introduction

Document-Level Relation Extraction (DocRE) involves identifying semantic connections between entities across an entire document, requiring complex reasoning over long distances and coreference resolution. While LLMs are powerful reasoners, their performance on standard benchmarks like DocRED is hindered by the sheer volume of candidate entity pairs. In a document with $n$ entities, there are $n(n-1)$ possible pairs, the vast majority of which are non-relational.

Distribution of entity pairs in DocRED and Re-DocRED benchmarks, highlighting the extreme prevalence of 'NA' (no relation) pairs compared to relational pairs.

This "noise" distracts the LLM's attention, leading to conservative labeling and poor recall. The authors identify this "data distribution skew" as the primary culprit for LLM underperformance. LMRC addresses this by pruning the candidate space, allowing the model to focus its reasoning power on promising candidates.

Methodology

LMRC decomposes the DocRE task into two distinct stages: Relation Candidate Proposal (RCP) and Relation Classification (RC).

The LMRC framework: RCP uses a lightweight encoder to filter candidates, while RC uses a fine-tuned LLM for final relation classification.
  1. Relation Candidate Proposal (RCP): A RoBERTa-large encoder is employed as a binary classifier to identify pairs likely to hold a relation. It utilizes "localized context pooling" to focus on specific entity mentions and their mutual attention weights. This stage transitions the complexity from $O(n^2)$ to a much smaller linear set of candidates.
  2. Relation Classification (RC): The filtered candidates are passed to an LLM (e.g., LLaMA-2, LLaMA-3) fine-tuned via Low-Rank Adaptation (LoRA). By focusing only on promising pairs, the LLM can dedicate its reasoning capacity to identifying specific relation types (e.g., "place of birth" vs. "employer").

Results and Discussion

The framework was evaluated on the DocRED and Re-DocRED benchmarks. Key results include:

  • Performance Gains: Integrating the RCP stage led to a massive jump in F1 scores. For LLaMA-2-13B, direct fine-tuning yielded an F1 of ~39, which jumped to 60.52 under the LMRC framework. LLaMA-3.1-8B achieved a state-of-the-art result for LLMs with 60.69 F1 on DocRED and 72.93 on Re-DocRED.
  • Efficiency: Beyond accuracy, the RCP stage drastically reduces the number of inputs sent to the LLM, saving significant inference time and API costs.
  • Attention Focus: Empirical results support the "Attention Dispersion" hypothesis, showing that filtering "NA" pairs allows the LLM's internal attention mechanisms to focus on relevant context rather than being drowned out by noise.
  • GPT-4 Validation: Even when using GPT-4 as the reasoning engine, the LMRC filtering strategy improved its F1 score from ~10 to over 36 on a sampled subset.

Conclusion

LMRC demonstrates that the primary hurdle for LLMs in DocRE is the data distribution skew rather than a lack of reasoning ability. By combining lightweight filtering with the high-level reasoning of fine-tuned LLMs, we can achieve performance comparable to specialized models. Future work will focus on mitigating the RCP bottleneck—where missed relations in the first stage cannot be recovered—and improving performance on long-tail relation types that appear infrequently in training data.

Summary updated

BibTeX
@misc{li2024llm,
  author = {Xingzuo Li and Kehai Chen and Yunfei Long and Min Zhang},
  title = {{LLM with Relation Classifier for Document-Level Relation Extraction}},
  year = {2024},
  eprint = {2408.13889},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2408.13889},
}
Figure