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

DocKS-RAG: Optimizing Document-Level Relation Extraction through LLM-Enhanced Hybrid Prompt Tuning

Xiaolong Xu, Yibo Zhou, Haolong Xiang, Xiaoyong Li, Xuyun Zhang, Lianyong Qi, Wanchun Dou

TL;DR

DocKS-RAG is a novel framework that significantly boosts document-level relation extraction by combining structural knowledge graphs with semantic retrieval-augmented generation (RAG). By feeding these "hybrid prompts" into a fine-tuned LLaMA3 model, the system can identify complex, implicit relationships between entities that span across multiple sentences—outperforming current state-of-the-art methods on major benchmarks.

The Challenge of Document-Level Relation Extraction

Relation Extraction (RE) is the task of turning raw text into structured data, specifically "triplets" like (Wisconsin — state of — US). While AI has become quite proficient at doing this within a single sentence, document-level RE remains a major hurdle.

In a long document, a subject and its corresponding object might be separated by several paragraphs. Furthermore, many relations are "implicit"—they aren't stated directly but must be inferred from the broader context. Existing models based on Pre-trained Language Models (PLMs) often struggle with two critical limitations:

  1. Lack of Structural Knowledge: They miss the "big picture" of how all entities in a document interact as a network.
  2. Semantic Misalignment: They have difficulty connecting relevant but distant sentences to help the model "reason" through a relationship.

The DocKS-RAG Framework

To bridge this gap, the authors propose DocKS-RAG, a framework that uses a "best of both worlds" approach to guide a Large Language Model (LLM). It consists of three main pillars:

  1. Document-level Knowledge Graph (DocKG): The system first builds a graph of the document using Graph Neural Networks (GNNs). This captures the structural "topology" of the entities and their potential interactions, effectively creating a map of the document's internal logic.
  2. Sentence-level Semantic RAG (SetRAG): To ensure the model has the right context, the system segments the document into sentences and uses a retrieval mechanism to find the most semantically relevant snippets for any given query. This provides the "semantic flavor" needed for reasoning.
  3. Hybrid Prompt Tuning: These two sources of information—the structural graph and the semantic sentences—are merged into a single "hybrid prompt." This prompt is then used to fine-tune an LLM (specifically LLaMA3-8B) using LoRA (Low-Rank Adaptation), a parameter-efficient method that allows the model to adapt to specific RE tasks without needing to retrain the entire massive network.
Architecture of the DocKS-RAG framework

Key Insights and Ideas

  • Structure is the Secret Sauce: The core insight here is that LLMs perform significantly better when they aren't just looking at flat text, but are also explicitly "told" about the underlying graph structure of the entities.
  • The Goldilocks Threshold: The paper highlights that more information isn't always better. They found a "peak" performance threshold for graph retrieval. If you include too many entity interactions, you introduce "noise"; if you include too few, the model lacks global understanding.
  • Hybrid Beats Few-Shot: While many researchers try to use LLMs via "few-shot" prompting (giving a few examples in the prompt), this paper demonstrates that Hybrid Prompt Tuning (combining RAG with actual parameter updates via LoRA) is drastically more effective for complex document-level tasks.

Datasets and Key Results

The researchers evaluated DocKS-RAG on two industry-standard benchmarks known for requiring multi-sentence reasoning: DocRED (a large-scale dataset constructed from Wikipedia) and Re-DocRED (a refined version with more complete annotations).

DocKS-RAG set new high-water marks on both datasets:

  • DocRED: Achieved an F1 score of 63.87, surpassing the previous best (KD-DocRE) at 62.03.
  • Re-DocRED: Reached an F1 score of 75.49, compared to the previous state-of-the-art of 74.55.
Performance comparison of DocKS-RAG against baseline models

Crucially, ablation studies showed that when the authors removed the DocKG (graph) component, performance dropped significantly. This proves that structural knowledge is a critical missing piece in standard RAG setups.

Limitations and Future Work

While DocKS-RAG is powerful, the authors acknowledge a few areas for future growth:

  • Scalability: The current method was tested on standard benchmarks; how it handles extremely long documents (like entire books or technical manuals) remains to be seen.
  • Domain Diversity: The researchers plan to explore how this framework adapts to specialized fields like medicine or law, where the "structural knowledge" might look very different from Wikipedia.
  • LLM Scaling: Future work will investigate if even larger LLMs or different architectures can further close the gap in implicit relation extraction.

Summary updated

BibTeX
@inproceedings{xu2025docks,
  author = {Xiaolong Xu and Yibo Zhou and Haolong Xiang and Xiaoyong Li and Xuyun Zhang and Lianyong Qi and Wanchun Dou},
  title = {{DocKS-RAG: Optimizing Document-Level Relation Extraction through LLM-Enhanced Hybrid Prompt Tuning}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=SVl9tIADWV},
}
Figure