Revolutionizing Database Q&A with Large Language Models: Comprehensive Benchmark and Evaluation

Yihang Zheng, Bo Li, Zhenghao Lin, Yi Luo, Xuanhe Zhou, Chen Lin, Jinsong Su, Guoliang Li, Shifu LiKDD 2024

Introduction: The Virtual DBA Challenge

Large Language Models (LLMs) are increasingly tasked with complex, domain-specific roles. In the database sector, an ideal LLM would function as a "virtual Database Administrator (DBA)." However, evaluating this capability is uniquely difficult because Database Question Answering (DBQA) requires mastery across three distinct knowledge layers: general SQL/ER concepts, product-specific nuances (e.g., version-specific quirks of PostgreSQL or MySQL), and instance-specific diagnostics that require real-time interaction with database tools.

Taxonomy of database knowledge required for a virtual DBA.

Existing benchmarks like Text2SQL are insufficient for this purpose, as they focus almost exclusively on query generation rather than the holistic reasoning and tool-use capabilities needed to manage real-world database systems.

Methodology: The EA&B Ecosystem

To address these gaps, the researchers propose the EA&B (Evaluation, Augmentation, and Benchmarking) ecosystem, consisting of two primary components: DQABench and DQATestbed.

DQABench: A Large-Scale Bilingual Dataset

DQABench is the first comprehensive DBQA benchmark, featuring over 200,000 QA pairs in both English and Chinese. To ensure high technical quality at scale, the authors utilized an innovative LLM-based pipeline. Instead of simple web scraping, they employed "prompt chains" to summarize technical manuals into key points, generate targeted questions, and produce detailed, professional answers.

DQABench statistics and the multi-stage pipeline for generating product-specific QA pairs.

DQATestbed: Modular Evaluation Framework

The DQATestbed is a modular "plug-and-play" framework designed to evaluate how LLMs handle diverse database tasks. Its architecture includes:

  • Question Classification Routing (QCR): A classifier that determines if a query is general, product-specific, or instance-specific.
  • Retrieval-Augmented Generation (RAG): A module to pull facts from technical documentation.
  • Tool Invocation Generation (TIG): A module that allows the LLM to call actual database tools (like workload analyzers) using Chain-of-Thought reasoning.

Key Insights and Results

The researchers evaluated nine LLMs, including GPT-4, Llama3, and GLM-3, revealing several critical findings:

  • Fine-Tuning Trumps Size: While GPT-4 remains the leader in general knowledge (WinRate ~0.80), domain-specific fine-tuning allows smaller models to outperform commercial giants in specialized tasks. For instance, Baichuan2-13B-sft achieved a WinRate of 0.85–0.87 in instance-specific scenarios, surpassing GPT-4 in complex tool planning and invocation.
  • The "Recall" Bottleneck: In RAG scenarios, the primary failure point is often the retriever's inability to find the exact technical snippet from a massive manual, rather than the LLM's generation capability.
  • The Necessity of Routing: Using a dedicated classifier to route questions to specific RAG or Tool pipelines significantly improves accuracy and is up to 6.7x faster than using a single general prompt for all queries.
  • Llama3's Efficiency: Llama3-8B showed a "logarithmic-scale" performance improvement over Llama2, proving that high-quality pre-training data can compensate for a smaller parameter count in technical domains.

Conclusion and Future Work

DQABench and DQATestbed establish a new gold standard for evaluating LLMs in the database domain. While fine-tuned open-source models show great promise, challenges remain in "multi-turn" tool invocation and RAG precision. Future work will focus on improving the recall of technical documentation and enhancing the multi-step planning capabilities of mid-sized models to make them truly autonomous DBAs.

Summary updated

BibTeX
@inproceedings{zheng2024revolutionizing,
  author = {Yihang Zheng and Bo Li and Zhenghao Lin and Yi Luo and Xuanhe Zhou and Chen Lin and Jinsong Su and Guoliang Li and Shifu Li},
  title = {{Revolutionizing Database Q\&A with Large Language Models: Comprehensive Benchmark and Evaluation}},
  booktitle = {ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
  year = {2024},
  url = {https://openreview.net/forum?id=TlJxmIfQU3},
}
Figure