SPL统一声明式编排确定性与概率计算,实现跨平台无缝执行。
SPL: Orchestrating Workflows with Declarative Deterministic-Probabilistic Composition

- 用GENERATE/EVALUATE和SOLVE/ASSERT统一处理概率与确定性计算
- 1200次实验验证,93%正确率(gemma4:e2b)优于仅生成不验证的模型
- 支持本地、云端、分布式多环境运行,适合构建高可信智能流程
我们提出SPL(结构化提示语言),一种声明式语言,可在单一规范中组合确定性与概率计算。现有框架将二者分离——如AutoGen、CrewAI、LangGraph用于LLM调用,SymPy、SageMath、Lean用于符号计算——而SPL实现了统一。它提供GENERATE/EVALUATE用于概率计算,SOLVE/ASSERT用于确定性计算,共享语法、变量绑定与运行时路由。.spl规格文件可在本地节点(Ollama)、云API(OpenRouter、Anthropic)及分布式网格(Momagrid)上无改动运行,模型与验证器选择推迟至调用时刻。通过78个配方菜谱与1200次受控实验(10模型×20问题×2分支×3重复;20问题涵盖6个难度层级)验证。求解分支实现82%-93%机器验证正确率(sonnet-4-6:85%,gemma4:e2b:93%),而仅生成分支衡量输出生成但无数学验证,对比为验证正确率与未验证流畅性之差。后端难度梯度显现(SymPy 78%,Sage 54%),主要失败模式为solver_error(内核拒绝表达式),而非格式错误。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。