[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-83463-en":3,"doc-seo-83463-105":30,"detail-sidebar-cat-0-en-105":91},{"code":4,"msg":5,"data":6},0,"success",{"doc_id":7,"user_id":8,"nickname":9,"user_avatar":10,"doc_module":4,"category_id":11,"category_name":12,"doc_title":13,"doc_description":14,"doc_content":15,"file_id":16,"file_url":17,"file_type":18,"file_size":19,"view_count":20,"is_deleted":4,"is_public":21,"is_downloadable":21,"audit_status":21,"page_count":22,"language":23,"language_code":24,"site_id":25,"html_lang":24,"table_of_contents":26,"faqs":27,"seo_title":13,"seo_description":14,"update_tm":28,"read_time":29},83463,1099513958762,"Logic","https://ap-avatar.wpscdn.com/avatar/1000023916a998db790?x-image-process=image/resize,m_fixed,w_180,h_180&k=1784791008015729253",8,"Research & Report","Query-Centric Optimization of AI Workflows via Approximate Query Processing and Proxy Models","Many modern AI workflows, from LLM post-training pipelines to agentic reasoning, can be written as declarative queries where an expensive predicate is evaluated by a large model or reward function. A query-centric formulation enables classical database methods—approximate query processing and proxy-model filtering—to cut the number of costly invocations without changing the underlying models. Strategy AQP progressively samples, maintains running aggregates with confidence bounds, and stops early under an error threshold. Strategy PM trains a lightweight CPU decision tree to pre-filter with high-confidence predictions, routing only uncertain cases to the expensive oracle model. Evaluations on TPC-DS and real LLM pipelines show large reductions in oracle calls with bounded accuracy loss.","Query-Centric Optimization of AI Workflows via Approximate Query Processing and Proxy Models  \nHuayi Wang  \nGeorgia Institute of Technology Atlanta, USA [hwang762@gatech.edu](hwang762@gatech.edu)  \nJun Xu  \nGeorgia Institute of Technology Atlanta, USA [jx@cc.gatech.edu](jx@cc.gatech.edu)  \nGromit Yeuk-Yin Chan  \nAdobe Research San Jose, USA[ychan@adobe.com](ychan@adobe.com)  \narXiv :2607 .00254v1 [ cs .DB] 30 Jun 2026  \nABSTRACT  \nMany modern AI workflows—ranging from LLM post-training pipelines to agentic reasoning tasks—can be expressed as declarative queries whose expensive predicate is evaluated by a large model or reward function. We propose a query-centric formulation of these workflows and show that classical database techniques, namely approximate query processing (AQP) and proxy-model (PM) based filtering, can substantially reduce the number of expensive model invocations without requiring changes to the underlying models or pipelines. Our first strategy treats the workflow as an online aggregation problem: it progressively samples records, maintains a running aggregate estimate with a confidence interval, and terminates early once the interval stabilizes, accepting the estimate when it falls within a user-specified error bound. Our second strategy trains a lightweight, CPU-resident decision tree on a small set of oracle-labeled examples and uses it to pre-filter records whose outcome can be predicted with high confidence, routing only uncertain records to the expensive model. We evaluate both strategies on TPC-DS aggregate queries and on real LLM post-training pipelines including math reasoning, general instruction following, and code generation. On TPC-DS, Strategy AQP keeps aggregate error under 10% while reaching its adaptive stopping point at 10–15% of oracle calls under balanced distributions—an 85–90% reduction—and Strategy PM reduces oracle calls by 60–70% on natural-label workloads. On LLM pipelines, Strategy AQP reaches its adaptive stopping point at 20–50% of oracle calls with less than 5% accuracy loss on the structured math and code tasks (open-ended instruction following, scored by a reward model, shows a larger but bounded reduction), and Strategy PM reduces reward-model scoring time by up to 19× on structured tasks with less than 10% accuracy loss.  \nPVLDB Reference Format:  \nHuayi Wang, Jun Xu, and Gromit Yeuk-Yin Chan. Query-Centric Optimization of AI Workflows. PVLDB, 14(1): XXX-XXX, 2020 .  \ndoi:XX.XX/XXX.XX  \nPVLDB Artifact Availability:  \nThe source code, data, and/or other artifacts have been made available at [https://github.com/Why1221/Query-Centric-AI-optimization](https://github.com/Why1221/Query-Centric-AI-optimization).  \nThis work is licensed under the Creative Commons BY-NC-ND 4.0 International License. Visit [https://creativecommons.org/licenses/by-nc-nd/4.0/ to view a copy of](https://creativecommons.org/licenses/by-nc-nd/4.0/ to view a copy of)[ ](https://creativecommons.org/licenses/by-nc-nd/4.0/ to view a copy of)[this license. For any use beyond those covered by this license](this license. For any use beyond those covered by this license), [obtain permission by](obtain permission by)[emailing info@vldb.org. Copyright](emailing info@vldb.org. Copyright) is held by the owner/author(s). Publication rights licensed to the VLDB Endowment.  \nProceedings of the VLDB Endowment, Vol. 14, No. 1 ISSN 2150-8097 .  \ndoi:XX.XX/XXX.XX  \n1 INTRODUCTION  \nThe rapid growth of expensive Large Language Model (LLM) computation inAI workflows [4, 9]—from training foundation models to invoking them hundreds of times in agentic task pipelines [3, 20]—has created new opportunities to optimize latency and cost. More importantly, many of the current AI-centric workflows can be expressed as database queries. Consider the following two examples:  \nExample 1.1. A recurring pattern in modern LLM post-training pipelines — explicitly documented in both the Llama 2 and Llama 3 technical reports [7, 26] — is what ca","cbCainlKUqHCT8V6","https://ap.wps.com/l/cbCainlKUqHCT8V6","pdf",2374655,4,1,12,"English","en",105,"# Abstract\n# Introduction\n## Example 1: LLM Post-Training as a Query\n## Example 2: Agentic Reasoning as Declarative Filtering","[{\"question\":\"What is the core idea of query-centric optimization for AI workflows?\",\"answer\":\"Transform workflows into declarative queries whose expensive predicates are evaluated by a large model or reward function, then optimize those predicates using database techniques without modifying the models or pipelines.\"},{\"question\":\"How does Strategy AQP reduce expensive model invocations?\",\"answer\":\"It treats the workflow as an online aggregation task, progressively samples records, keeps a running aggregate estimate with a confidence interval, and terminates early when the interval stabilizes within a user-specified error bound.\"},{\"question\":\"How does Strategy PM differ from AQP and what does it use to filter records?\",\"answer\":\"Strategy PM trains a lightweight CPU-resident decision tree on oracle-labeled examples to pre-filter records with high-confidence predicted outcomes, sending only uncertain records to the expensive reward model for evaluation.\"}]",1784188143,30,{"code":4,"msg":31,"data":32},"ok",{"site_id":25,"language":24,"slug":33,"title":13,"keywords":34,"description":14,"schema_data":35,"social_meta":86,"head_meta":88,"extra_data":90,"updated_unix":28},"query-centric-optimization-of-ai-workflows-via-approximate-query-processing-and-proxy-models","",{"@graph":36,"@context":85},[37,53,68],{"@type":38,"itemListElement":39},"BreadcrumbList",[40,44,48,51],{"item":41,"name":42,"@type":43,"position":21},"https://docshare.wps.com","Home","ListItem",{"item":45,"name":46,"@type":43,"position":47},"https://docshare.wps.com/document/","Document",2,{"item":49,"name":12,"@type":43,"position":50},"https://docshare.wps.com/document/research-report/",3,{"item":52,"name":13,"@type":43,"position":20},"https://docshare.wps.com/document/query-centric-optimization-of-ai-workflows-via-approximate-query-processing-and-proxy-models/83463/",{"url":52,"name":13,"@type":54,"author":55,"headline":13,"publisher":57,"fileFormat":60,"inLanguage":24,"description":14,"dateModified":61,"datePublished":62,"encodingFormat":60,"isAccessibleForFree":63,"interactionStatistic":64},"DigitalDocument",{"name":9,"@type":56},"Person",{"url":41,"name":58,"@type":59},"DocShare","Organization","application/pdf","2026-07-26","2026-07-16",true,{"@type":65,"interactionType":66,"userInteractionCount":20},"InteractionCounter",{"@type":67},"ViewAction",{"@type":69,"mainEntity":70},"FAQPage",[71,77,81],{"name":72,"@type":73,"acceptedAnswer":74},"What is the core idea of query-centric optimization for AI workflows?","Question",{"text":75,"@type":76},"Transform workflows into declarative queries whose expensive predicates are evaluated by a large model or reward function, then optimize those predicates using database techniques without modifying the models or pipelines.","Answer",{"name":78,"@type":73,"acceptedAnswer":79},"How does Strategy AQP reduce expensive model invocations?",{"text":80,"@type":76},"It treats the workflow as an online aggregation task, progressively samples records, keeps a running aggregate estimate with a confidence interval, and terminates early when the interval stabilizes within a user-specified error bound.",{"name":82,"@type":73,"acceptedAnswer":83},"How does Strategy PM differ from AQP and what does it use to filter records?",{"text":84,"@type":76},"Strategy PM trains a lightweight CPU-resident decision tree on oracle-labeled examples to pre-filter records with high-confidence predicted outcomes, sending only uncertain records to the expensive reward model for evaluation.","https://schema.org",{"og:url":52,"og:type":87,"og:title":13,"og:site_name":58,"og:description":14},"article",{"robots":89,"canonical":52},"index,follow",{"doc_id":7,"site_id":25},{"code":4,"msg":5,"data":92},[93,97,101,105,110,115,120,122,127,130,134],{"id":21,"doc_module":4,"doc_module_name":46,"category_name":94,"show_sort_weight":95,"slug":96},"Story & Novel",90,"story-novel",{"id":47,"doc_module":4,"doc_module_name":46,"category_name":98,"show_sort_weight":99,"slug":100},"Literature",80,"literature",{"id":20,"doc_module":4,"doc_module_name":46,"category_name":102,"show_sort_weight":103,"slug":104},"Exam",70,"exam",{"id":106,"doc_module":4,"doc_module_name":46,"category_name":107,"show_sort_weight":108,"slug":109},5,"Comic",60,"comic",{"id":111,"doc_module":4,"doc_module_name":46,"category_name":112,"show_sort_weight":113,"slug":114},6,"Technology",50,"technology",{"id":116,"doc_module":4,"doc_module_name":46,"category_name":117,"show_sort_weight":118,"slug":119},7,"Healthcare",40,"healthcare",{"id":11,"doc_module":4,"doc_module_name":46,"category_name":12,"show_sort_weight":29,"slug":121},"research-report",{"id":123,"doc_module":4,"doc_module_name":46,"category_name":124,"show_sort_weight":125,"slug":126},9,"Religion & Spirituality",20,"religion-spirituality",{"id":125,"doc_module":4,"doc_module_name":46,"category_name":128,"show_sort_weight":125,"slug":129},"World Cup","world-cup",{"id":131,"doc_module":4,"doc_module_name":46,"category_name":132,"show_sort_weight":131,"slug":133},10,"Lifestyle","lifestyle",{"id":135,"doc_module":4,"doc_module_name":46,"category_name":136,"show_sort_weight":106,"slug":137},19,"General","general"]