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

CodRED: A Cross-Document Relation Extraction Dataset for Acquiring Knowledge in the Wild

Yuan Yao, Jiaju Du, Yankai Lin, Peng Li, Zhiyuan Liu, Jie Zhou, Maosong Sun

Abstract

CodRED is the first human-annotated dataset designed for cross-document relation extraction (RE), a task that requires models to infer relationships between entities that never appear within the same document. While traditional RE systems focus on intra-sentence or intra-document links, real-world knowledge is often fragmented. CodRED provides over 30,000 relational facts and their corresponding reasoning paths, challenging AI to perform sophisticated multi-hop reasoning and document retrieval "in the wild."

Introduction

Most existing Relation Extraction (RE) systems are limited to finding links between entities within a single sentence or document. However, the authors observe that in Wikidata, over 57.6% of relational facts involve entity pairs that never co-occur in a single Wikipedia document. To acquire such knowledge, a system must move beyond simple pattern matching and perform two complex operations: retrieving relevant documents for disparate entities and identifying "bridging entities" that connect them across those texts.

The Challenge of Cross-Document Reasoning

To bridge the gap between isolated documents, a model must find a path through intermediate entities. For example, if Document 1 states that Entity A is the son of Entity C, and Document 2 states that Entity B is also the son of Entity C, a model must infer that A and B are siblings.

Illustration of cross-document relation extraction where a bridging entity connects two disparate entities across multiple documents.

Existing benchmarks like DocRED or TACRED do not capture this multi-document complexity, often allowing models to rely on "reasoning shortcuts"—guessing relations based on entity names rather than textual evidence.

Methodology

The authors constructed CodRED using a rigorous three-stage pipeline:

  1. Distant Supervision & Filtering: Wikipedia was aligned with Wikidata to find potential facts, followed by manual filtering to remove "noisy" reasoning chains.
  2. Human Annotation: Crowdworkers labeled 210,812 reasoning paths, identifying specific evidence sentences to provide "strong supervision."
  3. Adversarial Negative Generation: To prevent models from memorizing entity pairs, "hard" negative instances were created by replacing one entity in a valid path with a similar but unrelated one.

Two baseline architectures were evaluated: a Pipeline Model, which extracts relational graphs per document before linking them, and an End-to-End Model, which uses a BERT-based encoder to process concatenated text snippets with a selective attention mechanism.

Dataset Characteristics

The CodRED dataset consists of 30,504 relational facts across 276 relation types. It is significantly more complex than previous benchmarks; documents in CodRED average 2,416 words, compared to just 198 words in DocRED. Evaluation is conducted in two settings:

  • Closed Setting: Relevant documents are provided to the model.
  • Open Setting: The model must retrieve relevant documents from the entirety of English Wikipedia.

Experimental Results

The results highlight that cross-document RE remains a formidable challenge for current NLP architectures. The end-to-end approach consistently outperformed the pipeline method, particularly in the closed setting.

Performance comparison of Pipeline and End-to-end models across Closed and Open settings on the CodRED Dev and Test sets.

As shown in the table above, the End-to-end model achieved an F1 score of 51.02 in the closed test setting, nearly 20 points higher than the Pipeline model. However, performance drops significantly in the Open setting (F1 of 45.06), underscoring the "retrieval bottleneck" where finding the correct documents is as difficult as the reasoning itself.

Key Insights and Limitations

  • Context over Names: Adversarial negatives proved that standard models are often "lazy." When forced to rely on text rather than entity memorization, performance drops, highlighting the need for deeper natural language understanding.
  • The Bridging Problem: On average, there are 4.7 potential bridging entities between documents, requiring models to ignore numerous "distractors" to find the logical link.
  • Future Work: The authors identify several hurdles, including the need for more efficient retrieval methods and strategies for long-range reasoning beyond the two-hop paths currently featured in CodRED. Additionally, processing documents with thousands of words remains a challenge for standard transformer-based encoders with limited token windows.

Summary updated

BibTeX
@inproceedings{yao2021codred,
  author = {Yuan Yao and Jiaju Du and Yankai Lin and Peng Li and Zhiyuan Liu and Jie Zhou and Maosong Sun},
  title = {{CodRED: A Cross-Document Relation Extraction Dataset for Acquiring Knowledge in the Wild}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2021},
  doi = {10.18653/v1/2021.emnlp-main.366},
}
Figure