Large model reasoning optimization method and device based on background information fusion, equipment and medium

By integrating background information and task requirements to optimize the reasoning path of large models, the problems of limited capabilities and resource waste of large models in complex tasks are solved, and more efficient and accurate reasoning is achieved.

CN120764692AActive Publication Date: 2025-10-10SHANDONG INSPUR SCI RES INST CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510913714.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-03
Publication Date
2025-10-10
Estimated Expiration
2045-07-03

AI Technical Summary

Technical Problem

Existing large models lack the use of context and background information during reasoning, resulting in limited capabilities in complex tasks and an inability to accurately complete complex reasoning. At the same time, the fixed reasoning path of traditional large models leads to waste of resources.

Method used

By determining the background information related to the task to be processed, including user interaction records, task environment information and domain knowledge, the input data is integrated to determine the target information, and the optimized reasoning path is selected based on the task requirements, and the model parameters are adjusted to optimize the reasoning process.

Benefits of technology

It improves the reasoning efficiency and accuracy of large models in different task scenarios, adapts to task scenarios, avoids resource waste and improves accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120764692A_ABST
    Figure CN120764692A_ABST
Patent Text Reader

Abstract

The invention discloses a large model reasoning optimization method and device based on background information fusion, equipment and a medium, and relates to the field of artificial intelligence, and the method comprises the steps: determining background information related to a to-be-processed task; the background information comprises user interaction record information, task environment information and domain knowledge information related to the to-be-processed task; fusing the background information and the input data of the large model to obtain target information; the input data is data input to the large model by the user side based on the to-be-processed task; determining a target reasoning path based on the target information, the background information and a task demand of the to-be-processed task so as to execute the to-be-processed task by using the large model and the target reasoning path and obtain a corresponding reasoning result; after the to-be-processed task is executed, feedback information corresponding to the reasoning result is determined, and parameters of the large model are adjusted based on the feedback information so as to optimize the reasoning process of the large model. Therefore, the reasoning efficiency and precision of the large model can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence, and in particular to a large-model reasoning optimization method, device, equipment and medium based on background information fusion. Background Art

[0002] With the vigorous development of deep learning and artificial intelligence technologies, large models have been widely used in many fields such as natural language processing and computer vision.

[0003] Currently, these models require a large amount of computing resources to achieve high-precision reasoning during inference due to their large parameter size, and they also have significant shortcomings. First, existing reasoning methods generally lack the use of context and background information. Most models reason only based on input data and are unable to fully call on background content such as user interaction records, environmental information, and domain knowledge. This limits the model's ability to handle complex tasks, making it difficult to understand the environment in which the task is located and unable to accurately complete complex reasoning. Second, the reasoning path of traditional large models is fixed, and regardless of the complexity of the task and the usage of computing resources, it relies on a calculation path involving the entire model. This approach will cause excessive calculations and waste resources when handling simple tasks; when faced with complex tasks, it is difficult to ensure accurate reasoning.

[0004] Therefore, how to improve the reasoning efficiency and accuracy of large models in different task scenarios is a technical problem that needs to be solved urgently. Summary of the Invention

[0005] In view of this, the purpose of the present invention is to provide a large-scale model reasoning optimization method, device, equipment and medium based on background information fusion, which can improve the reasoning efficiency and accuracy of large models in different task scenarios. The specific scheme is as follows:

[0006] In a first aspect, the present application provides a large model reasoning optimization method based on background information fusion, comprising:

[0007] When the large model performs reasoning based on the task to be processed, background information related to the task to be processed is determined; the background information includes user interaction record information, task environment information, and domain knowledge information related to the task to be processed;

[0008] The background information and the input data of the large model are integrated to obtain target information; the input data is the data input by the user end to the large model based on the task to be processed;

[0009] Determining a target reasoning path based on the target information, the background information, and the task requirements of the task to be processed, so as to execute the task to be processed using the large model and the target reasoning path and obtain a corresponding reasoning result;

[0010] After the task to be processed is completed, feedback information corresponding to the inference result is determined, and the parameters of the large model are adjusted based on the feedback information to optimize the inference process of the large model.

[0011] Optionally, determining background information related to the task to be processed includes:

[0012] Extracting the task type, task domain, and task keywords of the task to be processed to determine corresponding task features;

[0013] Evaluate the relevance of each preset data source and the task to be processed based on the task characteristics, and obtain corresponding evaluation results;

[0014] A target data source is determined from each of the preset data sources based on the evaluation result, and information is retrieved from the target data source using the task characteristics to obtain background information related to the task to be processed.

[0015] Optionally, fusing the background information with the input data of the large model to obtain target information includes:

[0016] Determining a background information vector based on the background information, and inputting the background information vector into a pre-trained embedding model to convert the background information vector into a first embedding vector using a first preset activation function, a first preset bias term, and a preset embedding transformation matrix in the pre-trained embedding model;

