title: Reducing Hallucinations in Language Model-based SPARQL Query Generation
    Using Post-Generation Memory Retrieval
summary: The ability to generate SPARQL queries from natural language questions is
  crucial for ensuring efficient and accurate retrieval of structured data from
  knowledge graphs (KG). While large language models (LLMs) have been widely
  adopted for SPARQL query generation, they are often susceptible to
  hallucinations and out-of-distribution errors when producing KG elements like
  Uniform Resource Identifiers (URIs) based on internal parametric knowledge.
  This often results in content that appears plausible but is factually
  incorrect, posing significant challenges for their use in real-world
  information retrieval (IR) applications. This has led to increased research
  aimed at detecting and mitigating such errors. In this paper, we introduce PGMR
  (Post-Generation Memory Retrieval), a modular framework that incorporates a
  non-parametric memory module to retrieve KG elements and enhance LLM-based
  SPARQL query generation. Our experimental results indicate that PGMR
  consistently delivers strong performance across diverse datasets, data
  distributions, and LLMs. Notably, PGMR significantly mitigates URI
  hallucinations, nearly eliminating the problem in several scenarios.
paper_authors._id: 67b7610afedfe97127f75374
paper_authors.name: Aditya Sharma
paper_authors.status: admin_assigned
paper_authors.statusLastChangedAt: 2025-02-20T17:37:33.974Z
paper_authors._id: 66d959e4fb6d15635f2b9d76
paper_authors.avatarUrl: https://cdn-avatars.huggingface.co/v1/production/uploads/noauth/RpDOzFBoW_OQNW4iHuL0g.jpeg
paper_authors.fullname: Aditya Sharma 
paper_authors.type: user
paper_authors.user: adityasharma001
paper_authors._id: 67b7610afedfe97127f75375
paper_authors.name: Luis Lara
paper_authors.status: claimed_verified
paper_authors.statusLastChangedAt: 2025-02-20T17:11:22.814Z
paper_authors._id: 63e972f1ccae1fe5c6211759
paper_authors.avatarUrl: https://cdn-avatars.huggingface.co/v1/production/uploads/63e972f1ccae1fe5c6211759/AfKPgMdAraUtvbtJpoHFY.jpeg
paper_authors.fullname: Luis Lara
paper_authors.type: user
paper_authors.user: ludolara
paper_authors._id: 67b7610afedfe97127f75376
paper_authors.name: Amal Zouaq
paper_authors.status: admin_assigned
paper_authors.statusLastChangedAt: 2025-02-20T17:37:41.765Z
paper_authors._id: 64df79eff08b064990fd62db
paper_authors.avatarUrl: /avatars/88a494615a2339bc29db4ea33a9817b2.svg
paper_authors.fullname: Amal Zouaq
paper_authors.type: user
paper_authors.user: zouaq
paper_authors._id: 67b7610afedfe97127f75377
paper_authors.name: Christopher J. Pal
paper_title: Reducing Hallucinations in Language Model-based SPARQL Query Generation
    Using Post-Generation Memory Retrieval
paper_summary: The ability to generate SPARQL queries from natural language questions is
  crucial for ensuring efficient and accurate retrieval of structured data from
  knowledge graphs (KG). While large language models (LLMs) have been widely
  adopted for SPARQL query generation, they are often susceptible to
  hallucinations and out-of-distribution errors when producing KG elements like
  Uniform Resource Identifiers (URIs) based on internal parametric knowledge.
  This often results in content that appears plausible but is factually
  incorrect, posing significant challenges for their use in real-world
  information retrieval (IR) applications. This has led to increased research
  aimed at detecting and mitigating such errors. In this paper, we introduce PGMR
  (Post-Generation Memory Retrieval), a modular framework that incorporates a
  non-parametric memory module to retrieve KG elements and enhance LLM-based
  SPARQL query generation. Our experimental results indicate that PGMR
  consistently delivers strong performance across diverse datasets, data
  distributions, and LLMs. Notably, PGMR significantly mitigates URI
  hallucinations, nearly eliminating the problem in several scenarios.
paper_ai_keywords: SPARQL queries natural language questions knowledge graphs (KG) large language models (LLMs) hallucinations out-of-distribution errors Uniform Resource Identifiers (URIs) internal parametric knowledge information retrieval (IR) PGMR (Post-Generation Memory Retrieval) non-parametric memory module URI hallucinations