Answer reasoning method, device and medium based on large language model

By calculating the meta-hierarchical differentiation structure and iterative optimization method, the accuracy and efficiency issues of large language models when dealing with complex problems are solved, and more efficient answer reasoning is achieved.

CN120509490BActive Publication Date: 2025-09-30TONGJI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510976052.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-16
Publication Date
2025-09-30
Estimated Expiration
2045-07-16

AI Technical Summary

Technical Problem

Existing large language models have difficulty inferring accurate answers when dealing with complex or professional problems, and existing methods have problems such as inconsistent knowledge systems, inconsistent data formats, reasoning misunderstandings, and inconsistent coordination.

Method used

A hierarchical differentiation structure of computing elements is adopted to decompose complex problems into multiple sub-problems. Through horizontal and vertical iterative optimization, problem deconstruction and iterative optimization of computing elements are carried out in combination with user feedback. The parallel processing and score feedback mechanism of computing elements are utilized to reduce the repeated construction of answer verification modules.

Benefits of technology

It improves the accuracy and efficiency of large language models in handling complex problems, reduces the workload of the reasoning process, explicitly optimizes the reasoning path, and enhances the model's ability to handle complex problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120509490B_ABST
    Figure CN120509490B_ABST
Patent Text Reader

Abstract

The present invention relates to a method, device, and medium for answer reasoning based on a large language model. The method comprises the following steps: obtaining a problem to be solved and inputting it into a large language model; the computational elements in the large language model cyclically performing the following steps: each computational element at the current level determines the difficulty of the corresponding problem; if the difficulty of the problem is greater than a preset threshold, the problem is decomposed into multiple sub-problems and the corresponding computational elements at the next level are differentiated; starting from the computational element at the last level, the computational elements at the current level are repeatedly iterated horizontally and vertically until the computational elements at the current level are optimized and an inference result is obtained; after the optimization of the computational element at the current level is completed, the computational element at the previous level is optimized, and this process is repeated until the first level of computational elements is optimized, and the inference result of the computational elements at each level is summarized to obtain an inference result for the problem to be solved. Compared with the existing technology, the present invention has the advantages of being able to accurately infer the answer to complex problems.
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 method, device and medium for answer reasoning based on a large language model. Background Art

[0002] With the rapid development of artificial intelligence technology, large language models have demonstrated powerful language understanding and generation capabilities in many fields, providing new approaches to solving various problems. Existing large language model answer reasoning methods typically use a method of directly inputting questions and generating answers in one go. In this method, the model often attempts to directly grasp the relationship between questions and answers from a holistic perspective based on fixed parameters and training data, and then outputs the corresponding reasoning results. However, this approach is difficult to adapt to complex or proprietary problems. Currently, various large language models use enhancement methods such as importing professional knowledge bases, calling databases, introducing reasoning algorithms, and building multi-agent systems when dealing with complex or professional problems.

[0003] Each of the above methods has many advantages: importing a knowledge base can obtain more accurate and authoritative answers; calling a database can provide high-quality data, and the analysis and prediction results are more accurate; introducing an inference model makes the answer to the question more interpretable; building a multi-agent system can cope with a variety of problems and complex environments, and at the same time, division of labor and cooperation can also improve the ability to deal with complex problems.

[0004] Specifically, there are the following disadvantages: importing a knowledge base takes time to collect and judge knowledge in related fields, and there may be problems such as inconsistent knowledge systems, out-of-context answers, and low relevance; calling a database requires data processing, and on the other hand, the actual data is limited, and the training data format is inconsistent, etc.; introducing reasoning algorithms / thinking chains may complicate simple problems and cause reasoning to fall into misunderstandings; multi-agent systems have coordination inconsistencies, duplication or conflicting functions between different agents, and high operating costs.

[0005] CN119918654A discloses a large language model answer reasoning method and system that integrates memory and iterative optimization. First, an answer verification module generates natural language feedback for sub-question answers. This prevents the model from deviating from the correct reasoning path in subsequent reasoning steps if an error occurs in a certain step. Second, a sub-question verification module verifies and prunes the sub-questions generated during thought chain reasoning to prevent information from irrelevant sub-questions from interfering with the model. Finally, by utilizing this feedback information, the model's output is iteratively optimized, simulating the human process of self-reflection and correction, preventing the large language model from making the same error in the same reasoning step. This method does not fine-tune the large language model itself, saving resources required for fine-tuning the large language model and improving its reasoning performance. However, this method requires building corresponding answer verification modules when handling different professional questions, which is a significant workload. Furthermore, the structure is too simple, making it difficult to guarantee that the generated sub-questions will receive optimal answers from the large language model.

[0006] Therefore, there is a need for a method that can accurately reason and obtain answers to complex / professional questions. Summary of the Invention

[0007] The purpose of the present invention is to provide a method, device and medium for answer reasoning based on a large language model to accurately infer answers to complex / professional questions.

[0008] The purpose of the present invention can be achieved by the following technical solutions:

[0009] A method for answer reasoning based on a large language model, comprising the following steps:

[0010] Get the problem to be solved and input it into a large language model;