[0017] determining an input data vector based on the input data of the large model, and determining a second embedding vector based on the input data vector;

[0018] The first embedding vector and the second embedding vector are fused using a preset attention mechanism and the dimension of the first embedding vector, and the obtained fused vector is used as the target information.

[0019] Optionally, determining a target reasoning path based on the target information, the background information, and the task requirements of the task to be processed includes:

[0020] Determining a task requirement of the task to be processed, and determining a task requirement vector based on the task requirement;

[0021] Selecting a reasoning path from each reasoning path of the large model as a current reasoning path;

[0022] Determining a path activation probability of the current reasoning path based on a second preset activation function, the target information, the first embedding vector, and a second preset bias term;

[0023] jump to the step of selecting one inference path from the inference paths of the large model as a current inference path until all the inference paths of the large model are selected and each path activation probability is obtained;

[0024] In the inference paths of the large model, the inference path with the path activation probability greater than a preset probability threshold is determined as an initial inference path;

[0025] The accuracy and the amount of calculation of the initial inference path are determined, and based on the accuracy, the amount of calculation, and a preset path loss algorithm, an initial inference path with a minimum path loss value is determined as a target inference path.

[0026] Optionally, the executing the to-be-processed task by using the large model and the target inference path and obtaining a corresponding inference result comprises:

[0027] The target inference path is decomposed into inference steps, and the large model is driven to perform inference step by step based on the inference steps and the to-be-processed task;

[0028] In the process of step-by-step inference, the output result of the large model executing a current inference step is determined, and it is judged whether the output result is greater than a preset confidence threshold to obtain a judgment result;

[0029] If the judgment result indicates that it is greater, the output result of the current inference step is taken as input data of a next inference step;

[0030] If the judgment result indicates that it is not greater, a local inference segment is generated based on the to-be-processed task, the target content in the current inference step is replaced by using the local inference segment to obtain a replaced inference step, and the large model is driven to execute the replaced inference step;

[0031] When all the inference steps are executed, a corresponding inference result is determined.

[0032] Optionally, the adjusting the parameters of the large model based on the feedback information comprises:

[0033] The number of the feedback information is determined, a feedback analysis result is determined based on the feedback information and the number, and a loss value is determined by using the current parameters of the large model, the feedback information, and a preset loss function;

[0034] The feedback analysis result and the loss value are added, and a product value is obtained by multiplying the obtained addition value and a learning rate of the large model;

[0035] Target model parameters are determined using the product value and current parameters of the large model, and the current parameters of the large model are adjusted using the target model parameters.

[0036] In a second aspect, the present application provides a large model reasoning optimization device based on background information fusion, comprising:

[0037] An information determination module is used to determine background information related to the task to be processed when the large model performs reasoning based on the task to be processed; the background information includes user interaction record information, task environment information and domain knowledge information related to the task to be processed;

[0038] An information fusion module is used to fuse the background information with the input data of the large model to obtain target information; the input data is the data input by the user end to the large model based on the task to be processed;

[0039] A task reasoning module is used to determine a target reasoning path based on the target information, the background information, and the task requirements of the task to be processed, so as to execute the task to be processed using the large model and the target reasoning path and obtain a corresponding reasoning result;

[0040] The reasoning optimization module is used to determine feedback information corresponding to the reasoning result after the task to be processed is completed, and adjust the parameters of the large model based on the feedback information to optimize the reasoning process of the large model.

[0041] In a third aspect, the present application provides an electronic device, comprising:

[0042] Memory, used to store computer programs;

[0043] A processor is used to execute the computer program to implement the aforementioned large model reasoning optimization method based on background information fusion.

[0044] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned large-model reasoning optimization method based on background information fusion is implemented.

[0045] In the present application, when the large model performs reasoning based on the task to be processed, background information related to the task to be processed is determined; the background information includes user interaction record information, task environment information and domain knowledge information related to the task to be processed; the background information and the input data of the large model are fused to obtain target information; the input data is data input by the user end to the large model based on the task to be processed; based on the target information, the background information and the task requirements of the task to be processed, a target reasoning path is determined to utilize the large model and the target reasoning path to execute the task to be processed and obtain corresponding reasoning results; when the task to be processed is completed, feedback information corresponding to the reasoning result is determined, and the parameters of the large model are adjusted based on the feedback information to optimize the reasoning process of the large model. As can be seen from the above, in this application, when the large model is inferring, it first determines the background information related to the task to be processed; it integrates this background information with the input data of the user-side input to the large model for the task to obtain the target information; it determines the target reasoning path based on the target information, background information and task requirements, and uses the large model and the target reasoning path to execute the task to be processed to obtain the reasoning result; after the task is completed, it determines the feedback information corresponding to the reasoning result, adjusts the large model parameters accordingly, and optimizes the reasoning process. In this way, this application can make the reasoning of the large model adapt to the task scenario, thereby improving the accuracy of the large model reasoning. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0047] Figure 1 This is a flow chart of a large model reasoning optimization method based on background information fusion disclosed in this application;

