Research
Token Economics

Token Economics and Cascading Optimization for Multi-Agent LLM Systems: A Skill-Aware Framework with Adaptive Model Routing

面向工业多智能体大语言模型(Large Language Model,LLM)系统的技能感知优化框架,通过压缩、缓存、依赖感知路由与模型自适应,控制级联式 Token 成本。

Abstract

Multi-agent LLM (Large Language Model) systems in industrial environments face a critical economic bottleneck: token consumption grows super-linearly through redundant invocations, cache fragmentation, and model misrouting. This paper proposes a token-economic framework formalized as a POMDP (Partially Observable Markov Decision Process) with three dominant cost drivers. We introduce a three-layer architecture: input compression, strategy optimization (dependency DAGs (Directed Acyclic Graphs) + hierarchical skill caching), and model adaptation. Experiments across five industrial workloads show an average token reduction of 89.4% while maintaining 95.1% of baseline accuracy. We also characterize MCP (Model Context Protocol) security risks and propose defense-in-depth mitigation.

Index Terms. Multi-agent LLM systems, token economics, skill caching, model routing, prompt compression, industrial AI.

I. Introduction

Multi-agent LLM systems are mission-critical in industry, but unlike traditional multi-agent research [1], [2], LLM-native agents cause token consumption to grow super-linearly with agent count and session length [3]. This threatens their economic sustainability in domains like compute-center management, financial monitoring, and intelligent manufacturing. Unlike single-turn LLM inference where token cost is linear and predictable, multi-agent systems exhibit three distinct pathologies that compound token consumption exponentially. First, over-invocation: 68% of LLM calls in our logs are redundant (re-executing identical skills). Second, cache fragmentation: agents lack hierarchical caching, reinventing tool schemas and re-executing skills each session. Third, model misrouting: we observe that 62% of sub-tasks in our production logs can be handled by 20× cheaper models without accuracy loss.

These three pathologies are not independent. In a typical industrial multi-agent session orchestrated by our platform, a master agent delegates to three specialist agents; each specialist loads identical tool schemas, invokes overlapping skills, and routes all reasoning through the largest available model. The result is a token cascade. To derive this, consider a session with NN agents and TT turns. At each turn tt, every agent ii reloads its conversation history of length O(t)\mathcal{O}(t) tokens. The total input tokens per turn are i=1NO(t)=O(Nt)\sum_{i=1}^{N}\mathcal{O}(t)=\mathcal{O}(Nt). Summing over TT turns yields a cumulative cost of t=1TO(Nt)=O(NT2)\sum_{t=1}^{T}\mathcal{O}(Nt)=\mathcal{O}(NT^2). This quadratic growth, far exceeding linear expectation, threatens the economic viability of enterprise agent deployment, particularly as Gartner

Token consumption in a multi-agent session with and without optimization

Fig. 1. Token cascade effect in multi-agent sessions.

projects multi-agent systems to transition from occasional LLM invocation to continuous loop-based operation [3].

Contributions: Our contributions are threefold, distinguishing novel components from integrated state-of-the-art tools.

Novel components: (i) We identify three dominant cost pathologies (over-invocation, cache fragmentation, and model misrouting) and formalize them within a POMDP framework to structure the optimization. (ii) We propose a dependency-aware router with a cost-sensitive loss function (Eq. 6) that explicitly models inter-agent dependency depth, a feature absent in prior routing work. (iii) We design a three-layer hierarchical cache (L1 KV (Key-Value), L2 skill, L3 schema) with cross-agent visibility within sessions, and provide empirical threshold optimization.

Integrated and adapted components: (iv) We integrate and orchestrate existing tools - including HDPO [4] for redundant call suppression, BEAVER [5] for RAG (Retrieval-Augmented Generation) compression, and MCP Code Mode for tool invocation - within our framework. The synergy of this orchestration yields gains beyond the sum of individual tools (see ablation, Table IV). (v) We systematically evaluate the integrated framework across five industrial workloads, demonstrating its practical viability.

II. Related Work

Prior work on LLM cost optimization focuses on single-turn inference; we organize around three multi-agent cost drivers.

