---
title: 'Compound LLM Framework: Graph Abstractions & Schedulers'
url: https://www.emergentmind.com/topics/compound-llm-framework
type: topic
---

# Compound LLM Framework: Graph Abstractions & Schedulers

Searching arXiv for recent papers on compound LLM frameworks, model selection, scheduling, and scaffolded/agent architectures.
A compound LLM framework is a compound AI system in which a base LLM is embedded in a multi-component program rather than used as a single isolated predictor. In the cited literature, such systems appear as compound AI systems that combine multiple LLM calls, scaffolded language models with prompts, tools, and scaffold code, uncertainty-aware compound LLM applications, and graph-structured pipelines with stochastic nodes and heterogeneous outputs [2502.14815] [2410.16392] [2504.03444] [2605.23956]. Typical workflows include self-refine, multi-agent debate, retrieval-augmented generation, generate-test-critique loops, hierarchical agent delegation, and pre-inference or post-inference repair. Taken together, these formulations suggest that the central object of design is no longer a single model invocation but a computation graph whose nodes, interfaces, routing rules, and runtime policies jointly determine quality, cost, latency, and reliability.

## 1. Scope and conceptual definition

The broadest formalization in the survey literature defines a scaffolded language model as a compound AI system comprising a base LLM with fixed parameters $\theta$, prompt templates $P$, tool interfaces $T$, and scaffold code $S$, so that the overall system implements
$$
\hat y = \mathrm{System}(x; \theta, P, T, S).
$$
Within this view, the non-parametric variables are the prompts, tools, and code, and the system may instantiate architectures such as LLM + Tools, LLM + Code Interpreter, Retrieval-Augmented Generation, or Search Over LLM Calls [2410.16392].

Other papers specialize this general notion. In model selection for compound AI systems, a static compound AI system is a directed acyclic graph $G=(V,E)$ of LLM modules, where each node is one module such as a generator, critic, or refiner, and a model allocation $f:V\to M$ assigns exactly one model to each module [2502.14815]. In systems work, a compound LLM application is likewise represented as a DAG, but its stages may be regular, LLM, or dynamic, with dynamic stages expanding at runtime [2504.03444]. In retrieval, a compound retrieval system is defined as a broader class than cascading re-ranking, allowing arbitrary interactions among a first-stage scorer, pointwise relevance predictors, and pairwise LLM relevance predictors [2504.12063].

A recurring point across these formulations is that “compound” does not mean only “multi-agent.” It also includes linear pipelines, cascades, retrieval systems, verification loops, and heterogeneous training jobs. This directly contradicts the common simplification that compound design is synonymous with debate-style agents. The surveyed taxonomy explicitly includes RAG, code-interpreter wrappers, and search over LLM calls, while retrieval work shows that even classical ranking systems become compound once multiple predictors are jointly optimized [2410.16392] [2504.12063].

## 2. Architectural primitives and graph formalisms

The graph abstraction is the dominant formal device for describing compound LLM frameworks, but different papers attach different semantics to the nodes and edges. In model-allocation work, nodes are LLM modules and end-to-end performance is
$$
P(f)=\mathbb E_{z\sim D}[p(f,z)],
$$
with $p(f,z)\in\{0,1\}$ a binary success indicator [2502.14815]. In systems scheduling, each stage has an uncertain duration, and dynamic stages have uncertain internal membership and edges, so the runtime graph itself is partially stochastic [2504.03444]. QUIVER extends the graph formalism further to a typed pipeline graph $G=(V,E,T,F)$, where each node computes a stochastic function into a typed output space and node-wise distances are type-dispatched over categorical, set-valued, ordered-list, numeric, or text fields [2605.23956].

These differences matter because they determine what can be optimized or guaranteed. A static DAG is suitable for model allocation or module-wise search. A DAG with dynamic stages is suitable for scheduling under structural uncertainty. A typed stochastic graph is suitable for perturbation analysis, sensitivity measurement, and bifurcation detection. This suggests that “compound LLM framework” is best understood as a family of graph-based abstractions, not a single canonical architecture.

Several concrete control patterns recur across the literature. LLM-Modulo instantiates a generate-test-critique loop with a base LLM, format critic, constraint critics, and a meta-controller that consolidates failures into a backprompt [2411.14484]. TorchOpera uses a linear pre-inference and post-inference pipeline around a core LLM: safety detector, grounding module, core LLM, output safety detector, and repairer [2406.10847]. The Concurrent Modular Agent departs from centralized control altogether: modules are independently running Python async functions, a shared vector database stores utterances as embeddings, MQTT carries module-to-module messages, and there is no central clock or controller [2508.19042].

