Information processing method and apparatus, electronic device, computer-readable storage medium, and computer program product

WO2026166347A1PCT designated stage Publication Date: 2026-08-13TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2026-01-22
Publication Date
2026-08-13

Smart Images

  • Figure CN2026074289_13082026_PF_FP_ABST
    Figure CN2026074289_13082026_PF_FP_ABST
Patent Text Reader

Abstract

The present application provides an information processing method and apparatus, an electronic device, a computer-readable storage medium, and a computer program product. Embodiments of the present application can be applied to information processing scenarios such as education applications. The method comprises: generating intermediate reasoning information for question information, wherein the intermediate reasoning information refers to information describing a logical reasoning process when the question information is solved; performing accuracy verification on the intermediate reasoning information to obtain a corresponding verification result; when the verification result indicates that there is an error in the intermediate reasoning information, performing error correction on the intermediate reasoning information to obtain error-corrected reasoning information; and determining answer information of the question information on the basis of the error-corrected reasoning information.
Need to check novelty before this filing date? Find Prior Art

Description

An information processing method, apparatus, electronic device, computer-readable storage medium, and computer program product.

[0001] Cross-references to related applications

[0002] This application is based on and claims priority to Chinese Patent Application No. 2025101347968, filed on February 6, 2025, the entire contents of which are incorporated herein by reference. Technical Field

[0003] This application relates to artificial intelligence technology, and more particularly to an information processing method, apparatus, electronic device, computer-readable storage medium, and computer program product. Background Technology

[0004] With the widespread application of large language models in reasoning tasks, more and more users are choosing to use large language models to solve their problems. However, some large language models output incorrect intermediate reasoning information for user questions. Although related technologies can correct erroneous intermediate reasoning information, the correction efficiency is low, and the correction process requires a large amount of computing resources, resulting in low efficiency in generating the correct answer and serious resource consumption. Summary of the Invention

[0005] This application provides an information processing method, apparatus, electronic device, computer-readable storage medium, and computer program product that can improve the efficiency of generating correct answers to questions and reduce resource consumption.

[0006] The technical solution of this application embodiment is implemented as follows:

[0007] This application provides an information processing method, which is executed by an electronic device, and the method includes:

[0008] For the problem information, intermediate reasoning information is generated; wherein, the intermediate reasoning information refers to information describing the logical reasoning process when solving the problem information;

[0009] The accuracy of the intermediate inference information is verified to obtain the corresponding verification result.

[0010] When the verification result indicates that there is an error in the intermediate inference information, the intermediate inference information is corrected to obtain the corrected inference information.

[0011] Based on the corrected reasoning information, the answer information for the question is determined.

[0012] This application provides an information processing apparatus, including:

[0013] The reasoning generation module is configured to generate intermediate reasoning information for the problem information; wherein, the intermediate reasoning information refers to information describing the logical reasoning process when solving the problem information;

[0014] The inference verification module is configured to perform accuracy verification on the intermediate inference information and obtain the corresponding verification result.

[0015] The information correction module is configured to correct the intermediate inference information when the verification result indicates that there is an error in the intermediate inference information, so as to obtain the corrected inference information.

[0016] The answer generation model is configured to determine the answer information for the question information based on the error-corrected reasoning information.

[0017] This application provides an electronic device, the electronic device comprising:

[0018] Memory is used to store executable instructions or computer programs.

[0019] The processor, when executing computer-executable instructions or computer programs stored in the memory, implements the information processing method provided in the embodiments of this application.

[0020] This application provides a computer-readable storage medium storing a computer program or computer-executable instructions, which, when executed by a processor, implements the information processing method provided in this application.

[0021] This application provides a computer program product, including a computer program or computer executable instructions. When the computer program or computer executable instructions are executed by a processor, they implement the information processing method provided in this application.

[0022] The embodiments of this application have the following beneficial effects: intermediate inference information is generated for the problem information, and the accuracy of the intermediate inference information is immediately verified to determine whether there are errors. When errors are found, the intermediate inference information is corrected. This allows for the timely detection and correction of errors during the inference process. This "process detection" mechanism can identify errors at the initial stage of their occurrence. Once an error is confirmed, the intermediate inference information is immediately corrected. This immediate intervention mechanism effectively implements "early pruning" of erroneous inference branches, avoiding the continuation of a large amount of subsequent, ineffective inference calculations within the erroneous context. This reduces the "trial and error cost" and "ineffective computational overhead" on erroneous paths, enabling faster convergence to the correct inference path. This allows for the direct generation of correct answer information based on the corrected inference information, significantly shortening the overall time for generating the correct answer, improving the efficiency of generating the correct answer to the problem, and reducing resource consumption. Attached Figure Description

[0023] Figure 1 is a schematic diagram of how the large language model processes user questions.

[0024] Figure 2 is a schematic diagram of how the large language model processes user questions.

[0025] Figure 3 is a schematic diagram of the architecture of the information processing system provided in an embodiment of this application;

[0026] Figure 4 is a schematic diagram of the server structure in Figure 3 provided in an embodiment of this application;

[0027] Figure 5 is a flowchart illustrating the information processing method provided in an embodiment of this application;

[0028] Figure 6 is a schematic flowchart of the information processing method provided in the embodiment of this application;

[0029] Figure 7 is a flowchart illustrating the information processing method provided in an embodiment of this application.

[0030] Figure 8 is a flowchart illustrating the information processing method provided in an embodiment of this application.

[0031] Figure 9 is a flowchart illustrating the information processing method provided in an embodiment of this application.

[0032] Figure 10 is a schematic diagram of the self-correction of the large language model for input problems provided in the embodiments of this application;

[0033] Figure 11 is a schematic diagram of the process of solving specific mathematical problems based on a large language model according to an embodiment of this application;

[0034] Figure 12 is a schematic diagram illustrating the implementation process of the optimized large language model in multi-step reasoning provided in the embodiments of this application;

[0035] Figure 13 is a schematic diagram of the inference tree provided in an embodiment of this application;

[0036] Figure 14 is a schematic diagram of the reasoning tree expansion process provided in an embodiment of this application;

[0037] Figure 15 is a schematic diagram of the correctness label for determining non-leaf nodes provided in an embodiment of this application;

[0038] Figure 16 is a schematic diagram of the reasoning path determination process provided in the embodiments of this application.

[0039] It should be noted that the terms "first" and "second" mentioned above are only used to distinguish between different options and do not represent the degree of superiority or inferiority of the options or their priority in the implementation process. Detailed Implementation

[0040] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0041] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0042] In the following description, the terms "first / second / third" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first / second / third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.

[0043] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0044] Unless otherwise specified, "at least one" as used below refers to one or more cases, and "multiple" can refer to two or more cases.

[0045] Unless otherwise defined, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in the embodiments of this application is for the purpose of describing the embodiments of this application only and is not intended to limit this application.

[0046] In the implementation of this application, the collection and processing of relevant data should strictly comply with the requirements of relevant laws and regulations, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of laws and regulations and the authorization of the personal information subject.

[0047] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.

[0048] 1) Problem information refers to information provided by the user to describe the problem they need to solve. For example, problem information can be a math problem entered by the user that needs to be solved, or an image uploaded by the user that needs to be recognized.

[0049] 2) Answer information refers to information used to answer the user's question. For example, when the question is a mathematical problem that the user needs to solve, the answer information can be the final mathematical answer, such as the final calculated value; when the question is an image uploaded by the user that needs to be recognized, the answer information can be the image recognition result, and so on.

[0050] 3) Intermediate reasoning information describes the derivation process of the problem information during its solution; that is, it describes the reasoning process from the problem information to the answer information. For example, when the problem information is a mathematical problem that the user needs to solve, and the answer information is the final mathematical answer, the intermediate reasoning information can be the intermediate calculation process before obtaining the mathematical answer. When the problem information is an image uploaded by the user that needs to be recognized, and the answer information is the recognition result of the image, the intermediate reasoning information can be the analysis process of the content in the image.

[0051] 4) A reasoning tree is a tree-like structure used to represent the logical reasoning process. It can clearly show the reasoning path from the question information to the final answer information through nodes and branches.

[0052] 5) Validation results refer to data used to characterize the accuracy of intermediate inference information. For example, a validation result can be a binary label (e.g., 'correct' / 'incorrect') or a confidence score representing the probability of being correct.

[0053] 6) The target reasoning path refers to a path that starts from the root node representing the question information and eventually reaches a leaf node representing the correct answer information. This path can consist of a series of completely correct intermediate reasoning steps, or it can contain at least one erroneous reasoning step that has been successfully corrected and its subsequent correct reasoning steps.

[0054] 7) Information processing model refers to a large language model that has been trained and has the ability to self-verify and correct errors in real time during the reasoning process. Its core feature is that it can evaluate the accuracy of a series of intermediate reasoning information one by one or in batches during the generation of the series of intermediate reasoning information, and actively correct errors when they are found, rather than waiting until the entire reasoning is completed.

[0055] With the development of large language models, more and more users are choosing to use them to solve their problems. However, some large language models directly output the corresponding answer to the user's question. For example, Figure 1 illustrates how a large language model processes a user's question. As can be seen from Figure 1, the large language model, i.e., model 1-1, directly outputs answer 1-3 for the user's input question 1-2, lacking intermediate reasoning information. This makes it difficult for the user to understand how the answer information was generated. Other large language models may generate incorrect intermediate reasoning information, leading to incorrect answer information and causing inconvenience to the user.

[0056] To address the aforementioned issues, where large language models directly output answers without corresponding intermediate reasoning information, a related technology can guide the large language model through multi-step reasoning using a chain of thought, thereby generating intermediate reasoning information. The chain of thought is a method to enhance the reasoning ability of large language models by guiding them to gradually demonstrate the reasoning process, enabling them to output corresponding intermediate reasoning information based on the question information. However, this method requires manual tuning of the prompt words for the large language model, consuming considerable time to enable it to output intermediate reasoning information for the user's question. Furthermore, it is difficult to correct errors in the output intermediate reasoning information, leading to incorrect answers. The prompt word is a piece of text input into the large language model to provide contextual information, thereby guiding the model's output.

[0057] Regarding the issue of errors in the intermediate reasoning information generated by the large language model, leading to an incorrect final answer, related technologies can feed back the incorrect answer output by the large language model. For example, Figure 2 illustrates the processing of a user's question by the large language model. As shown in Figure 2, although model 2-1 can output 2-3 containing multiple intermediate derivations and an incorrect answer (i.e., circles marked with ×) for the user's input question 2-2, and although the developers can feed back the incorrect output to the large language model 2-1 after the reasoning is complete to guide the large language model to reason again, resulting in output 2-4 containing multiple intermediate derivations and the correct answer (i.e., circles marked with √), this method can only correct the incorrect answer obtained from the previous reasoning to arrive at the correct answer. It cannot detect and correct errors in time during the reasoning process to obtain the correct answer.

[0058] In summary, the relevant technologies suffer from the problem that large language models cannot detect and correct errors in the reasoning process in a timely manner, resulting in low error correction efficiency in the intermediate reasoning process. Ultimately, this leads to low efficiency in generating the correct answer to the question and high resource consumption.

[0059] This application provides an information processing method, apparatus, electronic device, computer-readable storage medium, and computer program product, which can improve the efficiency of generating correct answers to questions and reduce resource consumption. The following describes exemplary applications of the electronic device provided in this application. The electronic device provided in this application can be implemented as various types of terminals such as laptops, tablets, and desktop computers, or as a server. The following will describe exemplary applications when the electronic device is implemented as a server.

[0060] Referring to Figure 3, which is a schematic diagram of the architecture of the information processing system provided in this embodiment, to support an information processing application, in the information processing system 100, a terminal 400 (terminals 400-1 and 400-2 are shown as examples) connects to a server 200 via a network 300. The network 300 can be a wide area network (WAN), a local area network (LAN), or a combination of both. It should be noted that the information processing system 100 may also include a database 500 to provide data support to the server 200. The database 500 can be independent of the server 200 or configured within the server 200. Figure 3 shows the case where the database 500 is independent of the server 200.

[0061] Terminal 400 is used to respond to user input operations in the information input interface displayed in the graphical interface (graphical interfaces 400-11 and 400-21 are shown as examples), obtain problem information, and send the problem information to server 200 through network 300.

[0062] Server 200 is used to generate intermediate reasoning information for the problem information, wherein the intermediate reasoning information refers to information describing the logical reasoning process when solving the problem information; to verify the accuracy of the intermediate reasoning information and obtain the corresponding verification result; and when the verification result indicates that there is an error in the intermediate reasoning information, to correct the intermediate reasoning information and obtain the corrected reasoning information; to determine the answer information for the problem information based on the corrected reasoning information; and to send the intermediate reasoning information, the corrected reasoning information, and the answer information to terminal 400.

[0063] Terminal 400 is also used to display intermediate reasoning information, error-corrected reasoning information, and answer information in a graphical interface (i.e., graphical interface 400-11 and graphical interface 400-21 mentioned above).

[0064] In some embodiments, the terminal 400 is configured to respond to a user's input operation in the information input interface displayed on the graphical interface (graphical interfaces 400-11 and 400-21 are exemplarily shown), obtain question information, generate intermediate reasoning information for the question information, wherein the intermediate reasoning information refers to information describing the logical reasoning process of solving the question information; perform accuracy verification on the intermediate reasoning information to obtain the corresponding verification result, and when the verification result indicates that there is an error in the intermediate reasoning information, correct the intermediate reasoning information to obtain corrected reasoning information; determine the answer information of the question information based on the corrected reasoning information; and finally display the intermediate reasoning information, the corrected reasoning information, and the answer information in the graphical interface (i.e., the graphical interfaces 400-11 and 400-21 mentioned above).

[0065] The information processing method provided in this application is applicable to interactive question-and-answer or computational scenarios that require complex, multi-step reasoning to solve problems. This solution not only provides a final answer but also transparently displays the entire thought process (intermediate reasoning information) to the user and can self-detect and correct errors in this process. For example, it could be the following scenario:

[0066] 1) Online Education and Tutoring: Terminal 400 receives a complex math, physics, or logic problem input by a student through a graphical interface as problem information and sends it to server 200. Upon receiving the problem information, server 200 generates each step of the solution (intermediate reasoning) and initiates accuracy verification. For example, if formulas are confused or the calculation order is incorrect in a calculation step, the verification module detects the error, and server 200 corrects that step, generating a correct reasoning process. Finally, server 200 sends the incorrect approach (intermediate reasoning information), the correct approach (corrected reasoning information), and the final answer together to terminal 400, and displays a comparison of these two processes on the graphical interface, greatly helping students understand where they went wrong and what the correct solution is.

[0067] 2) Code Generation and Debugging: Terminal 400 receives the developer's code functional requirements (e.g., "Write a function in Python to merge two sorted lists") input into the graphical interface, as problem information, and sends this information to server 200. Upon receiving the problem information, server 200 generates preliminary code (intermediate inference) and initiates accuracy verification. For example, if the generated code contains syntax errors or logical flaws, the verification module will detect the errors, and server 200 will correct the code, generating correct and executable code. Finally, server 200 sends the erroneous preliminary code (i.e., intermediate inference information), the corrected code (i.e., inference information after correction), and the final usable function to terminal 400, and displays a comparison of the code before and after correction on the graphical interface to help developers quickly understand and use the correct code.

