[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-83290-en":3,"doc-seo-83290-105":29,"detail-sidebar-cat-0-en-105":83},{"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":20,"is_downloadable":20,"audit_status":20,"page_count":21,"language":22,"language_code":23,"site_id":24,"html_lang":23,"table_of_contents":25,"faqs":26,"seo_title":13,"seo_description":14,"update_tm":27,"read_time":28},83290,1374391974564,"Clementine","https://ap-avatar.wpscdn.com/avatar/14000253aa45c000a9e?x-image-process=image/resize,m_fixed,w_180,h_180&k=1779874745381141002",8,"Research & Report","Orchestrating Workflows with Declarative Deterministic–Probabilistic Composition","Structured Prompt Language (SPL) introduces a declarative specification that composes deterministic and probabilistic computation in a single workflow. SPL unifies LLM orchestration and symbolic computation by sharing syntax, variable bindings, and runtime routing across probabilistic (GENERATE/EVALUATE) and deterministic (SOLVE/ASSERT) modes. SPL specifications run unchanged across local nodes, cloud APIs, and distributed grids, deferring model and verifier choices to invocation time. Evaluation uses a 78-recipe cookbook and controlled 1,200-run experiments comparing verified correctness against unverified fluency.","arXiv :2607 .07727v 1 [ cs .PL] 6 Jul 2026  \nOrchestrating Workflows with Declarative Deterministic–Probabilistic Composition  \nWen G. Gong  \n[wen.g.gong@gmail.com](wen.g.gong@gmail.com)  \nIndependent Researcher  \nAbstract  \nWe present SPL (Structured Prompt Language), a declarative language that composes deterministic and probabilistic computation modes in a single specification. While existing frameworks separate these—orchestration systems (AutoGen, CrewAI, LangGraph) for LLM calls, symbolic tools (SymPy, SageMath, Lean) for computation—SPL unifies them. It provides GENERATE/EVALUATE for probabilistic computation and SOLVE/ASSERT for deterministic computation, sharing syntax, variable bindings, and runtime routing. A .spl specification runs unchanged across local nodes (Ollama), cloud APIs (OpenRouter, Anthropic), and distributed grids (Momagrid), with model and verifier selection deferred to invocation time.  \nWe validate SPL through an extensive 78-recipe cookbook and a controlled 1 ,200-run experiment (10 models × 20 problems × 2 arms × 3 repetitions; the 20 problems span 6 difficulty tiers) . The solver arm achieves 82–93% machine-verified correctness (sonnet-4-6: 85%, gemma4:e2b:  \n93%) while the LLM-only arm measures output production without mathematical verification, making the comparison one of verified correctness against unverified fluency. A backend difficulty gradient emerges (SymPy 78%, Sage 54%), and the dominant failure mode is solver_error (kernel-rejected expressions), not format non-compliance.  \nKeywords: declarative language, LLM orchestration, deterministic-probabilistic composition, workflow specification, symbolic verification, structured prompt language  \n1 Introduction  \n1.1 The Problem: Fragmentation in LLM Programming  \nBuilding LLM-powered workflow systems today demands a daunting intersection of skills. A practitioner must master prompt engineering for effective LLM interaction, Python programming for orchestration logic, API wrangling across disparate model providers, and manual state management for multi-step reasoning. Each popular framework — LangGraph, AutoGen [1], CrewAI [2] —introduces its own abstractions, API surfaces, and execution models, creating a fragmented ecosystem where knowledge transfers poorly and vendor lock-in is the norm.  \nThis situation echoes a pattern the data industry has seen before. In the early days of relational databases, programmers wrote imperative C and COBOL code to traverse data structures, manage cursors, and handle errors—all in application-specific ways. The introduction of SQL in the 1970s transformed this landscape by providing a declarative specification layer: users described what data they wanted, not how to retrieve it. This separation enabled decades of optimizer innovation underneath a stable surface language. The current state of LLM programming is analogous to the pre-SQL era: powerful capabilities buried under layers of imperative glue code.  \nThe barrier to entry compounds the problem. To build even a simple self-refining workflow— one that drafts, critiques, and revises its own output—a developer must write 80–150 lines of Python across multiple framework abstractions. This excludes the vast population of domain experts, analysts, and researchers who understand their workflows but lack the software engineering skills to express them in imperative orchestration code.  \n1.2 The Two-Mode Gap  \nAll existing frameworks—declarative and imperative alike—operate in a single computation mode. LLM-centric systems (LangGraph, DSPy, AutoGen) produce approximate, non-reproducible outputs shaped by the model’s training distribution. Symbolic tools (SymPy, SageMath, Lean) produce exact, reproducible, machine-verifiable results. Neither world speaks the other’s language within a unified programming model. We call this the two-mode gap.  \nReal agentic tasks routinely require both. A homework assistant must plan a solution in natural language (probabilistic),","cbCaihLUyGKB5sPz","https://ap.wps.com/l/cbCaihLUyGKB5sPz","pdf",500488,1,46,"English","en",105,"# Introduction\n## The Problem: Fragmentation in LLM Programming\n## The Two-Mode Gap\n# SPL: Structured Prompt Language\n## Core Primitives and Composition Model\n## Execution Across Runtimes\n# Experimental Validation\n## Cookbook Evaluation\n## Controlled 1,200-Run Study\n## Error Analysis","[{\"question\":\"How was SPL evaluated and how were results compared?\",\"answer\":\"Evaluation includes a 78-recipe cookbook and a controlled 1,200-run experiment spanning multiple models and problem difficulties. The solver path reports machine-verified correctness, while the LLM-only path measures output production without mathematical verification, enabling a verified-vs-unverified comparison.\"}]",1784186512,116,{"code":4,"msg":30,"data":31},"ok",{"site_id":24,"language":23,"slug":32,"title":13,"keywords":33,"description":14,"schema_data":34,"social_meta":78,"head_meta":80,"extra_data":82,"updated_unix":27},"orchestrating-workflows-with-declarative-deterministicprobabilistic-composition","",{"@graph":35,"@context":77},[36,53,68],{"@type":37,"itemListElement":38},"BreadcrumbList",[39,43,47,50],{"item":40,"name":41,"@type":42,"position":20},"https://docshare.wps.com","Home","ListItem",{"item":44,"name":45,"@type":42,"position":46},"https://docshare.wps.com/document/","Document",2,{"item":48,"name":12,"@type":42,"position":49},"https://docshare.wps.com/document/research-report/",3,{"item":51,"name":13,"@type":42,"position":52},"https://docshare.wps.com/document/orchestrating-workflows-with-declarative-deterministicprobabilistic-composition/83290/",4,{"url":51,"name":13,"@type":54,"author":55,"headline":13,"publisher":57,"fileFormat":60,"inLanguage":23,"description":14,"dateModified":61,"datePublished":62,"encodingFormat":60,"isAccessibleForFree":63,"interactionStatistic":64},"DigitalDocument",{"name":9,"@type":56},"Person",{"url":40,"name":58,"@type":59},"DocShare","Organization","application/pdf","2026-07-22","2026-07-16",true,{"@type":65,"interactionType":66,"userInteractionCount":20},"InteractionCounter",{"@type":67},"ViewAction",{"@type":69,"mainEntity":70},"FAQPage",[71],{"name":72,"@type":73,"acceptedAnswer":74},"How was SPL evaluated and how were results compared?","Question",{"text":75,"@type":76},"Evaluation includes a 78-recipe cookbook and a controlled 1,200-run experiment spanning multiple models and problem difficulties. The solver path reports machine-verified correctness, while the LLM-only path measures output production without mathematical verification, enabling a verified-vs-unverified comparison.","Answer","https://schema.org",{"og:url":51,"og:type":79,"og:title":13,"og:site_name":58,"og:description":14},"article",{"robots":81,"canonical":51},"index,follow",{"doc_id":7,"site_id":24},{"code":4,"msg":5,"data":84},[85,89,93,97,102,107,112,115,120,123,127],{"id":20,"doc_module":4,"doc_module_name":45,"category_name":86,"show_sort_weight":87,"slug":88},"Story & Novel",90,"story-novel",{"id":46,"doc_module":4,"doc_module_name":45,"category_name":90,"show_sort_weight":91,"slug":92},"Literature",80,"literature",{"id":52,"doc_module":4,"doc_module_name":45,"category_name":94,"show_sort_weight":95,"slug":96},"Exam",70,"exam",{"id":98,"doc_module":4,"doc_module_name":45,"category_name":99,"show_sort_weight":100,"slug":101},5,"Comic",60,"comic",{"id":103,"doc_module":4,"doc_module_name":45,"category_name":104,"show_sort_weight":105,"slug":106},6,"Technology",50,"technology",{"id":108,"doc_module":4,"doc_module_name":45,"category_name":109,"show_sort_weight":110,"slug":111},7,"Healthcare",40,"healthcare",{"id":11,"doc_module":4,"doc_module_name":45,"category_name":12,"show_sort_weight":113,"slug":114},30,"research-report",{"id":116,"doc_module":4,"doc_module_name":45,"category_name":117,"show_sort_weight":118,"slug":119},9,"Religion & Spirituality",20,"religion-spirituality",{"id":118,"doc_module":4,"doc_module_name":45,"category_name":121,"show_sort_weight":118,"slug":122},"World Cup","world-cup",{"id":124,"doc_module":4,"doc_module_name":45,"category_name":125,"show_sort_weight":124,"slug":126},10,"Lifestyle","lifestyle",{"id":128,"doc_module":4,"doc_module_name":45,"category_name":129,"show_sort_weight":98,"slug":130},19,"General","general"]