## 3. Optimization, routing, and model allocation

One core optimization problem is deciding which LLM to use at each module of a compound system. LLMSelector formulates this as the Model Selection Problem, maximizing $P(f)$ over allocations $f:V\to M$, where the search space has size $|M|^{|V|}$ [2502.14815]. The framework exploits two empirical insights: end-to-end performance is often monotonic in module performance with other modules fixed, and module-wise performance can be estimated accurately by a sufficiently capable LLM “diagnoser.” Its greedy round-robin procedure estimates
$$
g_i(m)\approx \mathbb E_{z\in D}[\hat p_i(f^t_{i\to m},z)]
$$
for each candidate model at module $i$, assigns the $\arg\max$, and repeats until convergence or budget exhaustion. Under module-wise intra- and inter-monotonicity and uniqueness of the global optimum, the procedure converges to the globally optimal allocation on the training set within $K$ rounds, with one full pass costing $K\cdot |M|$ diagnoser calls [2502.14815]. Empirically, on Self-Refine, Multi-Agent Debate, and Locate-Solve, it yields 5%–70% absolute gains over the best homogeneous allocation, including 89% to 95% on LiveCodeBench and 30% to 100% on TableArithmetic [2502.14815].

AdaptiveLLM addresses a related but narrower routing problem for code generation under cost constraints. It estimates task difficulty from the median Chain-of-Thought length generated by DeepSeek-R1-Distill-Qwen-32B over $T=10$ runs, clusters the scalar difficulty proxy into three levels by k-means, fine-tunes CodeBERT with triplet loss to encode difficulty-aware features, and trains an XGBoost classifier to select among eight candidate LLMs [2506.10525]. At inference, only the embedding, classifier, and selected model are active; CoT generation and difficulty clustering are offline. Reported results show pass@1 of 44.94%, a 7.86% improvement over ComplexityNet while reducing resource consumption by 88.9%, and approximately 15% accuracy improvement over a single model at the same cost consumption [2506.10525].

In retrieval, optimization concerns not only which model to invoke but where to invoke it and how to combine its outputs. Compound retrieval systems introduce a learned selection policy over pointwise and pairwise LLM calls and a learned aggregation function, optimized by a trade-off loss
$$
\mathcal L_{\rm comp}(f,\pi)=\alpha \mathcal L_{\rm ranking}(\pi,f)+(1-\alpha)\mathcal L_{\rm cost}(\pi).
$$
On TREC Deep Learning data, supervised compound systems outperform all cascade baselines for $N\gtrsim 200$ calls and reach PRP’s nDCG@100 with an order-of-magnitude fewer calls, approximately 50k instead of 1,000,000 [2504.12063]. A common implication across these works is that homogeneous model assignment and fixed top-$K$ routing are often suboptimal once modules have heterogeneous strengths and costs.

## 4. Scheduling and systems support

Compound LLM frameworks are also scheduling problems. LLMSched treats each compound application as a job whose runtime structure is a DAG $G=(S,D)$ with regular, LLM, and dynamic stages, each stage having uncertain duration and dynamic stages having uncertain membership of inner nodes and edges [2504.03444]. A Bayesian network profiles discretized stage durations from historical traces; runtime inference updates posterior distributions after each completion event. Uncertainty is quantified by Shannon entropy, and the scheduler computes an uncertainty-reduction score
$$
R(s)=I(Y_{1:M};X_s\mid \mathcal E)\times \sum_{m=1}^M[\max_y P(Y_m=y\mid \mathcal E)-\min_y P(Y_m=y\mid \mathcal E)].
$$
Dispatch then interleaves exploration, selecting the ready stage with maximal $R(s)$, and exploitation, selecting the ready stage from the job with shortest expected remaining time, through an $\epsilon$-greedy meta-policy [2504.03444]. On six representative applications, LLMSched reduces average JCT by 14–79% in simulation and 26–66% on a testbed relative to six baselines including FCFS, SJF, Argus, Decima, and Carbyne [2504.03444].