[0048] Figure 2 This is a flowchart of a specific large model reasoning optimization method based on background information fusion disclosed in this application;

[0049] Figure 3 This is a schematic diagram of the structure of a large model reasoning optimization device based on background information fusion disclosed in this application;

[0050] Figure 4 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0051] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0052] Currently, large models require a large amount of computing resources to achieve high-precision reasoning during reasoning due to the large scale of parameters, and there are significant deficiencies. First, existing reasoning methods generally lack the use of context and background information. Most models only perform reasoning based on input data and cannot fully call on background content such as user interaction records, environmental information, and domain knowledge. This limits the model's ability to handle complex tasks, making it difficult to understand the environment in which the task is located and unable to accurately complete complex reasoning. Second, the traditional large model reasoning path is fixed, and regardless of the complexity of the task and the usage of computing resources, it relies on a calculation path involving the entire model. This approach will cause excessive calculations and waste resources when processing simple tasks; when faced with complex tasks, it is difficult to ensure accurate reasoning. To this end, the present application provides a large model reasoning optimization method, device, equipment and medium based on background information fusion, which can improve the reasoning efficiency and accuracy of large models.

[0053] See also Figure 1 As shown, the embodiment of the present invention discloses a large model reasoning optimization method based on background information fusion, including:

[0054] Step S11: When the large model performs reasoning based on the task to be processed, background information related to the task to be processed is determined; the background information includes user interaction record information, task environment information and domain knowledge information related to the task to be processed.

[0055] It should be noted that the large model in this embodiment can be applied to the fields of natural language processing, computer vision, and recommendation systems, and the processing effects of tasks in various fields can be improved through background information fusion technology.

[0056] Specifically, in the field of natural language processing, this large model can be applied to intelligent customer service scenarios. For example, when a user inquires about an e-commerce platform's after-sales service policies, the large model integrates the user's historical order information, domain knowledge of the platform's after-sales regulations, and the context of the current inquiry. This allows the model to not only accurately understand the user's needs but also recommend appropriate solutions based on the user's past purchase history, such as expedited return and exchange procedures or discounted repair services, making customer service responses more targeted and efficient.

[0057] In the field of computer vision, large models can be used for intelligent security monitoring. For example, in airport security scenarios, when the system detects suspected prohibited items in luggage, the large model integrates the item's visual features, domain knowledge about airport security, such as prohibited items lists and dimensions, and real-time environmental information such as checkpoint traffic flow and equipment operating status. This allows the system to accurately identify the item and automatically prompt subsequent processing steps based on security inspection process requirements, such as directing the baggage for secondary inspection or notifying a human reviewer, thereby improving the accuracy and efficiency of security inspections.

[0058] In the field of recommendation systems, this large model can be applied to content recommendations on short video platforms. When users browse short videos, the large model combines user interaction information such as viewing history, likes and favorites, as well as knowledge about short video tags, popular trends, and other fields. It also considers the user's current usage environment, such as network status, to recommend content that is both relevant to the user's interests and preferences and fits the current situation. For example, during a user's evening leisure time, based on their previous interest in technology content and their current good network environment, the latest technology news short videos are prioritized, improving the user's viewing experience and recommendation satisfaction.

[0059] Specifically, in this embodiment, upon receiving a task to be processed, the large model first parses it. Using natural language processing techniques, it extracts the task type, such as question-answering, text generation, or logical reasoning. It also determines the domain to which the task belongs, such as healthcare, finance, or education. Furthermore, it extracts key terms and phrases from the task to form a comprehensive description of the task's characteristics.

[0060] Next, based on the extracted task features, the relevance of each pre-set data source to the task to be processed is evaluated. Pre-set data sources include, but are not limited to, historical user interaction databases, real-time environmental parameter collection systems, and domain-specific knowledge bases. The evaluation process analyzes the degree of match between the information in each pre-set data source and the task features, as well as the presence of key environmental variables in the real-time environmental parameters that affect task reasoning, to generate the corresponding evaluation results.

[0061] Further, according to the evaluation result, a target data source with higher relevance to the to-be-processed task is screened out from each preset data source. For the target data source, information retrieval is performed using the task features. For example, if the target data source is a user interaction record database, and the task features show an intelligent customer service task in the field of natural language processing, the user historical consultation records, order information, and other interaction record information in the database are retrieved; if the target data source is an environment information collection system, and the task features involve an intelligent security monitoring task in the field of computer vision, real-time environmental parameters such as light intensity and camera angle in the monitoring scene are retrieved; if the target data source is a domain knowledge base, and the task belongs to a short video content recommendation task in the field of a recommendation system, domain knowledge information such as video tag classification and user behavior preference model is retrieved, and finally background information closely related to the to-be-processed task is obtained.

[0062] In step S12, the background information and the input data of the large model are fused to obtain target information; the input data is data input by a user terminal to the large model based on the to-be-processed task.