[0011] The computational element loop in the large language model performs the following steps to deconstruct the problem and differentiate the computational elements: each computational element at the current level determines the difficulty of the corresponding problem. If the difficulty of the problem is greater than a preset threshold, the problem is deconstructed into multiple sub-problems and the corresponding computational elements at the next level are differentiated. Otherwise, the problem deconstruction and computational element differentiation are not performed. The number of computational elements at the first level is 1.

[0012] Iterative optimization of computing elements: Starting from the computing element at the last level, the computing elements at the current level are repeatedly iterated horizontally and vertically until the optimization of the computing element at the current level is completed, and the reasoning results of the corresponding sub-problems of each optimized computing element are obtained, wherein the first-level computing element only performs horizontal iteration; after the optimization of the computing element at the current level is completed, the computing element at the previous level is optimized, and this process is repeated until the optimization of the computing element at the first level is completed, and the reasoning results of the computing elements at all levels are summarized to obtain the reasoning results of the problem to be solved, wherein the horizontal iteration is that the computing elements at the same level iteratively process the corresponding sub-problems based on the default algorithm group within a limited time, and the vertical iteration is that the sub-level computing element that completes the horizontal iteration feeds back the reasoning results of the sub-problems and information related to the computing element operation to the computing element at the previous level. The computing element at the previous level independently evaluates and scores the reasoning results of different sub-level computing elements that process the same sub-problem according to the default judgment algorithm, replaces the sub-level computing element with the lowest score with the sub-level computing element with the highest score, and issues information and permissions to mobilize the corresponding sub-level computing elements for iterative optimization.

[0013] The method further comprises:

[0014] Obtain relevant issues or directions that need to be optimized based on user feedback based on reasoning results. The first-level computing element combines user feedback information to deconstruct the problem again. The differentiated sub-problems are divided into tractable sub-problems and untractable sub-problems. For tractable sub-problems, the default algorithm group is used to search for existing sub-level computing elements of any level as target sub-level computing elements, and the target sub-level computing elements are used to process them. For untractable sub-problems, new computing element differentiation and computing element iterative optimization are performed. The first-level computing element summarizes the reasoning results of the target sub-level computing element and the reasoning results after iterative optimization of the new differentiated sub-level computing element, and further outputs the reasoning results for relevant issues or directions that need to be optimized based on user feedback.

[0015] The difficulty of the question is calculated as follows:

[0016] ,

[0017] Where: L s is the difficulty level of the corresponding problem handled by the calculation element, L si This is the calculation element under the specified model. i The difficulty level of the evaluation, n is the number of evaluations, L u It is the difficulty level of the corresponding problem handled by the superior computation unit of this computation unit.

[0018] The upper limit of the number of sub-problems that can be decomposed from the problem is determined by the difficulty of the problem:

[0019] ,

[0020] Where: K max is the upper limit of the number of subproblems that can be decomposed, k is a selectable integer within a preset range, L s is the difficulty level of the problem to be decomposed, L 0 is the difficulty threshold, which is an integer.

[0021] The number of computing elements differentiated from each subproblem is a preset odd value and is less than or equal to the maximum parallel parameter value in the operating environment.

[0022] The number of computing elements differentiated from each subproblem is dynamically determined based on the difficulty of the upper-level problem corresponding to the subproblem, and is less than or equal to the maximum parallel parameter value in the operating environment.

[0023] The judgment condition for terminating the vertical iteration is: the number of iterations reaches the maximum number of vertical iterations.

[0024] The judgment condition for the termination of the vertical iteration is:

[0025] ,

[0026] Where: I ( q , i ) is the q The first sub-problem i Whether to continue iteration after vertical iterations. 0 means stop iteration, and 1 means continue iteration. The maximum number of iterations It is the set of evaluation scores of all sub-level calculation elements in the i-th iteration of the sub-problem.

[0027] An electronic device includes a memory, a processor, and a program stored in the memory, wherein the processor implements the method when executing the program.

[0028] A non-volatile computer-readable storage medium stores a program, which implements the method when executed.

[0029] Compared with the prior art, the present invention has the following beneficial effects:

[0030] The present invention introduces a hierarchical differentiation structure of computing elements, which can transform complex problems into problems of lower difficulty until they can be better solved by large language models; it supports parallel processing of sub-problems of different levels and a replacement mechanism based on score feedback, eliminating the need to repeatedly build answer verification modules, reducing the workload of the reasoning process; and it uses a combination of horizontal and vertical iterations to explicitly optimize the reasoning path. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 is a flow chart of the method of the present invention;

[0032] Figure 2 A schematic diagram of a planar expansion of a framework system of a single computing element in one embodiment;

[0033] Figure 3 Schematic diagram of the operation flow of asking a question for the first time in one embodiment;

[0034] Figure 4 A comparison of images generated by different schemes in one embodiment, wherein: Figure 4 (a) in the equation is the result generated by solution (a). Figure 4 (b) in the figure is the result generated by solution (e). DETAILED DESCRIPTION

[0035] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.

[0036] Example 1

[0037] This embodiment provides an answer reasoning method based on a large language model, such as Figure 1 As shown, the following steps are included:

[0038] S1, obtains the problem to be solved and inputs it into the large language model.

