System and program
Patent Information
- Application Number
- JP2024032275
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2024-03-04
- Publication Date
- 2025-02-12
- Estimated Expiration
- 2044-03-04
AI Technical Summary
【0007】 本発明によれば、より低コストで数理最適化問題の定式化を行うことができる。
Smart Images

Figure 0007628738000001_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to a system and a program. [Background technology]
[0002] Conventionally, mathematical optimization problems are solved using solvers. In this type of technology, formulating a problem and generating a problem formula to be given to a solver is not easy, and the skill of the generator may be required. In relation to this, a technology is known in which a user inputs a prompt generated in natural language into a large-scale language model (LLM) to have the LLM formulate the problem (Non-Patent Document 1). [Prior art documents] [Non-patent literature]
[0003] [Non-Patent Document 1] “LARGE LANGUAGE MODELS AS OPTIMIZERS”, Chengrun Yang et al., Google DeepMind Equal contribution, 7 Dec 2023 Summary of the Invention [Problem to be solved by the invention]
[0004] In conventional techniques, the LLM itself repeatedly evaluates the LLM solution, which can increase processing costs.
[0005] The present invention has been made in consideration of the above circumstances, and one of its objects is to provide a system and program that are capable of formulating a mathematical optimization problem at lower cost. [Means for solving the problem]
[0006] One aspect of the present invention is a system comprising an interface unit that receives a request regarding formulation of a mathematical optimization problem from a user's terminal device, a first processing unit that receives the request and first problem-related information, which is problem-related information of a similar problem to the mathematical optimization problem represented by the request, as prompts into a large-scale language model to receive second problem-related information, which is problem-related information corresponding to the request, and a second processing unit that receives the second problem-related information by inputting it into a solver, wherein the interface unit outputs one or both of the second problem-related information and the optimal solution to the terminal device. Effect of the Invention
[0007] According to the present invention, a mathematical optimization problem can be formulated at a lower cost. [Brief description of the drawings]
[0008] [Figure 1] 1 is a diagram showing an example of the configuration and surrounding environment of a system 100 according to the present invention. [Diagram 2] FIG. 2 is a diagram showing an outline of the flow of processing by each part of the system 100. [Diagram 3] 13 is a schematic diagram showing an example of the contents of a similar problem related information library 172. FIG. [Figure 4] FIG. 11 is a diagram illustrating a first example of a feedback process. [Diagram 5] FIG. 11 is a diagram illustrating a second example of the feedback process. [Figure 6] FIG. 11 is a diagram illustrating a third example of the feedback process. [Figure 7] FIG. 13 is a diagram illustrating a fourth example of a feedback process. [Figure 8] 1 is a flowchart showing an example of a processing flow by the system 100. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0009] Hereinafter, an embodiment of a system and a program of the present invention will be described with reference to the drawings. [composition] 1 is a diagram showing an example of the configuration and surrounding environment of a system 100 according to the present invention. The system 100 communicates with a terminal device 10 and an LLM server 200 via a network. The terminal device 10 is a terminal device of a user who wishes to use a service provided by the system 100, and is a computer device such as a personal computer, a tablet terminal, or a smartphone. The network includes the Internet, a cellular network, a dedicated line, a WAN (Wide Area Network), a LAN (Local Area Network), and the like.
[0010] The system 100 includes, for example, an IF (interface) unit 110, a first processing unit 120, a second processing unit 130, a solver 140, and a storage unit 170. The components other than the storage unit 170 are realized by, for example, a hardware processor such as a CPU (Central Processing Unit) executing a program (software). Some or all of these components may be realized by hardware (including circuitry) such as an LSI (Large Scale Integration), an ASIC (Application Specific Integrated Circuit), an FPGA (Field-Programmable Gate Array), a GPU (Graphics Processing Unit), or a SOC (System On Chip), or may be realized by cooperation between software and hardware. The program may be stored in advance in a storage device (a storage device having a non-transient storage medium) such as an HDD (Hard Disk Drive) or a flash memory, or may be stored in a removable storage medium (a non-transient storage medium) such as a DVD or a CD-ROM, and may be installed by mounting the storage medium in a drive device.
[0011] The storage unit 170 is a RAM (Random Access Memory), a HDD, a flash memory, or the like. Data and information such as a similar problem related information library 172 are stored in the storage unit 170. The storage unit 170 does not necessarily need to be associated with the system 100, and may be associated with an external server. The external server is not limited to a cloud server, and may be operated by a business operator that uses the system 100.
[0012] The IF unit 110 has, for example, a function of a web server, and provides the terminal device 10 with a web page for providing the functions of the system 100. The IF unit 110 acquires a request for formulating a mathematical optimization problem from the terminal device 10 of the user. The request may include a request sentence input by the user through text input or voice input, as well as operation information indicating that the user has performed an operation on an operation button associated with an option of a partial request sentence. The request is summarized in the form of a request sentence to be processed by the system 100. When the user operates the terminal device 10 to input a request such as a request sentence into a predetermined input field on the web page, the result derived by the system 100 is displayed on the web page. The request sentence has, for example, the following content: ########################################## I would like to formulate the following problem as a mathematical optimization problem. {Description of the problem you want to solve} Construct the formulation in the following two steps. 1. Define decision variables 2.Define the objective function Also, please add an explanation of the decision variables and the objective function. If you don't have enough information to decide on the objective function, please ask me. Then, list the necessary constraints in bullet points. Let's deepen our understanding of the problem by discussing before formulating it. ##########################################
[0013] The first processing unit 120 inputs the request statement and the first problem-related information, which is problem-related information of a similar problem similar to the mathematical optimization problem represented by the request statement, as a prompt into an LLM (large-scale language model) provided by the LLM server 200, to obtain second problem-related information, which is problem-related information corresponding to the request statement. The LLM server 200 is a server that provides LLMs known under names such as BERT and ChatGPT. The second processing unit 130 inputs the second problem-related information into the solver 140 to obtain an optimal solution. Here, the "problem-related information" in the first problem-related information and the second problem-related information may include information that indirectly defines (explains) the problem using natural language or abstracted information, in addition to a problem formula that directly defines the problem.
[0014] Then, the IF unit 110 outputs either or both of the second problem-related information and the optimal solution to the terminal device 10. Each of these processes will be described below in order.
[0015] First, let us explain mathematical optimization. Mathematical optimization is a process for finding (optimal) decision variables for minimizing or maximizing an objective function under given constraint conditions. Equations (1) and (2) show simple examples of problem-related information for mathematical optimization. Equation (1) indicates that the objective is to minimize the objective function f(x), and equation (2) indicates the constraint conditions.
[0016]
number
[0017] The problem formulation related to the problem-related information is solved by the solver 140 performing a process of exhaustively trying decision variables at least in part. The solver 140 utilizes various optimization techniques to find an optimal solution to the given problem formulation. When finding the optimal solution, an optimal approach may be selected according to the nature of the problem, such as a gradient method for continuous variables, a branch-and-bound method suitable for integer programming problems, or metaheuristics. However, the "optimal solution" means the best solution found through a search process, and absolute optimality is not necessarily guaranteed in all cases.
[0018] Here, there is a problem that it is difficult to create a problem formula unless the user is skilled in mathematical correspondence. Even if a logically correct problem formula is created, the accuracy of the optimal decision variable required may vary or the processing load may increase depending on the problem formula. Equations (3) to (5) are examples of problem formulas for the traveling salesman problem, but by adding the constraint x[0,0]=1 to this formula, the symmetry can be eliminated and the search space can be made smaller. In the formulas, parameters i and j respectively represent the salesman's visit destinations, and d i,j is the distance between destinations i and j, and x i,t is a binary variable that takes the value 1 when destination i is visited for the jth time and 0 otherwise, and N is the total number of destinations visited by the salesman. The constraint condition means that destination "0" is visited as the 0th destination, in other words, the salesman departs from destination 0. Problems (issues) that are the subject of mathematical optimization include the traveling salesman problem, as well as shift adjustment, flight schedule management, shift optimization, delivery planning, product shipping schedule optimization, production planning optimization, and facility layout problems.
[0019]
number
[0020] Furthermore, there may be problem formulas that cannot be handled depending on the type of solver 140. Equations (3) to (5) cannot be handled by a MILP solver because the objective function is a quadratic function of x.
[0021] [Processing flow] Therefore, each unit of the system 100 performs the above-mentioned processing to improve the accuracy of optimization and reduce the processing load. FIG. 2 is a diagram showing an outline of the flow of processing by each unit of the system 100. (1) First, the first processing unit 120 acquires a request. (2) The first processing unit 120 uses vector data based on the request to search the similar problem related information library 172, which is a database that stores problem related information groups of mathematical optimization problems, to acquire (3) information such as the first problem related information. FIG. 3 is a schematic diagram showing an example of the contents of the similar problem related information library 172. The similar problem related information library 172 is, for example, a library in which at least problem related information such as a problem formula is associated with vector data that is characteristic information of a request statement. In addition, the similar problem formula library 172 may further include tags that indicate the nature of the problem formula, supplementary explanations such as points to be noted in formulating according to the type of solver, constraint conditions (mathematical constraints), application methods, and the like. By making the similar problem formula library 172 into such a data structure, the prompts to be passed to the LLM provided by the LLM server 200 can be simplified. The vector data is obtained by converting words and / or sentences included in the request text into distributed representation vectors by a technique called embedding. The function of generating vector data may be provided in the system 100 or may be provided by an external device. The vector data has a property that the more similar the content of the original data is, the higher the similarity index (e.g., cosine similarity, Euclidean distance, deviation pattern similarity, etc.) between two vector data becomes. Therefore, the first processing unit 120 searches the similar problem-related information library 172 using a query obtained by vectorizing (converting into feature information) the request text acquired from the terminal device 10 by a similar technique, extracts a record (an example of data associated with one vector data) with the highest similarity index, and acquires the problem-related information included in the record as the first problem-related information. The first processing unit 120 may extract multiple records to create a group of first problem-related information.
[0022] Then, (4) the first processing unit 120 generates a prompt with additional information added to the request and first problem-related information acquired from the terminal device 10, and inputs the generated prompt to the LLM provided by the LLM server 200. The additional information includes, for example, a request to formulate the mathematical optimization problem and / or notes corresponding to the solver. (5) The LLM server 200 generates second problem-related information based on this and returns it.
[0023] The first processing unit 120 may include in the prompt, for example, a request from a user, a problem type (mathematical optimization), a purpose (desired formulation), steps for achieving the purpose (definition of decision variables -> definition of objective function), and information on similar problems. In addition, the first processing unit 120 may include in the prompt a request for the inclusion of predetermined variables and functions, explanations regarding each variable and function, and a list of necessary constraints in the response from the LLM server 200.
[0024] The first processing unit 120 may always include the problem type, purpose, and constraints in the prompt, and if these are missing during the request, may request the user to add the information via the IF unit 110. The first processing unit 120 may also include constraints (mathematical constraints), notes (techniques depending on the solver used), application methods, and mathematical expressions in the first problem-related information. The first processing unit 120 may also include in the prompt an instruction to "have a discussion between the user and the LLM" regarding the answer output by the LLM server 200.
[0025] The prompt sent may include, for example, the following: ########################################## I want to solve an optimization problem. Currently I am running it like this, and the information on similar problems is below. -Shift scheduling problem. · Similar problem formula is minf(x), stg(x)=C… The solver is ____. It cannot perform quadratic calculations. ##########################################
[0026] (6) The first processing unit 120 passes the information returned by the LLM server 200, including the second problem-related information, to the second processing unit 130.
[0027] (7)(8) The second processing unit 130 obtains an optimal solution by inputting the second problem-related information to the solver 140. Then, (9) the second processing unit 130 outputs one or both of the second problem-related information and the optimal solution to the terminal device 10 via the IF unit 110.
[0028] [feedback] Based on the process flow shown in FIG. 2, the system 100 may perform a feedback process to improve the second problem-related information or the optimal solution after the fact.
[0029] FIG. 4 is a diagram showing a first example of the feedback process. For example, in the system 100, (A) the IF unit 110 acquires a user's comment at any timing after outputting one or both of the second problem-related information and the optimal solution to the terminal device 10, (B) the first processing unit 120 inputs the already acquired second problem-related information and the acquired comment to the LLM provided by the LLM server 200, and (C) and (D) the second processing unit 130 acquires an updated version of the second problem-related information and causes the solver 140 to solve the problem, and the IF unit 110 may transmit the result to the terminal device 10. For example, there are cases where the user forgets to enter a necessary constraint condition, and in the example of searching for an optimal solution for a delivery plan of a transportation company, an optimal solution in which the break times of each employee do not match may be returned. In this case, the user checks the optimal solution, notices an inconvenience, and transmits a comment requesting that a constraint condition be added, thereby improving the optimal solution.
[0030] 5 is a diagram showing a second example of the feedback process. For example, in the system 100, when the second problem-related information is input to the solver 140 (F) and a result is obtained indicating that the optimal solution cannot be calculated, (G) the first processing unit 120 may add information commenting to that effect to the previous prompt and input it again to the LLM provided by the LLM server 200. In this case, the solver 140 may have a function of determining whether the second problem-related information is self-contradictory. The system 100 may repeat the process until the solver 140 can calculate the optimal solution, and may output one or both of the second problem-related information and the optimal solution to the terminal device 10 at the point in time when the solver can calculate the optimal solution.
[0031] 6 is a diagram showing a third example of the feedback process. For example, after the solver 140 calculates an optimal solution, the system 100 may add the optimal solution to the previous prompt, and input it again to the LLM provided by the LLM server 200 (n times: n is a natural number), and then output one or both of the second problem-related information and the optimal solution to the terminal device 10.
[0032] 7 is a diagram showing a fourth example of the feedback process. For example, the system 100 may output one or both of the second problem-related information and the optimal solution to the terminal device 10, and then (H) obtain from the terminal device 10 information input by the user on what the user wants to improve on one or both of the second problem-related information and the optimal solution (e.g., a schedule that allows all employees to eat at the same time during lunch break, etc.), and (I) input the information and the calculation result of the solver 140 to the LLM server 200 to request the second problem-related information.
[0033] These feedback processes may be executed in combination as appropriate.
[0034] FIG. 8 is a flowchart showing an example of the flow of processing by the system 100 described above. First, the system 100 acquires a request from the terminal device 10 (S1). Next, the system 100 acquires vector data for search based on the request (S2), and searches the similar problem-related information library 172 using the vector data to acquire first problem-related information (S3). Next, the system 100 generates a prompt using the first problem-related information, and inputs the prompt to the LLM server 200 (S4). Next, the system 100 causes the solver 140 to solve the second problem-related information returned from the LLM server 200 (S5), and outputs one or both of the optimal solution and the second problem-related information to the terminal device 10 (S6).
[0035] According to the embodiment described above, by inputting a prompt including the first problem-related information obtained from the similar problem-related information library 172 into the LLM provided by the LLM server 200, it is possible to save on token usage fees and to formulate a mathematical optimization problem at lower cost.
[0036] The above-described embodiment can be expressed as follows. a storage medium for storing computer-readable instructions; a processor coupled to the storage medium; The processor executes the computer-readable instructions to: receiving a request for formulating a mathematical optimization problem from a user's terminal device; inputting the request and first problem-related information, which is problem-related information of a similar problem similar to the mathematical optimization problem represented by the request, into a large-scale language model as a prompt, thereby acquiring second problem-related information, which is problem-related information corresponding to the request; obtaining an optimal solution by inputting the second problem-related information into a solver; outputting one or both of the second problem-related information and the optimal solution to the terminal device; Device.
[0037] The above describes the form for carrying out the present invention using an embodiment, but the present invention is not limited to such an embodiment, and various modifications and substitutions can be made within the scope that does not deviate from the gist of the present invention. [Explanation of symbols]
[0038] 10 Terminal Equipment 100 Systems 110 IF (Interface) Section 120 First Processing Section 130 Second Processing Section 140 Solvers 170 Storage section 172 Similar Problems Related Information Library 200 LLM Servers
Claims
1. an interface unit that receives a request for formulating a mathematical optimization problem from a user's terminal device; a first processing unit that inputs the request and first problem-related information, which is problem-related information of a similar problem similar to the mathematical optimization problem represented by the request, into a large-scale language model as a prompt to acquire second problem-related information, which is problem-related information corresponding to the request; the first processing unit inputs, to the large-scale language model, in addition to the request and the first problem-related information, a note corresponding to a solver that solves the mathematical optimization problem, into the prompt; system.
2. an interface unit that receives a request for formulating a mathematical optimization problem from a user's terminal device; a first processing unit that inputs the request and first problem-related information, which is problem-related information of a similar problem similar to the mathematical optimization problem represented by the request, into a large-scale language model as a prompt, to obtain second problem-related information, which is problem-related information corresponding to the request; a second processing unit that inputs the second problem-related information into a solver to obtain an optimal solution; the interface unit outputs one or both of the second problem-related information and the optimal solution to the terminal device; the first processing unit inputs, to the large-scale language model, the request, the first problem-related information, and a note corresponding to the solver, into the prompt; system.
3. an interface unit that receives a request for formulating a mathematical optimization problem from a user's terminal device; a first processing unit that inputs the request and first problem-related information, which is problem-related information of a similar problem similar to the mathematical optimization problem represented by the request, into a large-scale language model as a prompt, to obtain second problem-related information, which is problem-related information corresponding to the request; a second processing unit that inputs the second problem-related information into a solver to obtain an optimal solution; the interface unit outputs one or both of the second problem-related information and the optimal solution to the terminal device; the first processing unit inputs, to the large-scale language model, a request to formulate a mathematical optimization problem in two steps, that is, definition of a decision variable and definition of an objective function, in addition to the request and the first problem-related information, into the prompt; system.
4. the first processing unit, based on the request, searches a database that stores a group of problem-related information for the mathematical optimization problem, to acquire the first problem-related information; A system according to any one of claims 1 to 3.
5. the database includes a plurality of pairs of feature information of a request and problem-related information of a mathematical optimization problem; the first processing unit searches the database using a query that represents the request as characteristic information, and acquires the first problem-related information; The system of claim 4.
6. the interface unit outputs one or both of the second problem-related information and the optimal solution to the terminal device, and then acquires a comment from a user from the terminal device; the first processing unit inputs the second problem-related information already acquired and the acquired comments into the large-scale language model; The second processing unit obtains an optimal solution by inputting updated second problem-related information to the solver.
4. The system according to claim 2 or 3.
7. when the first processing unit inputs the second problem-related information to the solver and obtains a result indicating that an optimal solution cannot be calculated, it adds information indicating that the optimal solution cannot be calculated to a previous prompt and inputs the information to the large-scale language model again.
4. The system according to claim 2 or 3.
8. the first processing unit repeatedly adds, to a previous prompt, information indicating that the optimal solution cannot be calculated, and inputs the information to the large-scale language model again, until the solver is able to calculate the optimal solution. The system of claim 7.
9. The interface unit includes: After the first processing unit adds the previous optimal solution to the previous prompt and inputs the previous optimal solution to the large-scale language model, and the second processing unit inputs the updated second problem-related information to a solver to obtain an optimal solution, the process is performed a predetermined number of times. outputting one or both of the second problem-related information and the optimal solution to the terminal device; 4. The system according to claim 2 or 3.
10. At least one of the first problem-related information and the second problem-related information includes a problem formula. A system according to any one of claims 1 to 3.
11. The solver further comprises: A system according to any one of claims 1 to 3.
12. The processor: A process of receiving a request for formulating a mathematical optimization problem from a user's terminal device; The request and first problem-related information, which is problem-related information of a similar problem similar to the mathematical optimization problem represented by the request, are input as prompts to a large-scale language model, whereby second problem-related information, which is problem-related information corresponding to the request, is generated. A program for executing and in the process of acquiring the second problem-related information, causing the processor to input to the large-scale language model, in addition to the request and the first problem-related information, a note corresponding to a solver that solves the mathematical optimization problem, in the prompt. program.
13. The processor: A process of receiving a request for formulating a mathematical optimization problem from a user's terminal device; a process of acquiring second problem-related information, which is problem-related information corresponding to the request, by inputting the request and first problem-related information, which is problem-related information of a similar problem similar to the mathematical optimization problem represented by the request, into a large-scale language model as a prompt; inputting the second problem-related information into a solver to obtain an optimal solution; outputting one or both of the second problem-related information and the optimal solution to the terminal device; A program for executing and in the process of acquiring the second problem-related information, causing the processor to input, to the large-scale language model, the request, the first problem-related information, and a note corresponding to the solver, in the prompt. program.
14. The processor: A process of receiving a request for formulating a mathematical optimization problem from a user's terminal device; a process of acquiring second problem-related information, which is problem-related information corresponding to the request, by inputting the request and first problem-related information, which is problem-related information of a similar problem similar to the mathematical optimization problem represented by the request, into a large-scale language model as a prompt; inputting the second problem-related information into a solver to obtain an optimal solution; outputting one or both of the second problem-related information and the optimal solution to the terminal device; A program for executing In the process of acquiring the second problem-related information, the processor is caused to input, to the large-scale language model, a request to formulate a mathematical optimization problem in two steps, that is, definition of a decision variable and definition of an objective function, in addition to the request and the first problem-related information, in the prompt. program.
Citation Information
Patent Citations
Task execution method and task execution optimization method
CN116579339A
Question answering method and device based on use manual, electronic equipment and storage medium
CN116955568A
Large language model-based operation planning optimization method and system, electronic equipment and storage medium
CN117273005A
Cited By
Plan generating system, plan generating method, and program
WO2026197380A1