Emergency online decision-making method and system based on large language model
By constructing an offline rescue attack game model and fine-tuning technology of natural language prompt words, the complexity of online decision-making in emergencies is solved, the timely decision-making ability of large language models in emergency management of emergencies is realized, and emergency management is improved. efficiency and accuracy.
Patent Information
- Application Number
- CN202411040195.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-08-30
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing online decision-making methods are difficult to meet the requirements of timely decision-making in emergency management of emergencies. The model has poor generalization and cannot effectively handle the rescue material dispatching problem under complex confrontation conditions.
Normal distribution simulation is used to generate training data, build an offline rescue attack game model, generate optimal decision labels, and convert them into natural language prompt words, which are used to fine-tune the large language model and form an online decision-making model for emergencies.
Through simulation data and actual case verification, the fine-tuned large language model has online decision-making capabilities, can provide optimal solutions from an omniscient perspective in complex environments, and meet the needs of emergency management and handling of emergencies.
Smart Images

Figure CN118569684A
Abstract
Description
Technical Field
[0001] The present application relates to the field of emergency management of sudden incidents, and in particular to an online decision-making method and system for sudden incidents based on a large language model. Background Art
[0002] With the rapid development of the world, various emergencies are happening more and more frequently. For example, regional conflicts, public health incidents, natural disasters, terrorist attacks, etc., emergencies will lead to a large number of casualties and property losses, and decisions need to be made quickly to minimize losses, which poses a huge challenge to emergency management and material distribution. Therefore, emergency management and disposal of emergencies has become one of the important topics in the field of management science, especially for online decision-making problems. Decision information is given in a streaming manner, and the model can only make decisions based on historical and current information. How to make decisions to maximize long-term benefits is the focus and difficulty of online decision-making problems.
[0003] Existing research on online decision-making problems mainly uses traditional online algorithms to build models and solve single events, resulting in mediocre performance of the models in terms of generalization and failure to meet the requirements for timely decision-making in emergency management and disposal of sudden incidents. Summary of the invention
[0004] The purpose of this application is to provide an online decision-making method and system for emergencies based on a large language model, which can better meet the requirements for timely decision-making in emergency management and disposal of emergencies.
[0005] To achieve the above objectives, this application provides the following solutions:
[0006] In a first aspect, the present application provides an online decision-making method for emergencies based on a large language model, comprising:
[0007] Normal distribution simulation is used to generate training data; the training data at least includes the demand for rescue materials on each decision day, the transportation cost on each decision day, and the remaining rescue materials on each decision day; the decision day is the decision day for determining whether to implement material rescue;
[0008] According to the training data, an optimal decision label is generated by using an offline rescue attack game model; the two adversaries of the offline rescue attack game model include a rescuer who transports rescue supplies and an attacker who blocks the transportation of rescue supplies; the optimal decision label is obtained by taking the maximum total amount of rescue supplies transported within the total decision day as the game goal;
[0009] Converting the training data and the optimal decision labels into natural language prompt words to construct a fine-tuning training data set;
[0010] The large language model is trained using the fine-tuning training data set to obtain a large language model after fine-tuning training; during training, the training data converted into natural language prompt words is used as input, and the optimal decision label is used as output; the large language model is a ChatGLM3-6B model; the large language model after fine-tuning training is used as an online decision model for emergencies;
[0011] The emergency online decision-making model is used to make emergency online decision-making and obtain a decision result.
[0012] Optionally, before generating the optimal decision label using the offline rescue attack game model according to the training data, the method further includes: constructing an offline rescue attack game model corresponding to the rescue attack game problem;
[0013] The offline rescue attack game model corresponding to the rescue attack game problem is constructed, specifically including:
[0014] Constructing an attacker model; the attacker model is established according to the attacker force deployment; the attacker model at least includes a deployment number constraint and a total movement cost constraint for each decision day;
[0015] Constructing a rescuer model; the rescuer model is established according to the rescuer path selection; the rescuer model at least includes planning the shortest path constraint from the location of the materials to the transportation destination.
[0016] Constructing a utility function; wherein the utility function is established based on the respective costs of the rescuer and the attacker;
[0017] The offline rescue attack game model is constructed according to the attacker model, the rescuer model and the utility function.
[0018] Optionally, according to the training data, an offline rescue attack game model is used to generate an optimal decision label, specifically including:
[0019] Solving the mixed Nash equilibrium of the offline rescue attack game model, and obtaining the parameter values in the offline rescue attack game model under the mixed Nash equilibrium state;
[0020] Calculate the remaining relief supplies successfully transported according to the parameter values;
[0021] A binary linear programming model is used to represent the rescue attack game problem; the binary linear programming model takes the total amount of rescue supplies and the transportation budget as constraints, and aims to maximize the total amount of rescue supplies required;
[0022] The binary linear programming model is solved according to the remaining rescue supplies and the parameter values; the solution result of the binary linear programming model is the optimal decision label.
[0023] Optionally, when the large language model is trained using the fine-tuning training data set, each input is converted into training data of a natural language prompt word and a corresponding optimal decision label, and after a loss function is calculated, the loss function is temporarily stored;
[0024] After the loss function is calculated for all the data in a decision cycle, the gradient average of all the temporarily stored loss functions is taken to obtain the average loss function;
[0025] According to the average loss function, the model parameters of the large language model are updated.
[0026] Optionally, converting the training data and the optimal decision label into natural language prompt words to construct a fine-tuning training data set specifically includes:
[0027] By designing fine-tuning prompt words, the training data and the optimal decision label are converted into natural language prompt words in the form of natural language question-answer pairs to construct a fine-tuning training data set.
[0028] Optionally, the attacker model includes:
[0029] (1)
[0030] Where t represents the decision day, Z t represents the strategy adopted by the attacker on decision day t; T represents transposition; Represents the distribution vector of the attacker's power. If the attacker's power is distributed at node j, then ; V represents the node set; the attacker’s strategy is vectors, expressed as , if the attacker decides that the attacker force i chooses to control node j on decision day t, then z ijt =1; each attacker's strength The action of is limited by the total movement cost of the attacker, which is , From the vector f t ; 1 in the attacker model represents a 1 vector; represents the deployment movement cost from node j to node j'.
[0031] Optionally, the constraints of the rescuer model include:
[0032] (2)
[0033] (3)
[0034] The rescuer model includes:
[0035] (4)
[0036] Among them, t Indicates the location of the relief supplies, g t Indicates the transportation destination of relief supplies; variable y t represents the edge selected by the rescuer in the network. If the rescuer chooses edge k to reach g t , then y kt =1; FS(j) represents the edge set starting from node j, RS(j) represents the edge set arriving at node j; E represents the edge between two nodes.
[0037] Optionally, the utility function includes:
[0038] (5)
[0039] where c k represents the cost of passing through edge k, c k Taken from vector c, vector c represents the vector set of costs passing through each edge in the road network; d k represents the additional cost for the rescuer to pass through edge k controlled by the attacker, d k Taken from vector d, vector d represents the vector set of the additional cost of the rescuer passing through the edge controlled by the attacker; let is an intermediate decision variable: if edge k is under the control of the attacker on decision day t, then =1.
[0040] Optionally, the remaining relief supplies successfully transported are:
[0041]
[0042] Among them, r t Indicates the remaining relief supplies that can be successfully transported; Expressing the need for relief supplies; Indicates the looting rate of the attacker's force that the rescuer encounters.
[0043] In a second aspect, the present application provides an online emergency decision-making system based on a large language model, comprising:
[0044] A training data generation module, used to generate training data using normal distribution simulation; the training data at least includes the rescue material demand for each decision day, the transportation cost for each decision day, and the remaining rescue materials for each decision day; the decision day is the decision day for determining whether to implement material rescue;
[0045] An optimal decision label generation module is used to generate an optimal decision label based on the training data using an offline rescue attack game model; the two adversaries of the offline rescue attack game model include a rescuer who transports rescue materials and an attacker who blocks the transportation of rescue materials; the optimal decision label is obtained by taking the maximum total amount of rescue materials transported within the total decision day as the game goal;
[0046] A fine-tuning training data set construction module, used for converting the training data and the optimal decision label into natural language prompt words to construct a fine-tuning training data set;
[0047] A training module is used to train the large language model using the fine-tuning training data set to obtain a large language model after fine-tuning training; during training, the training data converted into natural language prompt words is used as input, and the optimal decision label is used as output; the large language model is a ChatGLM3-6B model; the large language model after fine-tuning training is used as an online decision model for emergencies;
[0048] The decision-making module is used to make online decisions on emergencies using the online emergency decision-making model to obtain decision results.
[0049] According to the specific embodiments provided in this application, this application discloses the following technical effects:
[0050] The present application provides an online decision-making method and system for emergencies based on a large language model. Training data is generated through simulation, and an offline rescue attack game model is used to generate optimal decision labels based on the training data, thereby providing the optimal solution to the decision problem from an omniscient perspective for the subsequent online decision model. The training data and the optimal decision labels are converted into natural language prompts to construct a fine-tuning training data set, and the large language model is trained to enable the large language model to have online decision-making capabilities, thereby better meeting the requirements for timely decision-making in emergency management and disposal of emergencies. The effectiveness of the method proposed in this application has been verified in experiments with simulation data and actual case data. The experimental results show that the large language model fine-tuned by this method has online decision-making capabilities. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0052] Figure 1 A flowchart of an online decision-making method for emergencies based on a large language model provided in an embodiment of the present application;
[0053] Figure 2 for Figure 1 A detailed flow chart of the steps in S2;
[0054] Figure 3 A schematic diagram of a gradient accumulation update algorithm provided in an embodiment of the present application;
[0055] Figure 4 A schematic diagram of natural language prompt words provided in an embodiment of the present application;
[0056] Figure 5 A schematic diagram of the structure of an online emergency decision-making system based on a large language model provided in an embodiment of the present application. DETAILED DESCRIPTION
[0057] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in this application. Obviously, the described embodiments are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0058] Combine the following Figure 1-Figure 3 The present application describes an online decision-making method and system for emergencies based on a large language model.
[0059] This application studies the online decision-making method for emergencies based on a large language model, and proposes the idea of "generating training data with an offline model and fine-tuning the large language model for online decision-making". Specifically, for the problem of dispatching emergency rescue materials under adversarial conditions, the offline model is used to generate the optimal decision label, and the decision is made through the offline model, and the large language model fine-tuning data is generated by simulation. The question-answer format is designed, and the constructed fine-tuning training data set is used to fine-tune the large language model, so that the large language model can acquire the ability to make online decisions.
[0060] Specifically, Figure 1 As shown, the online decision-making method for emergencies based on a large language model provided by the present application includes:
[0061] S1. Generate training data using normal distribution simulation.
[0062] The training data includes at least the demand for rescue materials on each decision day, the transportation cost on each decision day, and the remaining rescue materials on each decision day; the decision day is the decision day for determining whether to implement material rescue.
[0063] S2. Based on the training data, an offline rescue-attack game model is used to generate the optimal decision label.
[0064] The two adversaries in the offline rescue attack game model include the rescuer who transports relief supplies and the attacker who blocks the transportation of relief supplies; the optimal decision label is obtained by taking the maximum total amount of relief supplies transported within the total decision day as the game goal.
[0065] S3. Convert the training data and the optimal decision labels into natural language prompts to construct a fine-tuning training dataset.
[0066] S4. Use the fine-tuning training data set to train the large language model to obtain the large language model after fine-tuning training; during training, the training data converted into natural language prompt words is used as input, and the optimal decision label is used as output; the large language model is the ChatGLM3-6B model; the large language model after fine-tuning training is used as the online decision-making model for emergencies.
[0067] S5. Use the online decision-making model for emergencies to make online decisions on emergencies and obtain decision results.
[0068] This application aims at the online decision-making problem of emergency rescue material dispatch under adversarial conditions. It generates the optimal decision label with an offline rescue attack game model, makes decisions through the offline rescue attack game model, and simulates the generation of fine-tuning data for the large language model. The constructed fine-tuning training data set is used to fine-tune the large language model so that the large language model acquires the ability to make online decisions, and then the large language model after fine-tuning training is used to make online decisions for emergencies. The effectiveness of the method proposed in this application has been verified in experiments with simulation data and actual case data. The experimental results show that the large language model fine-tuned by this method has the ability to make online decisions.
[0069] In some embodiments, before S2, it also includes constructing an offline rescue attack game model corresponding to the rescue attack game problem.
[0070] Constructing an offline rescue attack game model corresponding to the rescue attack game problem, specifically including: constructing an attacker model; constructing a rescuer model; constructing a utility function; constructing an offline rescue attack game model according to the attacker model, the rescuer model and the utility function.
[0071] On each decision day, there is a game between the rescuer and the attacker: both parties play a game on a road network G = (V, E) consisting of nodes V (representing cities) and a set of edges E (representing roads). If the rescuer decides to meet the rescue demand w on decision day t, the rescuer will receive a rescue request from the material base city or the demand city g. t, the rescuer needs to plan a route through the road network to minimize transportation costs. On the other hand, the attacker needs to deploy forces at different nodes of the road network to intercept the rescuer under the constraint of mobility and plunder supplies. The confrontation between the rescuer and the attacker based on decision days can be modeled as an offline rescue-attack game model.
[0072] The attacker model is established according to the attacker's force deployment; the attacker model at least includes the number of deployment constraints and the total movement cost constraints for each decision day.
[0073] The problem facing the attacker is to deploy its forces in the road network and control some selected nodes, thereby blocking the rescue of the rescue party. Represents the distribution vector of force. If there is force stationed at node j, then , and V represents the node set. The attacker’s strategy is given by vectors, expressed as , if the attacker decides that the attacker force i will choose to control node j on decision day t, then z ijt = 1. At the same time, each attacker's strength The actions of the attacker are limited by the total movement cost of the attacker, which is given by Represents (from vector f t ).
[0074] Therefore, as an optional implementation, all possible actions of the attacker (ie, the attacker model) are expressed as:
[0075] (1)
[0076] Mode The first constraint of is that a unit can only be deployed once on each decision day, where 1 represents a 1 vector; T represents transpose. Denotes the deployment movement cost from node j to node j'. The attacker estimates the cost of deploying troops using road information. Therefore, the second constraint makes the attacker's deployment not exceed the limit of its total movement cost.
[0077] The rescuer model is established according to the rescuer's path selection; the rescuer model at least includes the planning of the shortest path constraint from the location of the materials to the transportation destination.
[0078] Specifically, the rescue problem can be modeled as the shortest path problem: planning the path from the location of the supplies to the t To the transport destination t The shortest path. Introduce variable y t represents the path (edge) chosen by the rescuer in the network, that is, if the rescuer chooses path k to reach gt , then y kt = 1. Optionally, FS(j) is used to represent the edge set starting from node j, RS(j) is used to represent the edge set reaching node j, and E is used to represent the edge between two nodes. Then the rescuer's strategy space can be determined by the following constraints:
[0079] (2)
[0080] (3)
[0081] Then the set of all possible strategies of the rescuer (rescuer model) can be expressed as:
[0082] (4)
[0083] The utility function is established based on the respective costs of the rescuer and the attacker.
[0084] The utility of both the rescuer and the attacker is the cost of emergency rescue transportation. The rescuer's goal is to minimize it by choosing the path to pass through, while the attacker's goal is to maximize it by choosing the optimal blocking rescue path.
[0085] Therefore, in some embodiments, the utility function is composed of the decision variables of the attacker and the rescuer as follows:
[0086] (5)
[0087] Among them, c k represents the cost of passing through edge k, c k Taken from vector c, vector c represents the vector set of costs for (rescuer / attacker) to pass through each edge in the road network; d k represents the additional cost for the rescuer to pass through edge k controlled by the attacker, d k Taken from vector d, vector d represents the vector set of the additional cost of the rescuer passing through the edge controlled by the attacker; let is an intermediate decision variable: If edge k is under the control of the attacker on decision day t, then =1.
[0088] Specifically, assume that all edges pointing to a garrison node are under control, that is:
[0089]
[0090] According to the above-mentioned attacker model, rescuer model and utility function, an offline rescue attack game model can be constructed.
[0091] Depend on represents the two parties in the game, then the game on each decision day can be represented as a tuple . This is the offline rescue attack game model.
[0092] After the offline rescue attack game model is built, it is used to generate the optimal decision labels for training subsequent large language models.
[0093] As an optional implementation, Figure 2 As shown, generating the optimal decision label in S2 specifically includes:
[0094] S21. Solve the mixed Nash equilibrium of the offline rescue attack game model, and obtain the parameter values in the offline rescue attack game model under the mixed Nash equilibrium state.
[0095] Finally in the game, the transport vector is the mixed Nash equilibrium of game Gt.
[0096] S22. Calculate the remaining relief supplies successfully transported according to the parameter values.
[0097] If the rescuer chooses to transport the goods along the edge controlled by the attacker on a decision day, then the rescue goods The amount of lost transport depends on the looting rate of the forces encountered by the rescuers. .
[0098] Therefore, in some embodiments, the remaining relief supplies successfully transported are:
[0099] (7)
[0100] Among them, r t Indicates the remaining relief supplies that can be successfully transported; Expressing the need for relief supplies; Indicates the looting rate of the attacker's force that the rescuer encounters.
[0101] S23. A binary linear programming model is used to represent the rescue attack game problem. The binary linear programming model takes the total amount of rescue supplies and the transportation budget as constraints, and aims to maximize the total amount of rescue supplies required.
[0102] Based on the results of the game of each decision-making day, when all data and parameters are known in advance, an offline emergency rescue plan for multiple decision-making days is constructed and converted into a linear programming to solve.
[0103] Specifically, the rescuer must decide whether to meet the rescue needs of a city on each decision day. n represents the length of the decision day, represents the decision variable of the rescuer. If the rescuer decides to meet the demand on decision day t ,but If the decision meets the requirements of the decision day, the rescuer will pay The transportation cost, and the objective function grows Therefore, as a long-term profit seeker, the goal of the rescuer is to and transportation budget Under the constraints of , the total amount of demand satisfaction is maximized.
[0104] In offline conditions and The data is globally known, so the offline rescue attack game model can be expressed as a binary integer linear program:
[0105] max r T x s . t . [ w a ] T x ≤ b
[0106] in , and let b represent the vector [b l ,b2] T .
[0107] S24. Solve the binary linear programming model according to the remaining relief supplies and the parameter values; the solution result of the binary linear programming model is the optimal decision label.
[0108] Binary linear programming models can be solved using common binary integer linear programming techniques.
[0109] The decision model established under the omniscient perspective constructs an offline version of the online decision problem. Through this model, the optimal solution to the decision problem can be solved using binary integer linear programming under the omniscient perspective. The offline model is the basis for fine-tuning data construction and also provides an upper bound for the evaluation of the online decision problem.
[0110] After generating the optimal decision labels through the offline rescue attack game model, the optimal decision labels are used, and prompt engineering and model fine-tuning techniques are adopted to explore and optimize the online decision-making ability of the large language model, and the optimized large language model is used to realize the online distribution of emergency supplies.
[0111] Considering the prior art, with the deepening of the research on large language models and the continuous improvement of their performance, there have been many studies in the field of decision optimization based on large language models to solve decision problems. At present, some studies have shown that large language models have shown strong performance in mathematics, logical reasoning, etc., and their advantages are reflected in generalization and comprehensiveness. The emergence of large language models provides a new solution for online decision-making of emergencies. By utilizing a large amount of historical data and existing knowledge, large language models can help decision makers analyze various possible situations of emergencies, quickly propose reasonable response plans, and optimize resource allocation. Compared with traditional decision-making methods based on rules or experience, large language models can better predict and adapt to complex and changeable situations, and improve the accuracy and efficiency of decision-making. Therefore, it is of great practical significance and application value to study how to use large language models to solve the problem of online decision-making resource allocation. The present invention provides a new decision support tool for emergency management and disposal of emergencies.
[0112] Currently, decision-making based on large language models has become a hot topic in academic research and has achieved good results. However, there is little research on online decision-making problems, and there is an urgent need to explore the performance of large language models in online decision-making problems.
[0113] Based on the above situation, this application introduces a large language model to realize online decision allocation of resource issues.
[0114] The following is an explanation of the online decision-making method based on the large language model:
[0115] Online decision-making requires that both the attacker and the rescuer must make irrevocable decisions without observing future inputs. Based on this feature, an online decision-making model for emergencies is constructed.
[0116] Unlike the offline version described above, the rescuer only knows historical information:
[0117]
[0118] In addition, on each decision day t, according to the game G on the decision day t The Nash equilibrium result of the day is informed to the rescuer. and Information. With this limited information, the rescuer needs to make an analysis and judgment based on it and make an irrevocable decision. Therefore, the online decision-making model of the emergency incident of the rescuer can be expressed as a function of the parameters observed in the history and current decision day:
[0119]
[0120] Mode represents the online decision-making model for emergencies. In other words, the core of the online decision-making problem is the constructor , so that decision makers can obtain the maximum benefits within the decision-making cycle under conditions of limited information.
[0121] The present invention essentially aims to design a large language model fine-tuning method adapted to online decision-making, so that the large language model can learn the function from a large number of optimal decision data sets. , so that the large language model has the ability to make online decisions.
[0122] Fine-tuning mechanism for online decision making of large language models:
[0123] Based on the training data generated by normal distribution simulation, the offline rescue-attack game model is used to give the optimal upper bound solution. Rules are designed to convert the data into natural language prompts to construct a fine-tuning training dataset. Then, the LoRA fine-tuning method is used to perform gradient accumulation updates on the decision cycle to fine-tune the model.
[0124] The fine-tuning training dataset constructed in S3 is used to train the online decision-making model for emergencies.
[0125] Optionally, when training a large language model, each input is converted into training data of a natural language prompt word and a corresponding optimal decision label, and after the loss function is calculated, the loss function is temporarily stored; after the loss function is calculated for all data of a decision cycle, the gradient average is taken according to all temporarily stored loss functions to obtain an average loss function; based on the average loss function, the model parameters of the large language model are updated.
[0126] Unlike general fine-tuning tasks, the objective function of online decision-making is to maximize the total benefit within a certain period, and each piece of data is only the decision of one decision day. In order to make the gradient descent in the correct direction, the data of one decision cycle must be updated in one batch, that is, the batch size batch_size is set according to the length of the decision cycle. Therefore, this application introduces the gradient cumulative descent method into the online decision fine-tuning method of the large language model. That is, after calculating the loss of the data of each decision day, temporarily store it, wait for the data of one decision cycle to calculate the loss function, and then take the gradient average to update the model parameters. The gradient cumulative update algorithm provided by this application is as follows: Figure 3 shown.
[0127] In specific implementation, the PEFT parameter efficient fine-tuning library can be used to implement the decision cycle gradient cumulative update algorithm by overwriting the Step_Runner and Epoch_Runner functions in the PEFT parameter efficient fine-tuning library, and only save the LoRA weights to avoid the storage problem caused by adding all model weights. The training is iterated for 30 epochs on 12,000 data (200 decision cycles * 60 decision days), and the early stopping strategy is that the loss does not decrease in 5 consecutive epochs.
[0128] In S3, in order to obtain a fine-tuning training dataset, the training data and the optimal decision labels are converted into natural language prompt words.
[0129] As an optional implementation, S3 specifically includes: by designing fine-tuning prompt words, converting the training data and the optimal decision label into natural language prompt words in the form of natural language question-answer pairs to construct a fine-tuning training data set.
[0130] By designing fine-tuning prompts for this problem, the generated labeled decision results are converted into natural language question-answer pairs. The construction of fine-tuning question-answer pairs adopts a two-stage structure. In order to complete the online decision-making task, the prompt first tells the model its role "you are a decision-making model", followed by the objective function of the decision, that is, making a decision to maximize the transportation volume within x days, and global information, including the total material volume and total transportation expenses. In each decision cycle, the model should also be informed of the historical demand and decision results, the demand of the day and the remaining material volume. The supervised label is the optimal decision obtained from an offline perspective.
[0131] like Figure 4 As shown in Figure 1, the parameter data and historical decision results are converted into a fine-tuning dataset according to the designed prompt word structure.
[0132] The present invention is based on the online decision-making problem of emergency rescue material dispatch in typical emergencies. By establishing an offline decision-making model, constructing a fine-tuning dataset for online decision-making of a large language model, and using prompt engineering and model fine-tuning technology, the online decision-making ability of the large language model is explored and optimized, and the online allocation of emergency resources is realized. In this application, the large language model is applied to the field of online decision-making, which provides new ideas and methods for the research of online decision-making. The effectiveness of the proposed online decision-making method has been verified in experiments, and the experimental results show the feasibility of the method of the present invention in online decision-making.
[0133] Based on the same inventive concept, the embodiment of the present application also provides an online decision-making system for emergencies for implementing the online decision-making method for emergencies based on a large language model. The implementation scheme for solving the problem provided by the system is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiment of the online decision-making system for emergencies based on a large language model provided below can be found in the above limitations on the online decision-making method for emergencies based on a large language model, and will not be repeated here.
[0134] like Figure 5 As shown, an online decision-making system for emergencies based on a large language model is provided, including:
[0135] The training data generation module M1 is used to generate training data by using normal distribution simulation; the training data at least includes the rescue material demand for each decision day, the transportation cost for each decision day, and the remaining rescue materials for each decision day; the decision day is the decision day for determining whether to implement material rescue;
[0136] The optimal decision label generation module M2 is used to generate the optimal decision label based on the training data using an offline rescue attack game model; the two adversaries of the offline rescue attack game model include the rescue party that transports rescue materials and the attacker that blocks the transportation of rescue materials; the optimal decision label is obtained by taking the maximum total amount of rescue material transportation within the total decision day as the game goal;
[0137] A fine-tuning training data set construction module M3 is used to convert the training data and the optimal decision label into natural language prompt words to construct a fine-tuning training data set;
[0138] The training module M4 is used to train the large language model using the fine-tuning training data set to obtain the large language model after fine-tuning training; during training, the training data converted into natural language prompt words is used as input, and the optimal decision label is used as output; the large language model is the ChatGLM3-6B model; the large language model after fine-tuning training is used as the online decision model for emergencies;
[0139] The decision module M5 is used to make online decisions on emergencies using an online decision model for emergencies and obtain decision results.
[0140] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0141] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.
Claims
1. An online decision-making method for emergencies based on a large language model, characterized in that: include: Normal distribution simulation is used to generate training data; the training data at least includes the demand for rescue materials on each decision day, the transportation cost on each decision day, and the remaining rescue materials on each decision day; the decision day is the decision day for determining whether to implement material rescue; According to the training data, an optimal decision label is generated by using an offline rescue attack game model; the two adversaries of the offline rescue attack game model include a rescuer who transports rescue supplies and an attacker who blocks the transportation of rescue supplies; the optimal decision label is obtained by taking the maximum total amount of rescue supplies transported within the total decision day as the game goal; Converting the training data and the optimal decision labels into natural language prompt words to construct a fine-tuning training data set; The large language model is trained using the fine-tuning training data set to obtain a large language model after fine-tuning training; during training, the training data converted into natural language prompt words is used as input, and the optimal decision label is used as output; the large language model is a ChatGLM3-6B model; the large language model after fine-tuning training is used as an online decision model for emergencies; The emergency online decision-making model is used to make emergency online decision-making and obtain a decision result.
2. The method for online decision-making of emergencies based on a large language model according to claim 1, characterized in that: Before generating the optimal decision label using the offline rescue-attack game model according to the training data, the method further includes: constructing an offline rescue-attack game model corresponding to the rescue-attack game problem; The offline rescue attack game model corresponding to the rescue attack game problem is constructed, specifically including: Constructing an attacker model; the attacker model is established according to the attacker force deployment; the attacker model at least includes a deployment number constraint and a total movement cost constraint for each decision day; Constructing a rescuer model; the rescuer model is established according to the rescuer path selection; the rescuer model at least includes planning the shortest path constraint from the location of the materials to the transportation destination; Constructing a utility function; wherein the utility function is established based on the respective costs of the rescuer and the attacker; The offline rescue attack game model is constructed according to the attacker model, the rescuer model and the utility function.
3. The method for online decision-making of emergencies based on a large language model according to claim 2, characterized in that: According to the training data, an offline rescue attack game model is used to generate an optimal decision label, specifically including: Solving the mixed Nash equilibrium of the offline rescue attack game model, and obtaining the parameter values in the offline rescue attack game model under the mixed Nash equilibrium state; Calculate the remaining relief supplies successfully transported according to the parameter values; A binary linear programming model is used to represent the rescue attack game problem; the binary linear programming model takes the total amount of rescue supplies and the transportation budget as constraints, and aims to maximize the total amount of rescue supplies required; The binary linear programming model is solved according to the remaining rescue supplies and the parameter values; the solution result of the binary linear programming model is the optimal decision label.
4. The method for online decision-making of emergencies based on a large language model according to claim 1, characterized in that: When the large language model is trained using the fine-tuning training dataset, After each input is converted into training data of natural language prompt words and the corresponding optimal decision label, and the loss function is calculated, the loss function is temporarily stored; After the loss function is calculated for all the data in a decision cycle, the gradient average of all the temporarily stored loss functions is taken to obtain the average loss function; According to the average loss function, the model parameters of the large language model are updated.
5. The method for online decision-making of emergencies based on a large language model according to claim 1, characterized in that: Converting the training data and the optimal decision label into natural language prompt words to construct a fine-tuning training data set, specifically including: By designing fine-tuning prompt words, the training data and the optimal decision label are converted into natural language prompt words in the form of natural language question-answer pairs to construct a fine-tuning training data set.
6. The method for online decision-making of emergencies based on a large language model according to claim 2, characterized in that: The attacker model includes: (1); Where t represents the decision day, Z t represents the strategy adopted by the attacker on decision day t; T represents transposition; Represents the distribution vector of the attacker's power. If the attacker's power is distributed at node j, then ; V represents the node set; the attacker’s strategy is vectors, expressed as , if the attacker decides that the attacker force i will choose to control node j on decision day t, then z ijt =1; each attacker's strength The action of is limited by the total movement cost of the attacker, which is , From the vector f t ; 1 in the attacker model represents a 1 vector; represents the deployment movement cost from node j to node j'.
7. The method for online decision-making of emergencies based on a large language model according to claim 3, characterized in that: The constraints of the rescuer model include: (2); (3); The rescuer model includes: (4); Among them, t Indicates the location of the relief supplies, g t Indicates the transportation destination of relief supplies; variable y t represents the edge selected by the rescuer in the network. If the rescuer chooses edge k to reach g t , then y kt =1; FS(j) represents the edge set starting from node j, RS(j) represents the edge set arriving at node j; E represents the edge between two nodes.
8. The method for online decision-making of emergencies based on a large language model according to claim 7, characterized in that: The utility function includes: (5); Among them, c k represents the cost of passing through edge k, c k Taken from vector c, vector c represents the vector set of costs passing through each edge in the road network; d k represents the additional cost for the rescuer to pass through edge k controlled by the attacker, d k Taken from vector d, vector d represents the vector set of the additional cost of the rescuer passing through the edge controlled by the attacker; let is an intermediate decision variable: If edge k is under the control of the attacker on decision day t, then =1.
9. The method for online decision-making of emergencies based on a large language model according to claim 8, characterized in that: The remaining relief supplies successfully transported are: ; Among them, r t Indicates the remaining relief supplies that can be successfully transported; Expressing the need for relief supplies; Indicates the looting rate of the attacker's force that the rescuer encounters.
10. An online emergency decision-making system based on a large language model, characterized in that: include: A training data generation module, used to generate training data using normal distribution simulation; the training data at least includes the rescue material demand for each decision day, the transportation cost for each decision day, and the remaining rescue materials for each decision day; the decision day is the decision day for determining whether to implement material rescue; An optimal decision label generation module is used to generate an optimal decision label based on the training data using an offline rescue attack game model; the two adversaries of the offline rescue attack game model include a rescuer who transports rescue materials and an attacker who blocks the transportation of rescue materials; the optimal decision label is obtained by taking the maximum total amount of rescue materials transported within the total decision day as the game goal; A fine-tuning training data set construction module, used for converting the training data and the optimal decision label into natural language prompt words to construct a fine-tuning training data set; A training module is used to train the large language model using the fine-tuning training data set to obtain a large language model after fine-tuning training; during training, the training data converted into natural language prompt words is used as input, and the optimal decision label is used as output; the large language model is a ChatGLM3-6B model; the large language model after fine-tuning training is used as an online decision model for emergencies; The decision-making module is used to make online decisions on emergencies using the online emergency decision-making model to obtain decision results.
Citation Information
Patent Citations
Online learning method for prospective emergency rescue planning
CN115271210A
Complex system dynamics behavior modeling method, system and equipment
CN117195731A
Method and device for quickly constructing simulation scenario based on large language model
CN117909470A
Construction method and system of dangerous chemical emergency auxiliary rescue decision-making system
CN118114889A
Database parameter adjustment method and apparatus, electronic device, and storage medium
WO2023098796A1