[0039] The input question to be solved can be asked alone or accompanied by other information, including requirements, data, codes, regulations, etc. involved in the question.

[0040] S2, the computing element loop in the large language model executes the following steps to perform problem deconstruction and computing element differentiation: each computing element at the current level judges the difficulty of the corresponding problem respectively. If the problem difficulty is greater than the preset threshold, the problem is deconstructed and decomposed into multiple sub-problems, and the corresponding next-level computing elements are differentiated. Otherwise, problem deconstruction and computing element differentiation are not performed, where the number of first-level computing elements is 1.

[0041] like Figure 2As shown in the figure, the main components of the computing element include: C area, M area, J area, E area, H area, P compression area and connection network, among which:

[0042] Area C: Mainly responsible for iteration, comprehensive analysis, external tools and other functions.

[0043] M area: mainly responsible for memorizing command information, storing data and other functions.

[0044] J Area: Mainly responsible for evaluation and judgment, and coordination of normal operation of other areas.

[0045] Area E: Mainly responsible for the iteration of the calculation element's own code, modification of its own information, and other functions.

[0046] H area: Mainly responsible for computing element differentiation, creation, and backup of core data in J area.

[0047] P compression area: includes all information in the rest areas except itself, and is usually in the compression inactive state.

[0048] Connection network: responsible for realizing the function of information transmission between different computing elements.

[0049] A first-level computational cell (calcell_F) or a computational cell with execution rights independently determines the problem's difficulty, transforms the original data, and decomposes the problem into multiple, interconnected, second-level subproblems. Based on the decomposition results of the subproblems, the first-level computational cell generates second-level computational cells, copies the subproblems and the corresponding data, and assigns them to the corresponding second-level computational cell (calcell_x_x). Each second-level computational cell continues to perform problem difficulty assessments and computational cell division until the resulting N-level computational cells (calcell_x_x..._x) independently determine that they can handle the corresponding N-level subproblems.

[0050] In this embodiment, the method for calculating the difficulty of the question is:

[0051] (1)

[0052] Where: L s is the difficulty level of the corresponding problem handled by the calculation element (all integers), L si This is the calculation element under the specified model. i The difficulty level of the evaluation (all integers), n is the number of evaluations, L u is the difficulty level of the corresponding problem handled by the parent computation element of this computation element (all integers).

[0053] This embodiment sets limits to prevent deviations in the difficulty of questions due to pseudoscopy and to prevent an excessive number of sub-questions. The upper limit of the number of sub-questions that can be decomposed from a question is determined based on the difficulty of the question:

[0054] (2)

[0055] Where: K max is the upper limit of the number of decomposed subproblems, k is a selectable integer within a preset range (2-4 in this embodiment), L s is the difficulty level of the problem to be decomposed, L 0 is the difficulty threshold, which is an integer, and is 3 in this embodiment.

[0056] In one embodiment, the number of computing elements differentiated from each subproblem is a preset odd value greater than 1 and less than or equal to the maximum parallel parameter value in the operating environment.

[0057] In another embodiment, the number of computing elements generated for each subproblem is dynamically determined based on the difficulty of the parent problem corresponding to the subproblem, and is less than or equal to the maximum parallel parameter value in the operating environment. This process can be expressed as:

[0058] (3)

[0059] in, m is the horizontal competition parameter determined according to the highest parallel parameter in the operating environment, representing a sub-problem m The above formula indicates that when the difficulty of the current sub-problem is greater than the preset threshold and it is necessary to divide the sub-problem, it is also necessary to differentiate the sub-level computing elements. The maximum value of the differentiated sub-level computing elements is It is determined by the upper limit of the number of differentiated sub-problems and the maximum parallel parameter of the operating environment. m After determination, each sub-level calculation element will have a corresponding label, which is used to adjust parameters such as temperature in the large language model, so that the output results of each sub-level calculation element are not exactly the same.

[0060] The parent calculation element determines the total number of child calculation elements that need to be differentiated W s for:

[0061] (4)

[0062] in, K s The number of subproblems generated is determined specifically for the parent computation element.

[0063] like Figure 3As shown, a flowchart of the operation of asking questions for the first time in an embodiment is shown. For the provided question 1, judgment 1 is first performed to determine the difficulty of the problem. If the difficulty of the problem is greater than or equal to 3, the problem is decomposed and divided into sub-problems 1 to sub-problems n. Taking sub-problem 1 as an example, according to the determined horizontal competition parameter m, there are A1a~A1m, and a total of m sub-level computing elements are differentiated, which are used for judging the sub-problems respectively. Then each sub-level computing element executes judgment 1 to determine the difficulty of the sub-problem to which it corresponds. If the difficulty of the problem is greater than or equal to 3, the next level of problem deconstruction and computing element differentiation are further performed until all computing elements determine that the problem difficulty is less than 3, then the iteration is stopped, indicating that the sub-level computing elements of the target can independently solve the sub-problems to which they correspond.