Maestro extends compound reasoning to training workloads such as knowledge distillation and multimodal LLM training. It restructures a heterogeneous training job into a section graph $G=(S,E)$, where each section is annotated by parameter count, execution mode, and effective sequence length, and each section independently chooses configuration
$$
C^s=\{DP^s,TP^s,PP^s,CP^s,mbs^s,fanout^s\}.
$$
A two-stage optimization first identifies the critical section and optimizes its efficiency, then assigns the smallest GPU allocation to auxiliary sections such that they never stall the critical section. To handle data-dependent activation, Maestro introduces a wavefront scheduling algorithm that reorders samples so the critical section has zero idle time [2605.10501]. On vision-language training, Maestro achieves 1.4$\times$ and 1.20$\times$ end-to-end throughput over Megatron-LM; on distillation, 1.75$\times$ end-to-end throughput; deployed in production, it reduces GPU consumption by approximately 40% [2605.10501].

These results make clear that compound LLM frameworks are constrained by orchestration at two levels: intra-application routing among modules and cluster-level scheduling among heterogeneous stages. This suggests that improvements in prompting or reasoning can be negated by poor scheduling, especially when execution paths are data-dependent.

## 5. Reliability, verification, and perturbation analysis

A major motivation for compound design is to impose reliability properties that a single LLM call cannot provide. LLM-Modulo exemplifies this approach in planning and scheduling. The system pairs a generator with a complete set of sound verifiers, rejecting any candidate that fails the format critic or any constraint critic and feeding consolidated feedback back to the generator [2411.14484]. The formal guarantee is soundness: if the system returns a plan $p$, then for all critics $v_i$, $v_i(p)=OK$. If each critic is sound and each checked constraint is necessary for correctness, then no fallacious plan can ever escape [2411.14484]. Across OSU Travel Planner and three Natural Plan scheduling domains, accuracy increases from 8.33% to 23.89% for GPT-4o on OSU, from 3.43% to 40.00% on Trip Planning, and up to 88.80% for Claude-3.5 on Calendar Scheduling [2411.14484].

TorchOpera addresses a different reliability axis: safety, grounding, hallucination detection, and lightweight repair. Its pre-inference phase screens unsafe inputs and grounds the prompt using vector retrieval; its post-inference phase detects hallucinations, generates explanations, and either applies rule-based wrappers or triggers re-grounding and re-inference [2406.10847]. The hallucination detector is trained as a joint classification and text-generation model on HaluEval and computes $\mathrm{Prob}[\text{Yes}]$ from top-10 first-token logits; the repairer can fix structured errors such as unsafe URLs via regex and external APIs without re-querying the core LLM [2406.10847]. Reported results include 0.928 hallucination-detection accuracy, input safety detection with Acc 0.877, Rec 0.624, F$_1$ 0.656, repair time of approximately 1.06 s on the URL task, and up to $4\times$ GPU memory saving through multi-LoRA serving [2406.10847].