HDPO [4] reduces redundant tool calls (98% to 2%). Skill-Lens [6] and MIND-Skill [7] reuse skills but lack caching. Our skill cache reduces invocations by 72%.

API-level prompt caching [8] reduces static-prefix costs by 85–89% by storing system prompts across consecutive calls, yet it addresses only the narrow problem of identical prefixes within a single session. KV-cache compression reduces memory footprint during autoregressive generation but does not persist across sessions and provides no semantic-level reuse. Submodular optimization guides cache management [9], [10]. We extend this insight to a three-level hierarchy (L1 KV-cache, L2 skill-cache, L3 schema-cache) and provide empirical curvature bounds justifying submodular approximation in the multi-agent token optimization domain.

Model routing selects the most cost-effective model for each query. FrugalGPT [11] cascades models (20–30% cost reduction). Switchcraft [12] targets agentic tool-calling. Traditional MAS addresses graph allocation [13] and edge orchestration [14] but not token cost. Our router uses call-graph topology and cost-sensitive loss.

Industrial MAS (Multi-Agent Systems) focuses on physical coordination [15]– [17]; our work addresses LLM token economics.

MCP Code Mode reduces tool-call tokens but has RCE (Remote Code Execution) vulnerabilities [18] (10 CVEs, more than 7k servers affected) and over-permissioning [19], motivating our defense-in-depth approach (Section IV-B4).

III. Problem Formulation

We formalize the token consumption dynamics of a multi-agent system to expose the structural drivers of cost escalation and to establish an optimization objective amenable to layered decomposition.

A. POMDP Formulation

Let the agent state at turn tt be st=[bt,Kt,Dt,Mt]s_t=[b_t,K_t,D_t,M_t], where btb_t is remaining budget, KtK_t is cache content hashes, DtD_t is pending dependency counts, and MtM_t is current model assignments. The action space A\mathcal{A} includes: compress history, select model mkm_k, query cache, or invoke LLM. The state transition is st+1=f(st,at,ot)s_{t+1}=f(s_t,a_t,o_t), where oto_t is observation. The Bellman equation for the optimal token-cost policy is:

Jt(s)=minaA[cost(a)+γE[Jt+1(ss,a)]](1)J_t(s) = \min_{a \in \mathcal{A}} \left[ \operatorname{cost}(a) + \gamma \,\mathbb{E}\left[J_{t+1}(s' \mid s,a)\right] \right] \tag{1}

where cost(a)\operatorname{cost}(a) measures tokens consumed by action aa and γ\gamma is a discount factor. The cost function decomposes into invocation, cache-miss, and routing components. Solving this POMDP exactly is computationally intractable due to large state spaces, partial observability of agent intentions, and inter-agent dependencies that create non-stationary transition dynamics. Our three-layer framework constitutes a greedy approximation: each layer optimizes a decomposed component of cost(a)\operatorname{cost}(a) with bounded regret, coordinated through shared state variables (budget counters, cache directories, dependency graphs).

B. Decomposed Cost Model

The total token cost decomposes into three components:

Ctotal=Cinvocation+Ccache miss+Crouting.C_{\mathrm{total}} = C_{\mathrm{invocation}} + C_{\mathrm{cache\ miss}} + C_{\mathrm{routing}}.

For agent aia_i at turn tt, invocation cost is:

Cinv(t,i)=SYSi+Hi(t)+Oi(t)+Ri(t)(2)C_{\mathrm{inv}}(t,i) = \lvert \mathrm{SYS}_i \rvert + \lvert H_i(t) \rvert + \lvert O_i(t) \rvert + \lvert R_i(t) \rvert \tag{2}

where SYSi\mathrm{SYS}_i is the system prompt (tool schemas, role definitions, safety instructions), Hi(t)H_i(t) is conversation history, Oi(t)O_i(t) is external observation, and Ri(t)R_i(t) is retrieved document context. SYSi\mathrm{SYS}_i is reinjected every turn; agents share subsets but each pays full cost (duplication). For NN agents with 15K prompts, per-turn cost is N15KN\cdot15\mathrm{K}. History tokens also repeat quadratically.

Cache-miss cost is:

Ccache miss=t,i(1hitL1)GENi+t,i(1hitL2)SKILLi+t,i(1hitL3)SCHEMAi(3)\begin{aligned} C_{\mathrm{cache\ miss}} &= \sum_{t,i} (1-\mathrm{hit}_{L1})\lvert \mathrm{GEN}_i \rvert \\ &\quad + \sum_{t,i} (1-\mathrm{hit}_{L2})\lvert \mathrm{SKILL}_i \rvert \\ &\quad + \sum_{t,i} (1-\mathrm{hit}_{L3})\lvert \mathrm{SCHEMA}_i \rvert \end{aligned} \tag{3}

where hitLk\mathrm{hit}_{L_k} denotes the hit rate at level kk. In current systems, hitL2\mathrm{hit}_{L2} and hitL3\mathrm{hit}_{L3} are near zero because agents lack persistent skill and schema caches across sessions. Our production measurements show that 34% of LLM calls re-execute skills with semantically identical inputs, and 89% of tool-schema tokens are redundant across agents within the same session. The L2 cache hit rate of 72% achieved by our framework directly eliminates these redundant invocations, while the L3 shared schema cache eliminates cross-agent duplication.

Routing cost:

Crouting=kckImink:qkqreqckI(4)C_{\mathrm{routing}} = \sum_k c_k \lvert I \rvert - \min_{k:\,q_k \ge q_{\mathrm{req}}} c_k \lvert I \rvert \tag{4}

where qreqq_{\mathrm{req}} is the required capability. Static assignment yields excess cost. Our dependency-aware router encodes downstream dependencies (a simple sub-task may be critical if three agents depend on it).

C. Optimization Objective

The optimization objective is:

minCtotalsubject toaccuracyθ.\min C_{\mathrm{total}} \qquad \text{subject to} \qquad \mathrm{accuracy} \ge \theta.

This is NP-hard; we adopt layered greedy optimization, with each layer optimizing its component independently. Ablation (Table IV) shows removing any layer degrades performance by 15–34%, indicating synergy.

IV. Proposed Framework

We propose a unified framework addressing the three cost drivers at complementary granularity levels. The architecture is designed for multi-agent sessions where agents share skills, tools, and model resources. Figure 2 illustrates the framework and its data flows.

A. Input Compression

The input layer reduces the token volume entering each LLM call. We employ a hybrid strategy differentiated by content type. For history, two-stage pruning (TF-IDF + attention) reduces tokens 45–60%, plus semantic deduplication. For RAG, we integrate the BEAVER page selection method [5] as our retrieval compression module, reducing 128K tokens to ∼3K tokens per query.

Three-layer token optimization framework

Fig. 2. Three-layer optimization framework.

TABLE I

L2 Skill-Cache Threshold Sensitivity (Mean ± SD, n=200n=200 per workload).

τ\tauHit Rate (%)Semantic Correctness (%)Selected
0.8578.3 ± 4.291.2 ± 3.1No
0.9074.1 ± 3.894.5 ± 2.4No
0.9272.0 ± 3.596.8 ± 1.9Yes
0.9560.2 ± 4.198.1 ± 1.4No

Skills are encoded into compact pseudocode signatures, reducing 500–2,000 tokens to 50–150 per skill. Hard compression for user-facing content, soft compression for internal states.

B. Strategy Optimization

1) Hierarchical Skill Caching with Theoretically Grounded Thresholds

We implement a three-level cache with cross-agent visibility within a session. L3 (Schema Cache): Tool definitions and API specifications are hashed by SHA-256 of the normalized OpenAPI specification. When agent aia_i loads a tool, the schema is retrieved from shared L3 if another agent in the same session has already loaded it. This eliminates 89% of schema-repetition tokens. The cache is session-scoped and evicted upon session termination. L2 (Skill Cache): Skill execution results are cached by a semantic hash of input parameters, computed via all-MiniLM-L6-v2 embeddings (22M parameters). Before invoking an LLM, agents query L2 for memoized results within a cosine-similarity threshold τ\tau.

A critical design choice is the similarity threshold τ\tau. Pareto analysis on 200 calls per workload yields τ=0.92\tau=0.92 as optimal (96.8% correctness, 72% hit rate). L1 (KV Cache): Provider-level prompt caching stores static prefixes, reducing per-turn input costs by 85-89% for agents with 15K-28K system prompts.

Semantic correctness is measured by GPT-4o-as-judge: given the cached output and the ground-truth output from a full LLM call, the judge scores 1 if semantically equivalent (5-point Likert scale, threshold ≥4), else 0.

2) Adaptive Model Routing with Runtime Dependency Graph

Static model assignment ignores the fact that multi-agent sub-tasks vary widely in complexity and that inter-agent dependencies create non-local routing effects. We construct a global dependency DAG G=(V,E)G=(V,E) at master-agent initialization, where VV denotes sub-tasks and EE denotes data dependencies [20]. Each edge (uv)(u\to v) indicates that sub-task vv depends on the output of uu; nodes may have multiple incoming and outgoing edges (n-to-n relations). During execution, we maintain a runtime dependency resolver via lightweight backward propagation: when sub-task vv completes, it broadcasts its output to all dependent successors, each decrementing its pending dependency count. Stalled successors trigger adaptive branch depth recalculation. Dependency graph simplification prunes sub-tasks whose outputs are fully satisfiable by cache or alternative paths.

Dependency depth combines static and dynamic factors. The static depth is the length of the longest path from the root node to the current node in GG, precomputed via topological sort. The dynamic effective depth is:

deff=αdstatic+β(downstream countsatisfied count)+γstalled ticks(5)\begin{aligned} d_{\mathrm{eff}} &= \alpha d_{\mathrm{static}} \\ &\quad + \beta\,(\mathrm{downstream\ count} - \mathrm{satisfied\ count}) \\ &\quad + \gamma\,\mathrm{stalled\ ticks} \end{aligned} \tag{5}

where weights (α,β,γ)=(0.5,0.3,0.2)(\alpha,\beta,\gamma)=(0.5,0.3,0.2) are calibrated via offline simulation on 500 historical sessions. A lightweight BERT-based router (2.4M parameters) is trained with cost-sensitive loss:

Lrouting=j[yjlog(pj)cactualcmin](6)\mathcal{L}_{\mathrm{routing}} = -\sum_j \left[ y_j \log(p_j) \cdot \frac{c_{\mathrm{actual}}}{c_{\min}} \right] \tag{6}

penalizing expensive misclassifications more severely than cheap ones. The router receives four input features: (i) the sub-task description encoded via the same BERT backbone; (ii) estimated output length predicted by a linear regression on historical traces; (iii) effective depth; and (iv) historical accuracy of each candidate model on similar tasks, maintained in a rolling accuracy table updated after each session. Sub-tasks with deff3.0d_{\mathrm{eff}}\ge3.0 are conservatively routed to strong models (capability score 0.9\ge0.9); leaf tasks (deff<1.5d_{\mathrm{eff}}<1.5) are aggressively routed to small models or deterministic code paths.

3) Budget-Aware Turn Management

