Organizations: School of Computer and Artificial Intelligence, Zhengzhou University, Zhengzhou, 450001, Henan, China · Engineering Research Center of Intelligent Swarm Systems, Ministry of Education, Zhengzhou, 450001, Henan, China · National Supercomputing Center in Zhengzhou, Zhengzhou, 450001, Henan, China · Henan Research Center for Large Model Technology and New Quality Software Engineering, Zhengzhou, 450001, Henan, China
Emergency situations in scheduling systems often trigger local functional failures that undermine system stability and even cause system collapse. Existing methods primarily rely on robust scheduling or reactive scheduling, handling emergencies through predefined rules or rescheduling strategies. However, the diversity and unpredictability of real-world emergencies make them difficult to anticipate, which limits the adaptability of these methods in complex scenarios. Recent studies have shown that Large Language Models (LLMs) possess strong potential for complex scheduling tasks because of their extensive prior knowledge and strong reasoning capabilities. Nevertheless, the high inference latency of LLMs and the lengthy contextual information of scheduling systems significantly hinder their application for emergency handling. To mitigate these issues, we propose the Multi-agent Driven Formal Instruction Generation Framework (MAFIG). The framework constrains the decision scope to local functional modules affected by emergency situations and repairs scheduling logic rapidly by generating formal instructions. MAFIG contains a Perception Agent and an Emergency Decision Agent, which mitigates the adverse impact of lengthy system contexts on emergency decision-making. We further introduce span-focused loss-driven local distillation mechanism (SFL) to transfer the decision-making capability of powerful Cloud Large Language Models (C-LLMs) to lightweight local models, reducing inference latency while preserving decision-making effectiveness. Experiments in the Port, Warehousing, and Deck scheduling datasets show success rates of 98.49%, 94.97%, and 97.50%, with average processing times of 0.33 s, 0.23 s, and 0.19 s. These results demonstrate that MAFIG effectively mitigates the impact of emergencies and improves the robustness and adaptability of scheduling systems.
Figures & tables
Figure 1: Accident types in Mediterranean port areas.
Figure 2: Architecture of MAFIG for emergency decision in scheduling systems. The framework consists of the Perception Agent, the Emergency Decision Agent and the Atomic Function Library. It supports semantic parsing, impact analysis, affected function localization and atomic function revision, which enables rapid recovery of scheduling logic under emergency situations.
Variable
Description
t
Current time step
st
Scheduling environment state at time t
et
Emergency situations at time t
x
Aggregated system context (system rules, module specifications, code context)
fs
Function specifications
DA
Atomic function library
Table 1: Description of variables and their corresponding meanings.
Figure 5: Overview of the EvalDeck evaluation datasets.
Task
Models
Total Time (s)
Avg Time (s)
Success Rate
Port
Qwen3-32B
1763.73
8.86
62.31%
Qwen3-Coder-480B-A35B-Instruct
896.53
4.51
85.93%
DeepSeek-V3.2
1827.28
9.18
86.43%
GLM-4.7
5460.58
27.44
89.95%
Qwen2.5-Coder-7B
69.20
0.35
25.62%
MAFIG(Qwen2.5-Coder-7B)
64.98
0.33
98.49%
Table 2: Performance comparison of different models across tasks.
Task
Model
Method
Total Time (s)
Avg Time (s)
Success Rate
Port
Qwen2.5-Coder-7B
—
69.20
0.35
25.62%
Meta-Llama-3.1-8B-Instruct
—
101.39
0.51
30.15%
GLM-4-9B-Chat
—
94.89
0.48
23.62%
Qwen2.5-Coder-7B
MAFIG(w/o SFL)
63.19
0.32
62.81%
Meta-Llama-3.1-8B-Instruct
MAFIG(w/o SFL)
71.06
0.36
48.24%
GLM-4-9B-Chat
MAFIG(w/o SFL)
86.11
0.43
64.82%
Table 3: Evaluating the Effect of MAFIG Architecture on Backbone Model Performance.
Task
Model
Method
Perception Time (s)
Decision Time (s)
Total Time (s)
Avg Time (s)
Accuracy
Port
Qwen2.5-Coder-7B
—
—
—
69.20
0.35
25.62%
MAFIG(w/o SFL)
18.25
44.94
63.19
0.32
62.81%
MAFIG
18.63
46.35
64.98
0.33
98.49%
Warehousing
Qwen2.5-Coder-7B
—
—
—
151.18
0.38
25.87%
MAFIG(w/o SFL)
23.02
64.85
87.87
0.22
55.53%
MAFIG
22.08
68.19
90.27
0.23
94.97%
Table 4: Latency and Success Rate Analysis of MAFIG With Versus Without SFL Across Different Tasks.
Figure 6: Performance comparison of SFL and LoRA under different training set sizes across tasks.
Figure 7: Case study of MAFIG in the deck scheduling scenario under concurrent emergency situations.
School of Computer Science and Engineering, Beihang University, Beijing 100191, China · Shenzhen Loop Area Institute, Shenzhen, China · Qingdao Research Institute, Beihang University +3
Department of Electrical & Computer Engineering, Stony Brook University, New York, United States of America · Barcelona Supercomputing Center, Barcelona, Catalonia, Spain · Department of Computer Science, Hofstra University, New York, United States of America