[0063] In this embodiment, after obtaining the background information related to the to-be-processed task, the background information needs to be vectorized and embedded. First, based on the semantic content and structural features of the background information, the background information vector is determined through natural language processing technologies such as word embedding and sentence vector generation. Then, the background information vector is input into a pre-trained embedding model, the first preset activation function in the embedding model is used to perform nonlinear transformation on the background information vector, the vector distribution is adjusted in combination with the first preset bias term, and then the vector dimension and feature space are mapped and converted through a preset embedding conversion matrix, so as to finally convert the background information vector into a first embedding vector that adapts to the inference architecture of the large model.

[0064] At the same time, the input data of the large model is processed. The input data includes task data in the form of text, image, voice, etc. input by the user terminal, and based on the type and format of the input data, the input data vector can be determined through the corresponding encoding mode. After obtaining the input data vector, according to the inference requirements and input layer features of the large model, the second embedding vector is determined through linear transformation, dimension alignment, etc. so that the vector and the first embedding vector are in the same feature space dimension.

[0065] Finally, the first embedding vector and the second embedding vector are fused using a preset attention mechanism. The preset attention mechanism can adopt classic attention architectures such as self-attention and cross-attention, and determine the matrix dimension and weight distribution rules of the attention calculation based on the dimension of the first embedding vector. During the fusion process, the attention mechanism automatically focuses on information features that are more valuable to the reasoning task by calculating the semantic association weights between background information and input data, suppressing the influence of irrelevant or redundant information. For example, in the intelligent customer service scenario of natural language processing, the attention mechanism can strengthen the association feature weights between the user's historical consultation records and the current input question; in the security monitoring scenario of computer vision, it can highlight the key correspondence between environmental parameters and image features. Through the weighted fusion operation of the attention mechanism, the first embedding vector and the second embedding vector are integrated into a fused vector. The fused vector contains both the core task features of the input data and the contextual associations and domain knowledge in the background information. Finally, the fused vector is input into the large model as the target information, providing certain information support for subsequent reasoning optimization.

[0066] Step S13: determining a target reasoning path based on the target information, the background information, and the task requirements of the task to be processed, so as to use the large model and the target reasoning path to execute the task to be processed and obtain a corresponding reasoning result.

[0067] In this embodiment, after obtaining the fused target information, the specific requirements of the task to be processed must be clarified. By analyzing the semantic content and parameter indicators of the task input, task requirements are determined, such as the required level of detail in intelligent customer service scenarios, the real-time requirements for target recognition in computer vision scenarios, and the personalized dimensions that need to be met in recommendation systems. These requirements are then converted into a task requirement vector.

[0068] Next, a single inference path from the multiple pre-defined inference paths within the large model is selected as the current evaluation target. The inference paths within the large model are constructed based on different algorithmic logic and knowledge-based strategies. For example, natural language processing may include rule-based inference paths and end-to-end inference paths based on deep learning. Computer vision may include inference paths based on traditional feature engineering and those based on novel architectures. When selecting the current inference path, polling, random selection, or heuristic strategies based on historical performance can be used to ensure coverage of all inference paths.

[0069] After determining the current reasoning path, the activation probability of the current reasoning path is calculated. This process jointly processes the target information and the first embedding vector through a second preset activation function, and adjusts the probability distribution in combination with a second preset bias term. The task characteristics in the target information and the contextual associations in the background information directly affect the adaptability of the reasoning path: when the target information contains complex domain knowledge, the reasoning path that is deeply integrated with the domain knowledge base will have a higher activation probability; if the target information contains a large proportion of real-time environmental parameters, the reasoning path that focuses on real-time data processing will have a greater advantage.

[0070] The above process of selecting inference paths and calculating activation probabilities is repeated until all inference paths have been evaluated, forming a set of activation probabilities for each path. A probability threshold is then set, and paths with activation probabilities above the threshold are selected as initial inference paths. These paths are considered to have high adaptability to the current task.

[0071] The initial inference path is further evaluated based on two key metrics. The first is accuracy, measured by the inference results on validation data, such as the accuracy of classification tasks and the error size of regression tasks. The second is computational cost, which measures the resource consumption during the inference process, including computational effort, memory usage, and inference time. Based on these two metrics, a preset loss algorithm is used to calculate the loss value of each path. This algorithm balances the weights of accuracy and efficiency, avoiding paths with high accuracy but excessive computational effort, or paths with low computational effort but insufficient accuracy. Ultimately, the initial inference path with the smallest loss value is selected as the target inference path, ensuring that inference efficiency is maximized while meeting the task accuracy requirements.

[0072] After determining the target reasoning path, it is broken down into a series of ordered reasoning steps. The large model is then driven to execute the reasoning task according to the reasoning steps. After each step is completed, the output result is obtained and its confidence is evaluated. If the confidence level exceeds a preset confidence threshold, the result of the current step is reliable and directly used as input for the next step. If the confidence level is insufficient, a local reasoning fragment is generated based on the task requirements and background information, replacing the uncertain content in the current step, and re-executing the step until the result meets the confidence requirement.