We implement a session-level token budget BB that is dynamically allocated across agents using a proportional-share algorithm. Each agent receives a sub-budget bib_i proportional to its criticality, measured by downstream dependency count. When an agent consumes 80% of bib_i, it triggers three escalation actions in sequence: (1) increase history compression ratio from 5x to 20x; (2) route subsequent sub-tasks to the cheapest adequate model; (3) prefer cached skill results over LLM inference. If the agent exceeds bib_i, it enters "survival mode": only cached results and deterministic heuristics are permitted, with a notification to the master agent for potential session replanning. This prevents individual agents from exhausting the session budget and causing cascading failures.

4) Code-Based Tool Invocation with Defense in Depth

We adopt MCP Code Mode replacing JSON with Python snippets. Tool schemas are progressively loaded (only router schema in system prompt). Combined with HDPO, this reduces tool-call tokens by 97.7%. MCP STDIO interfaces have RCE vulnerabilities [18] (10 CVEs). Our three-layer defense: (1) static pattern matcher for dangerous patterns (spawn, eval, curl, etc.); (2) command whitelist (read-only operations); (3) parameter validation (HTML-encoding). We mandate network firewalls and audit logging. Residual zero-day risk remains.

C. Model Adaptation

For model adaptation, we adopt the progressive fine-tuning strategy from PromptIntern [21] to internalize domain knowledge (system prompts, tool semantics, compliance rules) into model weights. This eliminates input-side system prompts entirely for routine tasks, achieving greater than 90% input reduction with 4.2× inference speedup. Fine-tuning: reconstruction (autoencoding, 20K pairs), behavior distillation (KL minimization, 50K pairs), and RLHF (Reinforcement Learning from Human Feedback) with PPO (Proximal Policy Optimization, 300 labels).