[0068] 3) Complex Decision Support System: Terminal 400 receives decision-making questions (e.g., "Based on last quarter's sales data and market trends, which product should we focus on promoting next quarter?") input by senior executives through a graphical interface, and sends this information to server 200. Upon receiving the question information, server 200 performs preliminary business analysis (intermediate inference) and initiates accuracy verification. For example, if outdated data is incorrectly cited in the preliminary analysis, the verification module (e.g., data source verification module) will detect the error, and server 200 will correct it by re-analyzing with the latest data to generate a reasoning process based on correct information. Finally, server 200 sends the preliminary analysis based on erroneous data (i.e., intermediate inference information), the final analysis based on correct data (i.e., corrected inference information), and the final decision recommendation to terminal 400, displaying them on the graphical interface. This allows decision-makers to clearly see the entire analysis process and gain greater confidence in the origins of their decisions.

[0069] 4) Legal or Medical Consultation: Terminal 400 receives a legal or medical consultation question entered by the user in the graphical interface as question information and sends it to server 200. Upon receiving the question information, server 200 performs logical reasoning based on its built-in professional knowledge base, lists the analysis steps (intermediate reasoning), and initiates accuracy verification. For example, in legal consultation, if the initial reasoning cites legal provisions that are not applicable to the user's region, the verification module will detect the error, and server 200 will correct it, replacing it with the correct, localized provisions, generating a new reasoning process. Finally, server 200 sends the initial analysis (including the incorrect citation, i.e., intermediate reasoning information), the corrected rigorous analysis (i.e., the corrected reasoning information), and the final consultation answer to terminal 400, which is clearly displayed on the graphical interface, thus providing users with more accurate and reliable consultation results.

[0070] In some embodiments, server 200 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. Terminals and servers can be connected directly or indirectly via wired or wireless communication, which is not limited in this embodiment.

[0071] Referring to Figure 4, which is a schematic diagram of the server (an embodiment of an electronic device) shown in Figure 3 according to an embodiment of this application, the server 200 shown in Figure 4 includes: at least one processor 210, a memory 250, and at least one network interface 220. The various components in the server 200 are coupled together via a bus system 240. It is understood that the bus system 240 is used to implement communication between these components. In addition to a data bus, the bus system 240 also includes a power bus, a control bus, and a status signal bus. However, for clarity, all buses are labeled as bus system 240 in Figure 4.

[0072] The processor 210 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.

[0073] The memory 250 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state storage, hard disk drives, optical disk drives, etc. The memory 250 may optionally include one or more storage devices physically located away from the processor 210.

[0074] The memory 250 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), and the volatile memory may be random access memory (RAM). The memory 250 described in this application embodiment is intended to include any suitable type of memory.

[0075] In some embodiments, memory 250 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or subsets or supersets thereof, as illustrated below.

[0076] Operating system 251 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic business functions and handling hardware-based tasks;

[0077] The network communication module 252 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 220, exemplary network interfaces 220 including: Bluetooth, WiFi, and Universal Serial Bus (USB), etc.

[0078] In some embodiments, the information processing apparatus provided in this application can be implemented in software. Figure 4 shows an information processing apparatus 255 stored in memory 250, which can be software in the form of programs and plug-ins, including the following software modules: reasoning generation module 2551, reasoning verification module 2552, information error correction module 2553, answer generation model 2554, and model training module 2555. These modules are logically related, and therefore can be arbitrarily combined or further divided according to the functions they implement. The functions of each module will be described below.

[0079] In other embodiments, the information processing apparatus provided in this application can be implemented in hardware. As an example, the information processing apparatus provided in this application can be a processor in the form of a hardware decoding processor, which is programmed to execute the information processing method provided in this application. For example, the processor in the form of a hardware decoding processor can be one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.

[0080] In some embodiments, a terminal or server (both possible implementations of electronic devices) can implement the information processing method provided in the embodiments of this application by running various computer-executable instructions or computer programs. For example, computer-executable instructions can be microprogram-level commands, machine instructions, or software instructions. Computer programs can be native programs or software modules in an operating system; they can be native applications (APPs), i.e., programs that need to be installed in the operating system to run, such as educational APPs; or they can be applets that can be embedded in any APP, i.e., programs that only need to be downloaded to a browser environment to run. In summary, the aforementioned computer-executable instructions can be any form of instruction, and the aforementioned computer programs can be any form of application, module, or plugin.

[0081] The information processing method provided in this application will be described below with reference to exemplary applications and implementations of the electronic device provided in the embodiments of this application. As mentioned above, the electronic device implementing the information processing method of the embodiments of this application can be a terminal, a server, or a combination of both. Therefore, the executing entity of each step will not be described again below.

[0082] Referring to Figure 5, which is a flowchart of the information processing method provided in the embodiment of this application, the steps shown in Figure 5 will be described in conjunction with the steps shown in Figure 5. The main body of the steps in Figure 5 is an electronic device.

[0083] Step 101: Generate intermediate reasoning information based on the problem information.

[0084] Here, problem information refers to the raw data that a user inputs into an electronic device, representing the user's needs or the task to be solved. Problem information can be text data in natural language form, such as the stem of a math word problem or a piece of code to be debugged; problem information can also be image data containing text, such as a photograph of a handwritten equation.

[0085] This application embodiment is implemented in the scenario of answering user questions, such as answering users' mathematical questions or questions about scientific concepts. In this application embodiment, the electronic device first understands and analyzes the user's question information to determine the semantics of the question information, clarify the user's intention expressed through the question information, and extract the contextual information of the question information, etc. After completing the understanding and analysis of the user's question information, the electronic device associates the question information with known knowledge or contextual information, and generates intermediate reasoning information based on the known knowledge or contextual information. Here, contextual information refers to background knowledge or prior interaction data associated with the question information that helps to understand or solve the problem information. Contextual information may include the constraints implicit in the question information itself, the history of multi-turn dialogues, and relevant domain knowledge (such as mathematical axioms and programming syntax rules) retrieved by the electronic device from an internal knowledge base or external database.

[0086] In some embodiments, step 101 can be implemented as follows: First, a preset word segmenter is activated to segment the textual question information into serialized discrete tokens according to preset word segmentation rules. Then, these discrete tokens are input into the embedding layer, and each token is converted into a corresponding high-dimensional vector representation through a lookup table mapping method. These high-dimensional vector representations not only encode the semantic identity of the token itself, but also typically incorporate positional encoding to preserve the temporal information of the token in the sequence. Based on this, a self-attention mechanism is used to calculate the interaction weights between high-dimensional vector representations at different positions in the sequence, and contextual information is fused through weighted aggregation, so that the updated high-dimensional vector representation can accurately reflect the deep semantic intent of the question information in a specific context. After clarifying the semantics of the question information based on the high-dimensional vector representation, this semantic representation is used as an index to perform a relevance search in an internal knowledge base or external database, recalling background support data matching the question information. This background support data is also converted into a high-dimensional vector sequence and concatenated or fused with the high-dimensional vector sequence of the question information to construct an enhanced input representation containing rich prior knowledge. Subsequently, this enhanced input representation is imported into the decoder of the information processing model. The decoder employs an autoregressive generation method, predicting and outputting the lexical units constituting the intermediate inference information one by one based on the current input probability distribution. This generation process is performed step by step, with each step relying on the question information and the previously generated intermediate inference information, until a complete logical node is completed or a preset stopping condition is met, thus obtaining the intermediate inference information.

[0087] It's important to clarify that intermediate reasoning information refers to information describing the logical reasoning process during problem-solving. It refers to the intermediate data generated by an electronic device during the generation of the final answer, reflecting the logical deduction chain and providing an explicit description of the specific thought process involved in solving the problem. Unlike the final conclusion, intermediate reasoning information demonstrates "how the conclusion was reached." For example, when the problem is a mathematical problem, the intermediate reasoning information is the derivation process of the answer, i.e., the intermediate problem-solving steps; when the problem is a programming problem, the intermediate reasoning information is the implementation logic or technical details of each step of the algorithm.

[0088] In this embodiment, the intermediate inference information may include a single inference step or multiple inference steps. That is, in this embodiment, the electronic device may generate intermediate inference information with only a single inference step for the problem information, or it may generate intermediate inference information with multiple inference steps for the problem information.

[0089] In some embodiments of this application, step 101 in Figure 5, namely generating intermediate reasoning information for the problem information, can be achieved through the following process: generating intermediate reasoning information for the problem information through an information processing model.

[0090] It should be noted that the information processing model here refers to the Large Language Model (LLM) in this embodiment, which has the ability to verify the accuracy of intermediate inference information and to correct errors in the intermediate inference information. In other words, in this embodiment, the electronic device can first generate corresponding intermediate inference information for the problem information using the information processing model, and then use the same information processing model to verify the accuracy and correct errors in the intermediate inference information. The information processing model can be implemented as any large language model, such as a large model based on a Transformer model; this embodiment does not limit its implementation.

[0091] In some embodiments, the information processing model may be trained by: acquiring sample problem information, erroneous sample intermediate inference information corresponding to the sample problem information, and correct sample intermediate inference information corresponding to the sample problem information; predicting the sample problem information using an initialized information processing model to obtain predicted sample intermediate inference information; correcting the erroneous sample intermediate inference information using an initialized information processing model to obtain predicted corrected intermediate inference information; determining a loss value based on a first difference between the predicted sample intermediate inference information and the correct sample intermediate inference information, and a second difference between the predicted corrected intermediate inference information and the correct sample intermediate inference information; and updating the initialized information processing model according to the loss value to obtain the trained information processing model.

[0092] In some other embodiments of this application, step 101 in FIG5, namely generating intermediate reasoning information for the problem information, can also be implemented by the following process: generating intermediate reasoning information for the problem information through a reasoning generation model.

[0093] In some embodiments, the inference generation model can be trained by: acquiring sample problem information and reference intermediate inference information corresponding to the sample problem information; predicting the sample problem information using the initialized inference generation model to obtain the predicted sample intermediate inference information; determining the loss value based on the difference between the predicted sample intermediate inference information and the reference intermediate inference information; updating the initialized information processing model according to the loss value to obtain the trained information processing model.

[0094] The reasoning generation model here refers to a large language model that only has the ability to generate intermediate reasoning information. Therefore, in this embodiment, the electronic device uses a large language model to generate intermediate reasoning information for the question information, and then uses another large language model, namely the information processing model, to verify the accuracy and correct errors of the generated intermediate reasoning information. The reasoning generation model here can also be implemented as any large language model, and this embodiment does not limit it.

[0095] As examples, the aforementioned information processing models and reasoning generation models can be generative variants of the Bidirectional Encoder Representations from Transformers (BERT), the Large Language Model Meta AI (LLaMA) series of models, the Text-to-Text Transfer Transformer (T5) model, etc.

[0096] Step 102: Verify the accuracy of the intermediate inference information and obtain the corresponding verification results.

[0097] After receiving intermediate inference information about a problem, the electronic device will verify the accuracy of the intermediate inference information to determine whether incorrect intermediate inference information has been generated for the problem information, thereby obtaining a verification result. The verification result is information that indicates whether there is an error in the intermediate inference information.

[0098] In some embodiments, accuracy verification of intermediate inference information to obtain the corresponding verification result can be achieved as follows: The information processing model is trained as a classifier, the intermediate inference information is used as input to the information processing model, and the output result can be a binary label of "correct" or "incorrect," which serves as the verification result. Specifically, a verification result of "correct" indicates that the intermediate inference information is error-free; a verification result of "incorrect" indicates that the intermediate inference information contains an error.

[0099] In other embodiments, accuracy verification of intermediate inference information to obtain the corresponding verification result can be achieved in the following way: the intermediate inference information is used as input to an information processing model, and the output of the information processing model can be a confidence score. When the confidence score is less than a preset confidence threshold, it indicates that the verification result is that the intermediate inference information contains errors; when the confidence score is greater than or equal to the preset confidence threshold, it indicates that the verification result is that the intermediate inference information does not contain errors.

[0100] Referring to Figure 6, which is a flowchart illustrating the information processing method provided in an embodiment of this application, in some embodiments of this application, step 102 in Figure 5, namely, verifying the accuracy of intermediate inference information to obtain the corresponding verification result, can be achieved through the following processing:

[0101] Step 1021: Using the information processing model, verify the accuracy of the intermediate inference information and obtain the verification result.

[0102] In other words, electronic devices can use a pre-trained information processing model to parse intermediate inference information to identify whether errors occur in the intermediate inference information, thereby verifying the accuracy of the intermediate inference information. When no errors occur in the intermediate inference information, i.e., the intermediate inference information is completely correct, a verification result indicating that there are no errors in the intermediate inference information is generated. When errors occur in the intermediate inference information, a verification result indicating that there are errors in the intermediate inference information is generated.

[0103] Step 103: When the verification result indicates that there is an error in the intermediate reasoning information, the intermediate reasoning information is corrected to obtain the corrected reasoning information.

[0104] When the verification result indicates an error in the intermediate inference information, the electronic device corrects the intermediate inference information to eliminate the error, thus obtaining corrected inference information. It should be noted that when the intermediate inference information includes a single inference step, the electronic device can correct only that inference step to obtain corrected inference information; when the intermediate inference information includes multiple inference steps, the electronic device can either correct only the erroneous inference steps to obtain corrected inference information, or it can regenerate entirely new inference steps to obtain corrected inference information.

[0105] As an example of error correction for a single reasoning step, the problem information is a simple arithmetic problem: "Calculate the result of (15+5)×3." The generated intermediate reasoning information (which contains an error) is "Step 1: First calculate the addition within the parentheses, 15+5=25." The accuracy of the generated intermediate reasoning information is verified, and "15+5=25" is found to be an incorrect calculation result. Therefore, the electronic device corrects Step 1 by re-executing the addition operation, resulting in the corrected reasoning information: "Step 1: First calculate the addition within the parentheses, 15+5=20."

[0106] As an example of error correction for multiple reasoning steps, the problem information is a logic puzzle: "Xiaoming is taller than Xiaohong, Xiaohong is taller than Xiaogang, who is the shortest?" The generated intermediate reasoning information (containing errors) is: "Reasoning 1: Based on 'Xiaoming is taller than Xiaohong,' the reasoning relationship is: Xiaoming > Xiaohong. Reasoning 2: Based on 'Xiaohong is taller than Xiaogang,' the reasoning relationship is: Xiaogang > Xiaohong (the logic is reversed here, containing errors). Reasoning 3: Combining the above relationships, the order is: Xiaoming > Xiaogang > Xiaohong." The accuracy of the generated intermediate reasoning information is verified. It is found that "Reasoning 2" contradicts the premise "Xiaohong is taller than Xiaogang," indicating a logical error. Therefore, the electronic device only locates "Reasoning 2," corrects it to a logical relationship consistent with the original problem, and updates the subsequent dependent "Reasoning 3" based on the corrected "Reasoning 2." The corrected reasoning information is as follows: "Reasoning 1: Based on 'Xiaoming is taller than Xiaohong,' the reasoning relationship is: Xiaoming > Xiaohong. Reasoning 2 (corrected): Based on 'Xiaohong is taller than Xiaogang,' the reasoning relationship is: Xiaohong > Xiaogang. Reasoning 3 (updated): Combining the above relationships, the order is: Xiaoming > Xiaohong > Xiaogang."

[0107] Referring again to Figure 6, in some embodiments of this application, step 103 in Figure 5, which involves correcting errors in the intermediate inference information when the verification result indicates that there are errors, to obtain corrected inference information, can be achieved through the following processing:

[0108] Step 1031: When the verification result indicates that there is an error in the intermediate reasoning information, the intermediate reasoning information is corrected through the information processing model to obtain the corrected reasoning information.

[0109] When an electronic device obtains a verification result indicating that there is an error in the intermediate inference information through the information processing model, the electronic device will immediately correct the intermediate inference information through the information processing model to obtain the corrected inference information.

