Compiling Deterministic Structure into SLM Harnesses
On the map: LLM reasoning → Reasoning for agents, planning and code
Abstract (arXiv)
Enterprise SLM deployment faces epistemic asymmetry: small models cannot self-correct reasoning errors, while frontier LLMs incur prohibitive costs and data sovereignty risks at scale. We propose Semantic Gradient Descent (SGDe), a teacher-student framework that compiles agentic workflows into discrete execution plans--DAG topologies, system prompts, and deterministic code. The trailing e distinguishes this discrete, compilation-based approach from stochastic gradient descent. Operating in discrete semantic space, a frontier teacher generates natural-language critiques that serve as directional gradients to iteratively refine the SLM's workflow artefacts. We formalise SGDe under PAC learning, establishing sample-complexity bounds that enable convergence with as few as three training examples by leveraging the teacher as a statistical prior. On an adversarially synthesized GSM-Hard test set, compiled workflows achieve 91.3% accuracy at m=5 and 99.3% at m=3--a +26.3% to +34.3% absolute gain over state-of-the-art prompt optimisers. Within harness engineering, SGDe treats deterministic code placement (which subtasks to delegate to Python versus retain as LLM calls) as a trace-driven, per-node optimisation target, generalising static whole-problem offloading in PAL and PoT. The teacher compiles two deterministic structures: capability offloading (delegating subtasks to Python when the SLM is unreliable) and structural consensus (wrapping variance-sensitive steps in fan-out/fan-in subgraphs with deterministic voting).
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Placed in Reasoning for agents, planning and code, one of 17 directions in LLM reasoning. Builds on 24 of its 29 references that are in the map. First posted on arXiv 19 Apr 2026.
Builds on
24 of 29 references.
Closest ancestors · 2
Same direction, newest first
- 2024AFlow: Automating Agentic Workflow Generation14 Oct
- 2024Mixture-of-Agents Enhances Large Language Model Capabilities7 Jun
Other references · 22
- 2023AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversationcited by 1,906
- 2023AgentBench: Evaluating LLMs as Agentscited by 1,211
- 2022Program of Thoughts Prompting: Disentangling Computation from Reasoning for Numerical Reasoning Taskscited by 1,057
- 2023Large Language Models Cannot Self-Correct Reasoning Yetcited by 965
- 2023Graph of Thoughts: Solving Elaborate Problems with Large Language Modelscited by 873
- 2023Large Language Models as Optimizerscited by 830
- 2023DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelinescited by 803
- 2022PAL: Program-aided Language Modelscited by 635
- 2024RouteLLM: Learning to Route LLMs with Preference Datacited by 633
- 2023Automatic Prompt Optimization with "Gradient Descent" and Beam Searchcited by 628
- 2023AgentTuning: Enabling Generalized Agent Abilities for LLMscited by 319
- 2024TextGrad: Automatic "Differentiation" via Textcited by 250
10 more
- 2023FireAct: Toward Language Agent Fine-tuningcited by 247
- 2023Domain Specialization as the Key to Make Large Language Models Disruptive: A Comprehensive Surveycited by 134
- 2024A Comprehensive Survey of Small Language Models in the Era of Large Language Models: Techniques, Enhancements, Applications, Collaboration with LLMs, and Trustworthinesscited by 125
- 2024Small Language Models: Survey, Measurements, and Insightscited by 109
- 2024Small Language Models Need Strong Verifiers to Self-Correct Reasoningcited by 85
- 2025AutoAgent: A Fully-Automated and Zero-Code Framework for LLM Agentscited by 49
- 2025Difficulty-Aware Agentic Orchestration for Query-Specific Multi-Agent Workflowscited by 23
- 2024How to Correctly do Semantic Backpropagation on Language-based Agentic Systemscited by 18
- 2024Efficient Knowledge Distillation: Empowering Small Language Models with Teacher Model Insightscited by 4
- 2026Interfaze: The Future of AI is built on Task-Specific Small Modelscited by 2
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026SkVM: Revisiting Language VM for Skills across Heterogenous LLMs and Harnesses
- 2025Scaling LLM Planning: NL2FLOW for Parametric Problem Generation and Rigorous Evaluation
- 2026Prior Knowledge or Search? A Study of LLM Agents in Hardware-Aware Code Optimization
- 2026FlowBot: Inducing LLM Workflows with Bilevel Optimization and Textual Gradients
- 2026TraceCompiler: Skill-Guided Mining and Compilation of LLM Agent Traces into Mostly Deterministic Workflows
- 2026OptiSkill: A Hierarchical and Evolving SkillBank for LLM-Based Optimization Modeling
- 2026Compile, Then Page: Executable SOP Programs and a Capability-Gated Runtime for Procedural LLM Agents
- 2026Reasoning as Gradient: Scaling MLE Agents Beyond Tree Search