[0073] After all inference steps are completed, the output results of each stage are integrated to form the final inference result. This process ensures that large models achieve accurate and efficient inference decisions in complex tasks through dynamic optimization of the target inference path and confidence control of the inference steps, avoiding inference deviations caused by unreasonable path selection or unreliable intermediate results.

[0074] Step S14: After the task to be processed is completed, feedback information corresponding to the inference result is determined, and the parameters of the large model are adjusted based on the feedback information to optimize the inference process of the large model.

[0075] In this embodiment, after the pending task is completed and the inference result is obtained, feedback information related to the inference result needs to be collected. Feedback information sources include but are not limited to the user's direct evaluation of the inference result, the degree of match between the inference result and the actual scenario, and the user's interactive behavior on the recommended content in the recommendation system.

[0076] After receiving feedback, we first count the number of responses. The number of responses reflects the richness of the data sample. If the number of responses is small, we need to consider whether insufficient samples may have led to analytical bias. If the number is sufficient, we can conduct a more comprehensive statistical analysis. We then generate the appropriate feedback analysis results based on the specific content and quantity of the feedback.

[0077] At the same time, the loss value is calculated using the current parameters of the large model, feedback information, and a preset loss function. That is, the expected result implicit in the feedback information is compared with the inference result generated by the large model based on the current parameters. The loss function converts the deviation into a numerical loss value. A larger loss value indicates a lower match between the current model parameters and the task requirements.

[0078] The feedback analysis results are combined with the loss value. The feedback analysis results qualitatively indicate the direction of model reasoning flaws, while the loss value quantitatively measures the degree of deviation. The two are added together to form a summation value, which is then multiplied by the learning rate of the large model to obtain the product value for parameter updates. The learning rate controls the step size of each parameter adjustment. If the learning rate is too high, it may lead to excessive parameter updates and deviation from the optimal solution; if it is too low, optimization efficiency will be reduced. The calculation of the product value essentially determines the appropriate parameter adjustment range based on the degree of deviation and the optimization direction.

[0079] Finally, the target model parameters are calculated using the product value and the current parameters of the large model. The target model parameters replace the current parameters of the large model, completing the model parameter adjustment. This adjustment process dynamically optimizes the model's parameter configuration in areas such as background information integration, reasoning path selection, and reasoning step execution, addressing issues exposed during inference. This allows the large model to more accurately integrate background information and more efficiently select reasoning paths when handling similar tasks in the future, thereby improving the large model's overall reasoning performance.

[0080] As can be seen from the above, in this application, when the large model is inferring, it first determines the background information related to the task to be processed; it integrates this background information with the input data of the user-side input to the large model for the task to obtain the target information; it determines the target reasoning path based on the target information, background information and task requirements, and uses the large model and the target reasoning path to execute the task to be processed to obtain the reasoning result; after the task is completed, it determines the feedback information corresponding to the reasoning result, adjusts the large model parameters accordingly, and optimizes the reasoning process. In this way, this application can make the reasoning of the large model adapt to the task scenario, thereby improving the accuracy of the large model reasoning.

[0081] The following combination Figure 2 The schematic diagram shown in FIG. 1 specifically illustrates the technical solution of the embodiment of the present application.

[0082] Specifically, the background information acquisition module first acquires background information related to the task (i.e., the task to be processed) from multiple data sources, providing richer contextual support for large-scale model reasoning. Based on the specific characteristics of the task, the appropriate background information source is determined. Task-related background information is extracted from the selected data source. For example, in natural language processing tasks, relevant concept definitions or contextual interaction records can be extracted from the knowledge base. Furthermore, the extracted background information is standardized using the following formula:

[0083] ;

[0084] Where, It is data containing background information. yes The average value of yes The standard deviation of .

[0085] Next, the background information fusion module fuses the preprocessed background information with the original input data of the large model to ensure that the large model can effectively understand the context required for the current task.

[0086] The background information is converted into a model-compatible embedding representation using a pre-trained embedding model. The background information is first converted into a background information vector. Then, the embedding conversion process converts the background information vector into Convert to the first embedding vector , the formula for embedding transformation is , in this formula, is the first preset activation function, is the preset embedding transformation matrix, is a first preset bias term. And, a second embedding vector is determined based on the input data.

[0087] The attention mechanism is introduced into background information fusion to highlight the information most relevant to the task. The background information embedding layer assigns different weights to different information, allowing the large model to focus more on information that is more relevant to the current task, thereby improving reasoning accuracy.

[0088] The attention mechanism fuses background information and original input data by calculating attention weights. The fused vector is the target information. That is, given the background information embedding vector (i.e., the first embedding vector) and the original input data embedding vector (i.e., the second embedding vector), the fused representation calculated by the attention mechanism can be expressed as follows:

[0089] ;

[0090] Where, is the dimension of the background information embedding vector, Embedding vector for the original input data, is the normalized exponential function.

[0091] And, the embedded Expressed as Furthermore, based on the background information and the fused vectors, the dynamic reasoning optimization module adjusts the model's reasoning path in real time to optimize computational efficiency. Using the background information and task requirements, the complexity of the current task is determined, thereby selectively activating certain reasoning paths of the model. In this embodiment, the activation probability of the reasoning path is calculated using the following formula to select a reasoning path based on each activation probability.

[0092] ;

[0093] Where, represents the second preset activation function, 、 as well as relative to 、 as well as The weight parameter, is the vector of task requirements, is the second bias term.

[0094] The path is monitored and selected in real time through the inference path optimization algorithm. The following formula can be used:

[0095] ;

[0096] Where, is the accuracy weight, is the weight of the computation, is the accuracy of the reasoning path correspondence, is the computational amount corresponding to the inference path, Indicates choosing the inference path that minimizes the loss.

[0097] The initial reasoning path with the smallest path loss is then determined as the target reasoning path. This target reasoning path is then broken down into reasoning steps, which drive the large model to reason about these steps and the task to be processed, thereby obtaining the corresponding reasoning results. The reasoning results are then displayed on the user end, and users can provide feedback on the reasoning results.

[0098] Finally, after the task is completed, feedback information on the reasoning results is collected. The feedback data is analyzed to evaluate the fusion effect of the background information and the rationality of the current reasoning path. The following formula can be used to evaluate the impact of feedback information:

[0099] ;

[0100] Where, is the amount of feedback information, It is Feedback information.

[0101] Based on feedback information, large models can use adaptive learning to automatically adjust their reasoning strategies in similar tasks, enabling continuous improvement. Adaptive learning can be expressed as:

[0102] ;

[0103] Where, are the old parameters of the large model, is the updated parameter, is the learning rate, It is the loss function calculated based on the feedback information under the old parameters of the large model. is the feedback analysis result, is the weight of the feedback analysis result.

[0104] Accordingly, see Figure 3 As shown, the embodiment of the present application provides a large model reasoning optimization device based on background information fusion, including:

[0105] An information determination module 11 is configured to determine background information related to the task to be processed when the large model performs reasoning based on the task to be processed; the background information includes user interaction record information, task environment information, and domain knowledge information related to the task to be processed;

[0106] An information fusion module 12 is configured to fuse the background information with the input data of the large model to obtain target information; the input data is data input by the user end to the large model based on the task to be processed;

[0107] A task reasoning module 13 is configured to determine a target reasoning path based on the target information, the background information, and the task requirements of the task to be processed, so as to execute the task to be processed using the large model and the target reasoning path and obtain a corresponding reasoning result;

[0108] The reasoning optimization module 14 is used to determine feedback information corresponding to the reasoning result after the task to be processed is completed, and adjust the parameters of the large model based on the feedback information to optimize the reasoning process of the large model.

[0109] As can be seen from the above, in this application, when the large model is inferring, it first determines the background information related to the task to be processed; it integrates this background information with the input data of the user-side input to the large model for the task to obtain the target information; it determines the target reasoning path based on the target information, background information and task requirements, and uses the large model and the target reasoning path to execute the task to be processed to obtain the reasoning result; after the task is completed, it determines the feedback information corresponding to the reasoning result, adjusts the large model parameters accordingly, and optimizes the reasoning process. In this way, this application can make the reasoning of the large model adapt to the task scenario, thereby improving the accuracy of the large model reasoning.

[0110] In some specific implementations, the information determination module 11 specifically includes:

[0111] A feature determination unit, configured to extract the task type, task domain, and task keywords of the task to be processed to determine corresponding task features;

[0112] a first result determination unit, configured to evaluate the relevance between each preset data source and the task to be processed based on the task characteristics, and obtain a corresponding evaluation result;

[0113] An information determination unit is configured to determine a target data source from each of the preset data sources based on the evaluation result, and perform information retrieval in the target data source using the task characteristics to obtain background information related to the task to be processed.

[0114] In some specific implementations, the information fusion module 12 specifically includes:

[0115] a vector conversion unit, configured to determine a background information vector based on the background information, and input the background information vector into a pre-trained embedding model to convert the background information vector into a first embedding vector using a first preset activation function, a first preset bias term, and a preset embedding conversion matrix in the pre-trained embedding model;

[0116] a first vector determining unit, configured to determine an input data vector based on input data of the large model, and determine a second embedding vector based on the input data vector;

[0117] A vector fusion unit is used to fuse the first embedding vector and the second embedding vector by using a preset attention mechanism and the dimension of the first embedding vector, and use the obtained fused vector as target information.

[0118] In some specific implementations, the task reasoning module 13 specifically includes:

[0119] a second vector determining unit, configured to determine a task requirement of the task to be processed, and determine a task requirement vector based on the task requirement;