Break-even occurs after 5,714 inferences for stable 20K-token prompts, amortizing training cost within 12 weeks for weekly volume greater than 500 calls.

V. Experimental Evaluation

All reported percentage reductions (e.g., 89.4% average token savings, 72% redundant call reduction, 97.7% tool-call savings) represent mean values across five independent runs unless otherwise specified. Workload-specific variations are reported in the respective subsections below.

We evaluate the framework through systematic measurement across five multi-agent workload categories with statistical rigor. Benchmarks: (1) Edit-heavy coding (3-agent SWE-bench Lite, n=300n=300); (2) Explanation-heavy diagnosis (4-agent incident response, n=2,847n=2{,}847); (3) General chat (2-agent Multi-Agent Bench); (4) RAG-heavy retrieval (3-agent compliance QA (Question Answering)); (5) Tool-heavy orchestration (5-agent Kubernetes, n=1,200n=1{,}200). Models: GPT-4o, GPT-4o-mini, Claude-3.5-Sonnet, LLaMA-3.1-8B with LoRA (Low-Rank Adaptation). Baselines: Unoptimized, FrugalGPT, AgentDiet, HDPO, 500xCompressor, BEAVER. All results report Mean ± SD from 5 independent runs.

A. Skill Caching and Cross-Domain Generalization

Without caching, 68.0±3.1% of LLM calls are redundant. With L2/L3 hierarchical caching, redundant calls drop to 19.2±2.4% (72% reduction). L2 hit rate is 72.0±3.5% overall, but varies significantly by workload: tool-heavy 81.3±2.8%, RAG-heavy 58.4±4.1%, diagnosis 69.7±3.2%, coding 65.1±3.9%, chat 74.2±2.6%. L3 schema cache achieves 89.1±2.1% across all workloads because tool definitions are invariant within a session.

Cross-domain: skills trained on diagnosis transfer to coding at 61.3% (primitive) and 12.4% (domain-specific). Held-out customer-support domain: TSR (Token Savings Rate) 71.2%, accuracy 94.5%.

Token savings by strategy and workload

Fig. 3. Token savings by strategy and workload.

TABLE II

Model Routing Performance (Mean ± SD, n=5n=5 runs per workload).

WorkloadRouter Acc (%)Cost Red. (%)Acc Ret. (%)Cost/Session
Edit-heavy85.4 ± 2.367.9 ± 1.894.8 ± 1.4$1.24 ± 0.07
Explanation89.1 ± 1.966.5 ± 1.597.3 ± 1.1$2.05 ± 0.09
Chat91.2 ± 1.567.0 ± 1.398.1 ± 0.8$0.38 ± 0.02
RAG86.7 ± 2.166.8 ± 1.695.5 ± 1.3$1.87 ± 0.08
Tool84.2 ± 2.669.2 ± 2.093.4 ± 1.7$2.41 ± 0.11

B. Adaptive Model Routing

Table II presents router performance across workloads. The cost-sensitive router correctly classifies 87.3±2.1% of subtasks, with misclassifications skewed toward conservative over-provisioning (routing simple tasks to strong models) rather than dangerous under-provisioning. Compared to static GPT-4o assignment, adaptive routing achieves 67.7±1.6% cost reduction while maintaining 95.8±1.3% of baseline accuracy. Ablating dependency features reduces cost savings to 56.1% and degrades accuracy by 8.3% on orchestration workloads. The router generalizes across model updates: when GPT-4o-mini capability increased 7% between model versions, 14.2±2.3% of sub-tasks automatically shifted to the cheaper model without retraining.