[0064] S3, iterative optimization of computing elements: starting from the computing element at the last level, the computing elements at the current level are repeatedly iterated horizontally and vertically until the optimization of the computing element at the current level is completed, and the reasoning results of the corresponding sub-problems of each optimized computing element are obtained. Among them, the first-level computing element only performs horizontal iteration; after the optimization of the computing element at the current level is completed, the computing element at the previous level is optimized, and this process is repeated until the optimization of the computing element at the first level is completed. The reasoning results of the computing elements at all levels are summarized to obtain the reasoning results of the problem to be solved. Among them, horizontal iteration means that the computing elements at the same level iteratively process the corresponding sub-problems based on the default algorithm group within a limited time, and vertical iteration means that the sub-level computing element that completes the horizontal iteration feeds back the reasoning results of the sub-problems and information related to the computing element operation to the computing element at the previous level. The computing element at the previous level independently evaluates and scores the reasoning results of different sub-level computing elements that process the same sub-problem according to the default judgment algorithm, replaces the sub-level computing element with the lowest score with the sub-level computing element with the highest score, and issues information and permissions to mobilize the corresponding sub-level computing elements for iterative optimization.

[0065] The default algorithm group can use the existing iterative algorithm, which will not be described in detail here. It can change the default prompt word, iteration parameters, introduce specified iteration rules, call the database, etc. The default upload information after the iteration is completed can also be expanded.

[0066] In one embodiment, the vertical iteration termination condition is: the number of iterations reaches the maximum number of vertical iterations, that is:

[0067] (5)

[0068] In another embodiment, the vertical iteration termination judgment condition is:

[0069] (6)

[0070] Where: I ( q , i ) is the qThe first sub-problem i Whether to continue iteration after vertical iterations, 0 means stop iteration, 1 means continue iteration; The maximum number of iterations It is the set of evaluation scores of all sub-level calculation elements in the i-th iteration of the sub-problem.

[0071] In one embodiment, the evaluation and scoring is specifically implemented as follows:

[0072] (7)

[0073] (8)

[0074] (9)

[0075] (10)

[0076] Where: A q-i For the q The first group of sub-questions i The judgment information uploaded by the child computing element, such as s 11 Whether the first child calculation element uploads the code, the corresponding value is 1 or 0, 1 means yes, 0 means no; 12 Whether to upload data, s 13 Explain whether to upload, etc., until s in Until. The same sub-question judgment information is summarized into A q Matrix, where m is the horizontal competition parameter value. F 1( A q ) is a composite algorithm group for processing judgment information matrix, which will combine specific actual data and A q Conduct joint scoring. G q It is q The total score matrix under each sub-question grouping is, for example, s 11 =0, then corresponding to g 11 =0. F 2( G q ) is a comprehensive algorithm group that scores each row independently and outputs a pre-evaluation score p ma . F 3( G q ) is completed based on the assessment p ma Combine the coefficient algorithm group of non-judgment information and output the final score for elimination comparisonp mb In a preferred embodiment, F 3( G q ) According to the adjustment parameter k pm right p ma Adjust to obtain p mb Specifically, for the non-judgment information iteration time T and total resources spent U The adjustment parameter k is obtained by combining pm The calculation example is as follows. This calculation formula is summarized based on current test data and is replaceable.

[0077] (11)

[0078] (12)

[0079] in, For calculation element m The total time consumed by the operation, For calculation element m The total amount of information consumed by the operation, Indicates based on and Utilization function f Calculated computational elements m The initial adjustment coefficient value, Represents a computational element m The adjustment parameters.

[0080] like Figure 3 As shown in the figure, when the problem difficulty is greater than or equal to 3, computation elements A_1a-A_1m first perform horizontal iterations, iteratively processing the corresponding subproblems within a finite time. Decision 2 determines whether the horizontal iteration has terminated. If not, the iteration continues and the intermediate iteration results are backed up. If it has terminated, computation elements A_1a-A_1m upload the relevant processing information to the parent computation element A. Parent computation element A independently evaluates and scores the reasoning results of different sub-computing elements and determines whether to terminate the vertical iteration through decision 3. If it has terminated, the sub-computing element with the lowest score is replaced with the sub-computing element with the highest score, and information and permissions for mobilizing the corresponding sub-computing elements for iterative optimization are issued. Otherwise, the next vertical iteration is performed.

[0081] During this iterative process, Figure 3 As shown, the first-level computing element also performs judgment 4, judging whether the correlation between the results reaches a threshold based on the evaluation of all the analyzed sub-problem processing results. If the threshold is not reached, the corresponding sub-problems continue to be vertically iterated, otherwise the valid information is summarized and stored.

[0082] Similarly, when the problem difficulty is less than 3, the upper-level calculation element A will perform horizontal iteration, and then determine whether the horizontal iteration is terminated through judgment 2. If it is not terminated, the iteration will continue and the intermediate iteration results will be backed up. If it is terminated, the first-level calculation element A will directly output the result.

[0083] After the first-level computing element completes the optimization, the total effective information obtained includes the cumulative iteration time of the sub-level computing element, the total_tokens number consumed by the iteration, the problem difficulty level, feature labels, etc.

[0084] Example 2

[0085] Based on Example 1, this embodiment performs a one-step iterative optimization on the answer reasoning result obtained in Example 1. That is, based on the aforementioned methods S1 to S3, this embodiment further includes:

[0086] S4, obtains the relevant problems or directions that need to be optimized based on the user's feedback based on the reasoning results. The first-level computing element combines the user feedback information to deconstruct the problem again. The differentiated sub-problems are divided into tractable sub-problems and untractable sub-problems. For the tractable sub-problems, the default algorithm group is used to search for the existing sub-level computing elements of any level as the target sub-level computing elements, and the target sub-level computing elements are used to process them; for the untractable sub-problems, new computing element differentiation and computing element iterative optimization are performed. The first-level computing element summarizes the reasoning results of the target sub-level computing element and the reasoning results after iterative optimization of the new differentiated sub-level computing element, and further outputs the reasoning results for the relevant problems or directions that need to be optimized based on the user feedback.

[0087] Example 3

[0088] This embodiment uses the construction of crawler code to obtain the distribution of all hospitals in Shanghai as an actual case to illustrate the effectiveness of the answer reasoning method described in Example 1 in dealing with complex problems.

[0089] This experiment provides a .txt file, a .docx file, and a .py file. The first .txt file explains the task of "building a crawler code to obtain the distribution of all hospitals in Shanghai"; the second .docx file provides four specific requirements; and the third .py file is a short reference code of 3KB in size.

[0090] For step S1, in this embodiment, the specific input tasks are:

[0091] 1. "Build code to obtain the distribution of all hospitals in Shanghai", the format is .txt. (There can only be one txt file)

[0092] 2. Attachment 1: Provide a document with specific requirements for the task to be implemented, in .docx format

[0093] 3. Attachment 2: Provide a non-functional process reference code, in .py format, 3KB in size

[0094] The computer ID of the problem: xcreatM91

[0095] For step S2, this embodiment specifies the difficulty level of the questions, as follows:

[0096] 'Level 1': simple and straightforward questions that can be answered;

[0097] 'Level 2': Issues that require calling other resources and methods;

[0098] 'Level 3': Problems that can be solved by a single person in a short time;

[0099] 'Level 4': Problems that can be solved by multiple people in a short period of time;

[0100] 'Level 5': A problem that can be solved by multiple people in the long term.

[0101] After 14 independent judgments by the large language model, the values ​​between 15% and 85% were considered reasonable. The average was taken and then rounded to the integer, resulting in Lu (Level) = 3 for this task. Because Lu > 2, the problem needs to be deconstructed. The interrelated sub-problems generated after deconstruction are:

[0102] 1. Use the AutoNavi Map API. (Paginate hospital POI data by keyword "hospital" and city "Shanghai" to ensure comprehensive coverage and avoid excessive requests.)

[0103] 2. Parse the acquired POI data. (Extract the hospital name, address, geographic coordinates, official website, and contact information, and store it in a structured DataFrame format for subsequent processing.)

[0104] 3. Visit the hospital's official website (use BeautifulSoup to parse the webpage content, crawl and extract useful text information such as hospital introductions, and supplement the richness of hospital information.)

[0105] 4. Use Folium to create a Shanghai hospital distribution map based on latitude and longitude data. (Save as an HTML file to visually display the spatial distribution of hospitals.)

[0106] 5. Support for subsequent expansion. (Through parameterized API calls, crawling and displaying information of hospitals in other cities is possible, with good versatility and maintainability.)

[0107] After that, each sub - problem repeats the problem - difficulty judgment, problem decomposition, and computational - element differentiation, and the judgments are 3, 1, 2, 3, 2 respectively. Since the parent - level (xcreatM91) problem Lu = 3, all the sub - problems are finally considered as Ls i <Lu. They are 2, 1, 2, 2, 2 respectively. It is found that there is no need to continue decomposing the sub - problems. It is planned to generate xcreatM91_1, xcreatM91_2, …, xcreatM91_5

[0108] For the subsequent processing of generating multiple sub - computational elements for the same sub - problems, here each sub - problem is simplified to fixedly take 3 corresponding ones, and the following are generated:

[0109] xcreatM91_1a, xcreatM91_1b, xcreatM91_1c;

[0110] xcreatM91_2a, xcreatM91_2b, xcreatM91_2c;

[0111]

[0112] xcreatM91_5a, xcreatM91_5b, xcreatM91_5c

[0113] For step S3, starting from the computational element with the most differentiation times, based on the default algorithm group, the corresponding assigned sub - problems are iteratively processed by itself within a limited time. The optimized output results required include code, data, explanations, etc. The processing results of the sub - problems and the information related to the operation of the computational element are passed to the upper - level computational element (upper_calcell), which is regarded as completing one horizontal iteration

[0114] Since the differentiation times are all the same, the first sub - problem is taken as an example for processing. xcreatM91_1a inherits the requirement information of "obtaining hospital POI data by paging with the keyword 'hospital' and the city 'Shanghai' to ensure comprehensive coverage and avoid overly frequent requests" of the parent - level computational element and the reference code provided by the parent - level computational element

[0115] The following optimization process is as follows:

[0116] Step 1. Record the characteristic information of the sub - problem, time, technical field involved, problem level, model used, etc

[0117] Step 2. On the premise of ensuring that the information content remains unchanged, convert the inherited information into a format such as json that can be processed subsequently

