TL;DR
This paper introduces SemBench, a novel benchmark designed to evaluate "semantic query processing engines" (SQPEs) – systems that leverage Large Language Models (LLMs) to interpret and execute queries expressed in natural language over multimodal data. SemBench aims to drive research in optimizing these LLM-powered systems for cost, latency, and accuracy, addressing a critical gap in current database benchmarking.
What Problem Does This Paper Address?
Traditional database benchmarks like TPC-H and TPC-DS are designed for purely relational data processing and SQL queries. However, the emergence of SQPEs, which integrate LLMs to handle natural language instructions and multimodal data (text, images, audio), presents a new set of challenges. These systems face different optimization problems: LLM calls are orders of magnitude more expensive than traditional relational operations, and LLM outputs are inherently stochastic, leading to accuracy concerns. Existing benchmarks are unsuitable for evaluating these new systems because they don't account for LLM costs, accuracy, or the complexities of multimodal data. SemBench aims to fill this void by providing a standardized way to measure and compare SQPE performance.
Methods
The core contribution is the SemBench benchmark suite. It's designed with three key dimensions:
- Scenarios: Five diverse scenarios (Movies, Wildlife, E-Commerce, Cars, MMQA) are created, inspired by real-world applications and academic datasets.
- Modalities: These scenarios cover text, images, and audio data, often combined within a single query.
- Operators: SemBench includes a variety of semantic operators (filters, joins, mappings, ranking, classification) that extend traditional SQL capabilities. These operators are configured via natural language instructions and executed by LLMs.
The benchmark also defines specific evaluation metrics:
- Cost: Includes execution time and monetary cost of LLM invocations.
- Quality: Assessed against ground truth using metrics like F1 score, Spearman's rank correlation, and Adjusted Rand Index, depending on the query type.
- Scalability: Evaluated by increasing database sizes.
The authors also detail their experimental setup, including the LLM used (gemini-2.5-flash), system tuning, and parallelism settings.
Datasets
SemBench is built upon existing publicly available datasets, primarily from Kaggle, which are enriched and combined to create the benchmark scenarios. For instance:
- Movies: Uses movie review data from Kaggle.
- Wildlife: Combines datasets of animal sound recordings and camera trap images from Kaggle.
- E-Commerce: Leverages an online fashion retail store dataset from Kaggle.
- Cars: Synthesizes tabular data and uses anonymized real-world datasets for text, images, and audio related to car damage.
- MMQA: Built on the MultiModalQA dataset, incorporating Wikipedia tables and texts.
The ground truth for queries is derived from the manual labels present in these original datasets.
Key Insights and Ideas
- LLM Costs Dominate: For semantic queries, the cost of LLM calls far outweighs traditional relational processing costs, making LLM optimization paramount.
- Quality-Cost Trade-offs are Crucial: Systems often exhibit a clear trade-off between minimizing cost and maximizing accuracy. For example, ThalamusDB achieves low costs with concise prompts but lower quality, while LOTUS and Palimpzest use more detailed prompts for higher quality at a higher cost.
- Semantic Joins are Particularly Challenging: Queries involving semantic joins across modalities (especially text and images) are the most expensive and time-consuming, posing significant scalability challenges.
- LIMIT Clause Handling Matters: Efficiently handling LIMIT clauses by terminating early can drastically reduce costs, a technique not universally adopted by all systems.
- Prompt Design is Key: The way prompts are constructed significantly impacts both cost and quality, with systems using different strategies (e.g., detailed vs. concise prompts).
- LLM Failures are Common: Systems need robust mechanisms to handle LLM invocation failures (e.g., network errors, rate limits) through retries.
- Domain-Specific Performance: The quality of semantic operators can vary significantly based on the domain and specificity of the data (e.g., generic car damages vs. specialized ones).
Key Results
The paper presents experimental results for four systems: LOTUS, Palimpzest, ThalamusDB (academic), and Google BigQuery (industrial).
- BigQuery's Strengths: BigQuery generally performs well, especially in terms of latency and cost management, due to its internal resource adjustment mechanisms. It also shows good quality, though not always the best.
- LOTUS and Palimpzest: These systems often achieve high quality, with LOTUS showing good cost-effectiveness in some scenarios. However, they face scalability issues with complex multimodal joins.
- ThalamusDB: Excels in minimizing costs, particularly for filter operations, by using concise prompts and early termination strategies, but often at the expense of quality.
- Scalability Limitations: Most systems struggle to scale to large datasets, especially for scenarios involving multimodal semantic joins. BigQuery is an exception due to its adaptive resource management.
- Operator Performance Varies: Semantic filters are generally well-supported and efficient. Semantic joins, however, are a bottleneck across most systems.
Limitations and Future Work
- Snapshot in Time: The results reflect a rapidly evolving field, and system performance can change quickly.
- LLM Dependency: The benchmark's performance is tied to the capabilities of the chosen LLM (gemini-2.5-flash).
- Scalability Bottlenecks: Significant challenges remain in scaling multimodal semantic joins and maintaining quality at scale.
- Future Work: The authors suggest exploring automated prompt design strategies, query optimization techniques like operator fusion and caching, and expanding the benchmark with more scenarios and operators (e.g., semantic aggregation) as SQPEs mature. They also highlight the need for systems to better handle LLM invocation failures and manage memory consumption.
Summary updated