[0110] It should be noted that the information processing model in this application embodiment acquires the ability to verify the accuracy of intermediate inference information and to correct errors in intermediate inference information through training, and the training process will be described in detail below.

[0111] Step 104: Based on the reasoning information after error correction, determine the answer information for the question.

[0112] After receiving the corrected reasoning information, the electronic device will continue to reason based on the corrected reasoning information until it obtains the final answer to the question information. This final answer is the answer information corresponding to the question information.

[0113] Continuing with the example of correcting a single reasoning step, based on the corrected reasoning information obtained in step 103, "Step 1: First calculate the addition within the parentheses, 15 + 5 = 20.", the electronic device continues to execute subsequent calculation logic based on the correctness of Step 1, generating a new reasoning step: "Step 2: Multiply the result of Step 1 by 3, i.e., 20 × 3.", calculating the result "60". At this point, the calculation process ends, and the electronic device determines the answer to the question "Calculate the result of (15 + 5) × 3" as "60".

[0114] Continuing with the example above of correcting multiple reasoning steps, based on the corrected reasoning information obtained in step 103, "Reasoning 1: Based on 'Xiaoming is taller than Xiaohong,' the reasoning relationship is: Xiaoming > Xiaohong. Reasoning 2: Based on 'Xiaohong is taller than Xiaogang,' the reasoning relationship is: Xiaohong > Xiaogang. Reasoning 3: Combining the above relationships, the order is: Xiaoming > Xiaohong > Xiaogang.", the electronic device extracts the final conclusion based on the complete and logically corrected reasoning chain. Analyzing the order "Xiaoming > Xiaohong > Xiaogang" in Reasoning 3, it identifies the entity at the end of the sequence representing "shortest" as "Xiaogang." Accordingly, the electronic device generates and determines the answer to the question "Who is the shortest?" as "Xiaogang."

[0115] It should be noted that electronic devices can use the aforementioned information processing model to continue reasoning based on the corrected inference information, thereby generating answer information. In this way, electronic devices only need one large language model to achieve the processes of generating intermediate inference information, verifying and correcting the accuracy of intermediate inference information, and generating answer information. Electronic devices can also use another large language model, i.e., another answer generation model, to process the corrected inference information to obtain the final answer information. Thus, electronic devices can determine the final answer information for the question information through the collaborative work of multiple large language models.

[0116] Understandably, compared to related technologies, large language models typically employ an "end-to-end" generation model. This means that after generating the complete reasoning chain from question information to the final answer in one go, the final result is verified using external tools or manually. However, due to the autoregressive generation characteristics of large language models, the subsequently generated lexical units are highly dependent on the preceding context. Since large language models cannot detect and correct errors during the reasoning process, if erroneous intermediate reasoning information is generated early in the reasoning process, the large language model will still continue to perform a large amount of subsequent reasoning calculations based on this erroneous context. This means that all subsequent generated content is actually built on logical fallacies or computational errors. Invalid information based on errors usually requires discarding the entire inference chain and retrying generation from scratch when the final verification reveals an error. This not only wastes significant computing resources but also significantly increases the time delay required to generate the correct answer, ultimately leading to low efficiency in generating the correct answer. In this embodiment, the electronic device first generates intermediate inference information based on the question information and immediately performs accuracy verification on the intermediate inference information to determine if there are any errors. If errors are found, the intermediate inference information is corrected. Thus, a real-time accuracy verification mechanism is introduced during the generation of intermediate inference information based on the question information. Once the verification result indicates that the currently generated intermediate inference information is incorrect, the electronic device immediately performs in-situ correction for the error. This processing method is equivalent to implementing "logic circuit breaking" and "instant correction" at the starting point of the error, effectively preventing the propagation and accumulation of errors to subsequent inference steps. By eliminating the possibility of invalid generation based on erroneous intermediate inference information, the electronic device avoids generating a large amount of useless redundant data and avoids having to completely overturn and start over due to incorrect results after the entire generation chain is completed. Therefore, the embodiments of this application can converge to the correct reasoning logic with minimal computational cost and the shortest time path, enabling the discovery and timely correction of errors during the reasoning process. This allows subsequent correct answer information to be generated directly based on the corrected reasoning information, thereby significantly improving the efficiency of generating the correct answer to the question.

[0117] It should be noted that the intermediate reasoning information generated by the electronic device in response to the question may not be erroneous, meaning that the generated intermediate reasoning information is correct. In this case, the electronic device will directly generate the subsequent answer information.

[0118] That is, in some embodiments of this application, after step 102 in Figure 5, that is, after verifying the accuracy of the intermediate inference information and obtaining the corresponding verification result, the method will also include the following processing: when the verification result indicates that there is no error in the intermediate inference information, the answer information of the question information is determined based on the intermediate inference information.

[0119] In other words, in this embodiment of the application, when the intermediate reasoning information is completely correct, the electronic device will directly perform further reasoning based on the generated intermediate reasoning information until the final answer information is determined for the question information.

[0120] As an example, the question is "Calculate the result of dividing 20 by 5 and then adding 3." The intermediate reasoning information is "Step 1: First calculate the division, 20 ÷ 5 = 4." The accuracy of the intermediate reasoning information is verified. The verification result indicates that "Step 1" is correct. Therefore, the electronic device continues to reason based on the intermediate reasoning information of Step 1, that is, "Step 2: Add 3 to the result of Step 1, that is, 4 + 3 = 7." Therefore, the final answer is "7".

[0121] In this embodiment, when the verification result indicates that there are no errors in the intermediate reasoning information, the inference is directly continued based on the intermediate reasoning information to determine the answer information, thus technically constructing a progressive generation mechanism based on "trust anchors." By confirming the correctness of intermediate nodes in real time during the reasoning process, it ensures that the contextual data input into the large language model for generating subsequent content is always logically rigorous and factually accurate. This mechanism effectively solves the technical problem in related technologies where minor, undetected errors in preceding steps are captured by the autoregressive mechanism of the large language model and used as the basis for subsequent generation, leading to the amplification and accumulation of logical fallacies in the long sequence generation, ultimately making the final generated answer completely unreliable. By ensuring that each step of reasoning is built on a solid and accurate preceding foundation, the logical consistency and high credibility of the final determined answer information are fundamentally guaranteed, achieving end-to-end accurate reasoning without error propagation.

[0122] In some embodiments, if the electronic device initially generates multiple intermediate inference information branches in parallel, and the verification result shows that only one branch has error-free intermediate inference information, the electronic device immediately triggers a pruning operation. The electronic device releases the computing resources (such as video memory) occupied by the other branches with errors and concentrates all computing power on the branch without errors. It continues to perform subsequent deep inference based solely on this verified correct path, thereby converting the breadth of parallel search into the speed of deep inference and quickly converging to the final answer information.

[0123] The training process of the information processing model mentioned above will be explained below.

[0124] Referring to Figure 7, which is a flowchart illustrating the information processing method provided in an embodiment of this application, in some embodiments of this application, before step 101 in Figure 6, i.e., before generating intermediate inference information for the problem information, the method further includes the following processing:

[0125] Step 105: Using the initial processing model, generate K first training inference information for the training question information, and determine K first training answer information for the training question information based on the K first training inference information.

[0126] The electronic device acquires an initial processing model and provides the training question information to it. The initial processing model then outputs K distinct intermediate inference information based on the training question information, which are recorded as the first training inference information. Subsequently, the electronic device continues to infer based on each of the first training inference information to obtain the corresponding answer information, thus generating K distinct answer information, which are recorded as the first training answer information. Here, K ≥ 2, and K is an integer. The electronic device can employ diverse sampling strategies (such as setting a non-zero temperature parameter or kernel sampling Top-P) to control the initial processing model to perform multiple independent parallel inferences on the same training question information, generating K distinct first training inference information, and subsequently generating K corresponding first training answer information.

[0127] As an example, the training question is "Xiaoming has 3 apples. His father gave him 2, and his mother took 1. How many apples does Xiaoming have now?" The standard answer is "4". The electronic device generates K=2 paths through the initial processing model. Path A (incorrect) is "First training inference information: Xiaoming originally had 3 apples, his father gave him 2, 3+2=5. His mother took 1, 5+1=6.", corresponding to "First training answer information: 6". Path B (correct) is "First training inference information: Xiaoming originally had 3 apples, his father gave him 2, 3+2=5. His mother took 1, 5-1=4.", corresponding to "First training answer information: 4".

[0128] Step 106: Based on the training question information, K first training inference information and K first training answer information, determine the first training dataset, and train the initial processing model based on the first training dataset to obtain the intermediate processing model.

[0129] The electronic device constructs a training dataset using the obtained K first training inference information, K first training answer information corresponding one-to-one with the K first training inference information, and the original training question information. This constructed dataset is denoted as the first training dataset. The first training dataset contains information describing the error correction process for erroneous first training inference information. Therefore, when constructing the first training dataset, the electronic device first needs to identify the erroneous first training inference information based on the K first training inference information and the K first training answer information, and then correct the erroneous first training inference information. Information reflecting this error correction process is added to the first training dataset. This ensures that the first training dataset includes erroneous inference information and its related error correction process information. Thus, the electronic device uses the first training dataset to train the initial processing model, enabling the initial processing model to learn the relevant knowledge of error recognition and correction.

[0130] Continuing with the example from step 105 above, the electronic device identifies that path A is incorrect (answer 6 is not equal to the standard answer 4). For path A, it constructs a training sample containing an error correction process: {Input (Prompt): "Question: Xiaoming has 3 apples. Dad gave him 2, and Mom took 1. How many apples does Xiaoming have now? Initial processing model answer: ...Mom took 1, 5+1=6.", Target (Target): "<Verification> Error detected. Mom taking one means the quantity decreases, so addition should not be done. <Correction> Corrected calculation: 5-1=4. Therefore, Xiaoming now has 4 apples." The electronic device adds the above training sample to the first training dataset and trains the initial processing model. Thus, the intermediate processing model, after training, can output the above verification and correction content when encountering logical errors such as "taking one but adding another" in subsequent iterations.}

[0131] It should be noted that the first training dataset may include not only information describing the error correction process for erroneous first training inference information, but also completely correct first training inference information and related information. Alternatively, the first training dataset may only include information describing the error correction process for erroneous first training inference information, allowing the electronic device to directly utilize this information as the first training dataset.

[0132] This application embodiment trains the initial processing model based on a first training dataset containing a description of the error correction process. Technically, this transforms the model from a "simple answer generator" to a "reflective inference engine," allowing the initial processing model to explicitly learn "what an error looks like" and the dynamic trajectory of "how to transition from an incorrect state to a correct state," rather than simply learning static correct answers. This solves the technical problems in related technologies where training data typically only contains correct samples, leading to the model's inability to self-recover once it goes astray in reasoning, and the lack of ability to discern erroneous logic. By transforming erroneous reasoning paths into error-correction teaching cases rich in supervisory signals, the robustness of the trained intermediate processing model in complex reasoning tasks is significantly enhanced. This allows it to mimic the human cognitive process of "discovering and correcting errors," thereby greatly improving the success rate of the intermediate processing model in generating correct answers in practical applications.

[0133] Referring to Figure 8, which is a flowchart illustrating the information processing method provided in an embodiment of this application, in some embodiments of this application, step 106 in Figure 7—that is, determining the first training dataset based on training question information, K first training inference information, and K first training answer information, and training the initial processing model based on the first training dataset to obtain an intermediate processing model—can be implemented through the following processing:

[0134] Step 1061: Based on the training question information, K first training inference information and K first training answer information, determine the first inference tree, and determine the first label information for the remaining nodes in the first inference tree except for the root node.

[0135] Here, the first reasoning tree refers to a data model that uses a hierarchical graph structure to represent multiple potential logical computation paths for a specific problem, used to structurally demonstrate the evolution process from problem input to different answer outputs. The first label information refers to the attribute values ​​assigned to nodes in the first reasoning tree through a verification mechanism, used to indicate whether the logical content or result carried by the node conforms to objective facts or expected standards.

[0136] When constructing the first training dataset, the electronic device first combines the training question information, K first training inference information generated based on the training question information, and K first training answer information to construct an inference tree, which is denoted as the first inference tree. Then, the electronic device generates labels for the remaining nodes in the first inference tree (excluding the root node), thus obtaining the first label information for the remaining nodes. The first inference tree is a tree structure used to represent the logical reasoning process based on the training question information. It clearly shows the reasoning path from the training question information to the final generated K first training answer information through nodes and branches. The root node in the first inference tree corresponds to the training question information. The remaining nodes can include at least one of leaf nodes and non-leaf nodes. Leaf nodes correspond to the first training answer information generated by the initial processing model, while non-leaf nodes correspond to the first training inference information generated by the initial processing model. Thus, the first label information of the remaining nodes is actually the label information characterizing whether the first training inference information and the first training answer information are incorrect.

[0137] It should be noted that the root node of the first reasoning tree is the node located at the top level of the first reasoning tree, which is the starting point of the first reasoning tree; the leaf node is the node in the first reasoning tree that has no child nodes, which is located at the end of the first reasoning tree and can be used as the end point of the first reasoning tree; the non-leaf node is the node in the first reasoning tree that has at least one child node, which is located in the middle part of the first reasoning tree and is used to connect the root node and the leaf node.

[0138] As an example, the training question is "If x + 2 = 5, then what is 2x equal to?". The electronic device generates two reasoning sequences: Sequence 1 contains the reasoning information "x = 3" and the answer "6"; Sequence 2 contains the reasoning information "x = 2" and the answer "4". In the constructed first reasoning tree, the root node "If x + 2 = 5, then what is 2x equal to?" connects to two non-leaf nodes. Non-leaf node A corresponds to "x = 3", and is connected to leaf node A with the answer "6". Non-leaf node B corresponds to "x = 2", and is connected to leaf node B with the answer "4". The electronic device verifies that Sequence 1 is correct and Sequence 2 is incorrect. It determines the first label information of non-leaf node A and leaf node A as "correct", and determines the first label information of non-leaf node B and leaf node B as "incorrect".

[0139] In some embodiments of this application, step 1061 in Figure 8, namely, determining a first inference tree based on training question information, K first training inference information, and K first training answer information, and determining first label information for the remaining nodes in the first inference tree excluding the root node, can be implemented through the following processing: generating K initial inference paths based on training question information, K first training inference information, and K first training answer information; constructing a first initial tree for training question text based on the K initial inference paths; expanding the first initial tree and determining the expanded result as the first inference tree for training question information; and determining first label information for the remaining nodes in the first inference tree based on the first training answer information corresponding to each leaf node of the first inference tree and the baseline answer information of the training question information.

[0140] The electronic device establishes a root node using training question information, non-leaf nodes using each first training inference piece of information, and leaf nodes using the first training answer information corresponding to each first training inference piece of information. The path formed by connecting the root node, non-leaf nodes, and leaf nodes is used as an initial inference path. After performing the above processing on K pieces of first training inference information and K pieces of first training answer information, K different initial inference paths are obtained. The electronic device can then integrate these K initial inference paths into a tree structure, which is the first initial tree. Next, the electronic device expands the first initial tree by increasing the number of non-leaf nodes and leaf nodes, and uses the expanded result as the first inference tree for the training question information. Of course, in other embodiments, the electronic device can also directly use the first initial tree as the first inference tree.

[0141] After obtaining the first inference tree, the electronic device acquires the baseline answer information of the training question information, that is, the standard answer information of the training question information. Then, it compares the first training answer information corresponding to each leaf node with the baseline answer information, and based on the comparison result, determines the corresponding first label information for the remaining nodes in the first inference tree, that is, all non-leaf nodes and leaf nodes.

