- The paper introduces the MAFIG framework that employs a lightweight Perception Agent and Emergency Decision Agent to precisely localize and repair affected code modules during emergencies.
- It utilizes a span-focused, loss-driven local distillation (SFL) mechanism to efficiently transfer high-fidelity edit patterns from large LLMs to local agents, even in low-data scenarios.
- Empirical results across port, warehouse, and deck scheduling scenarios show task success rates up to 98.49% and processing latencies as low as 0.19s, outperforming traditional LLM approaches.
Motivation and Problem Setting
Emergency scenarios in industrial scheduling systems such as ports, warehouses, and aircraft decks often induce local functional failures with potential to propagate and destabilize the entire system. Traditional robust and reactive scheduling approaches rely on a posteriori rules or conservative buffering, which fail to generalize for the broad spectrum and unpredictability of real emergencies. Recent exploration of LLMs as a back-end for such systems has demonstrated promising semantic parsing and code reasoning capabilities, but these models suffer from high inference latency and context-length sensitivity. Direct LLM integration encounters a severe Latency-Quality Tradeoff and Execution Misalignment, both exacerbated in environments characterized by high modular coupling and time sensitivity.
MAFIG Framework: Conceptual and Algorithmic Structure
MAFIG proposes a formal, multi-agent architecture to enable precise, efficient, and high-fidelity emergency handling by localizing intervention to affected code modules and minimizing system-level context propagation. The framework comprises two principal agents: a Perception Agent and an Emergency Decision Agent, operating over an atomic function library.
Figure 1: System-level architecture of MAFIG, illustrating the Perception Agent for context analysis and the Emergency Decision Agent for targeted atomic function repair.
The Perception Agent, instantiated as a lightweight distilled local model, receives emergency context and applies semantic parsing and causal impact analysis to rapidly localize affected atomic functions. A span-focused loss-driven local distillation mechanism (SFL) is employed to transfer function localization and reasoning abilities from cloud-scale LLMs to the local agent. Identified atomic functions and structured emergency descriptors are then delegated to the Emergency Decision Agent, which performs focused code edits or new atomic generation using a diff-based, span-weighted distillation—significantly reducing parameter dispersion over irrelevant code context and enhancing alignment with system requirements. The function library is dynamically updated with validated code, supporting continual system evolution.
Emergency Scheduling Scenarios and Evaluation Benchmarks
MAFIG’s empirical evaluation spans three task domains of increasing complexity and constraint: port terminals, warehouse logistics, and aircraft deck operations. For each, the EvalPort, EvalWare, and EvalDeck datasets encapsulate diverse emergency triggers and functional module architectures. Emergency types in maritime domains (see below) highlight the broad and severe impact profile that motivates MAFIG's design.
Figure 2: Categorization of accident/emergency types observed in real Mediterranean port operations.
EvalDeck, as the most structurally complex scenario, covers 642 test instances and 25 atomic functions involving concurrent operational and spatial constraints.
Figure 3: Dataset structure and emergency type distribution for deck scheduling evaluation.
Numerical Results and Comparative Analysis
MAFIG, using Qwen2.5-Coder-7B as backbone, is benchmarked against high-parameter C-LLMs including Qwen3-32B, Qwen3-Coder-480B-A35B-Instruct, DeepSeek-V3.2, and GLM-4.7. MAFIG consistently demonstrates a marked improvement in both task success rate and average processing latency across all three domains. In the port, warehouse, and deck scenarios, success rates reach 98.49%, 94.97%, and 97.50% respectively with average processing times of 0.33s, 0.23s, and 0.19s—substantially outperforming all evaluated C-LLMs on both axes.
SFL Mechanism: Gain in Data Efficiency and Local Model Competency
The SFL distillation mechanism enables local agents to acquire high-fidelity edit patterns from large teacher models, even in the low-data regime. Unlike LoRA, which applies uniform sequence optimization, SFL utilizes diff-based supervision and span-weighting, concentrating learning on critical edit regions and yielding substantial gains, especially as scenario complexity and constraint increase.
Figure 4: Task success rate comparison of SFL versus LoRA across different training set sizes, illustrating SFL’s superior data efficiency and performance saturation curve.
Localized Emergency Handling: Case Study in Deck Scheduling
A case study in EvalDeck with multiple concurrent heterogeneous emergencies demonstrates the pipeline: Perception Agent’s precise semantic extraction, atomic function localization, and targeted code revision by the Emergency Decision Agent. MAFIG’s approach successfully limits intervention to constrained code spans, producing executable corrections and maintaining system stability amid intense disruption.
Figure 5: Pipeline illustration of Perception Agent localization, Emergency Decision Agent repair, and function library update during concurrent deck emergencies.
Theoretical and Practical Implications
This work demonstrates that constraining LLM-driven reasoning to localized function modules and explicitly formalizing perception, impact analysis, and edit boundaries is more effective for emergency handling than direct global LLM application, irrespective of model scale. The SFL approach highlights the advantage of fine-grained, edit-centric distillation for small models operating in real-time settings. The framework’s self-evolving atomic function library also enables incremental adaptation, suggesting a pathway for continual learning in modular industrial control systems.
Practically, MAFIG enables real-time, privacy-preserving emergency handling deployable without reliance on cloud inference, thus addressing both system latency and privacy requirements in critical scheduling domains. Theoretically, the work suggests that local specialization, modularization, and targeted distillation are essential axes for the evolution of scheduling systems and broader AI-driven process control.
Conclusion
MAFIG establishes a multi-agent, formal-instruction generation protocol that robustly integrates LLM-derived reasoning into real-time scheduling systems, leveraging targeted distillation and modular design to realize rapid, accurate, and resilient emergency response. The method’s numerical superiority across diverse and dynamic industrial environments supports its relevance as an architectural paradigm, and its modular atomic function library provides a substrate for future research on self-evolving AI-driven scheduling infrastructure.