[0120] a first path determining unit, configured to select one reasoning path from the reasoning paths of the large model as a current reasoning path;

[0121] a first probability determination unit, configured to determine a path activation probability of the current reasoning path based on a second preset activation function, the target information, the first embedding vector, and a second preset bias item;

[0122] a second probability determination unit, configured to jump to the step of selecting an inference path from the inference paths of the large model as the current inference path, until all inference paths of the large model are selected and the activation probability of each path is obtained;

[0123] A second path determining unit is configured to determine, among the inference paths of the large model, a reasoning path having a path activation probability greater than a preset probability threshold as an initial reasoning path;

[0124] A third path determination unit is used to determine the accuracy and computational complexity of the initial reasoning path, and determine the initial reasoning path with the smallest path loss value among the initial reasoning paths based on the accuracy, computational complexity and a preset path loss algorithm, and determine the initial reasoning path with the smallest path loss value as the target reasoning path.

[0125] In some specific implementations, the task reasoning module 13 specifically includes:

[0126] A task reasoning unit, configured to decompose the target reasoning path into reasoning steps, and drive the large model to perform reasoning step by step based on the reasoning steps and the task to be processed;

[0127] A result judgment unit is used to determine the output result of the large model executing the current reasoning step during the step-by-step reasoning process, and to judge whether the output result is greater than a preset confidence threshold to obtain a judgment result;

[0128] an input data determining unit, configured to use the output result of the current reasoning step as input data for the next reasoning step if the judgment result indicates that the value is greater than the given value;

[0129] a step execution unit, configured to, if the judgment result indicates that the value is not greater than, generate a local reasoning fragment based on the task to be processed, replace the target content in the current reasoning step with the local reasoning fragment to obtain a replaced reasoning step, and drive the large model to execute the replaced reasoning step;

[0130] The second result determination unit is used to determine the corresponding reasoning result after all the reasoning steps are executed.

[0131] In some specific implementations, the reasoning optimization module 14 specifically includes:

[0132] a loss value determining unit, configured to determine the amount of the feedback information, determine a feedback analysis result based on the feedback information and the amount, and determine a loss value using current parameters of the large model, the feedback information, and a preset loss function;

[0133] a product value determining unit, configured to add the feedback analysis result and the loss value, and multiply the obtained added value by the learning rate of the large model to obtain a corresponding product value;

[0134] The model adjustment unit is used to determine target model parameters using the product value and the current parameters of the large model, and adjust the current parameters of the large model using the target model parameters.

[0135] Furthermore, the embodiment of the present application also discloses an electronic device, Figure 4 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be considered as any limitation on the scope of use of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the large model reasoning optimization method based on background information fusion disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0136] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device. The communication protocol it follows is any communication protocol that can be applied to the technical solution of this application and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world. Its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0137] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or CD, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0138] The operating system 221 is used to manage and control the hardware devices and computer program 222 on the electronic device 20, and can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of implementing the large model inference optimization method based on background information fusion performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program capable of completing other specific tasks.

[0139] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when executed by a processor, the computer program implements the aforementioned large-model inference optimization method based on background information fusion. The specific steps of this method can be referred to the corresponding content disclosed in the aforementioned embodiments and will not be repeated here.

[0140] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. Reference can be made to the descriptions of the identical or similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and the relevant parts can be referred to the descriptions of the methods.

[0141] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0142] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0143] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.

[0144] The above is a detailed introduction to the technical solution provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the ideas of the present application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A large model reasoning optimization method based on background information fusion, characterized in that: include: When the large model performs reasoning based on the task to be processed, determining background information related to the task to be processed; The background information includes user interaction record information, task environment information and domain knowledge information related to the task to be processed; The background information and the input data of the large model are integrated to obtain target information; the input data is the data input by the user end to the large model based on the task to be processed; Determining a target reasoning path based on the target information, the background information, and the task requirements of the task to be processed, so as to execute the task to be processed using the large model and the target reasoning path and obtain a corresponding reasoning result; After the task to be processed is completed, feedback information corresponding to the inference result is determined, and the parameters of the large model are adjusted based on the feedback information to optimize the inference process of the large model.

2. The large model reasoning optimization method based on background information fusion according to claim 1 is characterized in that: The determining of background information related to the task to be processed includes: Extracting the task type, task domain, and task keywords of the task to be processed to determine corresponding task features; Evaluate the relevance of each preset data source and the task to be processed based on the task characteristics, and obtain corresponding evaluation results; A target data source is determined from each of the preset data sources based on the evaluation result, and information is retrieved from the target data source using the task characteristics to obtain background information related to the task to be processed.