Baseline (unoptimized) cost per session: edit-heavy $3.87, explanation $6.12, chat $1.15, RAG $5.64, tool-heavy $7.83.

C. Tool-Call Optimization and Security Validation

Figure 4 presents the most striking finding: the representation format of tool calls dominates token costs in orchestration workloads. JSON-based tool invocation consumes 150K tokens per 100 tool calls, primarily due to verbose schema definitions, repeated field names, and natural-language reasoning chains. Switching to code-based invocation (MCP Code Mode) collapses this to 2K tokens - a 98.7% reduction for this specific scenario (measured on 100 equivalent tool calls per run) - because Python function calls are inherently more token-efficient than JSON-RPC envelopes.

HDPO further reduces tool-call frequency from 100 to 2 invocations per task. Our combined framework integrates all three: HDPO for intent-based call suppression, callmux for

Tool-call frequency and token cost across invocation paradigms

Fig. 4. Tool-call frequency and token cost across invocation paradigms.

Accuracy under budget constraints and cumulative token consumption

Fig. 5. (a) Accuracy under budget constraints; (b) Cumulative token consumption over 25-turn sessions.

parallel call aggregation, and code-based representation for minimal per-call token overhead. The net result is 1.5 calls per task at 3.5K total tokens—97.7% reduction from baseline, with accuracy improving by 4.2±0.8% due to eliminated JSON parsing errors.

D. Budget-Aware Execution and Edge-Deployment

Figure 5(a) shows that budget-aware allocation outperforms greedy baselines at all budget levels. At 0.4× normalized budget, our method achieves 72.3±2.1% accuracy vs. 62.1±2.8% greedy—a 16.4% relative gain. Figure 5(b) demonstrates the cumulative divergence: by turn 25, the optimized system consumes 58.2±3.4% fewer tokens than baseline, with the gap widening as history pruning and caching compound.

Edge simulation (50% inference on local T4 GPUs running LLaMA-8B, with cloud fallback) increases L2/L3 cache latency from 12ms/3ms to 45ms/15ms; TSR drops from 89.4±2.1% to 82.1±2.6%; accuracy retention remains 93.8±1.9%. Recommendation: retain L2/L3 caches and the dependency-aware router in cloud; edge deployment should use cloud-based routing with local inference as fallback. This hybrid architecture maintains 86.3±2.2% TSR with 94.7±1.6% accuracy.

E. Hyperparameter Sensitivity and Ablation

Table III evaluates sensitivity to key hyperparameters. A budget threshold at 80% (our default) balances cost and accuracy; lowering it to 60% triggers premature survival mode, degrading accuracy by 8.2%. Raising it to 90% delays escalation until budget exhaustion, degrading TSR by 12.4%.

TABLE III

Hyperparameter Sensitivity (Mean ± SD, n=5n=5).

Parameter ValueTSR (%)Acc Ret. (%)
Budget 60%91.2 ± 1.886.9 ± 2.1
Budget 80%89.4 ± 2.195.1 ± 1.5
Budget 90%77.0 ± 2.496.8 ± 1.2
Depth 2.080.3 ± 2.396.4 ± 1.3
Depth 3.089.4 ± 2.195.1 ± 1.5
Depth 4.091.7 ± 1.990.8 ± 1.8

TABLE IV

Ablation Study (Mean ± SD, n=5n=5).

ConfigurationTSR (%)Acc Ret. (%)Degradation
Full89.4 ± 2.195.1 ± 1.50%
w/o L167.5 ± 2.494.8 ± 1.6-21.9%
w/o L255.3 ± 2.893.2 ± 1.8-34.1%
w/o L374.6 ± 2.294.5 ± 1.5-14.8%
w/o L1+L238.2 ± 3.192.1 ± 2.0-51.2%
w/o L2+L341.5 ± 2.991.8 ± 1.9-47.9%

A dependency depth threshold at 3.0 optimizes the cost-accuracy frontier; threshold=2 over-provisions expensive models (-9.1% cost savings), while threshold=4 risks accuracy degradation (-4.3% accuracy).

Budget threshold: the percentage of allocated sub-budget consumed before triggering escalation actions.

