Learning Federated Neural Graph Databases for Answering Complex Queries from Distributed Knowledge Graphs

Qi Hu, Weifeng Jiang, Haoran Li, Zihao Wang, Jiaxin Bai, Qianren Mao, Yangqiu Song, Lixin Fan, Jianxin Li

Abstract

The increasing demand for deep learning-based foundation models has highlighted the importance of efficient data retrieval mechanisms. Neural graph databases (NGDBs) offer a compelling solution, leveraging neural spaces to store and query graph-structured data, thereby enabling LLMs to access precise and contextually relevant information. However, current NGDBs are constrained to single-graph operation, limiting their capacity to reason across multiple, distributed graphs. Furthermore, the lack of support for multi-source graph data in existing NGDBs hinders their ability to capture the complexity and diversity of real-world data. In many applications, data is distributed across multiple sources, and the ability to reason across these sources is crucial for making informed decisions. This limitation is particularly problematic when dealing with sensitive graph data, as directly sharing and aggregating such data poses significant privacy risks. To address these limitations, we propose to learn Federated Neural Graph DataBase (FedNGDB), a pioneering systematic framework that empowers privacy-preserving reasoning over multi-source graph data. FedNGDB leverages federated learning to collaboratively learn graph representations across multiple sources, enriching relationships between entities, and improving the overall quality of graph data. Unlike existing methods, FedNGDB can handle complex graph structures and relationships, making it suitable for various downstream tasks. We evaluate FedNGDBs on three real-world datasets, demonstrating its effectiveness in retrieving relevant information from multi-source graph data while keeping sensitive information secure on local devices. Our results show that FedNGDBs can efficiently retrieve answers to cross-graph queries, making it a promising approach for LLMs and other applications that rely on efficient data retrieval mechanisms.

Bridging the Silos: The Challenge of Distributed Knowledge Graphs

Knowledge Graphs (KGs) are the backbone of modern information retrieval, powering everything from recommendation engines to the "Retrieval-Augmented Generation" (RAG) systems used by Large Language Models (LLMs). However, real-world data is rarely centralized. It is typically distributed across different organizations, protected by strict privacy laws like GDPR, and often incomplete.

While Neural Graph Databases (NGDBs) have emerged to handle incomplete data by reasoning in embedding spaces, they have historically been limited to single, centralized graphs. Imagine you want to answer a query like: "Find research topics studied by Nobel Prize winners who were born in Germany." To answer this, you might need data from a "Nobel Prize KG," a "Biographical KG," and an Academic "Publication KG." In the real world, these databases belong to different entities, and directly merging them is often impossible due to privacy concerns or regulatory hurdles.

An example of a cross-graph complex query across distributed NGDBs.

Existing NGDBs are "single-graph" only. If the information is split, the system fails. Furthermore, existing federated graph embedding methods usually focus on simple tasks like "link prediction" rather than Complex Query Answering (CQA), which involves multi-step logical reasoning such as intersections, unions, and projections.

The FedNGDB Framework

To address these limitations, the authors propose FedNGDB, the first systematic framework to enable complex logical query answering across distributed neural graph databases while preserving data privacy. FedNGDB orchestrates collaboration between a central server and multiple clients (data owners) through several key innovations:

  1. Secret Aggregation: To prevent the central server from seeing sensitive entity embeddings, FedNGDB uses a perturbation-based protocol. Clients generate random "noise" (perturbations), share them securely with each other, and then upload perturbed embeddings to the server. The server aggregates the data, but because it doesn't have the "key" to the noise, it cannot reconstruct the original embeddings.
  2. Query Decomposition: When a user submits a complex cross-graph query, the FedNGDB server decomposes it into atomic sub-queries. These are sent to the relevant clients, who compute local "answers" in their neural embedding spaces.
  3. Privacy-Preserving Training: The system incorporates Local Differential Privacy (LDP) by adding Laplacian noise to gradients during training, ensuring that an attacker cannot infer the presence of specific edges in the private graphs.
  4. Global Alignment: The framework uses mapping matrices to align entities that appear in multiple local graphs, creating a unified neural space for reasoning without centralizing raw data.
The FedNGDB system architecture for privacy-preserving federated reasoning.

Experimental Evaluation and Key Results

The researchers evaluated FedNGDB using three standard knowledge graph benchmarks adapted for distributed settings: FB15k-237, FB15k, and NELL995. They simulated distributed environments by splitting these datasets among 3, 5, and 10 clients.

Key Insights

  • Collaboration Breeds Local Intelligence: Federated training improves performance even for local queries. By aligning with a global model, local NGDBs "fill in the gaps" of their own incomplete data.
  • Neural Logic is Modular: Logical operations (like "AND" or "OR") in an embedding space can be computed distributively. You don't need the whole graph to compute a logical intersection if the embedding spaces are properly aligned.
  • Privacy vs. Utility Balance: The authors show that high-level privacy (1-DP) can be achieved with only a marginal hit to reasoning accuracy, making it viable for sensitive industrial applications.

Performance Metrics

FedNGDB significantly outperformed local-only models. For example, on the FB15k-237 dataset with 3 clients, the GQE-based FedNGDB achieved a Hit Ratio (HR@3) of 13.54, compared to only 12.64 for a model trained in isolation. Furthermore, FedNGDB successfully answered queries requiring data from multiple silos—a task local models are mathematically incapable of performing. Communication overhead was also low, with convergence speeds only about 9% slower than baselines with weaker privacy protections.

Future Outlook

While FedNGDB marks a significant step forward, challenges remain. The current framework relies on some degree of entity or relation overlap between clients to align embedding spaces. Future work will explore methods for aligning entirely disjoint graphs and investigate security models involving "malicious" rather than just "honest-but-curious" servers. Nonetheless, FedNGDB provides a promising foundation for LLMs and other applications that require efficient, privacy-preserving data retrieval from distributed sources.

Summary updated

BibTeX
@article{hu2025learning,
  author = {Qi Hu and Weifeng Jiang and Haoran Li and Zihao Wang and Jiaxin Bai and Qianren Mao and Yangqiu Song and Lixin Fan and Jianxin Li},
  title = {{Learning Federated Neural Graph Databases for Answering Complex Queries from Distributed Knowledge Graphs}},
  journal = {Accepted by TMLR},
  year = {2025},
  url = {https://openreview.net/forum?id=3K1LRetR6Y},
}
Figure