Quantum Natural Language Processing Application for Estimating SQL Query Metrics
Quantum Natural Language Processing (QNLP) is built on a novel, category theoretical quantum machine learning model, which we use to solve a well-researched problem in the database field: estimating metrics for SQL queries. The metrics we focus on are latency (i.e., the execution time), cost (i.e., a value of how expensive the query is in total), and cardinality (i.e., the number of rows in the result table). The critical link between QNLP and the database problem lies in using grammars, such as context-free grammar. Both natural language and SQL queries admit grammatical presentations, which allow us to develop a comprehensive framework for applying QNLP methods to solve the query estimation problem. The model comprises an encoding mechanism and a training phase, integrating classical and quantum subroutines. The encoding mechanism transforms SQL queries into parametrized quantum circuits as in QNLP. Classical optimization algorithms optimize the circuit parameters during training to predict query metrics. Comparing our model to the QNLP models, our model achieves accuracy comparable to the QNLP model in binary classification tasks. Additionally, we expand upon previous research by implementing multi-class classification tasks and comparing the cardinality estimation results to those of state-of-the-art databases. Our theoretical analysis of the quantum machine learning model includes calculations of its expressibility and entangling capabilities. The analysis reveals that the model possesses beneficial properties, making it suitable to be executed on near-term quantum hardware.
Authors
- Valter Uotila (ORCID: https://orcid.org/0000-0001-8201-397X)
Institutions
- University of Helsinki (FI)
Publication Details
- Published
- 2024-09-15
- DOI
- https://doi.org/10.1109/qce60285.2024.10321
- Citations
- 1
- Primary Topic
- Scientific Computing and Data Management
- Type
- article
- Field-Weighted Citation Impact
- 1.05