3. The large model reasoning optimization method based on background information fusion according to claim 1 is characterized in that: The step of fusing the background information with the input data of the large model to obtain target information includes: Determining a background information vector based on the background information, and inputting the background information vector into a pre-trained embedding model to convert the background information vector into a first embedding vector using a first preset activation function, a first preset bias term, and a preset embedding transformation matrix in the pre-trained embedding model; determining an input data vector based on the input data of the large model, and determining a second embedding vector based on the input data vector; The first embedding vector and the second embedding vector are fused using a preset attention mechanism and the dimension of the first embedding vector, and the obtained fused vector is used as the target information.

4. The large model reasoning optimization method based on background information fusion according to claim 3 is characterized in that: The determining of a target reasoning path based on the target information, the background information, and the task requirements of the task to be processed includes: Determining a task requirement of the task to be processed, and determining a task requirement vector based on the task requirement; Selecting a reasoning path from each reasoning path of the large model as a current reasoning path; Determining a path activation probability of the current reasoning path based on a second preset activation function, the target information, the first embedding vector, and a second preset bias term; Jump to the step of selecting an inference path from the inference paths of the large model as the current inference path, until all inference paths of the large model are selected and the activation probability of each path is obtained; Among the inference paths of the large model, determining the inference path whose path activation probability is greater than a preset probability threshold as the initial inference path; Determine the accuracy and computational complexity of the initial reasoning path, and determine the initial reasoning path with the smallest path loss value among the initial reasoning paths based on the accuracy, computational complexity, and a preset path loss algorithm, and determine the initial reasoning path with the smallest path loss value as the target reasoning path.

5. The large model reasoning optimization method based on background information fusion according to claim 1 is characterized in that: The using the large model and the target reasoning path to execute the task to be processed and obtain a corresponding reasoning result includes: Decomposing the target reasoning path into reasoning steps, and driving the large model to perform reasoning step by step based on the reasoning steps and the tasks to be processed; During the step-by-step reasoning process, the output result of the large model executing the current reasoning step is determined, and whether the output result is greater than a preset confidence threshold is determined to obtain a judgment result; If the judgment result indicates that it is greater than, the output result of the current reasoning step is used as the input data of the next reasoning step; If the judgment result shows that it is not greater than, a local reasoning fragment is generated based on the task to be processed, and the target content in the current reasoning step is replaced by the local reasoning fragment to obtain a replaced reasoning step, and the large model is driven to execute the replaced reasoning step; When all the reasoning steps are completed, the corresponding reasoning results are determined.

6. The large model reasoning optimization method based on background information fusion according to any one of claims 1 to 5, characterized in that: The adjusting the parameters of the large model based on the feedback information includes: Determining the amount of the feedback information, determining a feedback analysis result based on the feedback information and the amount, and determining a loss value using current parameters of the large model, the feedback information, and a preset loss function; Adding the feedback analysis result and the loss value, and multiplying the obtained added value by the learning rate of the large model to obtain a corresponding product value; Target model parameters are determined using the product value and current parameters of the large model, and the current parameters of the large model are adjusted using the target model parameters.

7. A large model reasoning optimization device based on background information fusion, characterized in that: include: An information determination module is used to determine background information related to the task to be processed when the large model performs reasoning based on the task to be processed; The background information includes user interaction record information, task environment information and domain knowledge information related to the task to be processed; An information fusion module, configured to fuse the background information with the input data of the large model to obtain target information; the input data is data input by the user end to the large model based on the task to be processed; A task reasoning module is used to determine a target reasoning path based on the target information, the background information, and the task requirements of the task to be processed, so as to execute the task to be processed using the large model and the target reasoning path and obtain a corresponding reasoning result; The reasoning optimization module is used to determine feedback information corresponding to the reasoning result after the task to be processed is completed, and adjust the parameters of the large model based on the feedback information to optimize the reasoning process of the large model.

8. The large model reasoning optimization device based on background information fusion according to claim 7 is characterized in that: The reasoning optimization module includes: a loss value determining unit, configured to determine the amount of the feedback information, determine a feedback analysis result based on the feedback information and the amount, and determine a loss value using current parameters of the large model, the feedback information, and a preset loss function; a product value determining unit, configured to add the feedback analysis result and the loss value, and multiply the obtained added value by the learning rate of the large model to obtain a corresponding product value; The model adjustment unit is used to determine target model parameters using the product value and the current parameters of the large model, and adjust the current parameters of the large model using the target model parameters.

9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor is used to execute the computer program to implement the large model reasoning optimization method based on background information fusion as described in any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that Used to store computer programs; wherein, when the computer program is executed by a processor, it implements the large model reasoning optimization method based on background information fusion as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Reasoning optimization method and device for large model and medium

    CN119168067A

  • Data processing method, model training method, device and equipment based on multiple targets

    CN119273057A

  • Vehicle-mounted user intention recognition and task generation system based on large model

    CN119416895A

  • Multi-agent recommendation method and device combined with preference learning, electronic equipment, storage medium and program product

    CN120045697A

  • Using Chains of Thought to Prompt Machine-Learned Models Pre-Trained on Diversified Objectives

    US20230244938A1