[0142] As an example, the training problem is "Chickens and rabbits in a cage, 35 heads, 94 feet, find the number of chickens and rabbits." The baseline answer is "23 chickens, 12 rabbits." The initial processing model generates two initial inference paths. Path 1 includes non-leaf node A1 "Assuming all are chickens, there are 70 feet," non-leaf node A2 "24 extra feet, so there are 12 rabbits," and leaf node A "23 chickens, 12 rabbits." Path 2 includes non-leaf node B1 "Assuming 10 chickens, 20 feet," non-leaf node B2 "74 feet remaining, not divisible by 4," and leaf node B "No solution." The electronic device constructs the first initial tree. The electronic device detects the logical jump at non-leaf node A2, expands by inserting non-leaf node A1.5 "The actual number of feet is 24 more than assumed, each rabbit has 2 more feet than a chicken," generating the first inference tree. The comparison revealed that leaf node A matched the baseline answer. Therefore, the first label information for leaf node A and non-leaf nodes A1, A1.5, and A2 on the path was determined to be "no reasoning error". Since leaf node B did not match the baseline answer, the first label information for leaf node B and non-leaf nodes B1 and B2 was determined to be "reasoning error".

[0143] This application constructs a first inference tree based on the training question information and assigns first label information to the remaining nodes. By structurally integrating K independent initial inference paths into a tree topology sharing preorder logic, and assigning labels to the leaf nodes and upstream nodes in the tree structure based on the benchmark answer information, a hierarchical value assessment of the inference process is achieved. This approach solves the technical problem in related technologies where large language models focus only on the final output result and ignore the quality judgment of intermediate inference steps, making it difficult for large language models to distinguish whether errors originate from early logical deviations or final computational errors. By using the inference tree form, fine-grained supervision signals can be allocated to each level of inference nodes, enabling large language models to accurately learn which specific inference steps are effective, thereby significantly improving the ability of large language models to correctly select and value-judge intermediate processes in complex inference tasks.

[0144] In some embodiments, in the specific implementation of expanding the first initial tree, the electronic device can adopt a node splitting and completion strategy based on logical granularity. By performing semantic integrity analysis on the non-leaf nodes in the first initial tree, if a single non-leaf node is found to contain a logical jump with an excessively large span, a new non-leaf node is generated by inserting intermediate logical steps to increase the tree's hierarchical depth, ensuring that the derivation process between adjacent nodes in the first inference tree is smooth and verifiable. Simultaneously, the electronic device identifies the logical similarity between different branches of the first initial tree, merges and connects semantically similar non-leaf nodes, and optimizes the tree structure into a graph structure capable of aggregating statistical information, thus serving as the first inference tree. Regarding the determination of the first label information, a value allocation mechanism based on path backtracking can be introduced. First, the semantic matching degree between the first training answer information and the benchmark answer information corresponding to each leaf node is calculated to determine the correctness or incorrectness of the leaf node. Subsequently, the electronic device traverses backward from the leaf node to the root node according to logical dependencies. If a leaf node is correct, then the non-leaf nodes on the associated path are marked as correct; if a leaf node is incorrect, then by combining the labels of other parallel branches and using contribution analysis based on Shapley values, the specific non-leaf node that caused the error is located, and the location of the non-leaf node and the first label information of the subsequent non-leaf nodes are marked as indicating that a reasoning error has occurred, while the preceding common non-leaf nodes are marked as indicating that no reasoning error has occurred, thereby achieving accurate identification of logical breakpoints.

[0145] In some embodiments of this application, the remaining nodes include leaf nodes and non-leaf nodes. In this case, the determination of the first label information for the remaining nodes in the first inference tree based on the first training answer information corresponding to each leaf node of the first inference tree and the benchmark answer information of the training question information, as described above, can be achieved through the following process: comparing the first training answer information and the benchmark answer information corresponding to each leaf node, and generating the first label information for each leaf node based on the comparison result; determining the first label information for the non-leaf nodes based on the first label information of each leaf node.

[0146] Here, the benchmark answer information refers to the answer content that is pre-set for the training question information and regarded as the standard truth or correct reference, used as an objective basis for measuring the accuracy of the first training answer information.

[0147] The electronic device compares the first training answer information corresponding to each leaf node with the benchmark answer information to determine whether the first training answer information and the benchmark answer information are the same or sufficiently similar, i.e., whether the similarity reaches a similarity threshold. When the first training answer information and the benchmark answer information are the same, or the similarity reaches the similarity threshold, the electronic device generates first label information for the leaf node representing that there is no reasoning error. When the first training answer information and the benchmark answer information are different, or the similarity is less than the similarity threshold, the electronic device generates first label information for the leaf node representing that there is a reasoning error. In this way, the first label information for each leaf node can be determined. Then, the electronic device combines the first label information of all leaf nodes to analyze whether there is a reasoning error in the non-leaf nodes, thereby obtaining the first label information for each non-leaf node.

[0148] As an example, the training question is "Calculate the result of the expression 3 multiplied by (4 plus 5)". The baseline answer is "27". The first inference tree contains two branch paths. Path 1 contains a non-leaf node X1 that "first calculates the addition within the parentheses, 4 plus 5 equals 9", and its child node is a leaf node Y1 that "then calculates 3 multiplied by 9, the result is 27". Path 2 contains a non-leaf node X2 that "first expands using the distributive law, 3 multiplied by 4 equals 12", and its child node is a leaf node Y2 that "then adds 5, the result is 17". The electronic device compares the first training answer "27" corresponding to leaf node Y1 with the baseline answer, determines they are the same, and generates a first label indicating no inference error. It then compares the first training answer "17" corresponding to leaf node Y2 with the baseline answer, determines they are different, and generates a first label indicating an inference error. Subsequently, based on the correct label of leaf node Y1, the electronic device backtracks upwards to confirm that the first label of non-leaf node X1 indicates no inference error. Based on the erroneous label of leaf node Y2, the electronic device confirms the first label information of non-leaf node X2 as a representation of a reasoning error.

[0149] In some embodiments, the similarity between the first training answer information and the benchmark answer information can be determined as follows: First, the first training answer information and the benchmark answer information are encoded respectively to obtain a first feature vector corresponding to the first training answer information and a second feature vector corresponding to the benchmark answer information. Then, the similarity between the first feature vector and the second feature vector is determined as the similarity between the first training answer information and the benchmark answer information. The similarity between the first feature vector and the second feature vector can be determined using any of the following algorithms: cosine similarity, Euclidean distance, Manhattan distance, or Pearson correlation coefficient.

[0150] As an example, taking Euclidean distance, if the first eigenvector is (x1, y1) and the second eigenvector is (x2, y2), the distance between the first eigenvector and the second eigenvector is determined as follows: The similarity is calculated using the following method: Taking cosine similarity as an example, if the first eigenvector is m and the second eigenvector of the second vertex is n, determine the vector product of the first and second eigenvectors, the product of the lengths of the first and second eigenvectors, and the ratio of the vector product to the length product. This ratio is used as the similarity score. For example, if the vector product of the first and second eigenvectors is m*n, the length of the first eigenvector is |m|, the length of the second eigenvector is |n|, and the length product is |m|*|n|, then the similarity score is (m*n) / (|m|*|n|).

[0151] This application's embodiments construct a bottom-up value feedback and attribution mechanism by first comparing the first training answer information with the benchmark answer information to generate the first label information of the leaf nodes, and then determining the first label information of the non-leaf nodes based on the results of the leaf nodes. This processing method can effectively transmit the correctness of the final answer to the non-leaf nodes corresponding to the preceding intermediate reasoning steps that produced the result within the complex structure of the first inference tree. Technically, this solves the problem in related technologies where it is difficult to accurately assess the contribution of intermediate steps to the final result for long-chain reasoning tasks, leading to large language models being unable to identify and strengthen key correct steps or suppress early erroneous steps. Through this result-based global label allocation, precise supervision of every minute link in the inference chain is achieved, providing a reliable quantitative basis for subsequent selection of high-quality training data.

[0152] In some embodiments, determining the first label information of non-leaf nodes based on the first label information of each leaf node as described above can be achieved through the following process: determining descendant nodes for each non-leaf node from the leaf nodes, and using the first label information of the descendant nodes to represent descendant nodes that have not made inference errors, thus determining the correct descendant nodes for each non-leaf node; determining the inference accuracy of each non-leaf node by the ratio of the number of correct descendant nodes to the number of descendant nodes; and determining the first label information of each non-leaf node based on the inference accuracy and accuracy threshold of each non-leaf node.

[0153] In other words, the electronic device first determines the descendant nodes of each non-leaf node from all leaf nodes in the first inference tree. From each non-leaf node's descendant nodes, it extracts the first label information representing the descendant nodes that did not exhibit inference errors (i.e., the correct descendant nodes). It then counts the number of all descendant nodes and the correct descendant nodes. Since the inference direction in the first inference tree is step-by-step downwards (from non-leaf nodes to leaf nodes), the higher the probability that a non-leaf node did not exhibit inference errors, the higher the probability that its descendant nodes are correct. Therefore, the electronic device can infer the accuracy of non-leaf nodes by using the proportion of correct descendant nodes among all descendant nodes. Thus, after determining all descendant nodes and correct descendant nodes for non-leaf nodes, the electronic device uses the number of correct descendant nodes and the total number of descendant nodes to calculate the inference accuracy of each non-leaf node. Finally, the electronic device compares the inference accuracy of each non-leaf node with the accuracy threshold. When the inference accuracy of a non-leaf node is greater than or equal to the accuracy threshold, a first label is generated for that non-leaf node, indicating that no inference error has occurred. When the inference accuracy of a non-leaf node is less than the accuracy threshold, a first label is generated for that non-leaf node, indicating that an inference error has occurred. In this way, the first label information for each non-leaf node can be obtained.

[0154] As an example, the training question is "Calculate the value of 6 ÷ 2 + 1", the baseline answer is "4", and the accuracy threshold is 0.6. The first inference tree contains non-leaf nodes A and B. Non-leaf node A represents "First calculate the division, 6 divided by 2 equals 3", and has three descendant nodes: leaf nodes A1, A2, and A3. The first training answer for leaf node A1 is "Add 1, the result is 4"; the first training answer for leaf node A2 is "Add 1, the result is 4"; and the first training answer for leaf node A3 is "Add 1, the calculation is incorrect, the result is 5". Non-leaf node B represents "First calculate the addition, 2 plus 1 equals 3", and has two descendant nodes: leaf nodes B1 and B2. The first training answer for leaf node B1 is "Then divide 6 by 3, the result is 2"; and the first training answer for leaf node B2 is "Then divide 6 by 3, the calculation is incorrect, the result is 3".

[0155] The electronic device compares the first training answer information corresponding to leaf nodes A1 and A2 with the baseline answer information "4". If they are the same, it generates a first label indicating that no reasoning error has occurred, and identifies leaf nodes A1 and A2 as correct descendant nodes. The electronic device then compares the first training answer information corresponding to leaf nodes A3, B1, and B2 with the baseline answer information. If they are different, it generates a first label indicating that a reasoning error has occurred. For non-leaf node A, the number of descendant nodes is 3, and the number of correct descendant nodes is 2. The electronic device calculates the reasoning accuracy of non-leaf node A as 2 divided by 3, which is approximately 0.67. Since 0.67 is greater than the accuracy threshold of 0.6, the electronic device determines that the first label information for non-leaf node A indicates that no reasoning error has occurred.

[0156] It should be noted that descendant nodes of non-leaf nodes can include leaf nodes that have a non-leaf node as their parent node, as well as leaf nodes that are indirectly connected to non-leaf nodes, meaning that a non-leaf node can only be reached through another node. For example, if non-leaf node A has a child node B, non-leaf node B has a child node C, and non-leaf node A has another child node D, then leaf node C and leaf node D are both descendant nodes of non-leaf node A.

[0157] The accuracy threshold mentioned above can be set according to the actual situation, for example, set to 0.5 or 0.6. This application embodiment does not limit it here.

[0158] This application's embodiments calculate the inference accuracy of non-leaf nodes by statistically analyzing the proportion of nodes in descendant nodes whose first label information represents no inference errors. The first label information is then determined in conjunction with an accuracy threshold, technically introducing a statistical probability-based intermediate state evaluation mechanism. This approach leverages the structural characteristics of the first inference tree, transforming the evaluation of the dependency on intermediate steps from a single-path, accidental verification to a statistical verification based on multiple evolutionary paths. This effectively solves the technical problem in related technologies where the quality evaluation of corresponding intermediate inference steps often relies on the final result of a single generation, easily leading to misjudgments of correct preceding steps due to random errors in subsequent steps, or missed judgments of erroneous preceding steps due to luck, resulting in high noise in the training data labels. By quantifying inference accuracy, the objectivity and accuracy of value judgments on the intermediate inference logic represented by non-leaf nodes are significantly improved.

[0159] Step 1062: Based on the first label information of the remaining nodes, determine the target reasoning path from the first reasoning tree.

[0160] After generating the first label information for the remaining nodes, i.e., the leaf nodes and non-leaf nodes in the first reasoning tree, the electronic device combines the generated first label information to extract the completely correct reasoning paths in the first reasoning tree. These are the reasoning paths where the first label information for both non-leaf and leaf nodes indicates no reasoning error, as well as the reasoning paths where reasoning errors occurred and were corrected to arrive at the correct answer. The extracted reasoning paths are then used as the target reasoning paths. Thus, the resulting target reasoning paths include both correct reasoning paths and reasoning paths where reasoning errors occurred and were corrected.

[0161] It should be noted that a reasoning path is a path that starts at the root node and ends at a leaf node. Whether it's a completely correct reasoning path or a reasoning path that encounters and corrects errors to arrive at the correct answer, it always ends at a correct leaf node. Therefore, the target reasoning path can also be seen as a reasoning path that starts at the root node and ends at a leaf node whose first label information indicates no errors. The process of determining the target reasoning path is explained below.

[0162] In some embodiments of this application, step 1062 in Figure 8, namely determining the target reasoning path from the first reasoning tree based on the first label information of the remaining nodes, can be implemented by the following processing: performing the following processing by iterating i, where i is a positive integer: determining the target node of the i-th hop from the remaining nodes based on the first label information of the starting node of the i-th hop; when i = 1, the starting node of the i-th hop is a non-leaf node among the remaining nodes with the root node as its parent node; when i > 1, the starting node of the i-th hop is the target node of the (i-1)-th hop; when the target node of the i-th hop is a leaf node, stopping the iteration of i, and determining the target reasoning path based on the target node of the previous I hops, the starting node of the first hop, and the root node, where I is the value of i when the target node is a leaf node.

[0163] In other words, in this embodiment, a child node of the root node is used as the starting node of the first hop. Based on the first label information of that child node, the target node of the first hop is determined from the first inference tree. Then, the target node of the first hop is used as the starting node of the second hop, and the process is repeated in a similar manner until a leaf node is reached. At this point, the iteration stops, and the target node of each previous hop, the starting node of the first hop, and the root node are connected to obtain the target inference path. The reason for using a child node of the root node as the starting node of the first hop is that the root node corresponds to the training question information, but it does not have specific first label information. Therefore, it is impossible to determine the node to be reached, i.e., the target node, based on the first label information. However, the child nodes of the root node are either non-leaf nodes or leaf nodes, and they have corresponding first label information. Thus, the target node to be reached can be determined based on the first label information. Therefore, the electronic device starts with any child node of the root node to begin node traversal in order to search for nodes in the first inference tree that can form the target inference path.