[0118] Step 3. Generate a logical flow for the specific process of "Utilizing the AutoNavi Map API (Paging hospital POI data using the keyword "hospital" and the city "Shanghai" to ensure comprehensive coverage and avoid excessive requests)." Follow the flow to generate partial code snippets and the complete code "program_1.py." Obtain simulated data "data_1.xlsx" that matches the requirements and code, and generate the corresponding instruction file "report_1.json."

[0119] Step 4. Transfer the original data "data_1.xlsx" and the original code "program_1.py" to area C.

[0120] Step 5. Area C begins optimizing the data and code, generating new files "data_2.xlsx" and "program_2.py." A new description file, "report_2.json," is generated based on the new data and code, completing the first update. The new data and code are then used as the data and code for the next update. This process repeats four times until "data_5.xlsx" and "program_5.py" are generated.

[0121] Step 6. Test run "program_5.py" with a forced shutdown time of 30 seconds each time. If the run fails, the program will be stopped. The reason for the stop or error is automatically input to the large language model for correction. If no error is reported, the loop ends. By default, the program loops a maximum of three times, and the final code result is saved in "program_end.py."

[0122] Step 7. Transfer the last optimized data, code, and instruction file (all valid information) to Area J. This completes a pre-level iteration. Area J expands the valid information generated by this level iteration with the total iteration time T1, total information consumption U1, and sub-problem difficulty level, and uploads them to Area J of xcreatM91. This completes the first level iteration of this sub-component.

[0123] Step 8. Similarly, xcreatM91_1b and xcreatM91_1c also upload horizontal iteration information according to steps 1 to 7.

[0124] This is considered the first horizontal iteration of this subproblem. Repeat the same process for the other subproblems. Note that the results generated for different sequences ending in a-z tend to gradually progress from conservative to radical.

[0125] Afterwards, the upper-level calculation element will independently evaluate and score the output results of different sub-level calculation elements (lower_calcell) that process the same sub-problem according to the default judgment algorithm, eliminate the sub-level calculation element with the lowest score, retain the sub-level calculation elements with the highest score and the sub-level calculation elements with the highest score, and replace the eliminated sub-level calculation element with the calculation element with the highest score. The upper-level calculation element will summarize and save the information, and send down the information and authority to mobilize the sub-level calculation elements of the corresponding problem for iterative optimization, which is considered to have completed one vertical iteration.

[0126] Taking the first sub-problem as an example, after completing the first horizontal iteration, the J area of ​​xcreatM91 autonomously begins to independently evaluate and score the information of xcreatM91_1a, xcreatM91_1b, and xcreatM91_1c. The system selectively uses the provided data, codes, and instructions as judgment information, specifically 3 judgment information here. Because the 3 judgment information of xcreatM91_1a were successfully optimized and uploaded, the corresponding A 1-1 =[1 1 1], different computing units may upload different types of information, for example:

[0127] A corresponding to xcreatM91_5c 5-3 =[0 1 1], indicating that there is no judgment information about uploading data.

[0128] Step I. The judgment information matrix mapping A1 of all sub-level computing elements corresponding to the first sub-problem. According to the test output results, A1 is a standard 3*3 all-one unit.

[0129]

[0130] Step II. The scoring algorithm logic for different data types varies. To simplify understanding, the judgment information is independent of each other, and the corresponding scoring process is independent, without considering cross-terms. Because we are more concerned with the algorithm that can generate processing tasks, we set the data weight to 0.2, the instructions to 0.1, and the code weight to 0.7. The large language model independently sets reference indicators for each judgment information, such as data format and data size, and scores are 1 to 9. After multiple independent comprehensive scores, the data judgment information item received a score of 3.195.

[0131] The instruction score was 7.1, the comprehensive code score was 7.66, and the corresponding weighted pre-assessment score was 6.711.

[0132]

[0133] Step III. Considering that the scores after multiple eliminations may be similar or even equal, equality is not allowed. The core T and U are introduced as non-judgment information parameters to obtain the final elimination comparison score p1. Originally, time cost, information cost, space (storage) cost, and energy cost were considered, but the latter two are too difficult to quantify, so only the first two non-judgment parameters can be introduced. The simplified coefficient formulas refer to (9) and (10).

[0134] The first sub-level question is xcreatM91_1a's k 1_1 =(272.23)^(272.23 / 165559) =1.0092618;

[0135] The remaining xcreatM91_1b and xcreatM91_1c can also be calculated as follows:

[0136] k 1_2 =1.0089032, k 1_3 =1.009820, corresponding k1min = k 1_2 =1.0089032;

[0137] The corresponding normalized coefficients are k 1a =0.9996445, k 1b =1.0, k 1c =0.9990912.

[0138] Finally, multiply the pre-assessment score by the corresponding coefficient k 1a , k 1b , k 1c Get the K1 matrix.

[0139]

[0140] The highest-scoring candidate is xcreatM91_1c, the lowest-scoring candidate is xcreatM91_1a, and the average-scoring candidate is xcreatM91_1b. Next, xcreatM91_1a's valid information is replaced with xcreatM91_1c's, while xcreatM91_1b's information remains unchanged. In the next round, only xcreatM91_1c, with the highest score, is exempted from horizontal iteration, while xcreatM91_1a and xcreatM91_1b continue to undergo horizontal iteration.

