Hallucination Detection in Structured Query Generation via LLM Self-Debating

Miaoran Li, Jiangning Chen, Minghua Xu, Xiaolong Wang


Abstract
Hallucination remains a key challenge in applying large language models (LLMs) to structured query generation, especially for semi-private or domain-specific languages underrepresented in public training data. In this work, we focus on hallucination detection in these low-resource structured language scenarios, using Splunk Search Processing Language (SPL) as a representative case study. We start from analyzing real-world SPL generation to define hallucination in this context and introduce a comprehensive taxonomy. To enhance detection performance, we propose the Self-Debating framework, which prompts an LLM to generate contrastive explanations from opposing perspectives before rendering a final consistency judgment. We also construct a synthetic benchmark, SynSPL, to support systematic evaluation of hallucination detection in SPL generation. Experimental results show that Self-Debating consistently outperforms LLM-as-a-Judge baselines with zero-shot and chain-of-thought (CoT) prompts in SPL hallucination detection across different LLMs, yielding 5–10% relative gains in hallucination F1 scores on both real and synthetic datasets, and up to 260% improvement for LLaMA-3.1–8B. Besides hallucination detection on SPL, Self-Debating also achieves excellent performance on the FaithBench benchmark for summarization hallucination, demonstrating the strong generalization ability of Self-Debating, with OpenAI o1-mini achieving state-of-the-art performance. All these results consistently demonstrate the strong robustness and wide generalizability of Self-Debating.
Anthology ID:
2025.findings-emnlp.873
Volume:
Findings of the Association for Computational Linguistics: EMNLP 2025
Month:
November
Year:
2025
Address:
Suzhou, China
Editors:
Christos Christodoulopoulos, Tanmoy Chakraborty, Carolyn Rose, Violet Peng
Venue:
Findings
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
16102–16113
Language:
URL:
https://preview.aclanthology.org/ingest-luhme/2025.findings-emnlp.873/
DOI:
10.18653/v1/2025.findings-emnlp.873
Bibkey:
Cite (ACL):
Miaoran Li, Jiangning Chen, Minghua Xu, and Xiaolong Wang. 2025. Hallucination Detection in Structured Query Generation via LLM Self-Debating. In Findings of the Association for Computational Linguistics: EMNLP 2025, pages 16102–16113, Suzhou, China. Association for Computational Linguistics.
Cite (Informal):
Hallucination Detection in Structured Query Generation via LLM Self-Debating (Li et al., Findings 2025)
Copy Citation:
PDF:
https://preview.aclanthology.org/ingest-luhme/2025.findings-emnlp.873.pdf
Checklist:
 2025.findings-emnlp.873.checklist.pdf