[0164] As an example, the training problem information is "Solve the equation 3x + 5 = 11". The structure of the first inference tree is as follows: {Root node: "Solve the equation 3x + 5 = 11". Non-leaf node A (child node of the root node): "Subtract 5 from both sides of the equation to get 3x = 6", the first label information is "No inference error found". Non-leaf node B (child node of the root node): "Add 5 to both sides of the equation to get 3x = 16", the first label information is "Inference error found". The child nodes of non-leaf node A include leaf nodes A1 and A2. Leaf node A1: "Divide both sides by 3 to get x = 2", the first label information is "No inference error found". Leaf node A2: "Divide both sides by 3 to get x = 3", the first label information is "Inference error found".}. Then when i = 1, non-leaf node A is selected as the starting node of the first hop, and the first label information of non-leaf node A indicates that no inference error has occurred. Searching among the child nodes (leaf nodes A1 and A2) of non-leaf node A, it is found that the first label information of leaf node A1 does not contain any reasoning errors. Therefore, leaf node A1 is determined to be the target node for the first hop. At this point, leaf node A1 is determined to be a leaf node, satisfying the stopping condition. The iteration stops, and I = 1. Then, the root node, the first hop starting node (non-leaf node A), and the first hop target node (leaf node A1) are connected. The target reasoning path is determined as: "Solve the equation 3x + 5 = 11", "Subtract 5 from both sides of the equation to get 3x = 6", "Divide both sides by 3 to get x = 2". Here, for non-leaf node B, because its label is incorrect or its child nodes cannot form a complete and correct link, no target reasoning path is generated.

[0165] This application embodiment, through iteration i and hopping hop by hop based on the first label information of the starting node, determines the target node until reaching the leaf node, technically realizing a directional search mechanism for extracting high-quality linear sequences from a tree structure. This processing method utilizes the first label information as a navigation instruction for path selection, enabling precise locking within the multi-branched structure of the first inference tree and reconstructing a complete logical flow with high confidence or specific error-correction features from beginning to end. This effectively solves the technical problem in related technologies where, during the construction of training data for complex inference tasks, the lack of fine-grained screening of intermediate inference steps leads to incoherent logic in the extracted training samples or the inclusion of a large amount of noisy data. Through this layer-by-layer progressive path construction, it ensures that the determined target inference path possesses a complete logical closed loop from the root node to the leaf node, providing high-value serialized input for subsequent model training.

[0166] In some embodiments, determining the target node of the i-th hop from the remaining nodes based on the first label information of the starting node of the i-th hop can be achieved through the following processing: when the first label information of the starting node of the i-th hop indicates that the starting node of the i-th hop has no reasoning error, the target node of the i-th hop is determined from the child nodes of the starting node of the i-th hop from the remaining nodes; when the first label information of the starting node of the i-th hop indicates that the starting node of the i-th hop has a reasoning error, the target node of the i-th hop is determined from the sibling nodes of the starting node of the i-th hop from the remaining nodes.

[0167] Here, sibling nodes refer to two or more nodes in a tree data structure that share the same direct parent node. They are located at the same level of the tree and represent different parallel branches derived from the parent node.

[0168] The electronic device parses the first label information of the starting node for each hop to determine if there is a reasoning error at that node. If the first label information indicates that the node is logically correct (no reasoning error), the electronic device traverses downwards along the tree structure, obtaining all direct child nodes of the starting node, and selecting child nodes whose first label information also indicates no reasoning error, designating them as the target node for the i-th hop. If the first label information indicates that the node has a logical error (reasoning error), the electronic device stops descending along that branch and backtracks to the parent node of the starting node, obtaining other child nodes besides the starting node as sibling nodes. The electronic device traverses these sibling nodes, selecting those whose first label information indicates no reasoning error, designating them as the corrected target node for the i-th hop (or re-evaluating them as a new starting node). If all child nodes or sibling nodes indicate reasoning error, the path search terminates.

