KathDB-FAO: Optimizing Multimodal Queries through Operator Grouping and Code Reuse

arXiv:2609.28761v2 Announce Type: replace-cross Abstract: Advances in multimodal large language models (multimodal LLMs) allow data systems to answer analytical queries over text and images alongside relational tables, but at a significant cost for large-scale data. Existing systems reduce this cost through rewrite rules written in advance, which cannot use the logic of an individual query or the semantics of the data it processes. To address this challenge, we design, implement, and evaluate KathDB-FAO, a query evaluation system over multimodal data. KathDB-FAO decomposes a complex query into an execution plan of fine-grained steps, which we call Function-as-Operators (FAOs). To reduce execution cost, it searches for subsets of these FAOs to implement together as one function, enabling query-specific optimizations that make fewer model calls. Synthesizing these functions with a frontier model has its own cost, yet we observe that synthesized FAOs often recur across queries. To further reduce plan generation cost, KathDB-FAO uses pre-built functions and reuses functions synthesized for earlier queries. On SemBench and an additional workload, KathDB-FAO achieves quality comparable t