Table IV summarizes end-to-end framework performance and ablation results. The integrated three-layer system achieves 89.4±2.1% average TSR with 95.1±1.5% accuracy retention across all workloads. The highest savings occur in tool-heavy orchestration (94.2±1.8% TSR). The lowest savings occur in explanation-heavy diagnosis (82.1±2.3% TSR).

Ablation analysis reveals synergistic layer interactions. Removing Layer 1 degrades TSR by 21.9%; removing Layer 2 degrades TSR by 34.1% (the largest single impact because this layer contains skill caching, model routing, and tool optimization); removing Layer 3 degrades TSR by 14.8%. The interaction effects are informative: removing both Layer 1 and Layer 2 yields 38.2% TSR - better than the sum of individual degradations (33.1% predicted), indicating positive synergy where compression makes caching more effective. Conversely, removing Layer 2 and Layer 3 yields 41.5% TSR - worse than sum prediction - because without model adaptation, the router compensates via conservative over-provisioning.

VI. Discussion

Traditional industrial MAS focuses on physical coordination [1], [2]; our framework optimizes LLM token costs without altering core logic, complementing prior work.

Our four-phase deployment roadmap is as follows: Phase 1: L1 caching + code calls to TSR 74.2%. Phase 2: L2/L3 + router to TSR 82.3%, L2 hit 72%. Phase 3: LoRA + budget-aware to accuracy retention 95.1%. Phase 4: PromptIntern fine-tuning to break-even at 5,714 inferences. Final production: TSR 91.3%, accuracy 96.8%, latency overhead 5.6%.

Limitations: First, skill caching assumes skill inputs are semantically hashable; stochastic environments (e.g., real-time market data) may require adaptive cache invalidation policies rather than fixed TTL. Suzuki et al. [22] demonstrate that predictive maintenance in smart factories requires dynamic model updates every 4-6 hours, suggesting our fixed TTL may be suboptimal for rapidly changing industrial environments. Second, code-based tool invocation introduces execution security risks; our three-layer defense blocks all documented attack vectors in the test suites of [18], [19] but residual zero-day risk remains unquantified. gVisor sandboxing adds 45 ms cold-start latency not captured in token metrics. Third, the dependency-aware router currently operates on static call graphs; dynamic agent creation at runtime complicates dependency estimation and requires online graph reconstruction. Fourth, strict submodularity proof remains future work; empirical curvature bounds (c0.12c\le0.12) support the approximation.

VII. Conclusion

This paper has presented a systematic study of token economics for multi-agent LLM systems, identifying three dominant cost drivers—over-invocation, cache fragmentation, and model misrouting—and proposing a skill-aware three-layer optimization framework. Our key contributions include:

(1) a POMDP-based cost model that decomposes token consumption into invocation, cache-miss, and routing components;

(2) a three-layer architecture integrating input compression, dependency-aware routing with hierarchical skill caching, and model adaptation; (3) comprehensive experiments across five industrial workloads demonstrating 89.4% token reduction with 95.1% accuracy retention; and (4) a characterization of MCP security risks with a defense-in-depth mitigation. Future work includes adaptive strategy selection, dynamic topologies, Pareto bounds, and game-theoretic allocation.

References

[1] L. Wang, C. Ma, X. Feng, Z. Zhang, H. Yang, J. Zhang, Z. Chen, J. Tang, X. Chen, Y. Lin, W. X. Zhao, Z. Wei, and J. Wen, "A survey on large language model based autonomous agents," Frontiers of Computer Science, vol. 18, no. 6, p. 186345, 2024.

[2] L. Panait and S. Luke, "Cooperative multi-agent learning: The state of the art," Autonomous Agents and Multi-Agent Systems, vol. 11, no. 3, pp. 387-434, 2005.

[3] Gartner,“Forecast analysis: AI software and services, worldwide,”2025, gartner Report G00783264, Accessed: Jun. 2026.

[4] S. Yan, J. Tong, H. Xue, X. Tang, Y. Wang, K. Shi, G. Zhang, R. Li, and Y. Zou,“Act wisely: Cultivating meta-cognitive tool use in agentic multimodal models,”2026, [Online]. Available: arXiv:2604.08545.