[0169] As an example, the training question is "Calculate 20 + (8 ÷ 2)". The first reasoning tree hierarchy is: {Root node: "Calculate 20 + (8 ÷ 2)". Non-leaf node A (child of the root): "Calculate 20 + 8 = 28 first", first label: "Reasoning error occurred". Non-leaf node B (child of the root, sibling of A): "Calculate 8 ÷ 2 = 4 first", first label: "No reasoning error occurred". Non-leaf node B's child nodes include leaf node B1: "Calculate 20 + 4 = 24 next", first label: "No reasoning error occurred".}. If the initial path search incorrectly selects non-leaf node A as the starting node for the first hop, then when i = 1, the starting node is non-leaf node A. The electronic device checks the first label information and finds that it indicates "Reasoning error occurred". At this point, the electronic device abandons searching from the child nodes of non-leaf node A and instead obtains the sibling node of non-leaf node A, identifying the sibling node as non-leaf node B. Then, the first label information of non-leaf node B is checked. If the label indicates "no reasoning error," then non-leaf node B is identified as the (corrected) target node for the first hop. When i = 2, the previous hop target node B becomes the new starting node. B's label is checked and found to be "correct" (confirmed). Searching among the child nodes of non-leaf node B, the first label information of child node leaf node B1, indicating "no reasoning error," is identified. The electronic device then identifies leaf node B1 as the target node for the second hop. Since leaf node B1 is a leaf node, the iteration stops. The corrected target reasoning path is: root - non-leaf node B - leaf node B1.

[0170] This application's embodiments construct a target reasoning path with real-time error correction capabilities by selecting child nodes to extend the logical depth when the first label information representation of the starting node does not indicate a reasoning error, and selecting sibling nodes to find the correct alternative when a reasoning error occurs. This node selection strategy organically combines correct subsequent derivations with lateral corrections for errors, enabling the final determined target reasoning path to present a complete "trial-error-correction" thought process. This effectively solves the technical problem in related technologies where the training data construction method is singular, often directly discarding erroneous samples, making it difficult for the model to learn how to switch from erroneous branches back to the correct logical flow in specific reasoning steps. By utilizing sibling nodes for logical redirection, the training effect of the first training dataset on the model's self-correction ability is significantly enhanced.

[0171] Step 1063: Determine the first training dataset based on the target inference path.

[0172] After obtaining the target inference path, the electronic device can directly use the information corresponding to each node in the target inference path, such as the corresponding training question information, the first training inference information, and the first training answer information, to generate the first training dataset. Alternatively, it can generate corresponding prompt information based on the information corresponding to some nodes in the target inference path, such as incorrect first training inference information. It can also use the information corresponding to each node in the template inference path, the first label information of each node, and the generated prompt information to generate the first training dataset.

[0173] Here, the first training dataset refers to a collection of high-quality data samples that have undergone logical verification and screening, designed to supervise the fine-tuning or reinforcement training of the model through input-output pairs containing explicit reasoning steps. Hints refer to auxiliary instruction text constructed in natural language to guide the model to focus on specific logical paths, execute specific reasoning patterns, or avoid known errors. These can be used as part of the training input to enhance the model's contextual understanding of reasoning tasks.

[0174] As an example, the training problem information is "Solve the inequality 2x - 4 > 6". The target inference path includes: a root node, a non-leaf node A ("Add 4 to both sides to get 2x > 10"), and a leaf node B ("Divide both sides by 2 to get x > 5"). The electronic device extracts the above information and generates the first sample as: {Input: "Solve the inequality 2x - 4 > 6"; Output: "Step 1: Add 4 to both sides, rearrange terms to get 2x > 10. Step 2: Divide both sides by 2, the coefficient remains positive, the inequality sign remains unchanged, and we get x > 5."}. The generated second sample (with a hint) is: {Input: "Solve the inequality 2x - 4 > 6. Hint: Please carefully check the sign changes when rearranging terms."; Output: "Step 1: Add 4 to both sides to get 2x > 10. Step 2: Divide both sides by 2, the coefficient remains positive, the inequality sign remains unchanged, and we get x > 5."}. The electronic device stores these samples in the first training dataset.

[0175] In some embodiments, when determining the first training dataset, the electronic device may employ a multi-task hybrid construction strategy to enhance the model's general reasoning capabilities. The electronic device not only constructs supervised fine-tuning data in the standard "question-reasoning chain-answer" format, but also constructs preference-aligned data by leveraging the contrast between the target reasoning path and discarded erroneous paths in the first reasoning tree. The target reasoning path is labeled as a positive example, and sibling node paths at the same level, whose first label information represents reasoning errors, are labeled as negative examples, thereby generating contrast samples for training the reward model. Simultaneously, for each non-leaf node in the target reasoning path, the electronic device automatically generates reflective prompts (such as "Why perform this step?") using a large language model, and uses the content of subsequent nodes of that step as answers to the reflection, thus constructing "self-explanatory" type training samples. This extended approach transforms a single reasoning path into a multi-dimensional logical training signal, enhancing the model's self-detection capabilities regarding intermediate processes.

[0176] Step 1064: Train the initial processing model based on the first training dataset to obtain the intermediate processing model.

[0177] After obtaining the first training dataset, the electronic device will use the first training dataset to train the initial processing model. Through training, the model will learn relevant knowledge about error recognition and correction, thereby obtaining an intermediate processing model with a certain ability to recognize and correct errors.

[0178] In some embodiments of this application, the first training dataset includes: training question information, first training answer information that is correct for the training question information, and correct first training inference information. In this case, step 1064 in Figure 8, i.e., training the initial processing model based on the first training dataset to obtain the intermediate processing model, can be implemented by the following processing: performing the following processing through iteration j, where j is a positive integer: determining the target probability information of the iterative input model of the j-th iteration for outputting the correct first training answer information and the matching first training inference information for the training question information, and generating a first loss value based on the target probability information; wherein, when j=1, the input processing model of the j-th iteration is the initial processing model, and when j>1, the iterative input model of the j-th iteration is the iterative output model of the (j-1)-th iteration; adjusting the parameters of the iterative input model of the j-th iteration through the first loss value to obtain the iterative output model of the j-th iteration; when the iteration stopping condition is reached, the iterative output model of the J-th iteration is determined as the intermediate processing model, where J is the value of j when the iteration stopping condition is reached.

[0179] The electronic device first provides the training question information to the iterative input model of the j-th iteration. The iterative input model of the j-th iteration determines the output probability distribution for each training question in the first training dataset. This output probability distribution consists of the probability information of all possible outputs of the training question information. Among these outputs, there will be a target output that simultaneously includes the correct first training answer information for the training question information and the first training inference information that matches the correct first training answer information. The electronic device determines the probability information of obtaining the target output for the training question information from the output probability distribution. That is, the electronic device determines the probability information of obtaining the correct first training answer information and the matching first training inference information when a certain training question information is used as the input of the iterative input model of the j-th iteration, and uses this probability information as the target probability information.

[0180] Then, the electronic device can take the logarithm of the target probability information to obtain the logarithmic probability information. In this way, the logarithmic probability information of all training question information in the first training dataset can be obtained. Then, the mean of the logarithmic probability information of all training question information in the first training dataset is calculated, and the negative value of the mean calculation result is used as the first loss value. Of course, the electronic device can also directly accumulate the target probability information of all training question information and use the negative value of the accumulation result as the first loss value.

[0181] Next, the electronic device backpropagates the obtained first loss value into the iterative input model of the j-th iteration, thereby adjusting the parameters of the iterative input model of the j-th iteration. The purpose of parameter adjustment is to minimize subsequent loss values, thereby maximizing the mean of the aforementioned logarithmic probability information, or maximizing the accumulated result of the target probability information, thus maximizing the probability of generating the aforementioned target output for the training problem information. After completing the parameter adjustment of the iterative input model of the j-th iteration, the electronic device obtains the iterative output model of the j-th iteration. The electronic device continuously loops the above processing process, that is, iterates on j continuously until the iteration termination condition is reached, such as the total number of iterations reaching a threshold, or the first loss value during iteration being less than a corresponding threshold. At this point, the iteration on j stops, and the iterative output model of the last iteration, i.e., the j-th iteration, is used as the intermediate processing model. In this way, the electronic device completes the training of the initial processing model and obtains the intermediate processing model.

[0182] This application's embodiments technically construct a deep supervised fine-tuning mechanism based on maximum likelihood estimation by generating a first loss value based on target probability information and iteratively adjusting the parameters of the iterative input model. This approach uses a sequence containing correct first training answer information and matching first training inference information as a strong supervision signal. Gradient descent optimizes the model's parameter distribution, forcing the model to accurately fit the correct logical derivation path during the generation process by reducing the loss value. This effectively solves the technical problem in related technologies where large language models only learn the mapping relationship between input and output while ignoring the coherence of intermediate inference logic, leading to logical illusions or unexplainable problem-solving processes. Through continuous training until the iteration stopping condition is met, it ensures that the intermediate processing model can internalize the correct inference pattern into stable parameter weights, significantly improving the probability of generating high-quality inference content and accurate answers.

[0183] This application embodiment selects target reasoning paths from the first reasoning tree based on first label information, including both correct reasoning paths and those that have erroneous reasoning paths and have been corrected. A first training dataset is then constructed to train the initial processing model, technically achieving bidirectional reinforcement of correct logic generation and erroneous logic correction. This approach enables the intermediate processing model not only to directly generate correct results but, more importantly, to explicitly learn a dynamic strategy for identifying erroneous nodes and correcting them back to the correct logical path. This effectively solves the technical problem in related technologies where training samples typically only contain a single correct derivation demonstration, leading to a lack of error perception and self-correction mechanisms in large language models, resulting in incorrect final results once reasoning deviates. By integrating the training of error-correcting paths, the robustness and accuracy of the intermediate processing model in complex long-range reasoning tasks are significantly improved.

[0184] Step 107: Determine the information processing model based on the intermediate processing model and training problem information.

[0185] In this embodiment, the electronic device can employ at least one round of iterative training to enhance the error correction capability of the intermediate processing model, thereby obtaining a text processing model. Furthermore, during each round of iterative training, the electronic device can generate training data based on training question information for model training. The following explanation illustrates the generation process of the information processing model using a multi-round iterative training approach.

[0186] Referring to Figure 9, which is a flowchart illustrating the information processing method provided in an embodiment of this application, in some embodiments of this application, step 107 in Figure 7, namely determining the text processing model based on the intermediate processing model and training problem information, can be achieved through the following processing: performing the following processing through iteration t, where 1 ≤ t ≤ T, and T is the total number of iterations:

[0187] Step 1071: Using the training input model from the t-th training iteration, generate K second training inference information for the training question information, and based on the K second training inference information, determine K second training answer information for the training question information.

[0188] Here, the training input model refers to the neural network model deployed at the start of the current iteration (t-th iteration) to perform the inference generation task. In the first training iteration, it is usually a pre-trained base model or a seed model that has undergone initial fine-tuning; in subsequent iterations (t>1), the training input model is the model obtained after parameter updates and optimization in the previous iteration (t-1).

[0189] It should be noted that when t=1, the training input model for the t-th training iteration is an intermediate processing model; when t>1, the training input model for the t-th training iteration is the training output model for the (t-1)-th training iteration. That is, the training input model for the 1st training iteration is an intermediate processing model, the training input model for the 2nd training iteration is the training output model for the 1st training iteration, the training input model for the 3rd training iteration is the training output model for the 2nd training iteration, and so on.

[0190] In this embodiment, the electronic device generates an information processing model through T training iterations, i.e., T rounds of iterative training. For each training iteration in the T training iterations, i.e., the t-th iteration, the electronic device provides the training question information to its training input model for K inferences, thereby obtaining K different inference information and K different answer information. The generated inference information is recorded as the second training inference information, and the generated answer information is used as the second training answer information.

[0191] Step 1072: Based on the training question information, K second training inference information and K second training answer information, construct the second training dataset and the third training dataset.

[0192] After obtaining K pieces of second training inference information and K pieces of second training answer information, the electronic device will use the obtained information to construct the second training dataset and the third training dataset for the t-th training iteration. That is, in each round of iterative training, the electronic device will regenerate the corresponding training data based on the training question information.

[0193] It should be noted that the second training dataset is similar to the first training dataset, containing information describing the error correction process for erroneous second training inference information. The third training dataset, however, contains both correct second training answer information and its matching second training inference information, as well as incorrect second training answer information and incorrect second training inference information. Therefore, the second training dataset can be used to further enhance the model's ability to identify and correct errors, while the third training dataset can enhance the model's ability to distinguish the correctness of inference and answer information, thus helping the model generate correct answer information. The construction process of the second and third training datasets is explained below.

[0194] In some embodiments of this application, step 1072 in Figure 9, namely, constructing a second training dataset and a third training dataset based on training question information, K second training inference information, and K second training answer information, can be implemented through the following processing: using training question information, K second training inference information, and K second training answer information, determine a second inference tree for the training question information, and determine second label information for the remaining nodes in the second inference tree except for the root node; based on the second inference tree and the second label information, generate correct samples and incorrect samples; construct a second training dataset based on the correct samples, and construct a third training dataset based on the correct samples and incorrect samples.

[0195] It should be noted that the construction process of the second reasoning tree is similar to that of the first reasoning tree, and the determination process of the second label information is similar to that of the first label information, so they will not be repeated here.

[0196] After obtaining the second label information of the remaining nodes (non-leaf nodes and leaf nodes) in the second inference tree, the electronic device generates correct and incorrect samples for each training question based on the determined second inference tree and second label information. Next, the electronic device directly integrates the correct samples of all training questions into a single dataset to obtain the second training dataset. It then pairs the correct and incorrect samples of the same training question into a single dataset, thus obtaining the third training dataset.

[0197] This application's embodiments utilize training question information, second training inference information, and second training answer information to construct a second inference tree and determine second label information, thereby generating correct and incorrect samples. A second training dataset and a third training dataset are then constructed, technically achieving structured hierarchical transformation and multi-objective conversion of the generated data. This processing method, based on fine-grained node evaluation, transforms a single generated result into correct samples for positive reinforcement and combinations of positive and negative samples for contrastive learning or preference optimization. This effectively solves the technical problems in related technologies where training data often lacks high-quality negative sample comparisons, making it difficult for models to learn subtle logical errors and resulting in low data utilization. By specifically constructing dedicated datasets containing different logical features, valuable data support is provided for subsequent multi-task or multi-stage training to improve the model's inference accuracy and robustness.

[0198] In some embodiments, the remaining nodes include: non-leaf nodes and leaf nodes, so that the generation of correct samples and incorrect samples based on the second inference tree and the second label information described above can be achieved by the following process: extracting the second label information of the non-leaf nodes and the second label information of the leaf nodes from the second inference tree, both of which represent correct inference paths without inference errors; determining correct samples based on the correct inference paths; and determining incorrect samples based on other inference paths in the second inference tree besides the correct inference paths.

[0199] Here, a correct sample refers to a data unit containing training question information and a reasoning path that has been verified to be logically correct throughout, used to provide the model with positive examples to imitate. An incorrect sample refers to a data unit containing training question information and a reasoning path that has at least one logical error node or an incorrect final answer, used to provide the model with negative examples to avoid.

[0200] In other words, the electronic device takes the reasoning path in the second reasoning tree where both non-leaf nodes and leaf nodes are correct as the correct reasoning path. It then integrates the training question information, the second training reasoning information corresponding to the non-leaf nodes in the correct reasoning path, and the second training answer information corresponding to the leaf nodes in the correct reasoning path, in the order of question, reasoning, and answer, or in any other order, to obtain the correct sample. Next, the electronic device records the reasoning paths in the second reasoning tree other than the correct ones as other reasoning paths. It then integrates the training question information, the second training reasoning information corresponding to the non-leaf nodes in other reasoning paths, and the second training answer information corresponding to the leaf nodes in other reasoning paths, in the order of question, reasoning, and answer, or in any other order, to obtain the incorrect sample. That is, a correct sample is a sample where neither the second training reasoning information nor the second answer information contains an error, while an incorrect sample is a sample where either the second training reasoning information or the second answer information contains an error.

[0201] As an example, the training question is "Calculate 8 - 2 × 3". The second reasoning tree contains two paths. Path 1 includes non-leaf node A ("First calculate 2 × 3 = 6") and leaf node A1 ("Then calculate 8 - 6 = 2"). Path 2 includes non-leaf node B ("First calculate 8 - 2 = 6") and leaf node B1 ("Then calculate 6 × 3 = 18"). The electronic device detects that the second label information for both non-leaf node A and leaf node A1 is "No reasoning error found", thus determining Path 1 as the correct reasoning path and generating a correct sample: "Question: 8 - 2 × 3; Reasoning: First calculate 2 × 3 = 6, then calculate 8 - 6 = 2; Answer: 2". The electronic device detects that the second label information for non-leaf node B is "Reasoning error found", determining Path 2 as another reasoning path and generating an incorrect sample: "Question: 8 - 2 × 3; Reasoning: First calculate 8 - 2 = 6, then calculate 6 × 3 = 18; Answer: 18".

[0202] This application's embodiments technically construct a data cleaning and classification mechanism based on end-to-end logical consistency by rigorously selecting paths from the second inference tree where both the second label information of non-leaf nodes and the second label information of leaf nodes indicate no inference errors as correct inference paths, and treating the remaining paths as error samples. This processing method ensures that correct samples not only have correct results but also rigorous and error-free intermediate inference logic, while categorizing paths containing logical flaws or incorrect results as negative supervision signals. This effectively solves the technical problems in related technologies where selecting training data solely based on the correctness of the final answer leads to spurious relevance, resulting in the model learning "correct answers but incorrect inferences," and the lack of explicit negative examples to suppress logical illusions. Through this precise binary classification based on node label granularity, high-confidence positive samples and discriminative negative samples are provided for subsequent training, significantly improving the reliability and interpretability of the model's inference process.

[0203] Step 1073: Based on the second training dataset and the third training dataset, train the training input model for the t-th training to obtain the training output model for the t-th training.

[0204] After obtaining the second and third training datasets, the electronic device can train the input model for the t-th training iteration using both datasets separately to obtain the output model for the t-th training iteration. Alternatively, it can train the input model for the t-th training iteration using both datasets simultaneously to obtain the output model for the t-th training iteration. Simultaneous training using both datasets means providing both datasets to the input model for the t-th training iteration at the same time for model training.

[0205] In some embodiments of this application, step 1072 in Figure 9, namely, training the training input model of the t-th training iteration based on the second dataset and the third training dataset to obtain the training output model of the t-th training iteration, can be achieved through the following processing: performing the following processing through iteration n, where n is a positive integer: determining the second loss value based on the iterative input model of the n-th iteration and the second training dataset; wherein, when n=1, the input processing model of the n-th iteration is the training input model of the t-th training iteration, and when n>1, the iterative input model of the n-th iteration is... The iterative output model of the (n-1)th iteration; based on the iterative input model of the nth iteration, the third training dataset, and the training processing model of the (t-1)th training, the third loss value is determined; based on the second and third loss values, the fourth loss value is generated, and the parameters of the iterative input model of the nth iteration are adjusted based on the fourth loss value to obtain the iterative output model of the nth iteration; when the iteration stopping condition is reached, the iterative output processing model of the Nth iteration is determined as the training output model of the tth training, where N is the value of n when the iteration stopping condition is reached.

[0206] In other words, the t-th training iteration requires N iterations. During each iteration, the electronic device uses the iterative input model to process the second and third training datasets respectively, obtaining the second loss value for the second training dataset and the third loss value for the third training dataset. The largest of the second and third loss values ​​is then used as the fourth loss value, or the second and third loss values ​​are weighted and summed to obtain the fourth loss value. The electronic device then uses the fourth loss value to adjust the parameters of the iterative input model for each iteration, obtaining the iterative output model for each iteration after parameter adjustment, and begins the next iteration. This process repeats until an iteration stopping condition is met, such as when the number of iterations reaches a threshold, or when the fourth loss value is less than a corresponding threshold. The output model of the last iteration is then used as the training output model for the t-th training iteration, thus completing the t-th training iteration.

[0207] This application's embodiments technically construct a hybrid optimization mechanism that balances supervised enhancement and distribution constraints by combining a second loss value determined based on a second training dataset, a third loss value determined using a third training dataset and the training processing model from the (t-1)th training iteration as a reference, to generate a fourth loss value and adjust parameters. This approach utilizes the second loss value to ensure the model's ability to fit correct logic, while simultaneously introducing historical models as regularization constraints through the third loss value, effectively limiting the policy update magnitude when using the third training dataset for differentiated learning. This effectively solves the technical problem in related technologies where, during model iterative optimization, overfitting to new data or lack of distribution constraints can lead to catastrophic forgetting or policy collapse, thereby damaging existing inference capabilities. Through this multi-objective joint optimization, the training output model from the tth training iteration is ensured to maintain the stability of parameter distribution while improving inference performance.

[0208] It should be noted that the calculation process for the second loss value is similar to that for the first loss value, and will not be repeated here. The third loss value is obtained based on the logarithm of the probability ratio difference for each training question information. For example, the negative of the average of the logarithms of the probability ratio differences for all training question information can be used as the third loss value, or the negative of the sum of the probability ratio differences for all training question information can be used as the third loss value. Here, the probability ratio difference is calculated by taking the difference between the first and second probability ratios, and the hyperparameters used to control the deviation between the iterative input model in each iteration and the training output model in the previous training iteration. The first probability ratio is the ratio of the probability that the iterative input model in each iteration generates a correct output for the training question information to the probability that the training output model in the previous training iteration generates a correct output for the training question information, where correct output refers to the output content in the correct sample. The second probability ratio is the ratio of the probability that the iterative input model in each iteration generates an incorrect output for the training question to the probability that the training output model in the previous training iteration generates an incorrect output for the training question information, where incorrect output refers to the output content in the incorrect sample.

[0209] Step 1074: When t is iterated to T, the training output model of the Tth training is determined as the information processing model.

[0210] After completing T rounds of iterative training, the electronic device will use the training output model of the Tth training round as the information processing model. In this way, the information processing model is obtained, which can be used to process the user's question in subsequent practical applications to obtain the corresponding intermediate reasoning information and answer information.

[0211] This application's embodiments, through iteration t, utilize the training input model to exploratoryly generate training problem information, and update the training input model by constructing a second and third training dataset based on the generated results. Technically, this constructs a dynamic evolutionary closed loop based on a model self-reinforcing mechanism. This approach allows the training input model to sample data and correct parameters at the boundaries of its current inference ability in each iteration, thereby continuously accumulating high-quality inference patterns. This effectively solves the technical problems in related technologies where relying solely on statically distributed training data leads to models being unable to adapt to shifts in the generated distribution, and making it difficult to overcome performance bottlenecks in the absence of new external data. Through multiple rounds of iterative optimization, the final determined information processing model converges to a better parameter space, significantly improving the inference depth and answer accuracy for complex problems.

[0212] In summary, this application's embodiments generate intermediate inference information based on the problem information and immediately verify the accuracy of this intermediate inference information to determine if errors exist. When errors are identified, the intermediate inference information is corrected. This allows for the timely detection and correction of errors during the reasoning process. This "process detection" mechanism identifies errors at their initial stage and immediately corrects them once an error is confirmed. This immediate intervention mechanism effectively implements "early pruning" of erroneous inference branches, avoiding the continuation of numerous invalid inference calculations within the erroneous context. This reduces the "trial and error cost" and "invalid computational overhead" on erroneous paths, enabling faster convergence to the correct inference path. Consequently, the correct answer information can be directly generated based on the corrected inference information, significantly shortening the overall correct answer generation time, improving the efficiency of correct answer generation, and reducing resource consumption.

[0213] The following will describe an exemplary application of the embodiments of this application in a real-world application scenario.

[0214] This application embodiment is implemented based on a large language model for solving input problems in educational applications. In this embodiment, it can identify erroneous intermediate steps in the reasoning process of the input problem, correct these erroneous steps in a timely manner, and then continue with subsequent reasoning.

[0215] Figure 10 is a schematic diagram of the self-correction of the large language model for the input problem provided in the embodiment of this application. Referring to Figure 10, in the embodiment of this application, the large language model 10-2 can perform multi-step reasoning for the input problem 10-1 to obtain the corresponding output text 10-3. The output text includes multiple intermediate problem-solving steps and can correct erroneous problem-solving steps 10-4 for subsequent processing.

[0216] The following example, using a mathematical problem as the input, illustrates the process.

[0217] Figure 11 is a schematic diagram of the process of solving specific mathematical problems based on a large language model according to an embodiment of this application. Referring to Figure 11, the large language model 11-2 (referred to as the information processing model) generates multiple intermediate problem-solving steps (referred to as intermediate reasoning information) for the input problem (referred to as problem information) 11-1, namely problem-solving steps 11-3 to 11-7. Among them, an error occurred in problem-solving step 11-4. The large language model 11-2 can identify the error in the problem-solving step in time and correct the error, thereby obtaining the correct problem-solving step 11-4 again, and continuing to generate problem-solving steps 11-5 and 11-7 until the end.

[0218] It should be noted that in this embodiment, a large language model capable of identifying and correcting errors generates solution steps for mathematical problems, and identifies and corrects erroneous solution steps. The large language model can achieve this capability through optimization of its multi-step reasoning error correction capabilities, which will be explained below.

[0219] The training process of a large language model can be summarized as follows: given an initial model M0 and a seed dataset D... train ={(x i ,y i )} i∈[1,N] , where x i This represents the input mathematical problem, y. i This represents the correct answer, and y i This only includes the final answer, excluding the reasoning process. N represents the number of samples in the seed dataset. In this embodiment, the seed dataset is used to train the model's multi-step reasoning ability, and to correct errors when errors occur in the reasoning steps. The final model is designed for r. j Output reasoning process r j And the final answer y i And when the reasoning process r j When errors occur, they can be corrected promptly.

[0220] Figure 12 is a schematic diagram illustrating the implementation process of optimizing the error correction capability of a large language model in multi-step inference according to an embodiment of this application. Referring to Figure 12, the optimization process of this embodiment can be divided into two stages: the first stage 12-1 is used for initial training of the error correction capability of the large language model, and the second stage 12-2 is used to further enhance the error correction capability of the large language model. In the first stage 12-1, the initial model M0 (referred to as the initial processing model) generates inference processes and results based on the seed dataset, and constructs an inference tree (referred to as the first inference tree) based on the inference processes and results. Then, the correctness of each inference step in the inference tree is judged to obtain a correctness label. Then, through inference tree search, an inference process dataset containing step error correction is constructed (referred to as the first training dataset), and the initial model M0 is trained using this dataset to obtain model M′0 (referred to as the intermediate processing model). In the second stage 12-2, the error correction capability is enhanced through T iterations of optimization. It first uses the model M0 from the (t-1)th iteration... t-1 Using the seed dataset (called the training input model for the t-th training iteration) and an error correction dataset (called the second training dataset) and a preference dataset (called the second training dataset), the model is trained based on the constructed error correction dataset and preference dataset to obtain the model M for the t-th iteration. t (This is called the training output model of the t-th training iteration). The model M′0 obtained in the first stage can be used to train model M... t-1 Perform initialization.

[0221] The following is an explanation of the first stage of the processing.

[0222] In this embodiment of the application, regarding the input question x i (Referred to as training input information), the model will perform k inferences (k≥2), thus obtaining k inference processes (referred to as first training inference information) and corresponding answers (referred to as first training answer information), and from question x... i The k reasoning processes and answers constitute a reasoning tree T. i (This is called the first initial tree.)

[0223] For example, Figure 13 is a schematic diagram of a reasoning tree provided in an embodiment of this application. Referring to Figure 13, k=3, a reasoning tree 13-1 with 3 reasoning processes and their answers can be obtained. The reasoning tree 13-1 has 3 levels, and each solid circle represents a node. The root node 13-11 represents the question x. i Leaf nodes 13-12 represent problem x i The answer is the intermediate node (called the non-leaf node) located between the root node 13-11 and the leaf node 13-12, which represents the intermediate reasoning process.

[0224] The server obtains the reasoning tree T.i Then, we will continue to perform k-1 more inferences on all intermediate nodes, thereby completing the reasoning of the reasoning tree T. i The expansion. For example, Figure 14 is a schematic diagram of the expansion process of the reasoning tree provided in the embodiment of this application. Referring to Figure 14, the intermediate nodes of the first and second layers are reasoned twice to obtain new nodes. The new nodes are represented by dashed circles in Figure 14.

[0225] After the above processing, a reasoning tree T′ is obtained. i (This is called the first reasoning tree). Assume T′ i The m-th layer from top to bottom, and the n-th node from left to right, are represented as follows: So starting from the root node Starting from the top, select the next hop node from top to bottom until a leaf node is reached. This will yield a reasoning path, which is the solution to problem x. i One possible solution is the leftmost path in Figure 14. This constitutes a reasoning path. Since each node in the reasoning tree is derived from the node of the previous hop, and each reasoning step in the reasoning path is also derived from the reasoning of the previous step, the logic between adjacent reasoning steps is coherent, and thus the logic of the entire reasoning path is also coherent. The server can traverse the reasoning tree starting from the root node and obtain multiple reasoning paths, thus solving the problem x. i Multiple potential solutions exist. Training the model using these inference paths can improve its reasoning ability. However, since these inference paths may contain incorrect reasoning steps or answers, directly using this data for model training will affect the model's performance. Therefore, the server needs to further identify and correct the erroneous steps in the inference paths to obtain the correct inference paths.

[0226] In the above inference tree T′ i In the process, by comparing the leaf nodes with the answer labels, the correctness label (called the first label information) of each leaf node can be obtained. The correctness label is used to indicate whether the node is correct or incorrect, that is, whether there is a reasoning error. Correct is represented by 1 and incorrect is represented by 0. Then, based on the labels of the leaf nodes, the correctness labels of non-leaf nodes, that is, intermediate nodes, are determined.

[0227] Using the reasoning tree T′ i Nodes in Let's take an example to illustrate the process of determining the correctness label of a node. Assume a node... There is a q-branch path that leads to a leaf node, meaning there are q ways to achieve the final result, and p of these paths lead to the correct answer. Therefore, the node... The accuracy rate (called reasoning accuracy) can be calculated using equation (1):

[0228] in, Represents a node The accuracy of p can be determined by comparing the final answer with the answer label (called the baseline answer information). Thus, the meaning of formula (1) is that since the model reasoning direction is step by step downward, when the accuracy of the previous step is high, the accuracy of the subsequent result is also high. Therefore, the accuracy of the previous step can be inferred from the accuracy of the subsequent result.

[0229] For example, Figure 15 is a schematic diagram of determining the correctness of non-leaf nodes according to an embodiment of this application. Taking the nodes in Figure 15 with m=1 and n=0 as an example... The nodes under this node are Further reasoning yields a node with 5 leaf nodes. Three circles filled with dots represent correct leaf nodes, and two circles filled with diagonal lines represent incorrect leaf nodes. Thus, the node... The total number of solutions, q, is 5, and the number of correct solutions, p, is 3. Therefore, the node... The accuracy rate is Following the same logic, we can calculate separately and Their respective accuracy rates, i.e. and

[0230] After that, the server can determine the node accuracy Determine the correctness label of the node. Its determination process can be expressed as shown in equation (2):

[0231] Based on equation (2), we can determine respectively The correctness labels are correct, correct, incorrect, and correct.

[0232] After obtaining the correctness labels of all nodes, the server can perform a depth-first search traversal of the reasoning tree T′ starting from the root node. i By traversing the nodes in the tree until leaf nodes are reached, multiple reasoning paths can be obtained. Depth-first search is an algorithm for traversing tree structures or graphs. Its traversal strategy involves going as deep as possible into a branch until no further progress is possible, then backtracking to the nearest node and continuing the search for the next branch.

[0233] To ensure that all traversed reasoning paths yield correct results, this embodiment employs a traversal-backtracking method for continuous trial and error. Specifically, when an incorrect node is encountered, the process backtracks to the parent node of the incorrect node and continues traversing downwards until the correct leaf node is encountered. More specifically, the process involves traversing from the root node downwards until a correct node is encountered. Then, the process continues traversing the next hop node (called the target node of the i-th hop). When an incorrect node is encountered, the process backtracks to the previous hop node (called the starting node of the i-th hop) and searches for the correct node among the sibling nodes of the previous hop node. This process continues until the correct leaf node is reached.

[0234] It should be noted that in the embodiments of this application, multiple errors are allowed in a single step, multiple searches for the correct node are allowed in the child nodes of the same parent node, and multiple errors are allowed in multiple steps. That is, it is allowed to encounter and correct erroneous nodes at multiple levels. Whenever an erroneous node is encountered, it is necessary to backtrack to the parent node to correct the error. If an erroneous step is corrected, the next step needs to be performed, but it is not allowed to change a step from correct to erroneous.

[0235] For example, Figure 16 is a schematic diagram of the reasoning path determination process provided in an embodiment of this application. The nodes in Figure 16 and All are incorrect nodes; if starting from the root node... By starting the traversal, we can obtain a reasoning path where both the steps and the final answer are correct. This results in a reasoning path that does not include an error correction process. Of course, starting from the root node... Starting the traversal, another reasoning path can be obtained. Among them, The error node needs to be traced back to... parent node Then continue traversing downwards to reach the node. Due to the node If the node is correct, continue traversing downwards until the correct leaf node is found. This yields a reasoning path that includes step-by-step error correction.

[0236] Then, the server can select the reasoning path that ultimately yields the correct answer from the multiple reasoning paths it has traversed, thereby constructing dataset D. c (Referred to as the first training dataset), this dataset can contain not only inference paths where all steps are error-free, but also inference paths where errors occur and are corrected. In this way, the model can be trained to detect and correct errors using this dataset.

[0237] Dataset D is constructed based on the reasoning path that ultimately yields the correct answer. c At that time, the server can add a correctness label for each inference step after each inference step, for example, for the inference path. In this way, the reasoning path can be... Convert to sample in, This indicates the specific content of the reasoning step. Of course, in addition to adding correctness labels for steps, the server can also add error correction messages for steps that encounter errors, such as "The current step may contain an error; the error needs to be corrected, and the current step should be regenerated." Error correction messages can be represented by "I," thus based on the aforementioned reasoning path... Samples can be obtained In this way, dataset D can be completed. c The construction of.

[0238] Then, dataset D can be used. c The self-correction ability of the training model can be expressed by the loss function as shown in equation (3):

[0239] Where M0 represents the initial model, M θ M represents the model obtained in the current iteration during the training process (called the iterative output model of the j-th iteration), with an initial state of M0. After training is completed, it becomes M′0. θ (·) indicates that the model M is based on the current iteration. θ The obtained output probability distribution, (x i ,r i ,y i ) is the dataset D c A sample, x i The input question is represented by r, which is the root node of the reasoning tree; i This represents a reasoning process, consisting of multiple reasoning steps, y i This represents the final answer, i.e., a leaf node of the reasoning tree, and thus, logM θ (r i ,y i |x i ) represents model M θ Given input x i Next prediction target (r) i ,y i The logarithmic probability of M is given by M, where L0 represents the loss function. The training objective is to minimize the loss function L0, indicating that model M is optimal. θ Given x i This makes it possible for the target (r) to be lowered.i ,y i The predicted probability should be as accurate as possible.

[0240] The second stage of the process is described below. In this stage, the server employs an iterative optimization method, utilizing the data generated by the model itself to improve the model's error correction capabilities.

[0241] For the t-th iteration (called the t-th training), the server obtains the model through the (t-1)-th iteration. (referred to as the training input model for the t-th training iteration), for the seed dataset D train Problem x i Process to generate k outputs, i.e. in, This represents the reasoning process in the k-th output, i.e., the reasoning path. Let represent the answer in the k-th output, t∈[1,T], where T is the number of iterations for model optimization. The initial state is M′0.

[0242] Afterwards, the server will respond according to question x. i Correctness label of the answer And the correctness label at the end of each step in the reasoning process, to determine whether the model is appropriate for problem x. i The output is determined only if the final answer and each step are correct. To be correct, that is, to determine. The correct sample is identified, and all other samples are identified as incorrect samples. An incorrect sample can be represented as... Next, the server will utilize all the correct samples. Constructing an error correction dataset The sample pairs formed by the correct and incorrect samples are then combined to create a preference dataset.

[0243] After constructing the error correction dataset and the preference dataset, the server can use these two datasets to optimize the model's self-correction capability. Since the error correction dataset contains samples that correct errors in the inference process, training the model using the error correction dataset can optimize the model's self-correction capability, and its loss function can be given by equation (4):

[0244] Among them, M θ This represents the model currently being trained, whose initial state is M. t-1 Thus, each iteration of the server is trained based on the model obtained in the previous iteration.

[0245] Server usage preference dataset Training the model enables it to distinguish whether the reasoning process and the final answer are correct. Its loss function can be expressed as equation (5):

[0246] in, Indicates a correct sample; Let σ represent erroneous samples, β be the sigmoid function, and β be a hyperparameter used to control model M. θ With model M t-1 The degree of deviation, It is the output of the model in the current iteration (called the iterative input model of the nth iteration). probability, It is the output of the model obtained from the (t-1)th training iteration (called the training output model of the tth training iteration). probability, The meaning and Similar meaning, Meaning and The meaning is similar. This represents the loss function, and the training objective is to minimize this value. Loss function As small as possible, indicating that model M θ Given input x i This will increase the correct output. Increase the predicted probability and reduce erroneous output. The ability to predict probabilities and train models to output correct processes and answers.

[0247] It should be noted that in the embodiments of this application, the error correction dataset is utilized simultaneously. and preference dataset Model training will be performed on the error correction dataset. and preference dataset This is also provided to the model for training, so the final loss during training can be expressed as equation (6):

[0248] Where λ1 is the loss function The weight hyperparameters, λ2 is the loss function. The weight hyperparameters can be set according to the actual situation.

[0249] When t reaches T, model M can be obtained. t This allows for iterative optimization.

[0250] In other words, the iterative optimization of the second-stage model can be:

[0251] In the first iteration, model M θ The initial value is model M′0 obtained from the first stage of processing. The server uses the dataset. and To train model M′0, and obtain model M1 after training is completed;

[0252] Second iteration: Model M θ The initial value is M1, and the server uses the dataset. and To train model M1, we obtain model M2 after training is complete.

[0253] ...

[0254] In the Tth iteration, model M θ The initial value is M T-1 The server uses the dataset and To train model M T-1 After training, model M is obtained. T After completing T iterations, the model will stop iterating.

[0255] At this point, the server has completed model training and obtained a large language model with the ability to identify and correct errors, so that it can solve mathematical problems input by users based on this large language model.

[0256] It is understood that in the embodiments of this application, user information, such as user question information and other related data, is involved. When the embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with relevant laws, regulations and standards.

[0257] The following continues to describe an exemplary structure of the information processing device 255 provided in this application embodiment as a software module. In some embodiments, as shown in FIG4, the software module stored in the information processing device 255 in the memory 250 may include:

[0258] The reasoning generation module 2551 is configured to generate intermediate reasoning information for the problem information; wherein, the intermediate reasoning information refers to information describing the logical reasoning process when solving the problem information;

[0259] The inference verification module 2552 is configured to perform accuracy verification on intermediate inference information and obtain the corresponding verification result.

[0260] The information correction module 2553 is configured to correct the intermediate inference information when the verification result indicates that there is an error in the intermediate inference information, and obtain the corrected inference information.

[0261] The answer generation model 2554 is configured to determine the answer information based on the reasoning information after error correction.

[0262] In the above scheme, the answer generation model 2554 is also configured to determine the answer information of the question information based on the intermediate reasoning information when the verification result indicates that there are no errors in the intermediate reasoning information.

[0263] In the above scheme, the inference verification module 2552 is also configured to perform accuracy verification on the intermediate inference information through the information processing model and obtain the verification result;

[0264] The information correction module 2553 is also configured to correct the intermediate inference information through an information processing model when the verification result indicates that there is an error in the intermediate inference information, so as to obtain the corrected inference information.

[0265] In the above scheme, the information processing device 255 further includes: a model training module 2555, configured to generate K first training inference information for the training question information through an initial processing model, and determine K first training answer information for the training question information based on the K first training inference information; wherein K≥2, and K is an integer; determine a first training dataset based on the training question information, the K first training inference information and the K first training answer information, and train the initial processing model based on the first training dataset to obtain an intermediate processing model; wherein the first training dataset contains information describing the error correction process of the erroneous first training inference information; and determine an information processing model based on the intermediate processing model and the training question information.

[0266] In the above scheme, the model training module 2555 is further configured to determine a first inference tree based on training question information, K first training inference information, and K first training answer information, and determine first label information for the remaining nodes in the first inference tree excluding the root node; determine a target inference path from the first inference tree based on the first label information of the remaining nodes; wherein, the target inference path includes a correct inference path and an inference path that has an inference error and has completed error correction; determine a first training dataset based on the target inference path; and train an initial processing model based on the first training dataset to obtain an intermediate processing model.

[0267] In the above scheme, the model training module 2555 is further configured to generate K initial inference paths based on training question information, K first training inference information and K first training answer information; construct a first initial tree for the training question text based on the K initial inference paths; expand the first initial tree and determine the expansion result as the first inference tree for the training question information; and determine the first label information for the remaining nodes in the first inference tree based on the first training answer information corresponding to each leaf node of the first inference tree and the baseline answer information of the training question information.

[0268] In the above scheme, the remaining nodes include: leaf nodes and non-leaf nodes; the model training module 2555 is also configured to compare the first training answer information and the benchmark answer information corresponding to each leaf node, and generate the first label information of each leaf node according to the comparison result; and determine the first label information of the non-leaf nodes based on the first label information of each leaf node.

[0269] In the above scheme, the model training module 2555 is further configured to determine descendant nodes for each non-leaf node from the leaf nodes, and to characterize the descendant nodes that have not made inference errors with the first label information of the descendant nodes, thereby determining the correct descendant nodes for each non-leaf node; to determine the inference accuracy of each non-leaf node by the ratio of the number of correct descendant nodes to the number of descendant nodes; and to determine the first label information of each non-leaf node based on the inference accuracy and accuracy threshold of each non-leaf node.

[0270] In the above scheme, the model training module 2555 is also configured to perform the following processing through iteration i, where i is a positive integer; based on the first label information of the starting node of the i-th hop, determine the target node of the i-th hop from the remaining nodes; when i = 1, the starting node of the i-th hop is a non-leaf node among the remaining nodes whose parent node is the root node; when i > 1, the starting node of the i-th hop is the target node of the (i-1)-th hop; when the target node of the i-th hop is a leaf node, stop iterating on i, and determine the target inference path based on the target node of the previous I hops, the starting node of the first hop, and the root node, where I is the value of i when the target node is a leaf node.

[0271] In the above scheme, the model training module 2555 is further configured to determine the target node of the i-th hop from the child nodes of the i-th hop's starting node when the first label information of the i-th hop's starting node indicates that the i-th hop's starting node has no inference error; and to determine the target node of the i-th hop from the sibling nodes of the i-th hop's starting node from the remaining nodes when the first label information of the i-th hop's starting node indicates that the i-th hop's starting node has an inference error.

[0272] In the above scheme, the first training dataset includes: training question information, first training answer information that is correct for the training question information, and first training inference information that matches the correct first training answer information;

[0273] The model training module 2555 is also configured to perform the following processing through iteration j, where j is a positive integer: determine the target probability information of the first training answer information and the matching first training inference information that the iterative input model of the j-th iteration outputs for the training question information, and generate a first loss value based on the target probability information; wherein, when j=1, the input processing model of the j-th iteration is the initial processing model, and when j>1, the iterative input model of the j-th iteration is the iterative output model of the (j-1)-th iteration; adjust the parameters of the iterative input model of the j-th iteration using the first loss value to obtain the iterative output model of the j-th iteration; when the iteration stopping condition is reached, determine the iterative output model of the J-th iteration as the intermediate processing model, where J is the value of j when the iteration stopping condition is reached.

[0274] In the above scheme, the model training module 2555 is further configured to perform the following processing through iteration t, where 1≤t≤T, and T is the total number of iterations: Using the training input model from the t-th training iteration, K second training inference information are generated for the training question information, and based on the K second training inference information, K second training answer information is determined for the training question information; where, when t=1, the training input model from the t-th training iteration is an intermediate processing model, and when t>1, the training input model from the t-th training iteration is the training output model from the (t-1)-th training iteration; based on the training question information, the K second training inference information, and the K second training answer information, a second training dataset and a third training dataset are constructed; based on the second training dataset and the third training dataset, the training input model from the t-th training iteration is trained to obtain the training output model from the t-th training iteration; when t is iterated to T, the training output model from the T-th training iteration is determined as the information processing model.

[0275] In the above scheme, the model training module 2555 is further configured to use training question information, K second training inference information and K second training answer information to determine the second inference tree of training question information, and determine the second label information for the remaining nodes in the second inference tree except for the root node; generate correct samples and incorrect samples based on the second inference tree and the second label information; construct the second training dataset based on the correct samples, and construct the third training dataset based on the correct samples and the incorrect samples.

[0276] In the above scheme, the remaining nodes include: non-leaf nodes and leaf nodes; the model training module 2555 is also configured to extract the second label information of non-leaf nodes and the second label information of leaf nodes from the second inference tree, both of which represent the correct inference path without inference errors; based on the correct inference path, determine the correct sample; based on other inference paths in the second inference tree besides the correct inference path, determine the incorrect sample.

[0277] In the above scheme, the model training module 2555 is further configured to perform the following processing through iteration n, where n is a positive integer: Based on the iterative input model of the nth iteration and the second training dataset, determine the second loss value; where, when n=1, the input processing model of the nth iteration is the training input model of the tth training iteration, and when n>1, the iterative input model of the nth iteration is the iterative output model of the (n-1)th iteration; Based on the iterative input model of the nth iteration, the third training dataset, and the training processing model of the (t-1)th training iteration, determine the third loss value; Based on the second and third loss values, generate the fourth loss value, and adjust the parameters of the iterative input model of the nth iteration using the fourth loss value to obtain the iterative output model of the nth iteration; When the iteration stopping condition is reached, determine the iterative output processing model of the Nth iteration as the training output model of the tth training iteration, where N is the value of n when the iteration stopping condition is reached.

[0278] This application provides a computer program product, which includes a computer program or computer-executable instructions stored in a computer-readable storage medium. The processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the information processing method described in this application.

[0279] This application provides a computer-readable storage medium storing computer-executable instructions or computer programs. When the computer-executable instructions or computer programs are executed by a processor, the processor will execute the information processing method provided in this application, such as the information processing method shown in FIG3.

[0280] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of devices including one or any combination of the above-mentioned memories.

[0281] In some embodiments, computer-executable instructions may take the form of programs, software, software modules, scripts, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.

[0282] As an example, computer-executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple co-located files (e.g., files that store one or more modules, subroutines, or code sections).

[0283] As an example, computer-executable instructions can be deployed to execute on a single electronic device, or on multiple electronic devices located at one location, or on multiple electronic devices distributed across multiple locations and interconnected via a communication network.

[0284] In summary, through the embodiments of this application, intermediate inference information is generated for the problem information, and the accuracy of the intermediate inference information is immediately verified to determine whether there are any errors. When errors are found in the intermediate inference information, they are corrected. In this way, errors can be detected and corrected in a timely manner during the reasoning process. This "process detection" mechanism can identify errors at the initial stage of their occurrence. Once an error is determined, the intermediate inference information is corrected immediately. This real-time intervention mechanism effectively implements "early pruning" of erroneous inference branches, avoiding the continuation of a large amount of subsequent invalid reasoning calculations in the erroneous context. This reduces the "trial and error cost" and "invalid computation overhead" on the erroneous path, enabling faster convergence to the correct inference path. This allows the correct answer information to be generated directly based on the corrected inference information, significantly shortening the overall time for generating the correct answer, improving the efficiency of generating the correct answer to the problem, and reducing resource consumption.

[0285] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.

Claims

1. An information processing method, the method being executed by an electronic device, the method comprising: For the problem information, intermediate reasoning information is generated; wherein, the intermediate reasoning information refers to information describing the logical reasoning process when solving the problem information; The accuracy of the intermediate inference information is verified to obtain the corresponding verification result. When the verification result indicates that there is an error in the intermediate inference information, the intermediate inference information is corrected to obtain the corrected inference information. Based on the corrected reasoning information, the answer information for the question is determined.

2. The method according to claim 1, wherein, After verifying the accuracy of the intermediate inference information and obtaining the corresponding verification result, the method further includes: When the verification result indicates that there are no errors in the intermediate reasoning information, the answer information of the question information is determined based on the intermediate reasoning information.

3. The method according to claim 1 or 2, wherein, The accuracy verification of the intermediate inference information, to obtain the corresponding verification result, includes: The accuracy of the intermediate inference information is verified using an information processing model to obtain the verification result. When the verification result indicates that the intermediate inference information contains an error, the intermediate inference information is corrected to obtain corrected inference information, including: When the verification result indicates that there is an error in the intermediate inference information, the intermediate inference information is corrected through the information processing model to obtain the corrected inference information.

4. The method according to any one of claims 1 to 3, wherein, Before generating intermediate reasoning information based on the problem information, the method further includes: Through the initial processing model, K first training inference information are generated for the training question information, and K first training answer information for the training question information are determined based on the K first training inference information; where K≥2, and K is an integer; Based on the training question information, K first training inference information and K first training answer information, a first training dataset is determined, and the initial processing model is trained based on the first training dataset to obtain an intermediate processing model; wherein, the first training dataset contains information describing the error correction process for the erroneous first training inference information; Based on the intermediate processing model and the training problem information, the information processing model is determined.

5. The method according to claim 4, wherein, The step of determining a first training dataset based on the training question information, K first training inference pieces, and K first training answer pieces, and training the initial processing model based on the first training dataset to obtain an intermediate processing model includes: Based on the training question information, K first training inference information and K first training answer information, a first inference tree is determined, and first label information is determined for the remaining nodes in the first inference tree except for the root node. Based on the first label information of the remaining nodes, a target reasoning path is determined from the first reasoning tree; wherein, the target reasoning path includes a correct reasoning path and a reasoning path in which a reasoning error occurs and is corrected. Based on the target inference path, the first training dataset is determined; The initial processing model is trained based on the first training dataset to obtain the intermediate processing model.

6. The method according to claim 5, wherein, The step of determining a first inference tree based on the training question information, K first training inference information pieces, and K first training answer information pieces, and determining first label information for the remaining nodes in the first inference tree excluding the root node, includes: Based on the training question information, K first training inference information, and K first training answer information, K initial inference paths are generated; Based on the K initial inference paths, construct the first initial tree of the training question text; The first initial tree is expanded, and the expanded result is determined as the first inference tree for the training problem information; Based on the first training answer information corresponding to each leaf node of the first inference tree, and the baseline answer information of the training question information, the first label information is determined for the remaining nodes in the first inference tree.

7. The method according to claim 6, wherein, The remaining nodes include: leaf nodes and non-leaf nodes; determining the first label information for the remaining nodes in the first inference tree based on the first training answer information corresponding to each leaf node of the first inference tree and the baseline answer information of the training question information includes: The first training answer information and the benchmark answer information corresponding to each leaf node are compared, and the first label information of each leaf node is generated based on the comparison result. Based on the first label information of each leaf node, the first label information of the non-leaf nodes is determined.

8. The method according to claim 7, wherein, Determining the first label information of the non-leaf nodes based on the first label information of each leaf node includes: From the leaf nodes, for each non-leaf node, a descendant node is determined, and the first label information in the descendant node represents the descendant node that has not made a reasoning error, thus determining the correct descendant node for each non-leaf node; The ratio of the number of correct descendant nodes to the total number of descendant nodes is used to determine the inference accuracy for each non-leaf node. The first label information of each non-leaf node is determined based on the inference accuracy and accuracy threshold of each non-leaf node.

9. The method according to any one of claims 5 to 8, wherein, Determining the target reasoning path from the first reasoning tree based on the first tag information of the remaining nodes includes: The following processing is performed by iterating over i, where i is a positive integer; Based on the first label information of the starting node of the i-th hop, the target node of the i-th hop is determined from the remaining nodes; when i = 1, the starting node of the i-th hop is the non-leaf node with the root node as its parent node among the remaining nodes, and when i > 1, the starting node of the i-th hop is the target node of the (i-1)-th hop. When the target node of the i-th hop is a leaf node, stop iterating over i, and determine the target inference path based on the target node of the previous I hops, the starting node of the first hop, and the root node, where I is the value of i when the target node is a leaf node.

10. The method according to claim 9, wherein, The determination of the target node for the i-th hop from the remaining nodes based on the first label information of the starting node of the i-th hop includes: When the first label information of the starting node of the i-th hop indicates that there is no reasoning error in the starting node of the i-th hop, the target node of the i-th hop is determined from the child nodes of the starting node of the i-th hop among the remaining nodes. When the first label information of the starting node of the i-th hop indicates that the starting node of the i-th hop has a reasoning error, the target node of the i-th hop is determined from the sibling nodes of the starting node of the i-th hop among the remaining nodes.

11. The method according to any one of claims 5 to 10, wherein, The first training dataset includes: the training question information, the first training answer information that is correct for the training question information, and the first training inference information that matches the correct first training answer information; The step of training the initial processing model based on the first training dataset to obtain the intermediate processing model includes: The following processing is performed by iterating through j, where j is a positive integer: Determine the target probability information for the iterative input model of the j-th iteration to output the correct first training answer information and the matching first training inference information in response to the training question information, and generate a first loss value based on the target probability information; Wherein, when j=1, the input processing model of the j-th iteration is the initial processing model, and when j>1, the iterative input model of the j-th iteration is the iterative output model of the (j-1)-th iteration; Using the first loss value, the parameters of the iterative input model for the j-th iteration are adjusted to obtain the iterative output model for the j-th iteration. When the iteration stopping condition is met, the iteration output model of the Jth iteration is determined as the intermediate processing model, where J is the value of j when the iteration stopping condition is met.

12. The method according to any one of claims 4 to 11, wherein, The step of determining the information processing model based on the intermediate processing model and the training problem information includes: The following processing is performed through iteration t, where 1 ≤ t ≤ T, and T is the total number of iterations: Using the training input model from the t-th training iteration, K second training inference information are generated for the training question information, and based on the K second training inference information, K second training answer information is determined for the training question information. Wherein, when t=1, the training input model for the t-th training is the intermediate processing model, and when t>1, the training input model for the t-th training is the training output model for the (t-1)-th training. Based on the training question information, K sets of second training inference information, and K sets of second training answer information, a second training dataset and a third training dataset are constructed; Based on the second training dataset and the third training dataset, the training input model for the t-th training is trained to obtain the training output model for the t-th training. When t is iterated to T, the training output model of the Tth training iteration is determined as the information processing model.

13. The method according to claim 12, wherein, The construction of a second training dataset and a third training dataset based on the training question information, K pieces of second training inference information, and K pieces of second training answer information includes: Using the training question information, K second training inference information and K second training answer information, a second inference tree of the training question information is determined, and second label information is determined for the remaining nodes in the second inference tree except for the root node; Based on the second inference tree and the second label information, generate correct samples and incorrect samples; The second training dataset is constructed based on the correct samples, and the third training dataset is constructed based on the correct samples and the incorrect samples.

14. The method according to claim 13, wherein, The remaining nodes include: non-leaf nodes and leaf nodes; the generation of correct and incorrect samples based on the second inference tree and the second label information includes: From the second reasoning tree, the second label information of the non-leaf nodes and the second label information of the leaf nodes both represent the correct reasoning path without reasoning errors; Based on the correct reasoning path, the correct sample is determined; The erroneous sample is determined based on other reasoning paths in the second reasoning tree besides the correct reasoning path.

15. The method according to any one of claims 12 to 14, wherein, The step of training the input model for the t-th training iteration based on the second training dataset and the third training dataset to obtain the output model for the t-th training iteration includes: The following processing is performed iteratively by n, where n is a positive integer: Based on the iterative input model of the nth iteration and the second training dataset, the second loss value is determined; wherein, when n=1, the input processing model of the nth iteration is the training input model of the tth training, and when n>1, the iterative input model of the nth iteration is the iterative output model of the (n-1)th iteration. Based on the iterative input model of the nth iteration, the third training dataset, and the training processing model of the (t-1)th training, the third loss value is determined. Based on the second loss value and the third loss value, a fourth loss value is generated, and the parameters of the iterative input model of the nth iteration are adjusted using the fourth loss value to obtain the iterative output model of the nth iteration. When the iteration stopping condition is met, the iterative output processing model of the Nth iteration is determined as the training output model of the tth training, where N is the value of n when the iteration stopping condition is met.

16. The method according to claim 15, wherein, The step of generating a fourth loss value based on the second loss value and the third loss value includes: Perform any of the following processes: The larger of the second and third loss values ​​is taken as the fourth loss value, or... The second loss value and the third loss value are weighted and summed to obtain the fourth loss value.

17. An information processing apparatus, the apparatus comprising: The reasoning generation module is configured to generate intermediate reasoning information for the problem information; wherein, the intermediate reasoning information refers to information describing the logical reasoning process when solving the problem information; The inference verification module is configured to perform accuracy verification on the intermediate inference information and obtain the corresponding verification result. The information correction module is configured to correct the intermediate inference information when the verification result indicates that there is an error in the intermediate inference information, so as to obtain the corrected inference information. The answer generation model is configured to determine the answer information for the question information based on the error-corrected reasoning information.

18. An electronic device, the electronic device comprising: Memory is used to store executable instructions or computer programs. A processor, when executing computer-executable instructions or computer programs stored in the memory, implements the method according to any one of claims 1 to 16.

19. A computer-readable storage medium storing computer-executable instructions or a computer program that, when executed by a processor, implements the method of any one of claims 1 to 16.

20. A computer program product comprising computer-executable instructions or a computer program that, when executed by a processor, implements the method of any one of claims 1 to 16.