SPL: Orchestrating Workflows with Declarative Deterministic-Probabilistic Composition

📅 2026-07-05
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the fragmentation in existing frameworks that treat deterministic and probabilistic computations in isolation, lacking a unified declarative language to orchestrate large language models (LLMs) and symbolic tools. We propose Structured Prompt Language (SPL), the first framework to deeply integrate probabilistic operations (GENERATE/EVALUATE) and deterministic reasoning (SOLVE/ASSERT) within a single declarative paradigm. SPL supports shared variable binding, runtime dynamic routing, and seamless interoperability with LLMs (e.g., Ollama, Anthropic), symbolic engines (e.g., SymPy, SageMath, Lean), and the distributed execution grid Momagrid. Across 1,200 experiments, SPL achieves machine-verified correctness rates of 82–93% (e.g., 93% for gemma4:e2b), substantially outperforming pure LLM baselines; most failures stem from solver kernels rejecting invalid expressions.
📝 Abstract
We 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. We validate SPL through an extensive 78-recipe cookbook and a controlled 1,200-run experiment (10 models x 20 problems x 2 arms x 3 repetitions; the 20 problems span 6 difficulty tiers). The solver arm achieves 82-93% machine-verified correctness (sonnet-4-6: 85%, gemma4:e2b: 93%) 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.
Problem

Research questions and friction points this paper is trying to address.

declarative language
deterministic computation
probabilistic computation
workflow orchestration
LLM integration
Innovation

Methods, ideas, or system contributions that make the work stand out.

declarative language
deterministic-probabilistic composition
structured prompt language
verified correctness
runtime routing
🔎 Similar Papers
No similar papers found.