[5] Z. Hu, K. Li, D. Fu, C. Zeng, Y. Li, Y. Tang, and J. Huang,“BEAVER: A training-free hierarchical prompt compression method via structure-aware page selection,”2025, [Online]. Available: arXiv:2603.19635.

[6] Y. Miao, Z. Yu, L. Zhao, B. Zhu, and H. Haque,“Skilllens: Adaptive multigranularity skill reuse for cost-efficient LLM agents,”2026, [Online]. Available: arXiv:2605.08386.

[7] Y. Li, M. Cai, Z. Xiao, W. Wang, Y. Deng, and B. An,“MIND- Skill: Quality-guaranteed skill generation via multi-agent induction and deduction,”2026, [Online]. Available: arXiv:2605.08670.

[8] E. Lumer, F. Nizar, A. Jangiti, K. Frank, A. Gulati, M. Phadate, and V. K. Subbiah,“Don’t break the cache: An evaluation of prompt caching for long-horizon agentic tasks,”2026, [Online]. Available: arXiv:2601.06007.

[9] L. Kumari, S. Wang, T. Zhou, N. Sarda, A. Rowe, and J. Bilmes, "Bumblebee: Dynamic KV-cache streaming submodular summarization for infinite-context transformers," in Proc. COLM, 2024.

[10] Q. Chen, X. Chen, and K. Huang, "Slimcaching: Edge caching of mixture-of-experts for distributed inference," IEEE Transactions on Mobile Computing, vol. 25, no. 7, pp. 10 924-10 938, 2026.

[11] L. Chen, M. Zaharia, and J. Zou, "FrugalGPT: How to use large language models while reducing cost and improving performance," 2023, [Online]. Available: arXiv:2305.05176.

[12] S. Agarwal, P. Namyar, A. Wolman, R. Ambavat, A. Gupta, and Q. Zhang, "Switchcraft: AI model router for agentic tool calling," 2026, [Online]. Available: arXiv:2605.07112.

[13] S. S. Reeh and S. Hartmann, "Graph-based task allocation for multi-agent fleet management with LLM integration," in Proc. ICIEA, 2025, pp. 245-250.

[14] M. Zhang, J. Cao, X. Shen, and Z. Cui, "EdgeShard: Efficient LLM inference via collaborative edge computing," 2024, [Online]. Available: arXiv:2405.14371.

[15] K. Zhang, L. Wang, S. Liu, Y. Chen, and H. Zhao, "Intelligent scheduling of multi-agent systems in smart manufacturing," in Proc. ICIEA, 2024, pp. 178-183.

[16] H. Liu, Q. Wu, T. Wang, and J. Zhang, "Energy-efficient resource allocation for industrial IoT using multi-agent reinforcement learning," in Proc. ICIEA, 2023, pp. 312-317.

[17] H. Chen, Y. Yang, X. Li, Z. Wang, and R. Zhou, "Distributed consensus optimization for heterogeneous multi-agent systems," in Proc. ICIEA, 2025, pp. 401-406.

[18] OX Security, "Critical systemic vulnerability at the core of the MCP," 2026, OX Security Research Report. [Online]. Available: https://ox.security/mcp-vulnerability/.

[19] C. Huang, X. Huang, and A. M. Fard, "Auditing MCP servers for over-privileged tool capabilities," 2026, [Online]. Available: arXiv:2603.21641.

[20] J. Dunkel, "Streamlining the action dependency graph framework," 2024, [Online]. Available: arXiv:2412.01277.

[21] J. Zou, M. Zhou, T. Li, S. Han, and D. Zhang, "Promptintern: Saving inference costs by internalizing recurrent prompt during large language model fine-tuning," in Findings of the Association for Computational Linguistics: EMNLP 2024. Miami, Florida, USA: Association for Computational Linguistics, 2024, pp. 10 288-10 305. [Online]. Available: https://aclanthology.org/2024.findings-emnlp.602/

[22] T. Suzuki, K. Tanaka, H. Nakamura, M. Yamamoto, and Y. Sato, "Predictive maintenance with multi-agent systems in smart factories," in Proc. ICIEA, 2023, pp. 445-450.