Knowledge-Aware Query Expansion with Large Language Models for Textual and Relational Retrieval

Yu Xia, Junda Wu, Sungchul Kim, Tong Yu, Ryan A. Rossi, Haoliang Wang, Julian J. McAuley

Abstract

Large Language Models (LLMs) have significantly advanced query expansion in information retrieval. However, they often suffer from "relational hallucinations," where they generate semantically plausible but factually incorrect relationships, such as suggesting incompatible hardware or non-existent citations. We introduce Knowledge-Aware Retrieval (KAR), a framework designed to ground LLM-based query expansions in structured Knowledge Graphs (KGs). KAR utilizes a multi-stage pipeline involving entity parsing, document-based relation filtering, and knowledge-aware expansion. Our evaluations on the STaRK benchmark demonstrate that KAR substantially improves retrieval accuracy, particularly for complex queries involving dense relational constraints.

The Challenge of Relational Hallucination

Modern search engines often rely on LLMs to expand user queries into more descriptive terms. While effective for capturing semantic intent, these models frequently fail when queries involve specific relational constraints. For example, a user searching for a "highly rated camera for wildlife photography compatible with Nikon F-Mount lenses" requires a result that satisfies both a textual description (wildlife photography) and a structural fact (lens compatibility).

Standard methods like HyDE (Hypothetical Document Embeddings) or RAR (Retrieve-and-Read) often prioritize textual similarity, leading them to suggest popular cameras from other brands (e.g., Sony) that are physically incompatible with the specified lenses. This phenomenon, termed "relational hallucination," results in search outcomes that appear relevant but are functionally incorrect.

Figure 1: Comparison of query expansion methods. Unlike HyDE and RAR, KAR correctly identifies compatible hardware by grounding the expansion in Knowledge Graph relations.

The KAR Framework

To address these limitations, researchers from UCSD and Adobe developed Knowledge-Aware Retrieval (KAR). The core philosophy of KAR is to "teach" the LLM to respect the underlying graph structure of the data. The framework operates through a five-step pipeline:

  1. Entity Parsing: An LLM identifies key entities within the user query (e.g., "Nikon F-Mount").
  2. KG Relation Propagation: The system maps these entities to nodes in a Knowledge Graph and explores their $h$-hop neighbors to identify potentially relevant related entities.
  3. Document-based Relation Filtering (DRF): To manage dense or noisy graphs, KAR employs a novel filtering mechanism. It uses text embeddings to compare the full content of neighbor documents against the query embedding, ensuring only the most relevant relational links are preserved.
  4. Document Triples Construction: The filtered relations are formatted into "knowledge triples" that combine structured links with rich textual descriptions (e.g., [Camera A] — [is compatible with] — [Lens B]).
  5. Knowledge-Aware Expansion: Finally, the LLM generates a query expansion using these factual triples as context, ensuring the output is both semantically rich and structurally accurate.
Figure 2: The KAR pipeline, illustrating the flow from initial query parsing to knowledge-aware expansion grounded in KG relations and document filtering.

Experimental Evaluation

The effectiveness of KAR was tested using the STaRK benchmark, which includes three large-scale datasets representing different domains:

  • AMAZON: Product search with 1M entities and 9.4M relations (e.g., "also bought", "brand").
  • MAG: Academic paper search with 1.9M entities and 39.8M relations (e.g., citations, authorship).
  • PRIME: Precision medicine with 129K entities and 8.1M relations between diseases, drugs, and genes.

Key Results

KAR consistently outperformed state-of-the-art baselines across all metrics. On the MAG dataset, KAR achieved a 50.47% Hit@1, a significant improvement over the 39.02% achieved by RAR. The performance gains were most pronounced in the MAG and PRIME datasets, which feature denser relational structures. This indicates that as the complexity of the information "web" increases, the grounding provided by KAR becomes increasingly critical.

Insights and Future Directions

A primary takeaway from this research is that text is often the best representation for graph nodes. By using full document text rather than simple node labels for filtering (DRF), KAR achieves higher precision in dense graphs. Furthermore, KAR is a zero-shot framework; it does not require retraining when new entities are added to the database, making it highly scalable for dynamic environments like e-commerce or academic publishing.

While KAR offers significant improvements, it remains dependent on the latency of underlying LLM APIs and the quality of the source Knowledge Graph. Future work will focus on reducing inference time through parallel processing and improving robustness against incomplete or noisy graph data.

Summary updated

BibTeX
@inproceedings{xia2025knowledge,
  author = {Yu Xia and Junda Wu and Sungchul Kim and Tong Yu and Ryan A. Rossi and Haoliang Wang and Julian J. McAuley},
  title = {{Knowledge-Aware Query Expansion with Large Language Models for Textual and Relational Retrieval}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2025},
  doi = {10.18653/v1/2025.naacl-long.216},
}
Figure