{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/arxiv-2605-13647","title":"FlowCompile: An Optimizing Compiler for Structured LLM Workflows","arxiv_id":"2605.13647","date":"2026-05-13","proceeding":null,"authors":["Junyan Li","Zhang-Wei Hong","Maohao Shen","Yang Zhang","Chuang Gan"],"abstract":"Structured LLM workflows, where specialized LLM sub-agents execute according to a predefined graph, have become a powerful abstraction for solving complex tasks. Optimizing such workflows, i.e., selecting configurations for each sub-agent to balance accuracy and latency, is challenging due to the combinatorial design space over model choices, reasoning budgets, and workflow structures. Existing cost-aware methods largely treat workflow optimization as a routing problem, selecting a configuration at inference time for each query according to the accuracy-latency objective used during training. We argue that structured LLM workflows can also be optimized from a compilation perspective: before deployment, the system can globally explore the workflow design space and construct a reusable set of workflow-level configurations spanning diverse accuracy-latency trade-offs. Drawing inspiration from machine learning compilers, we introduce FlowCompile, a structured LLM workflow compiler that performs compile-time design space exploration to identify a high-quality, reusable trade-off set. FlowCompile decomposes a workflow into sub-agents, profiles each sub-agent under diverse configurations, and composes these measurements through a structure-aware proxy to estimate workflow-level accuracy and latency. It then identifies diverse high-quality configurations in a single compile-time pass, without retraining or online adaptation. Experiments across diverse workflows and challenging benchmarks show that FlowCompile consistently outperforms heuristically optimized workflow configurations and routing-based baselines, delivering up to 6.4x speedup. The compiled configuration set further serves as a reusable optimization artifact, enabling flexible deployment under varying runtime preferences and supporting downstream selection or routing.","url_abs":"https://arxiv.org/abs/2605.13647","url_pdf":"https://arxiv.org/pdf/2605.13647","source":{"archive":null,"snapshot":"2025-07-28","note":"not in the Papers with Code archive (frozen at the snapshot)","row_kind":"graph","title_abstract_authors_date":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)"},"code_links":[],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2605.13647","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2605.13647"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/UMass-Embodied-AGI/FlowCompile","reach":null}],"summary":{"ran":10,"unverified":3},"by_repo_kind":{"found_in_text":{"samples":13,"ran":10,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"53e1a9cea473a26a","entry":"analyze_agent_usage","repo":"UMass-Embodied-AGI/FlowCompile","repo_kind":"found_in_text","path":"src/flowcompile/compiler/ground_truth.py","file_url":"https://github.com/UMass-Embodied-AGI/FlowCompile/blob/HEAD/src/flowcompile/compiler/ground_truth.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"53e1a9cea473a26a"}},{"code_sha256_prefix":"4f0ceea9b18f67dd","entry":"create_problem_to_metadata_map","repo":"UMass-Embodied-AGI/FlowCompile","repo_kind":"found_in_text","path":"src/flowcompile/compiler/complete_pipeline.py","file_url":"https://github.com/UMass-Embodied-AGI/FlowCompile/blob/HEAD/src/flowcompile/compiler/complete_pipeline.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4f0ceea9b18f67dd"}},{"code_sha256_prefix":"8f77cedd313681e6","entry":"find_trace_files","repo":"UMass-Embodied-AGI/FlowCompile","repo_kind":"found_in_text","path":"src/flowcompile/compiler/agent_dataset.py","file_url":"https://github.com/UMass-Embodied-AGI/FlowCompile/blob/HEAD/src/flowcompile/compiler/agent_dataset.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8f77cedd313681e6"}},{"code_sha256_prefix":"1f9b1fdd47db32fc","entry":"generate_random_indices","repo":"UMass-Embodied-AGI/FlowCompile","repo_kind":"found_in_text","path":"src/flowcompile/benchmarks/utils.py","file_url":"https://github.com/UMass-Embodied-AGI/FlowCompile/blob/HEAD/src/flowcompile/benchmarks/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1f9b1fdd47db32fc"}},{"code_sha256_prefix":"8e5c19fe5b2726c3","entry":"load_azure_config","repo":"UMass-Embodied-AGI/FlowCompile","repo_kind":"found_in_text","path":"src/flowcompile/compiler/agent_dataset.py","file_url":"https://github.com/UMass-Embodied-AGI/FlowCompile/blob/HEAD/src/flowcompile/compiler/agent_dataset.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8e5c19fe5b2726c3"}},{"code_sha256_prefix":"925a652e082f2f3a","entry":"load_trace_file","repo":"UMass-Embodied-AGI/FlowCompile","repo_kind":"found_in_text","path":"src/flowcompile/compiler/agent_dataset.py","file_url":"https://github.com/UMass-Embodied-AGI/FlowCompile/blob/HEAD/src/flowcompile/compiler/agent_dataset.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"925a652e082f2f3a"}},{"code_sha256_prefix":"94b4397c2eaf6bd6","entry":"measure_batch","repo":"UMass-Embodied-AGI/FlowCompile","repo_kind":"found_in_text","path":"src/flowcompile/compiler/latency.py","file_url":"https://github.com/UMass-Embodied-AGI/FlowCompile/blob/HEAD/src/flowcompile/compiler/latency.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"94b4397c2eaf6bd6"}},{"code_sha256_prefix":"afda4a0e9231ef2b","entry":"measure_batch_openai","repo":"UMass-Embodied-AGI/FlowCompile","repo_kind":"found_in_text","path":"src/flowcompile/compiler/latency.py","file_url":"https://github.com/UMass-Embodied-AGI/FlowCompile/blob/HEAD/src/flowcompile/compiler/latency.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"afda4a0e9231ef2b"}},{"code_sha256_prefix":"63ef8b11c6d66fdc","entry":"register_benchmark","repo":"UMass-Embodied-AGI/FlowCompile","repo_kind":"found_in_text","path":"src/flowcompile/benchmarks/registry.py","file_url":"https://github.com/UMass-Embodied-AGI/FlowCompile/blob/HEAD/src/flowcompile/benchmarks/registry.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"63ef8b11c6d66fdc"}},{"code_sha256_prefix":"4cefb9c263e68fc6","entry":"split_data_set","repo":"UMass-Embodied-AGI/FlowCompile","repo_kind":"found_in_text","path":"src/flowcompile/benchmarks/utils.py","file_url":"https://github.com/UMass-Embodied-AGI/FlowCompile/blob/HEAD/src/flowcompile/benchmarks/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4cefb9c263e68fc6"}},{"code_sha256_prefix":"90c15666efa6571b","entry":"format_float","repo":"UMass-Embodied-AGI/FlowCompile","repo_kind":"found_in_text","path":"src/flowcompile/compiler/latency.py","file_url":"https://github.com/UMass-Embodied-AGI/FlowCompile/blob/HEAD/src/flowcompile/compiler/latency.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"90c15666efa6571b"}},{"code_sha256_prefix":"f625baf4f4ac84b0","entry":"get_benchmark_class","repo":"UMass-Embodied-AGI/FlowCompile","repo_kind":"found_in_text","path":"src/flowcompile/benchmarks/registry.py","file_url":"https://github.com/UMass-Embodied-AGI/FlowCompile/blob/HEAD/src/flowcompile/benchmarks/registry.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f625baf4f4ac84b0"}},{"code_sha256_prefix":"921caf54acaa9ca3","entry":"get_benchmark_info","repo":"UMass-Embodied-AGI/FlowCompile","repo_kind":"found_in_text","path":"src/flowcompile/benchmarks/registry.py","file_url":"https://github.com/UMass-Embodied-AGI/FlowCompile/blob/HEAD/src/flowcompile/benchmarks/registry.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"921caf54acaa9ca3"}}]},"arxiv_metadata":{"licence":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)","fields":["title","abstract","authors","date"],"primary_category":"cs.CL","source":"arxiv_2026.jsonl"},"syntology_extracted_results":null}