A method and apparatus for resource scheduling based on large language model reasoning with missing answer support.
By structurally decomposing the missing answer support in large language models and dynamically scheduling resources, the problems of over-reasoning for simple problems and under-reasoning for complex problems caused by fixed resource allocation are solved, thus achieving refined resource management and stable improvement in answer quality.
Patent Information
- Application Number
- CN202611024823.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-10
- Publication Date
- 2026-11-10
AI Technical Summary
Existing large language models suffer from inefficient resource utilization due to fixed resource allocation during the reasoning process, resulting in over-reasoning for simple problems and under-reasoning for complex problems. Furthermore, they lack dynamic and precise resource scheduling.
By using a method based on missing support in the answer, the large language model is invoked to generate initial candidate answers and perform structured decomposition to determine the missing support vector. The candidate reasoning action with the greatest quality gain per unit resource is selected, and the answer is iteratively updated until the stopping condition is met, and the final answer is output.
It effectively solved the problem of resource mismatch, realized the refined management and scheduling of reasoning resources, ensured the steady improvement of answer quality, and improved resource utilization efficiency.
Smart Images

Figure CN123068064A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a method and apparatus for scheduling reasoning resources for large language models based on missing answer support. Background Technology
[0002] With the rapid development of large language model technology, question answering, reasoning, code generation, agent task execution, and retrieval enhancement systems based on large language models have been widely used. However, large language models still face technical challenges in practical deployment.
[0003] For simple problems, existing systems often generate a large number of redundant tokens and inference delays due to fixed-depth inference or globally enabling multiple rounds of retrieval and tool calls, resulting in wasted resources. For complex problems, existing systems are prone to missing intermediate inference steps, incorrect conclusions, or incomplete tasks due to fixed-length outputs or single calls. At the same time, retrieval and tool calls lack dynamic control. Existing systems usually statically decide whether to enable the Retrieval Enhancement Generation Method (RAG) or tool calls before inference, and cannot adaptively adjust according to the actual evidence gaps or tool gaps after candidate answer generation, which easily introduces retrieval noise or erroneous calls.
[0004] However, existing adaptive inference methods also have limitations. For example, existing model routing methods (such as BEST-Route and Route-To-Reason) mainly select a model or strategy once before inference based on the problem complexity; existing adaptive lexical budgeting methods (such as SelfBudgeter) mainly predict the generated length; and existing dynamic retrieval enhancement generation methods (such as DioR and ConfRAG) mainly determine whether a retrieval is triggered. All of the above methods ignore the state information after the candidate answer is generated, and cannot determine whether the current answer lacks evidence, inference steps, or tool execution results.
[0005] Furthermore, due to the lack of a unified scheduling mechanism for various inference resources, resources such as inference steps, external retrieval, and tool calls have different costs and quality improvement benefits. Therefore, existing methods are difficult to compare and select the optimal resource actions under the same optimization framework, resulting in low resource utilization efficiency.
[0006] To address the technical problems in existing technologies regarding large language model reasoning, such as over-reasoning of simple problems and under-reasoning of complex problems due to fixed resource allocation, as well as the lack of dynamic and precise resource scheduling, no effective solution has yet been proposed. Summary of the Invention
[0007] The embodiments of this disclosure provide a method and apparatus for resource scheduling in large language model reasoning based on missing answer support, in order to at least solve the technical problems existing in the prior art in large language model reasoning, such as over-reasoning of simple problems and under-reasoning of complex problems due to fixed resource allocation, and the lack of dynamic and accurate scheduling of resources.
[0008] According to one aspect of this disclosure, a method for scheduling large language model inference resources based on answer support missing values is provided, comprising: invoking a large language model based on a preset resource configuration to generate initial candidate answers to an input question and corresponding initial resource state information; structurally decomposing the initial candidate answers and determining corresponding support missing value vectors. The support missing value vectors indicate the support missing value type corresponding to the initial candidate answers; determining a set of candidate inference actions based on the support missing value vectors, and determining the unit resource quality gain corresponding to each candidate inference action in the set of candidate inference actions. The unit resource quality gain indicates the improvement in answer quality by each candidate inference action when consuming a unit of resources; updating the initial candidate answers and initial resource state information using the candidate inference action with the largest unit resource quality gain, and calculating the answer quality score corresponding to the updated next candidate answer; and outputting the corresponding final candidate answer as the answer to the input question when at least one of the unit resource quality gain, answer quality score, and initial resource state information satisfies a stopping condition.
[0009] According to another aspect of the present disclosure, a storage medium is also provided, the storage medium including a stored program, wherein, when the program is executed, a processor performs any of the methods described above.
[0010] According to another aspect of the present disclosure, a resource scheduling device for large language model inference based on answer support missing values is also provided, comprising: an initial candidate answer generation module, used to generate initial candidate answers to the input question and corresponding initial resource state information by invoking a large language model based on a preset resource configuration; a support missing vector determination module, used to perform structured decomposition of the initial candidate answers and determine the corresponding support missing vectors. The support missing vectors are used to indicate the support missing type corresponding to the initial candidate answers; a unit resource quality gain determination module, used to determine a set of candidate inference actions based on the support missing vectors, and determine the unit resource quality gain corresponding to each candidate inference action in the set of candidate inference actions. The unit resource quality gain is used to indicate the improvement in answer quality by each candidate inference action when consuming a unit of resources; an update module, used to update the initial candidate answers and initial resource state information using the candidate inference action with the largest unit resource quality gain, and calculate the answer quality score corresponding to the updated next candidate answer; and an answer output module, used to output the corresponding final candidate answer as the answer to the input question when at least one of the unit resource quality gain, answer quality score, and initial resource state information satisfies a stopping condition.
[0011] According to another aspect of the present disclosure, a resource scheduling device for large language model inference based on answer support missing values is also provided, comprising: a processor; and a memory connected to the processor, configured to provide the processor with instructions for processing the following steps: based on a preset resource configuration, invoking a large language model to generate initial candidate answers to the input question and corresponding initial resource state information; structurally decomposing the initial candidate answers and determining corresponding support missing values vectors. The support missing values vectors indicate the support missing type corresponding to the initial candidate answers; determining a set of candidate inference actions based on the support missing values vectors, and determining the unit resource quality gain corresponding to each candidate inference action in the set of candidate inference actions. The unit resource quality gain indicates the improvement in answer quality by each candidate inference action when consuming unit resources; updating the initial candidate answers and initial resource state information using the candidate inference action with the largest unit resource quality gain, and calculating the answer quality score corresponding to the updated next candidate answer; and outputting the corresponding final candidate answer as the answer to the input question when at least one of the unit resource quality gain, answer quality score, and initial resource state information satisfies a stopping condition.
[0012] To address the lack of dynamic and precise resource scheduling, this application provides a resource scheduling method for large language model inference based on answer support gaps. First, based on minimum resource allocation, an initial candidate answer is generated by calling a large language model. Then, the initial candidate answer is structurally decomposed, and the support gap type corresponding to the initial candidate answer (i.e., the type of the initial candidate answer that needs optimization) is quantified into a support gap vector, which is used to determine the set of candidate inference actions. Next, the candidate inference action with the largest quality gain per unit of resource is selected, and the initial candidate answer is iteratively updated to improve the answer quality until the corresponding data meets the stopping condition. The updated final candidate answer is then output to the user as the answer to the input question.
[0013] This effectively solves the resource mismatch problem caused by fixed resource allocation, resulting in over-reasoning for simple problems and under-reasoning for complex problems. Furthermore, it achieves refined management and scheduling of reasoning resources while ensuring a stable improvement in answer quality. Moreover, it addresses the technical problems in existing technologies for large language model reasoning, where fixed resource allocation leads to over-reasoning for simple problems and under-reasoning for complex problems, and the lack of dynamic and precise resource scheduling. Attached Figure Description
[0014] The accompanying drawings, which are included to provide a further understanding of this disclosure and form part of this application, illustrate exemplary embodiments of this disclosure and are used to explain this disclosure, but do not constitute an undue limitation of this disclosure. In the drawings: Figure 1 This is a hardware structure block diagram of a computing device for implementing the method according to Embodiment 1 of this disclosure; Figure 2 This is a schematic diagram of a system for scheduling reasoning resources based on a large language model with missing answer support, as described in Embodiment 1 of this disclosure; Figure 3 This is a flowchart illustrating the resource scheduling method for large language model inference based on missing answer support, as described in Embodiment 1 of this disclosure. Figure 4 This is a flowchart illustrating the answer to the reasoning input question according to Embodiment 1 of this disclosure; Figure 5 This is a flowchart of determining a set of candidate reasoning actions according to Embodiment 1 of this disclosure; Figure 6 This is a schematic diagram of a large language model inference resource scheduling device based on missing answer support, according to Embodiment 2 of this disclosure; and Figure 7 This is a schematic diagram of a large language model reasoning resource scheduling device based on missing answer support, according to Embodiment 3 of this disclosure. Detailed Implementation
[0015] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this disclosure.
[0016] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0017] Example 1
[0018] According to this embodiment, a method embodiment of a large language model reasoning resource scheduling method based on missing answer support is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0019] The method embodiments provided in this example can be executed on mobile terminals, computer terminals, servers, or similar computing devices. Figure 1 A hardware block diagram of a computing device for implementing a resource scheduling method for reasoning in large language models based on missing answer support is shown. Figure 1 As shown, a computing device may include one or more processors (processors may include, but are not limited to, microprocessors such as MCUs or programmable logic devices such as FPGAs), a memory for storing data, a transmission device for communication functions, and an input / output interface. The memory, transmission device, and input / output interface are connected to the processor via a bus. In addition, it may also include a display, keyboard, and cursor control device connected to the input / output interface. Those skilled in the art will understand that... Figure 1The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, a computing device may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0020] It should be noted that the aforementioned one or more processors and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element in a computing device. As involved in the embodiments of this disclosure, the data processing circuits serve as processor control (e.g., selection of a variable resistor termination path connected to an interface).
[0021] The memory can be used to store software programs and modules of application software, such as the program instruction / data storage device corresponding to the large language model inference resource scheduling method based on missing answer support in this embodiment of the present disclosure. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby realizing the above-mentioned application's large language model inference resource scheduling method based on missing answer support. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the computing device via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0022] The transmission device is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the computing device's communication provider. In one example, the transmission device includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0023] The display can be, for example, a touchscreen liquid crystal display (LCD), which allows users to interact with the user interface of the computing device.
[0024] It should be noted here that, in some optional embodiments, the above... Figure 1The computing device shown may include hardware elements (including circuitry), software elements (including computer code stored on a computer-readable medium), or a combination of both hardware and software elements. It should be noted that... Figure 1 This is only one instance of a specific particular instance, and is intended to illustrate the types of components that may exist in the aforementioned computing devices.
[0025] Figure 2 This is a schematic diagram of a system for resource scheduling based on a large language model with missing answer support, as described in this embodiment. (Refer to...) Figure 2 As shown, the system includes: a terminal device 100, a server 200 that is communicatively connected to the terminal device 100, and a database 300 that is communicatively connected to the server 200, which is used to resolve the contradiction between over-reasoning of simple problems and under-reasoning of complex problems caused by fixed resource allocation in large language model reasoning.
[0026] First, users can send an inference request command, containing an input question, historical context, and inference budget, to a server 200 configured with a large language model via terminal device 100. The input question indicates the question the user currently wants to ask; the historical context indicates the multi-turn dialogue records in the current session prior to the input question, supporting coherent inference in multi-turn interaction scenarios; and the inference budget indicates the resource limits preset by the user or system administrator, including cost budgets (e.g., the maximum acceptable API call cost or the maximum acceptable latency) and lexical budgets (e.g., the maximum total number of input / output lexical units that can be consumed).
[0027] In response to the inference request command, server 200, based on preset resource configuration, invokes a large language model to infer initial candidate answers to the input question and retrieves an external knowledge base from database 300 to support the candidate inference actions. Furthermore, server 200 selects the optimal candidate inference action to execute, iteratively updating the candidate answers and resource status information until a stopping condition is met, balancing the improvement of answer quality with resource consumption. Finally, server 200 returns the optimized final candidate answer to terminal device 100 as the answer to the input question.
[0028] Database 300 stores external knowledge bases (such as vector / document libraries) to support candidate inference actions, as well as logs that record the inference scheduling process for subsequent auditing and system optimization.
[0029] It should be noted that the terminal device 100, server 200, and database 300 in the system can all be adapted to the hardware structure described above.
[0030] Under the aforementioned operating environment, according to the first aspect of this embodiment, a method for scheduling inference resources based on missing answer support in a large language model is provided. This method consists of... Figure 2 The server 200 shown is implemented. Figure 3 A flowchart illustrating the method is shown below. (Refer to...) Figure 3 As shown, the method includes: S302: Based on the preset resource configuration, call the large language model to generate initial candidate answers to the input question and the corresponding initial resource status information; S304: Decompose the initial candidate answers into a structured form and determine the corresponding support / missing vectors. The support / missing vectors indicate the types of support / missing information corresponding to the initial candidate answers. S306: Based on the missing support vectors, determine a set of candidate reasoning actions, and determine the quality gain per unit resource for each candidate reasoning action in the set. The quality gain per unit resource indicates the improvement in answer quality that each candidate reasoning action provides per unit of resource consumption. S308: Utilize the candidate reasoning action that maximizes the quality gain per unit resource to update the initial candidate answer and initial resource state information, and calculate the answer quality score corresponding to the updated next candidate answer; and S310: If at least one of the unit resource quality gain, answer quality score, and initial resource state information satisfies the stopping condition, output the corresponding final candidate answer as the answer to the input question.
[0031] Specifically, Figure 4 A flowchart illustrating the answer to a reasoning input question according to Embodiment 1 of this disclosure is shown. (Reference) Figures 2-4 As shown, firstly, the user sends a reasoning request instruction containing an input question and historical context to the server 200 configured with a large language model via the terminal device 100. The input question indicates the question the user currently wants to ask; the historical context indicates the multi-turn dialogue records in the current session prior to the input question, supporting coherent reasoning in multi-turn interaction scenarios.
[0032] Then, in response to the user's inference request instruction, server 200 invokes the large language model and, based on the preset resource configuration, generates initial candidate answers to the input question and corresponding initial resource status information (corresponding to step S302). The preset resource configuration indicates the minimum resource configuration, including: a lightweight model, a small maximum output length, disabling external retrieval, and disabling external tool invocation.
[0033] Therefore, by adopting a minimum resource allocation, we can avoid the waste of resources caused by fixed high resource allocation when answering simple questions, and provide an interference-free diagnostic basis for subsequent calculations supporting missing vectors.
[0034] Then, server 200 uses a large language model to perform a structured decomposition of the initial candidate answers and determine the corresponding support-missing vectors, thereby determining the type of initial candidate answers that need to be optimized. The support-missing vectors indicate the type of support-missing information corresponding to the initial candidate answers (corresponding to step S304). The specific steps of the structured decomposition and support-missing vector calculation will be explained in detail later and will not be repeated here.
[0035] Furthermore, server 200 utilizes a large language model to determine a set of candidate reasoning actions for optimizing the initial candidate answers based on the support missing vectors corresponding to the initial candidate answers. It also determines the quality-per-unit (PPC) gain for each candidate PPC action within the PPC set. The PPC gain indicates the improvement in answer quality that each candidate PPC action provides while consuming a unit of resources (corresponding to step S306). The specific steps for determining the PPC set will be explained in detail later and will not be repeated here.
[0036] Then, server 200 uses the large language model to execute the candidate reasoning action with the greatest quality gain per unit resource, updates the initial candidate answer and initial resource state information, and calculates the answer quality score corresponding to the updated next candidate answer (corresponding to step S308).
[0037] Finally, if at least one of the unit resource quality gain, answer quality score, and initial resource state information meets the stopping condition, the large language model outputs the corresponding final candidate answer as the answer to the input question (corresponding to step S310). Furthermore, the server 200 sends the final answer to the input question to the user's terminal device 100.
[0038] If the stopping condition is not met, the updated next candidate answer is used as the current candidate answer and the above steps S304~S308 are repeated until the data corresponding to the obtained candidate answer meets the stopping condition. The large language model outputs the corresponding final candidate answer as the answer to the input question.
[0039] In other words, this application structurally decomposes the initial candidate answers and quantifies the support missing type corresponding to the initial candidate answers (i.e., the type of the initial candidate answers that needs to be optimized) into a calculated support missing vector, and uses this as the basis to determine the set of candidate inference actions. Then, the candidate inference action with the largest quality gain per unit resource is selected, and the initial candidate answers are iteratively updated to improve the answer quality until the corresponding data meets the stopping condition. The updated final candidate answer is then output to the user as the answer to the input question.
[0040] This effectively solves the resource mismatch problem caused by fixed resource allocation, resulting in over-reasoning for simple questions and under-reasoning for complex questions. Furthermore, it achieves refined management and scheduling of reasoning resources while ensuring a stable improvement in answer quality. Consequently, it enables large language models to optimize reasoning for user-input questions.
[0041] As described in the background section, with the rapid development of large language model technology, question answering, reasoning, code generation, agent task execution, and retrieval enhancement systems based on large language models have been widely used. However, large language models still face technical challenges in practical deployment.
[0042] For simple problems, existing systems often generate a large number of redundant tokens and inference delays due to fixed-depth inference or globally enabling multiple rounds of retrieval and tool calls, resulting in wasted resources. For complex problems, existing systems are prone to missing intermediate inference steps, incorrect conclusions, or incomplete tasks due to fixed-length outputs or single calls. At the same time, retrieval and tool calls lack dynamic control. Existing systems usually statically decide whether to enable the Retrieval Enhancement Generation Method (RAG) or tool calls before inference, and cannot adaptively adjust according to the actual evidence gaps or tool gaps after candidate answer generation, which easily introduces retrieval noise or erroneous calls.
[0043] However, existing adaptive inference methods also have limitations. For example, existing model routing methods (such as BEST-Route and Route-To-Reason) mainly select a model or strategy once before inference based on the problem complexity; existing adaptive lexical budgeting methods (such as SelfBudgeter) mainly predict the generated length; and existing dynamic retrieval enhancement generation methods (such as DioR and ConfRAG) mainly determine whether a retrieval is triggered. All of the above methods ignore the state information after the candidate answer is generated, and cannot determine whether the current answer lacks evidence, inference steps, or tool execution results.
[0044] Furthermore, due to the lack of a unified scheduling mechanism for various inference resources, resources such as inference steps, external retrieval, and tool calls have different costs and quality improvement benefits. Therefore, existing methods are difficult to compare and select the optimal resource actions under the same optimization framework, resulting in low resource utilization efficiency.
[0045] In view of this, this application provides a resource scheduling method for large language model inference based on answer support gaps. First, based on minimum resource allocation, the large language model is invoked to generate initial candidate answers. Then, the initial candidate answers are structurally decomposed, and the support gap types corresponding to the initial candidate answers (i.e., the types of initial candidate answers that need optimization) are quantified into support gap vectors, which are used to determine the set of candidate inference actions. Next, the candidate inference action with the largest quality gain per unit of resource is selected, and the initial candidate answers are iteratively updated to improve answer quality until the corresponding data meets the stopping condition. The updated final candidate answer is then output to the user as the answer to the input question.
[0046] This effectively solves the resource mismatch problem caused by fixed resource allocation, resulting in over-reasoning for simple problems and under-reasoning for complex problems. Furthermore, it achieves refined management and scheduling of reasoning resources while ensuring a stable improvement in answer quality. Moreover, it addresses the technical problems in existing technologies for large language model reasoning, where fixed resource allocation leads to over-reasoning for simple problems and under-reasoning for complex problems, and the lack of dynamic and precise resource scheduling.
[0047] Optionally, the missing support vectors include: missing evidence values, missing reasoning values, and missing tool values. The operation of structurally decomposing the initial candidate answers and determining the corresponding missing support vectors includes: structurally decomposing the initial candidate answers to obtain the corresponding assertion set, sub-objective set, and tool requirement set; and determining the missing evidence values, missing reasoning values, and missing tool values based on the assertion set, sub-objective set, and tool requirement set, respectively.
[0048] Specifically, Figure 5 A flowchart illustrating the determination of a set of candidate inference actions according to Embodiment 1 of this disclosure is shown. (See also...) Figure 4 and Figure 5 As shown, firstly, server 200 uses a large language model to process the generated initial candidate answers. By performing structured decomposition, the corresponding set of assertions is obtained. Sub-goal set and tool requirement set The sub-objective set includes the input problem. The corresponding first sub-target set and initial candidate answers The second sub-target set that has been covered .
[0049] assertion set Indicates the initial candidate answer It is a collection of all statements with independent factual meanings extracted from the text, and each assertion can be verified for truth or falsity independently.
[0050] For example, user input problems The initial candidate answers generated were for the question: "What are the health effects of drinking coffee?" The statement reads: "Drinking coffee can reduce the risk of type 2 diabetes, but drinking more than four cups of coffee a day may lead to poor sleep quality." At this point, the assertion set... It includes two assertions. Specifically, the first assertion... Drinking coffee can reduce the risk of type 2 diabetes, and second assertion. Drinking more than four cups of coffee a day may lead to poor sleep quality.
[0051] Input problem The corresponding first sub-target set In order to answer the input question A complete summary list of all the necessary "intermediate steps" or "stage tasks" that must be completed, broken down in advance. Initial candidate answers. The second sub-target set that has been covered This indicates the initial candidate answers. With the first sub-target set After comparison, it was determined that the initial candidate answer had been selected. The set of sub-goals covered (i.e., mentioned or completed) by the content.
[0052] For example, user input problems The question is: "Evaluate the major literary achievements and representative works of Li Bai, a poet of the Tang Dynasty." (To fully answer the input question...) The following four sub-goals need to be achieved. Specifically, the first sub-goal... : Identify Li Bai's main literary genres (such as poetry, Yuefu, and ancient-style poetry); Second sub-objective Summarize the stylistic characteristics of Li Bai's poetry (such as its bold and unrestrained style and rich imagination); Third sub-objective List the names of Li Bai's representative works (such as "Quiet Night Thoughts" and "Drinking Alone Under the Moon"); and the fourth sub-target. This explains Li Bai's status in literary history and his influence on later generations.
[0053] Initial candidate answers generated The answer is: "Li Bai was a great romantic poet of the Tang Dynasty in China. His poems are known for their bold and unrestrained style, and he is hailed as the 'Poet Immortal'." The large language model identifies the initial candidate answers. The second sub-target was covered. and the fourth sub-target At this point, the input problem... The corresponding first sub-target set Initial candidate answers The second sub-target set that has been covered .
[0054] Tool requirements set In order to answer the input question This involves a pre-identified list of external tools that will be needed (such as calculators, search engines, external databases, code interpreters, and application programming interfaces). At this point, a set of tools already invoked also exists. , used to represent the generation of initial candidate answers The collection of tools that have already been invoked.
[0055] For example, user input problems The question asked for help planning my business trip from Beijing to Shanghai next Wednesday, including flight recommendations and weather forecasts upon arrival. (To fully answer the input question...) This requires calling the following three tools. Specifically, the first tool... The first tool is a flight search tool used to find flight information from Beijing to Shanghai next Wednesday (such as airline, departure and arrival times, prices, etc.); the second tool... A weather forecast tool for Shanghai next Wednesday (including temperature, probability of precipitation, wind speed, etc.); and a third-party tool. A time calculation tool used to determine the match between flight arrival times and meeting schedules (such as whether they will affect meeting arrangements).
[0056] Initial candidate answers generated The suggestion was: "We recommend you take a morning flight to Shanghai next Wednesday. Shanghai is currently in its rainy season, so the weather will be quite humid and hot. Please check the local weather forecast upon arrival and pack appropriate clothing." The large language model identified the initial candidate answers. The second tool was invoked. At this point, the tool requirement set The toolset has been invoked. .
[0057] Then, server 200 is based on the assertion set. Determine the initial candidate answers Corresponding missing evidence value Furthermore, the value of missing evidence. The higher the value, the more support the initial candidate answer is given. The less external evidence there is, the lower the credibility. (Evidence missing value) The specific calculation formula is as follows: (1) in, Indicates the initial candidate answer; Indicates the initial candidate answer Corresponding missing evidence value; Indicates the initial candidate answer The corresponding set of assertions; Represents a set of assertions The number of assertions in the text; Represents a set of assertions The Middle An assertion, , Represents a set of assertions The number of assertions; This represents the set of external evidence documents currently obtained, used to make assertions. Is it supported by external evidence documents? Indicates a pointer function used to indicate assertions. Whether it is supported by external evidence documents. And within that, the indicator function. The value can be 0 or 1. Expressing an assertion Not supported by external evidence documents. Expressing an assertion Supported by external evidence documents.
[0058] For example, assertion sets If there are three assertions, then the number of assertions is... When one of the assertions When supported by external evidence documents, the corresponding missing evidence value .
[0059] Server 200 based on input question The corresponding first sub-target set and initial candidate answers The second sub-target set that has been covered Determine the initial candidate answers Corresponding missing values in reasoning Furthermore, inference missing values The higher the value, the better the initial candidate answer. The less comprehensive the reasoning, the more missing values it contains. The specific calculation formula is as follows: (2) in, Indicates the initial candidate answer; This indicates an input problem; Indicates the initial candidate answer Corresponding missing inference values; Indicates input problem The corresponding first sub-target set; Represents the first sub-target set The number of sub-objectives in the input problem The corresponding number of sub-targets; Indicates the initial candidate answer The second set of sub-targets that has already been covered; Represents the second sub-target set The number of sub-objectives in the initial candidate answer. Number of sub-targets that have been covered.
[0060] For example, input problems There are three corresponding sub-objectives, then the first sub-objective set Number of sub-targets When the initial candidate answer When only two of the sub-targets are covered, the second sub-target set Number of sub-targets and initial candidate answers Corresponding missing values in reasoning .
[0061] Server 200 is based on tool requirements. and the collection of invoked tools Determine the initial candidate answers Corresponding missing values for tools Missing values for the tool The higher the value, the better the initial candidate answer. The higher the degree of missing necessary tools, the more significant the tool missing value. The specific calculation formula is as follows: (3) in, Indicates the initial candidate answer; This indicates an input problem; Indicates the initial candidate answer The corresponding tool is missing value; Indicates the initial candidate answer The corresponding set of invoked tools; Indicates the set of tools that have been invoked. The number of tools in; Indicates input problem The corresponding set of expected tool requirements; Represents the set of tool requirements The number of tools in; Indicates the set of tools that have been invoked. This belongs to the tool requirement set. The number of tools; This represents a constant used to prevent the denominator from being zero.
[0062] Therefore, based on the aforementioned missing evidence value Missing values in inference and missing tool values It can determine the initial candidate answer. Corresponding missing support vector Among them, the missing support vectors .
[0063] Optionally, the candidate inference action set includes at least one of the following: adding inference steps, adding external retrieval, and calling external tools. The operation of determining the candidate inference action set based on the support missing vector includes: pre-setting a first threshold corresponding to the evidence missing value, a second threshold corresponding to the inference missing value, and a third threshold corresponding to the tool missing value; adding an external retrieval action to the candidate inference action set when the evidence missing value is greater than the first threshold; adding an inference step action to the candidate inference action set when the inference missing value is greater than the second threshold; and adding a calling external tool action to the candidate inference action set when the tool missing value is greater than the third threshold.
[0064] Specifically, refer to Figure 4 and Figure 5 As shown, firstly, server 200 pre-sets a value related to missing evidence. The corresponding first threshold Missing values in inference The corresponding second threshold and missing values of the tool The corresponding third threshold .
[0065] Then, the evidence missing value With the first threshold Compare. When evidence is missing. Greater than the first threshold When the condition is met, an external retrieval action will be added to the candidate reasoning action set. Otherwise, no action needs to be added. Adding an external retrieval action requires retrieving an external knowledge base from database 300 to support the candidate reasoning actions.
[0066] Missing values in inference With the second threshold Compare. When inference is missing values Greater than the second threshold If the condition is met, the additional reasoning step action will be added to the candidate reasoning action set. Otherwise, no action needs to be added.
[0067] Missing values for tools With the third threshold Compare. When the tool has a missing value. Greater than the third threshold When the action is invoked, the action to call the external tool will be added to the candidate inference action set. Otherwise, no action needs to be added. Invoking the external tool action requires connecting to the interface of the external tool via server 200.
[0068] Therefore, based on the initial candidate answers The type of missing support can be used to determine the initial candidate answers for optimization. The candidate inference action set. Furthermore, the candidate inference action set includes at least one of the following: adding an inference step, adding an external retrieval action, and invoking an external tool.
[0069] Optionally, the initial resource state information includes: initial resource cost, and the operation of determining the unit resource quality gain corresponding to each candidate reasoning action in the candidate reasoning action set includes: determining the initial answer quality score corresponding to the initial candidate answer; determining the corresponding candidate answer quality score according to each candidate reasoning action; determining the quality improvement amount corresponding to each candidate reasoning action according to the initial answer quality score and the candidate answer quality score; and determining the unit resource quality gain corresponding to each candidate reasoning action according to the quality improvement amount and the resource cost increment, wherein the resource cost increment represents the increase in resource cost corresponding to each candidate reasoning action relative to the initial resource cost in the current state.
[0070] Specifically, first, server 200 determines the initial candidate answers. Corresponding initial answer quality score .
[0071] Then, server 200 uses the large language model to execute the candidate inference action sets respectively. Each candidate reasoning action And generate the corresponding candidate answers. Furthermore, based on each candidate answer... Then determine the quality score of the corresponding candidate answer.
[0072] Furthermore, server 200 determines the quality score based on the initial answer. and candidate answer quality score Determine the reasoning actions for each candidate. Corresponding quality improvement The specific calculation formula is as follows: (4) in, Represents the reasoning actions of each candidate. The corresponding improvement in quality; Represents the reasoning actions of each candidate. The corresponding candidate answer quality score; Indicates the initial candidate answer The corresponding initial answer quality score; Indicates the current state; Represents the set of candidate reasoning actions Each candidate reasoning action in the process; It represents the mathematical expectation.
[0073] Furthermore, if the initial candidate answer The corresponding set of candidate reasoning actions There is only one candidate reasoning action. That is, when there is only one candidate answer, the reasoning action for that candidate answer is... Corresponding quality improvement The specific calculation formula can be simplified to: .
[0074] Furthermore, server 200, based on the current state Below, each candidate reasoning action The corresponding resource cost relative to the initial resource cost The increase amount is determined in the current state. Increased resource costs .
[0075] Finally, server 200 based on the quality improvement amount and incremental resource costs Determine the reasoning actions for each candidate. Corresponding unit resource quality gain The specific calculation formula is as follows: (5) in, Represents the reasoning actions of each candidate. The corresponding unit resource quality gain; Represents the reasoning actions of each candidate. The corresponding improvement in quality; Represents the reasoning actions of each candidate. The corresponding increase in resource costs.
[0076] Optionally, the operation of determining the quality score of the initial candidate answer includes: determining the factual similarity and internal consistency of the initial candidate answer based on the evidence missing value; determining the reasoning completeness of the initial candidate answer based on the reasoning missing value; and determining the quality score of the initial answer based on the factual similarity, reasoning completeness, internal consistency, and model confidence of the large language model.
[0077] Specifically, first, server 200 based on the assertion set Determine the initial candidate answers Corresponding fact similarity Used to indicate the set of assertions The proportion of assertions supported by external evidence documents. Fact similarity. The higher the value, the better the initial candidate answer. The closer to the objective facts, the more sufficient the factual basis; factual similarity The lower the value, the better the initial candidate answer. There is much more information that is unsubstantiated.
[0078] Fact similarity The specific calculation formula is as follows: (6) in, Indicates the initial candidate answer Corresponding factual similarity; Indicates the initial candidate answer The corresponding set of assertions; Represents a set of assertions The number of assertions in the text; Indicates the initial candidate answer; Represents a set of assertions The Middle An assertion, , Represents a set of assertions The number of assertions; This represents the current collection of external evidence documents. This indicates an indicator function, which takes the value 0 or 1 and is used to indicate assertions. Is it supported by external evidence documents?
[0079] Furthermore, server 200 is based on the assertion set. Determine the initial candidate answers Corresponding internal consistency Used to indicate the initial candidate answer The proportion of assertions that do not contradict each other within the body.
[0080] (7) in, Indicates the initial candidate answer Corresponding internal consistency; Indicates the initial candidate answer The corresponding set of assertions; Represents a set of assertions The number of assertions in the text; Indicates the initial candidate answer A set of contradictory assertions that are internally contradictory; Represents a set of contradictory assertions The number of assertions in the text; This represents the initial candidate answer.
[0081] Then, server 200 responds to the input question. The corresponding first sub-target set and initial candidate answers The second sub-target set that has been covered Determine the initial candidate answers Corresponding reasoning completeness Used to indicate the first sub-target set In the initial candidate answer The proportion of sub-targets that have been covered. Reasoning completeness. The higher the score, the more complete the reasoning; reasoning completeness The lower the value, the more severe the break in the logical chain of reasoning.
[0082] (8) in, Indicates the initial candidate answer The corresponding reasoning completeness; Indicates the initial candidate answer; This indicates an input problem; Indicates input problem The corresponding first sub-target set; Represents the first sub-target set The number of neutron targets; Indicates the initial candidate answer The second set of sub-targets that has already been covered; Represents the second sub-target set The number of neutron targets.
[0083] Then, server 200 determines the model confidence of the large language model. The specific calculation formula is as follows: (9) in, Represents the model confidence of a large language model; Indicates the first The probability of a word being the next word; Indicates the first The entropy of the lexical unit is used to indicate the entropy of the lexical unit. The uncertainty of each lexical unit as the next lexical unit, and ; , Indicates the number of lexical units.
[0084] Finally, server 200 is pre-set to correspond to fact similarity. First weight Corresponding to internal consistency Second weight Corresponding to the completeness of reasoning The third weight and the corresponding model confidence level The fourth weight .
[0085] Therefore, the initial answer quality score The calculation formula is as follows: (10) in, Indicates the initial candidate answer Corresponding factual similarity, This indicates the corresponding first weight; Indicates the initial candidate answer The corresponding internal consistency, This indicates the corresponding second weight; Indicates the initial candidate answer The corresponding reasoning completeness, This indicates the corresponding third weight; This represents the model confidence of a large language model. This indicates the corresponding fourth weight.
[0086] Optionally, the initial resource state information also includes: the initial number of lexical units, and the operation of updating the initial candidate answer and the initial resource state information using the candidate reasoning action with the largest unit resource quality gain, and calculating the answer quality score corresponding to the updated next candidate answer, including: selecting the candidate reasoning action with the largest unit resource quality gain, updating the initial candidate answer and the initial resource state information, obtaining the next candidate answer and the updated next resource state information, wherein the next resource state information includes the cumulative cost and the cumulative number of lexical units, and the cumulative number of lexical units is related to the initial number of lexical units; and determining the corresponding answer quality score based on the next candidate answer.
[0087] Specifically, firstly, with the initial candidate answers... For example, server 200 performs inference actions based on each candidate. Corresponding unit resource quality gain Select unit resource quality gain Largest candidate reasoning action implement.
[0088] After execution, the updated next candidate answer is obtained. And the next resource status information. The next resource status information includes cumulative cost. and cumulative word meta-number Cumulative costs Indicates the quality gain per unit of resource Largest candidate reasoning action Costs consumed and initial resource costs The sum; cumulative word units Indicates the quality gain per unit of resource Largest candidate reasoning action The number of lexical units consumed compared to the initial number of lexical units sum.
[0089] Then, based on the next candidate answer Using formulas (1) to (10), the next candidate answer is determined. Corresponding answer quality score .
[0090] Optionally, the operations prior to calling the large language model based on the preset resource configuration to generate the initial candidate answers to the input question and the corresponding initial resource status information include: pre-setting the inference budget, wherein the inference budget includes a cost budget and a lexical number budget.
[0091] Specifically, for large language models, users pre-define the inference budget used to answer input questions. This includes a cost budget. and word meta-budget Furthermore, cost budget Examples include expenses, time delays, and computing resource quotas.
[0092] This prevents the consumption of reasoning for a single input problem from getting out of control, avoiding user losses and over-reasoning.
[0093] Optionally, the stopping conditions include: the answer quality score is greater than or equal to a preset quality threshold, the cumulative cost is greater than or equal to the cost budget, the cumulative number of lexical units is greater than or equal to the lexical unit budget, and the unit resource quality gain corresponding to the candidate reasoning action set of the final candidate answer is less than a preset gain threshold.
[0094] Specifically, with the initial candidate answers For example, server 200 determines the next candidate answer after the update. Does the system meet one or more of the stopping conditions? The stopping conditions are as follows: Answer quality score Greater than or equal to the preset quality threshold This indicates that the candidate answer meets the required quality standard; cumulative cost Greater than or equal to the cost budget , indicating cost budget Exhausted; cumulative lexical units Greater than or equal to the word morpheme budget , indicating the lexical number budget If the resource quality gain per unit is less than the preset gain threshold, it means the gain is too low and there is no need to add unnecessary consumption.
[0095] Therefore, in the next candidate answer If the stopping condition is met, the large language model outputs the corresponding final candidate answer as the answer to the input question. If the stopping condition is not met, the next candidate answer is... The process of judging the type of missing support and evaluating the quality improvement of the answer is repeated again and again as the current candidate answer until the data corresponding to the candidate answer meets the stopping condition. The large language model then outputs the corresponding final candidate answer as the answer to the input question.
[0096] Thus, according to the first aspect of this embodiment, the resource mismatch problem of over-reasoning for simple questions and under-reasoning for complex questions caused by fixed resource allocation is effectively solved, and the fine-grained management and scheduling of reasoning resources are achieved while ensuring a stable improvement in answer quality. Furthermore, this enables the optimization of reasoning for user input questions by a large language model.
[0097] Furthermore, according to a second aspect of this embodiment, a storage medium is provided. The storage medium includes a stored program, wherein, when the program is executed, a processor performs the method described in any of the above embodiments.
[0098] Therefore, this embodiment effectively solves the resource mismatch problem caused by fixed resource allocation, resulting in over-reasoning for simple questions and under-reasoning for complex questions. Furthermore, it achieves refined management and scheduling of reasoning resources while ensuring a stable improvement in answer quality. Consequently, it enables the optimization of reasoning for user input questions using a large language model.
[0099] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.
[0100] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0101] Example 2
[0102] Figure 6 A resource scheduling apparatus for large language model inference based on missing answer support, according to a first aspect of this embodiment, is shown, corresponding to the method described according to the first aspect of Embodiment 1. Reference Figure 6 As shown, the device includes: an initial candidate answer generation module 610, used to generate initial candidate answers to the input question and corresponding initial resource status information by calling a large language model based on a preset resource configuration; a support missing vector determination module 620, used to perform structured decomposition of the initial candidate answers and determine the corresponding support missing vectors. The support missing vectors indicate the support missing type corresponding to the initial candidate answers; a unit resource quality gain determination module 630, used to determine a set of candidate reasoning actions based on the support missing vectors and determine the unit resource quality gain corresponding to each candidate reasoning action in the set. The unit resource quality gain indicates the improvement in answer quality by each candidate reasoning action when consuming a unit of resources; an update module 640, used to update the initial candidate answers and initial resource status information using the candidate reasoning action with the largest unit resource quality gain, and calculate the answer quality score corresponding to the updated next candidate answer; and an answer output module 650, used to output the corresponding final candidate answer as the answer to the input question when at least one of the unit resource quality gain, answer quality score, and initial resource status information meets a stopping condition.
[0103] Optionally, the missing support vector includes: missing evidence value, missing reasoning value, and missing tool value, and the missing support vector determination module 620 includes: a structured decomposition submodule, used to structure the initial candidate answers to obtain the corresponding assertion set, sub-target set, and tool requirement set; and a missing value determination submodule, used to determine the missing evidence value, missing reasoning value, and missing tool value respectively based on the assertion set, sub-target set, and tool requirement set.
[0104] Optionally, the candidate inference action set includes at least one of the following: adding inference steps, adding external retrieval, and calling external tools. The unit resource quality gain determination module 630 includes: a threshold setting submodule, used to pre-set a first threshold corresponding to the evidence missing value, a second threshold corresponding to the inference missing value, and a third threshold corresponding to the tool missing value; a first judgment submodule, used to add the adding external retrieval action to the candidate inference action set when the evidence missing value is greater than the first threshold; a second judgment submodule, used to add the adding inference steps action to the candidate inference action set when the inference missing value is greater than the second threshold; and a third judgment submodule, used to add the calling external tool action to the candidate inference action set when the tool missing value is greater than the third threshold.
[0105] Optionally, the initial resource state information includes: initial resource cost, and the unit resource quality gain determination module 630 includes: an initial answer quality score determination submodule, used to determine the initial answer quality score corresponding to the initial candidate answer; a candidate answer quality score determination submodule, used to determine the corresponding candidate answer quality score according to each candidate reasoning action; a quality improvement amount determination submodule, used to determine the quality improvement amount corresponding to each candidate reasoning action according to the initial answer quality score and the candidate answer quality score; and a unit resource quality gain determination submodule, used to determine the unit resource quality gain corresponding to each candidate reasoning action according to the quality improvement amount and the resource cost increment, wherein the resource cost increment represents the increase in resource cost corresponding to each candidate reasoning action relative to the initial resource cost in the current state.
[0106] Optionally, the initial answer quality score determination submodule includes: a similarity determination submodule, used to determine the factual similarity and internal consistency of the initial candidate answer based on the evidence missing value; an inference completeness determination submodule, used to determine the inference completeness of the initial candidate answer based on the inference missing value; and a calculation submodule, used to determine the initial answer quality score based on factual similarity, inference completeness, internal consistency, and the model confidence of the large language model.
[0107] Optionally, the initial resource state information also includes: an initial number of lexical units, and the update module 640 includes: an update submodule, used to select the candidate reasoning action with the largest unit resource quality gain, update the initial candidate answer and the initial resource state information, and obtain the next candidate answer and the updated next resource state information, wherein the next resource state information includes the cumulative cost and the cumulative number of lexical units, and the cumulative number of lexical units is related to the initial number of lexical units; and an answer quality score determination submodule, used to determine the corresponding answer quality score based on the next candidate answer.
[0108] Optionally, the device further includes: a pre-set inference budget, wherein the inference budget includes a cost budget and a lexical number budget.
[0109] Optionally, the stopping conditions include: the answer quality score is greater than or equal to a preset quality threshold, the cumulative cost is greater than or equal to the cost budget, the cumulative number of lexical units is greater than or equal to the lexical unit budget, and the unit resource quality gain corresponding to the candidate reasoning action set of the final candidate answer is less than a preset gain threshold.
[0110] Therefore, this embodiment effectively solves the resource mismatch problem caused by fixed resource allocation, resulting in over-reasoning for simple questions and under-reasoning for complex questions. Furthermore, it achieves refined management and scheduling of reasoning resources while ensuring a stable improvement in answer quality. Consequently, it enables the optimization of reasoning for user input questions using a large language model.
[0111] Example 3
[0112] Figure 7 A resource scheduling apparatus for large language model inference based on missing answer support, according to a first aspect of this embodiment, is shown, corresponding to the method described according to the first aspect of Embodiment 1. Reference Figure 7 As shown, the device includes: a processor 710; and a memory 720 connected to the processor 710, used to provide the processor 710 with instructions to process the following steps: based on a preset resource configuration, calling a large language model to generate initial candidate answers to the input question and corresponding initial resource state information; performing structured decomposition on the initial candidate answers and determining the corresponding support-missing vectors. The support-missing vectors indicate the support-missing type of the initial candidate answers; determining a set of candidate reasoning actions based on the support-missing vectors, and determining the unit resource quality gain corresponding to each candidate reasoning action in the set. The unit resource quality gain indicates the improvement in answer quality by each candidate reasoning action when consuming a unit of resources; updating the initial candidate answers and initial resource state information using the candidate reasoning action with the largest unit resource quality gain, and calculating the answer quality score corresponding to the updated next candidate answer; and outputting the corresponding final candidate answer as the answer to the input question if at least one of the unit resource quality gain, answer quality score, and initial resource state information satisfies a stopping condition.
[0113] Optionally, the missing support vectors include: missing evidence values, missing reasoning values, and missing tool values. The operation of structurally decomposing the initial candidate answers and determining the corresponding missing support vectors includes: structurally decomposing the initial candidate answers to obtain the corresponding assertion set, sub-objective set, and tool requirement set; and determining the missing evidence values, missing reasoning values, and missing tool values based on the assertion set, sub-objective set, and tool requirement set, respectively.
[0114] Optionally, the candidate inference action set includes at least one of the following: adding inference steps, adding external retrieval, and calling external tools. The operation of determining the candidate inference action set based on the support missing vector includes: pre-setting a first threshold corresponding to the evidence missing value, a second threshold corresponding to the inference missing value, and a third threshold corresponding to the tool missing value; adding an external retrieval action to the candidate inference action set when the evidence missing value is greater than the first threshold; adding an inference step action to the candidate inference action set when the inference missing value is greater than the second threshold; and adding a calling external tool action to the candidate inference action set when the tool missing value is greater than the third threshold.
[0115] Optionally, the initial resource state information includes: initial resource cost, and the operation of determining the unit resource quality gain corresponding to each candidate reasoning action in the candidate reasoning action set includes: determining the initial answer quality score corresponding to the initial candidate answer; determining the corresponding candidate answer quality score according to each candidate reasoning action; determining the quality improvement amount corresponding to each candidate reasoning action according to the initial answer quality score and the candidate answer quality score; and determining the unit resource quality gain corresponding to each candidate reasoning action according to the quality improvement amount and the resource cost increment, wherein the resource cost increment represents the increase in resource cost corresponding to each candidate reasoning action relative to the initial resource cost in the current state.
[0116] Optionally, the operation of determining the quality score of the initial candidate answer includes: determining the factual similarity and internal consistency of the initial candidate answer based on the evidence missing value; determining the reasoning completeness of the initial candidate answer based on the reasoning missing value; and determining the quality score of the initial answer based on the factual similarity, reasoning completeness, internal consistency, and model confidence of the large language model.
[0117] Optionally, the initial resource state information also includes: the initial number of lexical units, and the operation of updating the initial candidate answer and the initial resource state information using the candidate reasoning action with the largest unit resource quality gain, and calculating the answer quality score corresponding to the updated next candidate answer, including: selecting the candidate reasoning action with the largest unit resource quality gain, updating the initial candidate answer and the initial resource state information, obtaining the next candidate answer and the updated next resource state information, wherein the next resource state information includes the cumulative cost and the cumulative number of lexical units, and the cumulative number of lexical units is related to the initial number of lexical units; and determining the corresponding answer quality score based on the next candidate answer.
[0118] Optionally, the operations prior to calling the large language model based on the preset resource configuration to generate the initial candidate answers to the input question and the corresponding initial resource status information include: pre-setting the inference budget, wherein the inference budget includes a cost budget and a lexical number budget.
[0119] Optionally, the stopping conditions include: the answer quality score is greater than or equal to a preset quality threshold, the cumulative cost is greater than or equal to the cost budget, the cumulative number of lexical units is greater than or equal to the lexical unit budget, and the unit resource quality gain corresponding to the candidate reasoning action set of the final candidate answer is less than a preset gain threshold.
[0120] Therefore, this embodiment effectively solves the resource mismatch problem caused by fixed resource allocation, resulting in over-reasoning for simple questions and under-reasoning for complex questions. Furthermore, it achieves refined management and scheduling of reasoning resources while ensuring a stable improvement in answer quality. Consequently, it enables the optimization of reasoning for user input questions using a large language model.
[0121] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0122] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0123] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0124] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0125] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0126] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0127] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A resource scheduling method for reasoning in a large language model based on missing answer support, characterized in that, include: Based on the preset resource configuration, the large language model is invoked to generate initial candidate answers to the input question and the corresponding initial resource status information. The initial candidate answers are decomposed in a structured manner, and the corresponding support missing vectors are determined, wherein the support missing vectors are used to indicate the support missing type corresponding to the initial candidate answers; Based on the missing support vector, a set of candidate reasoning actions is determined, and the unit resource quality gain corresponding to each candidate reasoning action in the set of candidate reasoning actions is determined, wherein the unit resource quality gain is used to indicate the improvement of the answer quality by each candidate reasoning action in consuming a unit of resources; Using the candidate reasoning action that maximizes the quality gain per unit resource, update the initial candidate answer and the initial resource state information, and calculate the answer quality score corresponding to the updated next candidate answer; as well as If at least one of the unit resource quality gain, the answer quality score, and the initial resource state information satisfies the stopping condition, the corresponding final candidate answer is output as the answer to the input question.
2. The method according to claim 1, characterized in that, The missing support vectors include: missing evidence values, missing reasoning values, and missing tools values. The operation of structurally decomposing the initial candidate answers and determining the corresponding missing support vectors includes: The initial candidate answers are structurally decomposed to obtain the corresponding assertion set, sub-goal set, and tool requirement set; and Based on the assertion set, the sub-target set, and the tool requirement set, the evidence missing value, the reasoning missing value, and the tool missing value are determined respectively.
3. The method according to claim 2, characterized in that, The candidate inference action set includes at least one of the following: adding inference steps, adding external retrieval, and calling external tools. The operation of determining the candidate inference action set based on the support missing vector includes: A first threshold corresponding to the evidence missing value, a second threshold corresponding to the reasoning missing value, and a third threshold corresponding to the tool missing value are preset; When the evidence missing value is greater than the first threshold, the additional external retrieval action is added to the candidate reasoning action set; When the missing inference value is greater than the second threshold, the additional inference step action is added to the candidate inference action set; and When the missing value of the tool is greater than the third threshold, the action of calling the external tool is added to the candidate inference action set.
4. The method according to claim 2, characterized in that, The initial resource state information includes: initial resource cost, and the operation of determining the unit resource quality gain corresponding to each candidate inference action in the candidate inference action set includes: Determine the initial answer quality score corresponding to the initial candidate answer; Based on each candidate reasoning action, the corresponding candidate answer quality score is determined. Based on the initial answer quality score and the candidate answer quality scores, determine the quality improvement amount corresponding to each candidate reasoning action; and Based on the quality improvement amount and the resource cost increment, determine the unit resource quality gain corresponding to each candidate inference action, wherein the resource cost increment represents the increase in resource cost corresponding to each candidate inference action relative to the initial resource cost in the current state.
5. The method according to claim 4, characterized in that, The operation of determining the initial answer quality score corresponding to the initial candidate answer includes: Based on the set of assertions, determine the factual similarity and internal consistency of the initial candidate answers; Based on the set of sub-targets, determine the reasoning completeness corresponding to the initial candidate answer; and The initial answer quality score is determined based on the fact similarity, internal consistency, reasoning completeness, and model confidence of the large language model.
6. The method according to claim 4, characterized in that, The initial resource state information also includes: the initial number of lexical units, and the operation of updating the initial candidate answer and the initial resource state information using the candidate inference action that maximizes the quality gain per unit resource, and calculating the answer quality score corresponding to the updated next candidate answer, includes: Select the candidate reasoning action that maximizes the quality gain per unit resource, update the initial candidate answer and the initial resource state information, and obtain the next candidate answer and the updated next resource state information, wherein the next resource state information includes cumulative cost and cumulative lexical count, and the cumulative lexical count is related to the initial lexical count; and Based on the next candidate answer, determine the corresponding answer quality score.
7. The method according to claim 6, characterized in that, The operations performed before calling the large language model based on the preset resource configuration to generate initial candidate answers to the input question and corresponding initial resource state information include: A pre-defined inference budget is set, which includes a cost budget and a lexical budget.
8. The method according to claim 7, characterized in that, The stopping conditions include: the answer quality score is greater than or equal to a preset quality threshold, the cumulative cost is greater than or equal to the cost budget, the cumulative number of lexical units is greater than or equal to the lexical unit budget, and the unit resource quality gain corresponding to the candidate reasoning action set of the final candidate answer is less than a preset gain threshold.
9. A storage medium, characterized in that, The storage medium includes a stored program, wherein, when the program is executed, the method described in any one of claims 1 to 8 is performed by a processor.
10. A resource scheduling device for reasoning in a large language model based on missing answer support, characterized in that, include: The initial candidate answer generation module is used to generate initial candidate answers to the input question and corresponding initial resource status information based on the preset resource configuration and by calling the large language model. The support missing vector determination module is used to perform structured decomposition of the initial candidate answer and determine the corresponding support missing vector, wherein the support missing vector is used to indicate the support missing type corresponding to the initial candidate answer; The unit resource quality gain determination module is used to determine a set of candidate reasoning actions based on the support missing vector, and to determine the unit resource quality gain corresponding to each candidate reasoning action in the set of candidate reasoning actions, wherein the unit resource quality gain is used to indicate the improvement of the answer quality by each candidate reasoning action when consuming unit resources; The update module is used to update the initial candidate answer and the initial resource status information using the candidate reasoning action with the largest unit resource quality gain, and to calculate the answer quality score corresponding to the updated next candidate answer; as well as The answer output module is used to output the corresponding final candidate answer as the answer to the input question when at least one of the unit resource quality gain, the answer quality score and the initial resource state information meets the stopping condition.
11. A resource scheduling device for reasoning in a large language model based on missing answer support, characterized in that, include: processor; as well as A memory, connected to the processor, for providing the processor with instructions to perform the following processing steps: Based on the preset resource configuration, the large language model is invoked to generate initial candidate answers to the input question and the corresponding initial resource status information. The initial candidate answers are decomposed in a structured manner, and the corresponding support missing vectors are determined, wherein the support missing vectors are used to indicate the support missing type corresponding to the initial candidate answers; Based on the missing support vector, a set of candidate reasoning actions is determined, and the unit resource quality gain corresponding to each candidate reasoning action in the set of candidate reasoning actions is determined, wherein the unit resource quality gain is used to indicate the improvement of the answer quality by each candidate reasoning action in consuming a unit of resources; Using the candidate reasoning action that maximizes the quality gain per unit resource, update the initial candidate answer and the initial resource state information, and calculate the answer quality score corresponding to the updated next candidate answer; as well as If at least one of the unit resource quality gain, the answer quality score, and the initial resource state information satisfies the stopping condition, the corresponding final candidate answer is output as the answer to the input question.
