Skip to content
aiqbench takeAI Research

aiqbench analysis

Composing insight from the full article — this may take a moment.

Source coveringarXiv

Speculative Ad-hoc Querying

arXiv1 min read

arXiv:2503.00714v2 Announce Type: replace-cross Abstract: Large language models (LLMs) invite substantial effort and investment, yet agentic systems can spend much of their time waiting for tools. This paper explores how a small auxiliary LLM can reduce these waits by speculatively preparing a database while the primary LLM reasons. The challenge is that the auxiliary model must anticipate the primary model's actions before the primary model takes them. Our key insight is that database systems give the speculator a structural advantage: it need not predict the exact next query. Instead, it can prepare work shared by many plausible queries. Predicting query shapes enables advance compilation, predicting data access warms caches, and predicting broader data requirements enables precomputation of superset results that subsequent queries can refine. We present Wonder, a system that exploits this advantage for analytical SQL workloads. Wonder constructs reusable superset queries, materializes their components, and rewrites subsequent queries against the resulting temporary tables. Its scheduler prioritizes foreground queries while using reasoning intervals for speculative preparation. The same engine supports humans writing SQL, using incomplete queries to guide speculation and displaying intermediate results as they type. In a replay-based evaluation of agent workflows, Wonder reduces SQL execution time by up to 31.8% and combined primary-agent reasoning and active SQL time by up to 22.6%, with approximately 6% higher recorded main-agent and prediction API cost and 10% more read I/O on the full dataset. A separate 24-participant study finds significantly lower query latency on both analytical tasks and improved time-to-answer on one, with 87.5% of participants reporting increased productivity.

Read the full article at arXiv

Related coverage