System and program
The system addresses high processing costs in LLM-based optimization by integrating an interface and processing units to efficiently formulate and solve mathematical optimization problems using LLMs and solvers, achieving cost-effective problem formulation and solution.
Patent Information
- Application Number
- JP2024032275
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-03-04
- Publication Date
- 2025-09-17
- Estimated Expiration
- 2044-03-04
AI Technical Summary
Conventional methods for formulating mathematical optimization problems using large-scale language models (LLMs) are costly due to repeated evaluations by the LLM, increasing processing costs.
A system and program that utilizes an interface unit to receive user requests, a first processing unit to input prompts into an LLM for problem-related information, and a second processing unit to input this information into a solver, thereby formulating mathematical optimization problems at a lower cost.
The system reduces processing costs by leveraging LLMs efficiently to formulate and solve mathematical optimization problems with improved accuracy and reduced load.
Smart Images

Figure 2025134394000001_ABST
Abstract
Description
[Technical Field]
[0001] The present invention relates to a system and a program. [Background technology]
[0002] Conventionally, mathematical optimization problems have been solved using solvers. In this type of technology, formulating the problem and generating the problem formula to be given to the solver is not easy and may require the skill of the generator. In this context, 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 the processing cost.
[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 can formulate a mathematical optimization problem at a 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 for formulating 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 for a similar problem to the mathematical optimization problem represented by the request, as prompts and inputs it 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 and inputs it into a solver to receive an optimal solution, wherein the interface unit outputs one or both of the second problem-related information and the optimal solution to the terminal device. [Effects of the Invention]
[0007] According to the present invention, a mathematical optimization problem can be formulated at a lower cost. [Brief explanation 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. [Figure 2] FIG. 2 is a diagram showing an outline of the processing flow by each unit of the system 100. [Figure 3] FIG. 10 is a schematic diagram showing an example of the contents of a similar problem related information library 172. [Figure 4] FIG. 10 is a diagram illustrating a first example of a feedback process. [Figure 5] FIG. 10 is a diagram illustrating a second example of the feedback process. [Figure 6] FIG. 10 is a diagram illustrating a third example of the feedback process. [Figure 7] FIG. 10 is a diagram illustrating a fourth example of feedback processing. [Figure 8] 10 is a flowchart showing an example of a processing flow by the system 100. DETAILED DESCRIPTION OF THE INVENTION
[0009] Hereinafter, an embodiment of a system and a program according to 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 an SOC (System On Chip), or may be realized by a combination of software and hardware. The program may be stored in advance in a storage device (a storage device with a non-transitory storage medium) such as an HDD (Hard Disk Drive) or flash memory, or may be stored in a removable storage medium (a non-transitory storage medium) such as a DVD or CD-ROM, and installed by inserting the storage medium into a drive device.
[0011] The storage unit 170 is a RAM (Random Access Memory), a HDD, a flash memory, or the like. The storage unit 170 stores data and information such as a similar problem related information library 172. The storage unit 170 does not necessarily have to be attached to the system 100, but may be attached to 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, the functionality 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 related to the formulation of a mathematical optimization problem from the user's terminal device 10. The request may include a request statement entered by the user through text or voice input, as well as operation information indicating that the user has operated an operation button associated with an option for a partial request statement. The request is summarized in the form of a request statement to be processed by the system 100. When the user operates the terminal device 10 to enter a request, such as a request statement, into a predetermined input field on the web page, the result derived by the system 100 is displayed on the web page. The request statement may have, 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 your formulation in the following two steps: 1. Define the decision variables 2. Defining the objective function Also, please add an explanation of the decision variables and objective function. If you need more information to determine 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. ##########################################
[0013] The first processing unit 120 acquires second problem-related information, which is problem-related information corresponding to the request statement, by inputting the request statement and first problem-related information, which is problem-related information for a similar problem similar to the mathematical optimization problem represented by the request statement, as prompts into an LLM (large-scale language model) provided by the LLM server 200. The LLM server 200 is a server that provides LLMs known under names such as BERT and ChatGPT. The second processing unit 130 acquires an optimal solution by inputting the second problem-related information into a solver 140. Here, the "problem-related information" in the first problem-related information and the second problem-related information may include not only a problem formula that directly defines the problem, but also information that indirectly defines (explains) the problem using natural language or abstract information.
[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 explained below in order.
[0015] First, let us explain mathematical optimization. Mathematical optimization is the process of finding the (optimal) decision variables to minimize or maximize an objective function under given constraints. Equations (1) and (2) show simple examples of information related to mathematical optimization problems. Equation (1) indicates that the objective is to minimize the objective function f(x), and equation (2) indicates the constraints.
[0016]
number
[0017] The problem formulation related to the problem-related information is solved by the solver 140 by performing a process of at least partially exhaustively trying decision variables. The solver 140 utilizes various optimization methods to find an optimal solution to the given problem formulation. When finding the optimal solution, an optimal approach may be selected depending on 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 the 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. Furthermore, even if a logically correct problem formula is created, the accuracy of the optimal decision variable obtained 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, 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 on the jth day, and 0 otherwise, and N is the total number of destinations visited by the salesperson. The constraint condition means that destination 0 is visited on the 0th day, meaning that the salesperson departs from destination 0. Problems (issues) that are the subject of mathematical optimization include the traveling salesperson problem as well as shift adjustment, flight schedule management, shift optimization, delivery planning, product shipping schedule optimization, production planning optimization, and facility location 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 component of the system 100 performs the above-described processing to improve optimization accuracy and reduce processing load. Figure 2 illustrates an overview of the processing flow performed by each component 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, a database that stores problem-related information for mathematical optimization problems, to (3) acquire information such as the first problem-related information. Figure 3 is a schematic diagram illustrating an example of the contents of the similar problem-related information library 172. The similar problem-related information library 172 associates, for example, vector data, which is characteristic information of a request statement, with problem-related information such as at least a problem formula. The similar problem formula library 172 may also include tags that indicate the properties of the problem formula, supplementary explanations such as key points for formulation depending on the type of solver, constraints (mathematical constraints), application methods, and the like. By configuring the similar problem formula library 172 in this data structure, the prompts passed to the LLM provided by the LLM server 200 can be simplified. The vector data is generated by converting words and / or sentences included in a request sentence into distributed representation vectors using a technique known as embedding. The function for generating vector data may be included in the system 100 or may be provided by an external device. The vector data has the property that the more similar the content of the original data, the higher the similarity index (e.g., cosine similarity, Euclidean distance, deviation pattern similarity, etc.) between two vector data. Therefore, the first processing unit 120 searches the similar problem-related information library 172 using a query obtained by vectorizing (converting feature information into) the request sentence acquired from the terminal device 10 using a similar technique, extracts a record with the highest similarity index (example data associated with one vector data), and acquires the problem-related information included in that record as the first problem-related information. The first processing unit 120 may also 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 in addition to the request and first problem-related information acquired from the terminal device 10, and inputs this to the LLM provided by the LLM server 200. The additional information may include, 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 the user, the problem type (mathematical optimization), the objective (desired formulation), steps to achieve the objective (definition of decision variables → definition of objective function), and information on similar problems. The first processing unit 120 may also include in the prompt a request that the response from the LLM server 200 include predetermined variables and functions, explanations for each variable and function, and a list of necessary constraints.
[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 additional information from the user 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 formulas in the first problem-related information. The first processing unit 120 may also include in the prompt an instruction to "discuss 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 would like to solve an optimization problem. Currently, I am using it as follows, and the information on similar problems is as follows: Shift scheduling problem. · Similar problem formula is minf(x), stg(x)=C… The solver is ____. Quadratic calculations are not possible. ##########################################
[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] The system 100 may perform a feedback process to improve the second problem-related information or the optimal solution after the fact, based on the process flow shown in FIG.
[0029] FIG. 4 illustrates a first example of feedback processing. For example, in the system 100, (A) the IF unit 110 acquires a user's comment at any time 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 into the LLM provided by the LLM server 200; and (C) and (D) the second processing unit 130 acquires updated second-problem-related information and causes the solver 140 to solve the problem, and the IF unit 110 transmits the result to the terminal device 10. For example, a user may forget to enter a necessary constraint. For example, in an example where an optimal solution for a transportation company's delivery plan is sought, an optimal solution in which the break times of each employee do not match may be returned. In this case, the user may check the optimal solution, notice a problem, and send a comment requesting the addition of a constraint, thereby improving the optimal solution.
[0030] 5 illustrates a second example of feedback processing. For example, when the system 100 receives (F) a result indicating that an optimal solution cannot be calculated when second-problem-related information is input to the solver 140, (G) the first processing unit 120 may add information indicating this to the previous prompt and input the result again into the LLM provided by the LLM server 200. In this case, the solver 140 may have a function for determining whether the second-problem-related information is self-consistent. The system 100 may repeat this processing until the solver 140 can calculate an optimal solution, and when the solver can calculate an optimal solution, output one or both of the second-problem-related information and the optimal solution to the terminal device 10.
[0031] 6 is a diagram illustrating a third example of the feedback process. For example, after the solver 140 calculates the optimal solution, the system 100 may add the optimal solution to the previous prompt and input it again into 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 feedback processing. For example, after outputting one or both of the second-problem-related information and the optimal solution to the terminal device 10, the system 100 may (H) acquire from the terminal device 10 information input by the user about improvements the user would like to see made to one or both of the second-problem-related information and the optimal solution (e.g., a request for a schedule that allows all employees to eat lunch at the same time), and (I) input the information and the calculation results of the solver 140 to the LLM server 200 to request the second-problem-related information.
[0033] These feedback processes may be performed in combination as appropriate.
[0034] FIG. 8 is a flowchart showing an example of the processing flow of the system 100 described above. First, the system 100 receives a request from the terminal device 10 (S1). Next, the system 100 receives vector data for search based on the request (S2), and uses the vector data to search the similar problem-related information library 172 to obtain first problem-related information (S3). Next, the system 100 generates a prompt using the first problem-related information and inputs it 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 formulate mathematical optimization problems at lower cost.
[0036] The above-described embodiment can be expressed as follows. a storage medium for storing computer-readable instructions; a processor connected to the storage medium; The processor executes the computer-readable instructions to: A request for formulating a mathematical optimization problem is received from a user's terminal device, and 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 prompts, thereby obtaining second problem-related information, which is problem-related information corresponding to the request; 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; 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 acquires second 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 prompts; 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. system.
2. the first processing unit retrieves the first problem-related information by searching a database that stores problem-related information for mathematical optimization problems, based on the request; The system of claim 1 .
3. the database includes a plurality of pairs of characteristic information of requests and problem-related information of mathematical optimization problems; 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 2.
4. the first processing unit inputs to the large-scale language model, in addition to the request and the first problem-related information, a request to formulate a mathematical optimization problem, including the prompt; The system of claim 1 .
5. the first processing unit inputs the request, the first problem-related information, and a note corresponding to the solver into the large-scale language model, together with the prompt; 10. The system of claim 1 or 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 user's comment from the terminal device; the first processing unit inputs the second problem-related information that has already been acquired and the acquired comments into the large-scale language model; the second processing unit inputs updated second problem-related information into the solver to obtain an optimal solution; The system of claim 1 .
7. when the first processing unit inputs the second problem-related information into 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 the previous prompt and inputs the information into the large-scale language model again. The system of claim 1 .
8. the first processing unit repeatedly adds information to the previous prompt, commenting 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 after the first processing unit adds the previous optimal solution to the previous prompt and inputs the resulting solution into the large-scale language model, and the second processing unit inputs the updated second problem-related information into 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; The system of claim 1 .
10. At least one of the first problem-related information and the second problem-related information includes a problem formula. The system of claim 1 .
11. further comprising the solver; The system of claim 1 .
12. The processor 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 prompts; 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 to execute.
Citation Information
Cited By
Information support device, information support method, and information support program
JP7878611B1