[0141] Step IV. The scores of the remaining sub-level calculation elements are evaluated in the same way as steps 1 to 3.

[0142] Step V. Activate the computational elements that need to perform the next horizontal iteration, which is considered to have completed one vertical iteration.

[0143] Repeat the above steps. When the vertical iteration reaches the default value or the iteration score reaches the dynamic threshold, the upper-level computing element starts horizontal iteration.

[0144] For simplicity, Equation (5) is used here by default. Taking the first subproblem as an example, after three vertical iterations, the problem with the highest score is found to be xcreatM91_1b. The valid information from xcreatM91_1b is selected as the solution to this subproblem. Similarly, the valid information from xcreatM91_2a, xcreatM91_3a, xcreatM91_4c, and xcreatM91_5b is the corresponding solution. After obtaining the solutions to all subproblems, xcreatM91 reconstructs the problem based on the deconstruction approach. Following the logical flow, the valid information is integrated to obtain xcreatM91's original data ("data_1.xlsx," "data_2.xlsx," ..., "data_5.xlsx") and the original code ("program_version_1.py"). Four horizontal iterations are performed to obtain the code ("program_version_5.py"), which is then tested and run to obtain "program_mix.py."

[0145] Finally, after receiving the information from the child-level computing element, the first-level computing element completes the corresponding vertical and horizontal iterations and outputs the results, storing the total valid information.

[0146] Taking the first subproblem as an example, xcreatM91 will eventually back up all valid information provided by xcreatM91_1a and transfer it to the M area. Summarizing the subcomponents' completion of the task, model, and time and resource consumption, this time was 8449 seconds, using the gpt-4.1-nano model and 4670258 tokens. The same logic applies to the remaining higher-level problems.

[0147] In step S4, the second question, "Need to further understand the university distribution in Beijing and Tianjin?", the algorithm no longer iterates over the final solutions to subproblems 1-5 and instead directly calls them. The remaining subproblems that cannot be directly called are generated, such as "Expand the input section to generate the target object," which generates xcreatM91_6a, xcreatM91_1b, and xcreatM91_6c.

[0148] After receiving the information of the target sub-level computing element and the information of the newly differentiated sub-computing element, the first-level computing element completes the corresponding vertical iteration and horizontal iteration, outputs the result, and stores the new total effective information.

[0149] Finally, summarize the final processed solutions of sub-problems 1 to 6, merge them, perform 5 horizontal iterations, and output the final code and supporting data with instructions.

[0150] This example tests the comparative analysis of responses given by a large language model using different methods. Four methods are generally included: directly using a large language model; using a large language model with reasoning capabilities; using currently available multi-agents; and using the computational element proposed in this invention. Specific usage scenarios are as follows:

[0151] (a) Directly use OpenAI's GPT-4O model; (b) Use Deepseek's V3 model;

[0152] (c) Using the R1 model of deepseek;

[0153] (d) Use the "Programming Master" provided by LinkAI (based on the Claude-3.7-Sonnet model); LinkAI does not have the ability to process files and can only convert them into text before input;

[0154] (e) The computational architecture of the present invention was used (based on the gpt-4.1-nano model). The specific results are shown in Table 1 below:

[0155] Table 1 Comparative analysis of results under different usage scenarios

[0156]

[0157] The K value refers to the ratio of the output code to the starting code.

[0158] It can be seen that the code generated by most methods cannot run normally. At the same time, the size of the output code is too low to handle the required tasks, and the corresponding number of qualified codes is also low. Figure 4 A comparison of images generated by the HTML generated according to the requirements for solution (a) and solution (e) is shown. It can be seen that the GPT-4.1-nano model used by the computational element performs worse than the other large language models mentioned above in comprehensive testing. However, the images drawn by the computational element output code based on this model are more illustrative, and the charts are more vivid and detailed. While the model used is the worst, the overall effect is the best, concluding that the computational element can enhance model capabilities to a certain extent.

[0159] Example 4

[0160] The electronic device of the present invention includes a central processing unit (CPU), which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) or loaded from a storage unit into a random access memory (RAM). In the RAM, various programs and data required for device operation can also be stored. The CPU, ROM, and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.

[0161] Many components in a device are connected to the I / O interface, including: input units, such as a keyboard and mouse; output units, such as various types of displays and speakers; storage units, such as magnetic disks and optical disks; and communication units, such as network cards, modems, and wireless communication transceivers. The communication unit allows the device to exchange information / data with other devices via computer networks such as the Internet and / or various telecommunication networks.

[0162] The processing unit performs the various methods and processes described above, such as methods S1 to S4. For example, in some embodiments, methods S1 to S4 can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit. In some embodiments, part or all of the computer program can be loaded and / or installed on the device via a ROM and / or a communication unit. When the computer program is loaded into the RAM and executed by the CPU, one or more steps of methods S1 to S4 described above can be performed. Alternatively, in other embodiments, the CPU can be configured to execute methods S1 to S4 by any other appropriate means (for example, by means of firmware).