QUIVER formalizes reliability as perturbation propagation rather than only end-task success. For each edge $(v_i\to v_j)$, it defines magnitude sensitivity
$$
O_{ij}=\mathbb E\left[\frac{d_j(f_j(x),f_j(x'))}{d_i(x_i,x_i')}\,\middle|\, d_i>\varepsilon\right]
$$
and occurrence-lift
$$
L_{ij}=P(d_j>0\mid d_i>0)-P(d_j>0\mid d_i=0),
$$
classifying edges as amplifiers, absorbers, or threshold-sensitive [2605.23956]. It further decomposes trajectory divergence into iteration-count divergence $D_{\mathrm{iter}}$, structural-shape divergence $D_{\mathrm{shape}}$, and value-drift divergence $D_{\mathrm{output}}$, defines bifurcation thresholds for the smallest perturbation that changes structure, and measures distribution faithfulness by $D_{KL}(P_{\mathrm{prod}}\|P_{\mathrm{eval}})$ [2605.23956]. Validated on two production enterprise pipelines and a public DSPy multihop QA pipeline, with more than 8,200 traces and more than 32,000 pairwise comparisons, QUIVER shows that equal end-to-end divergence rates can arise from mechanically different cascade patterns [2605.23956]. A common misconception is that compound reliability reduces to adding more reasoning; these papers instead show that guarantees arise from critics, detectors, typed instrumentation, and explicit control logic.

## 6. Hierarchy, multi-agent organization, and asynchronous coordination

Compound LLM frameworks frequently use multiple agents, but the literature is explicit that hierarchy and deliberation are distinct design axes. In an adversarial POMDP study in CybORG CAGE-2, the defender is modeled as
$$
M=(S,A,\Omega,T,O,R,\gamma),
$$
with non-positive reward and a 30-step horizon [2605.16205]. The study varies context representation, deliberation tools, and hierarchical decomposition. Programmatic state abstraction and compressed history provide the largest returns per token spent, improving mean return by up to 76% over raw observations. Hierarchical decomposition without deliberation achieves the best absolute performance for most models, while distributing self-questioning, self-critique, and self-improvement across sub-agents degrades performance for all five model families, reaching up to 3.4$\times$ worse mean return while using 1.8–2.7$\times$ more tokens; this destructive pattern is termed a deliberation cascade [2605.16205]. The design principle stated in that work is to invest first in deterministic state abstraction and clean task decomposition rather than deeper per-agent reasoning.

The Concurrent Modular Agent proposes a different organizational logic: fully asynchronous modules with a shared persistent vector database and MQTT-based text messaging [2508.19042]. Modules wake on timers, incoming messages, or relevant memory retrieval, query context from ChromaDB, call the LLM, and may write memory, publish messages, or invoke hardware. Because no module holds locks on the global state or message channels, failures do not block others, and a Conflict Detector meta-module flags semantically conflicting memory insertions for downstream suppression [2508.19042]. In Plantbot, end-to-end conversational latency is 400 $\pm$ 50 ms versus 800 $\pm$ 200 ms in a monolithic loop, system uptime over 48 h is 99.7%, and memory growth is approximately 5 KB/min before pruning rather than approximately 10 KB/min in the prior centralized implementation. In ALTER3, the system ran for 14 h and autonomously triggered approximately $10^4$ events [2508.19042].

LessonL shows yet another coordination mechanism: a team of LLM agents collaborates over multiple rounds by soliciting, banking, selecting, and reusing “lessons” from one another’s successes and failures [2505.23946]. Lessons are stored as triples $(z,s,f)$, where $z$ is the lesson, $s$ the speedup at creation time, and $f$ an effectiveness factor adjusted by later performance. On ParEval and PolyBench, LessonL achieves the best reported geometric mean speedup, including 2.16 in serial mode and 3.46 in OpenMP mode, and on HumanEval it reaches pass@1 of 0.915 [2505.23946]. Across these studies, more interaction is not inherently beneficial; performance depends on whether the coordination protocol resolves uncertainty, enforces contracts, and controls prompt growth.

## 7. Domain-specific realizations and broader implications

Domain-specific frameworks show how compound design scales beyond generic chat or coding. In medical multi-image reasoning, M$^3$LLM is built from a five-stage, context-aware instruction generation pipeline over 237,137 compound figures extracted from biomedical literature [2511.22232]. The stages are inline text summarization, medical knowledge complementation, visual perception enhancement, context–question–answer instruction generation, and leakage-prevented context refinement. The final model combines an InternViT vision encoder, a two-layer connector, and a QWen2.5-7B language module with multi-image cross-attention, trained for three epochs with standard next-token cross-entropy plus weight decay [2511.22232]. On PMC-MI-Bench, M$^3$LLM improves BLEU@4 from 9.8 to 15.0 and STS from 74.7 to 78.2 relative to the best baseline in open-ended multi-image VQA, and it also improves disease diagnosis and progression prediction on longitudinal chest X-rays from MIMIC [2511.22232].

The survey perspective frames these examples as instances of training scaffolded language models with language supervision: prompts, tools, and scaffold code are optimized as non-parametric variables through static synthesis, dynamic program analysis, or streaming updates based on textual critiques [2410.16392]. In that formulation, compound frameworks are semi-parametric systems whose behavior can be improved without gradient access to the base model, preserving compatibility with closed-source LLMs and mitigating catastrophic forgetting relative to direct parametric updating [2410.16392].

Several limits recur across the literature. LLMSched identifies BN structure learning, discretization trade-offs, and multi-tenant resource interference as open problems [2504.03444]. CMA identifies latency and API-cost overhead, unpredictable emergent behaviors, scalability beyond dozens of modules, and automated conflict resolution as open questions [2508.19042]. QUIVER shows that stale evaluation datasets can be localized to specific node-field categories through distribution-faithfulness analysis, implying that aggregate final-output metrics can miss high-sensitivity failure modes [2605.23956]. A plausible synthesis is that compound LLM frameworks should be evaluated simultaneously as algorithms, software architectures, and stochastic dynamical systems: they require optimization of module choice, verification and repair boundaries, scheduling and resource allocation, and production-faithful instrumentation.

Source: https://www.emergentmind.com/topics/compound-llm-framework