[0163] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.

[0164] The program code for implementing the method of the present invention can be written in any combination of one or more programming languages. Such program code can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0165] In the context of the present invention, machine-readable medium can be a tangible medium that can contain or store a program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0166] The above describes in detail the preferred embodiments of the present invention. It should be understood that those skilled in the art can make numerous modifications and variations based on the concepts of the present invention without inventive effort. Therefore, any technical solutions that can be derived by those skilled in the art through logical analysis, reasoning, or limited experimentation based on the concepts of the present invention and the prior art should be within the scope of protection defined by the claims.

Claims

1. A method for answer reasoning based on a large language model, characterized in that: The following steps are involved: Get the problem to be solved and input it into a large language model; The computational element loop in the large language model performs the following steps to deconstruct the problem and differentiate the computational elements: each computational element at the current level determines the difficulty of the corresponding problem. If the difficulty of the problem is greater than a preset threshold, the problem is deconstructed into multiple sub-problems and the corresponding computational elements at the next level are differentiated. Otherwise, the problem deconstruction and computational element differentiation are not performed. The number of computational elements at the first level is 1. Iterative optimization of computing elements: Starting from the computing element at the last level, the computing elements at the current level are repeatedly iterated horizontally and vertically until the optimization of the computing element at the current level is completed, and the reasoning results of the corresponding sub-problems of each optimized computing element are obtained, wherein the first-level computing element only performs horizontal iteration; after the optimization of the computing element at the current level is completed, the computing element at the previous level is optimized, and this process is repeated until the optimization of the computing element at the first level is completed, and the reasoning results of the computing elements at all levels are summarized to obtain the reasoning results of the problem to be solved, wherein the horizontal iteration is that the computing elements at the same level iteratively process the corresponding sub-problems based on the default algorithm group within a limited time, and the vertical iteration is that the sub-level computing element that completes the horizontal iteration feeds back the reasoning results of the sub-problems and information related to the computing element operation to the computing element at the previous level. The computing element at the previous level independently evaluates and scores the reasoning results of different sub-level computing elements that process the same sub-problem according to the default judgment algorithm, replaces the sub-level computing element with the lowest score with the sub-level computing element with the highest score, and issues information and permissions to mobilize the corresponding sub-level computing elements for iterative optimization.

2. The answer reasoning method based on a large language model according to claim 1, characterized in that: The method further comprises: Obtain relevant issues or directions that need to be optimized based on user feedback based on reasoning results. The first-level computing element combines user feedback information to deconstruct the problem again. The differentiated sub-problems are divided into tractable sub-problems and untractable sub-problems. For tractable sub-problems, the default algorithm group is used to search for existing sub-level computing elements of any level as target sub-level computing elements, and the target sub-level computing elements are used to process them. For untractable sub-problems, new computing element differentiation and computing element iterative optimization are performed. The first-level computing element summarizes the reasoning results of the target sub-level computing element and the reasoning results after iterative optimization of the new differentiated sub-level computing element, and further outputs the reasoning results for relevant issues or directions that need to be optimized based on user feedback.

3. The answer reasoning method based on a large language model according to claim 1, characterized in that: The difficulty of the question is calculated as follows: , Where: L s is the difficulty level of the corresponding problem handled by the calculation element, L si This is the calculation element under the specified model. i The difficulty level of the evaluation, n is the number of evaluations, L u It is the difficulty level of the corresponding problem handled by the superior computation unit of this computation unit.

4. The answer reasoning method based on a large language model according to claim 1, characterized in that: The upper limit of the number of sub-problems that can be decomposed from the problem is determined by the difficulty of the problem: , Where: K max is the upper limit of the number of subproblems that can be decomposed, k is a selectable integer within a preset range, L s is the difficulty level of the problem to be decomposed, L 0 is the difficulty threshold, which is an integer.

5. The answer reasoning method based on a large language model according to claim 1, characterized in that: The number of computing elements differentiated from each subproblem is a preset odd value and is less than or equal to the maximum parallel parameter value in the operating environment.

6. The answer reasoning method based on a large language model according to claim 1, characterized in that: The number of computing elements differentiated from each subproblem is dynamically determined based on the difficulty of the upper-level problem corresponding to the subproblem, and is less than or equal to the maximum parallel parameter value in the operating environment.

7. The answer reasoning method based on a large language model according to claim 1, characterized in that: The judgment condition for terminating the vertical iteration is: the number of iterations reaches the maximum number of vertical iterations.

8. The answer reasoning method based on a large language model according to claim 1, characterized in that: The judgment condition for the termination of the vertical iteration is: , Where: I ( q , i ) is the q The first sub-problem i Whether to continue iteration after vertical iterations, 0 means stop iteration, 1 means continue iteration; The maximum number of iterations It is the set of evaluation scores of all sub-level calculation elements in the i-th iteration of the sub-problem.

9. An electronic device comprising a memory, a processor, and a program stored in the memory, wherein: When the processor executes the program, the method according to any one of claims 1 to 8 is implemented.

10. A non-volatile computer-readable storage medium having a program stored thereon, characterized in that: When the program is executed, the method according to any one of claims 1 to 8 is implemented.