Data processing method and device, electronic equipment and medium
Through the method of thinking chain splitting and comparative learning, the problem of frequent errors in existing models in task processing is solved, and the accuracy of the model's task processing processes such as code generation and mathematical problem solving is improved.
Patent Information
- Application Number
- CN202411886944.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-04-29
AI Technical Summary
Existing models often experience errors in task processing, affecting the accuracy of the results.
By obtaining sample prompt information and correct result data, inputting it into the preset data model, splitting the thinking chain to determine the error logic block, and training the model through comparative learning methods to improve the accuracy of the processing process.
Through the method of thinking chain splitting and comparative learning, we help the model learn the error points of each logical block and correct the errors in the inference details, thereby improving the accuracy of the model's task processing process such as code generation and mathematical problem-solving.
Smart Images

Figure CN119903903A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a method, device, electronic equipment and medium for data processing. Background Art
[0002] With the development of artificial intelligence, more and more complex tasks rely on artificial intelligence platforms. Artificial intelligence platforms process tasks by calling corresponding models, such as using models to solve math problems raised by users or using models to generate the code required by users. However, when existing models process tasks, errors often occur, affecting the accuracy of the results. Summary of the invention
[0003] In view of the above problems, a method, device, electronic device and medium for data processing are proposed to overcome the above problems or at least partially solve the above problems, including:
[0004] A method for data processing, the method comprising:
[0005] Obtaining sample prompt information and correct result data of the sample prompt information;
[0006] Inputting the sample prompt information into a preset data model to obtain inference result data output by the data model, and determining target inference result data with errors from the inference result data;
[0007] Performing thought chain splitting on the target reasoning result data to obtain a plurality of first logic blocks, and determining a target first logic block with errors from the plurality of first logic blocks;
[0008] Performing thought chain splitting on the correct result data to obtain a plurality of second logic blocks, and determining a target second logic block corresponding to the target first logic block from the plurality of second logic blocks;
[0009] training the data model according to the target first logic block and the target second logic block;
[0010] Target prompt information is obtained, and the target prompt information is input into a trained data model to obtain target result data output by the trained data model.
[0011] Optionally, determining the target reasoning result data having errors from the reasoning result data includes:
[0012] The correct result data is compared with the inference result data, and according to the comparison result, the target inference result data with errors is determined from the inference result data.
[0013] Optionally, the target reasoning result data is split into thought chains to obtain a plurality of first logic blocks, including:
[0014] Acquire a first thinking chain of the model reasoning process of the target reasoning result data, and split the first thinking chain to obtain a plurality of first logic blocks;
[0015] The correct result data is split into thought chains to obtain a plurality of second logic blocks, including:
[0016] A second thinking chain of the model reasoning process of the correct result data is obtained, and the second thinking chain is split to obtain multiple second logic blocks.
[0017] Optionally, the determining a target first logic block having an error from the plurality of first logic blocks comprises:
[0018] Correctness verification is performed on the plurality of first logic blocks respectively, and according to the correctness verification result, a target first logic block having an error is determined from the plurality of first logic blocks.
[0019] Optionally, the training the data model according to the target first logic block and the target second logic block includes:
[0020] determining a loss value according to the target first logic block and the target second logic block;
[0021] According to the loss value, the parameters of the data model are adjusted to train the data model.
[0022] Optionally, the correct result data, the inference result data, and the target result data are code data, and the first logic block and the second logic block are code blocks in the code data.
[0023] Optionally, the correct result data, the inference result data, and the target result data are answers to math problems, and the first logic block and the second logic block are problem-solving steps for calculating the answers to the math problems.
[0024] Optionally, the data model is a large model.
[0025] A data processing device, comprising:
[0026] Obtaining sample prompt information and correct result data of the sample prompt information;
[0027] Inputting the sample prompt information into a preset data model to obtain inference result data output by the data model, and determining target inference result data with errors from the inference result data;
[0028] Performing thought chain splitting on the target reasoning result data to obtain a plurality of first logic blocks, and determining a target first logic block with errors from the plurality of first logic blocks;
[0029] Performing thought chain splitting on the correct result data to obtain a plurality of second logic blocks, and determining a target second logic block corresponding to the target first logic block from the plurality of second logic blocks;
[0030] training the data model according to the target first logic block and the target second logic block;
[0031] Target prompt information is obtained, and the target prompt information is input into a trained data model to obtain target result data output by the trained data model.
[0032] An electronic device comprises a processor, a memory and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the method described above when executed by the processor.
[0033] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described above is implemented.
[0034] The embodiments of the present invention have the following advantages:
[0035] In an embodiment of the present invention, sample prompt information and correct result data of the sample prompt information are obtained; the sample prompt information is input into a preset data model to obtain the inference result data output by the data model, and the target inference result data with errors is determined from the inference result data; the target inference result data is split into a thinking chain to obtain a plurality of first logic blocks, and the target first logic block with errors is determined from the plurality of first logic blocks; the correct result data is split into a thinking chain to obtain a plurality of second logic blocks, and the target second logic block corresponding to the target first logic block is determined from the plurality of second logic blocks; the data model is trained according to the target first logic block and the target second logic block; the target prompt information is obtained, and the target prompt information is input into the trained data model to obtain the target result data output by the trained data model, thereby realizing the decomposition of the model processing process into a plurality of logic blocks by means of thinking chain splitting, and by means of comparative learning, the model is helped to learn the error points of each logic block according to the comparison between the correct logic block and the error logic block, thereby improving the accuracy of model processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solution of the present invention, the accompanying drawings required for use in the description of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0037] Figure 1 is a flowchart of steps of a data processing method provided by some embodiments of the present invention;
[0038] Figure 2 is a flowchart of another data processing method provided by some embodiments of the present invention;
[0039] Figure 3 is a flowchart of another data processing method provided by some embodiments of the present invention;
[0040] Figure 4 is a flowchart of another data processing method provided by some embodiments of the present invention;
[0041] Figure 5 is a flowchart of another data processing method provided by some embodiments of the present invention;
[0042] Figure 6 It is a structural block diagram of a data processing device provided by some embodiments of the present invention. DETAILED DESCRIPTION
[0043] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0044] For data models such as code generation models and mathematical problem-solving models, when performing complex tasks, errors in a certain reasoning step often lead to errors in the final result. Therefore, in the process of model processing, accurately locating and correcting the error steps is the key to improving model performance.
[0045] In related technologies, model optimization focuses on the overall result level, lacking fine-grained analysis of step-by-step reasoning during model processing, and thus failing to effectively improve the overall accuracy of model processing.
[0046] In the embodiment of the present invention, a fine-grained step-by-step thinking chain method based on contrastive learning is proposed to optimize the effects of model processing processes such as code generation and mathematical problem solving.
[0047] Among them, Chain of Thought (CoT) is an artificial intelligence technology that helps the model analyze and solve problems step by step by inserting a series of logical reasoning steps between the input and output of the model. It simulates the human thinking process, generates a series of related thinking links, and forms a coherent thinking chain to solve complex problems.
[0048] Contrastive learning is a learning method that focuses on extracting meaningful representations by contrasting positive and negative examples. It exploits the assumption that similar instances should be closer together, while dissimilar instances should be farther apart in the learned embedding space. By casting learning as a discriminative task, contrastive learning allows the model to capture relevant features and similarities in the data.
[0049] In the model processing process such as code generation and mathematical problem solving, the final result may be erroneous due to local errors because the reasoning link is too long and the dependency is too strong. The embodiment of the present invention gradually disassembles the reasoning process and combines it with a comparative learning method. By comparing the correct steps with the wrong steps, the model learns the error points of each step and corrects the performance of the model in the reasoning details, so as to improve the accuracy of generation and enhance the effect of the model in model processing processes such as code generation and mathematical problem solving.
[0050] Specifically, the embodiment of the present invention proposes to add a logic block splitting model in the model processing process such as code generation and mathematical problem solving, and split the generated code and mathematical problem solving process into multi-step logic blocks to form a thinking chain logic diagram. In addition, the embodiment of the present invention introduces a comparative learning method to optimize local errors. The model can not only find the error points, but also learn how to correct these errors, further improve the reasoning performance, and fine-tune the model in a fine-grained manner to improve the model effect. Furthermore, the embodiment of the present invention can use automated tools such as GPT (Generative Pre-trained Transformer) to quickly locate and correct erroneous steps, reduce manual intervention, and improve efficiency.
[0051] The present invention is exemplarily described below with reference to the accompanying drawings:
[0052] Reference Figure 1 , shows a flowchart of a data processing method provided by some embodiments of the present invention, which may specifically include the following steps:
[0053] Step 101, obtaining sample prompt information and correct result data of the sample prompt information.
[0054] As an example, the sample prompt information (Prompt) is text information in natural language.
[0055] In practical applications, sample prompt information can be collected from the user's historical interaction data, and the correct result data of the sample prompt information can be pre-marked.
[0056] For example, a batch of code generation samples with correct answers (i.e. correct result data) are collected to obtain a data set Among them, x is the sample prompt information, For the correct code data.
[0057] In some examples, in order to split the COT process and facilitate error identification for each step, a split instruction statement, such as "think step by step", can be carried in the sample prompt information (Prompt), thereby ensuring that the reasoning results of the model are structured into multiple reasoning steps, such as each step clearly starting with "Step i:".
[0058] Step 102: input the sample prompt information into a preset data model to obtain inference result data output by the data model, and determine target inference result data with errors from the inference result data.
[0059] In some embodiments of the present invention, the data model is a large model.
[0060] In practical applications, sample prompt information can be input into a preset data model. After processing by the data model, the inference result data output by the data model can be obtained. Since the data model may output erroneous results, the inference result data output by the data model can be screened, and then the target inference result data with errors can be determined from the inference result data output by the data model.
[0061] In some embodiments of the present invention, the determining of target reasoning result data having errors from the reasoning result data includes:
[0062] The correct result data is compared with the inference result data, and according to the comparison result, the target inference result data with errors is determined from the inference result data.
[0063] In practical applications, the correct result data may be compared with the inference result data output by the data model. When the correct result data is inconsistent with the inference result data output by the data model, it may be determined that the inference result data is target inference result data with errors.
[0064] For example, by comparing the inference result data y of the data model with the correct answer Compare and record the inference result data including the wrong steps to generate a data set
[0065] Step 103, splitting the target reasoning result data into thought chains to obtain multiple first logic blocks, and determining the target first logic block with errors from the multiple first logic blocks.
[0066] In some examples, preset auxiliary models (such as the GPT model) can be used to split the thought chain, such as performing logical judgment on the code generation process and the mathematical problem-solving process, and splitting the code generation process and the mathematical problem-solving process into logical blocks.
[0067] In some embodiments of the present invention, the target reasoning result data is split into thought chains to obtain a plurality of first logic blocks, including:
[0068] A first thinking chain of the model reasoning process of the target reasoning result data is obtained, and the first thinking chain is split to obtain a plurality of first logic blocks.
[0069] In some embodiments of the present invention, determining a target first logic block having an error from the plurality of first logic blocks includes:
[0070] Correctness verification is performed on the plurality of first logic blocks respectively, and according to the correctness verification result, a target first logic block having an error is determined from the plurality of first logic blocks.
[0071] For example, each incorrect inference result in D1 (i.e., target inference result data) is explicitly presented as a series of inference steps y=s1…s n , continue to verify the correctness of each reasoning step (i.e., the first logical block) until the wrong step S is found loss (i.e. the first logical block of the target) and record its step number k, thus obtaining a data set containing the wrong steps
[0072] Step 104, performing thought chain splitting on the correct result data to obtain a plurality of second logic blocks, and determining a target second logic block corresponding to the target first logic block from the plurality of second logic blocks.
[0073] In some embodiments of the present invention, the correct result data is split into thought chains to obtain a plurality of second logic blocks, including:
[0074] A second thinking chain of the model reasoning process of the correct result data is obtained, and the second thinking chain is split to obtain multiple second logic blocks.
[0075] For the correct result data, in order to obtain the thinking chain of the model reasoning process of the correct result data, the correct steps s1…s can be re-reasoned through the sample prompt information. k-1 , generate multiple candidate outputs y cont, retaining the outputs that match the correct result data, i.e., multiple second logic blocks.
[0076] After obtaining a plurality of second logical blocks, a target second logical block corresponding to the target first logical block may be determined from the plurality of second logical blocks to obtain a final data set.
[0077] For example, the target first logic block is the first logic block with an error among the multiple first logic blocks. In the re-reasoning correct steps s1…s k-1 In the example, select the first inference step s that meets the conditions win (ie, the target second logical block), forming a data set D3 after error correction.
[0078] Step 105: training the data model according to the target first logic block and the target second logic block.
[0079] In some embodiments of the present invention, the step of training the data model according to the target first logic block and the target second logic block includes:
[0080] A loss value is determined according to the target first logic block and the target second logic block; and a parameter of the data model is adjusted according to the loss value to train the data model.
[0081] In some examples, the following loss function can be used:
[0082]
[0083] Among them, l is the contrastive learning loss function, comparing the difference between the wrong step and the correct step, β is the weight, σ is the sigmoid function, and π ref is the reference model, π θ is the policy model, y win This is the correct step, loss It is a wrong step;s 1~k-1 Represents the content from the start step to the previous step of the current step.
[0084] In some examples, in order to prevent errors from occurring again during the intermediate reasoning process, double checks are required through manual or automated tools to ensure that the final output reasoning path is correct, so that the model can learn and improve based on D3 and continuously improve the overall accuracy of code generation.
[0085] Step 106, obtaining target prompt information, inputting the target prompt information into the trained data model, and obtaining target result data output by the trained data model.
[0086] In some embodiments of the present invention, the correct result data, the inference result data, and the target result data are answers to math problems, and the first logic block and the second logic block are problem-solving steps for calculating the answers to the math problems.
[0087] Taking the data problem-solving process as an example, the specific process is as follows:
[0088] Prompt: Determine the smallest positive integer x such that the remainder after x+4609 is divided by 12 is 2104.
[0089] Reasoning Steps: Let's reason step by step.
[0090] Step 1: x+4609=2104(mod12).
[0091] Step 2: We can rewrite the given congruence as x=2104-4609(mod12).
[0092] Step 3: Calculate 2104-4609=-2505.
[0093] Step 4: Find the equivalent positive integer of -2505 (mod 12).
[0094] To do this, we divide -2505 by 12 and find the remainder. -2505 ÷ 12 = -208, which gives a remainder of -9. However, we want a positive remainder, so we add 12 to -9, which gives us a positive remainder: -9 + 12 = 3. Therefore, -2505 = 3 (mod 12).
[0095] Step 4 above is an incorrect step: we want to find a positive integer x, so we keep adding 12 until we get a positive number: -2505+12×210=30.
[0096] In some embodiments of the present invention, the correct result data, the inference result data, and the target result data are code data, and the first logic block and the second logic block are code blocks in the code data.
[0097] Taking the code generation process as an example, the specific process is shown in Table 1 below:
[0098]
[0099]
[0100]
[0101] Table 1
[0102] In an embodiment of the present invention, sample prompt information and correct result data of the sample prompt information are obtained; the sample prompt information is input into a preset data model to obtain the inference result data output by the data model, and the target inference result data with errors is determined from the inference result data; the target inference result data is split into a thinking chain to obtain a plurality of first logic blocks, and the target first logic block with errors is determined from the plurality of first logic blocks; the correct result data is split into a thinking chain to obtain a plurality of second logic blocks, and the target second logic block corresponding to the target first logic block is determined from the plurality of second logic blocks; the data model is trained according to the target first logic block and the target second logic block; the target prompt information is obtained, and the target prompt information is input into the trained data model to obtain the target result data output by the trained data model, thereby realizing the decomposition of the model processing process into a plurality of logic blocks by means of thinking chain splitting, and by means of comparative learning, the model is helped to learn the error points of each logic block according to the comparison between the correct logic block and the error logic block, thereby improving the accuracy of model processing.
[0103] Reference Figure 2 , shows a flowchart of another data processing method provided by some embodiments of the present invention, which may specifically include the following steps:
[0104] Step 201, obtaining sample prompt information and correct result data of the sample prompt information.
[0105] Step 202: input the sample prompt information into a preset data model to obtain inference result data output by the data model, and determine target inference result data with errors from the inference result data.
[0106] Step 203, obtaining the first thinking chain of the model reasoning process of the target reasoning result data, splitting the first thinking chain to obtain multiple first logic blocks, and determining the target first logic block with errors from the multiple first logic blocks.
[0107] Step 204, obtain the second thinking chain of the model reasoning process of the correct result data, split the second thinking chain to obtain multiple second logic blocks, and determine the target second logic block corresponding to the target first logic block from the multiple second logic blocks.
[0108] Step 205: training the data model according to the target first logic block and the target second logic block.
[0109] Step 206, obtaining target prompt information, inputting the target prompt information into the trained data model, and obtaining the target result data output by the trained data model.
[0110] Reference Figure 3 , shows a flowchart of another data processing method provided by some embodiments of the present invention, which may specifically include the following steps:
[0111] Step 301, obtaining sample prompt information and correct result data of the sample prompt information.
[0112] Step 302: input the sample prompt information into a preset data model to obtain inference result data output by the data model, and determine target inference result data with errors from the inference result data.
[0113] Step 303, splitting the target reasoning result data into thought chains to obtain multiple first logic blocks, and determining the target first logic block with errors from the multiple first logic blocks.
[0114] Step 304, performing thought chain splitting on the correct result data to obtain a plurality of second logic blocks, and determining a target second logic block corresponding to the target first logic block from the plurality of second logic blocks.
[0115] Step 305: determine a loss value according to the target first logic block and the target second logic block, and adjust the parameters of the data model according to the loss value to train the data model.
[0116] Step 306, obtaining target prompt information, inputting the target prompt information into the trained data model, and obtaining the target result data output by the trained data model.
[0117] Reference Figure 4 , shows a flowchart of another data processing method provided by some embodiments of the present invention, which may specifically include the following steps:
[0118] Step 401, obtaining sample prompt information and correct result data of the sample prompt information.
[0119] Step 402, input the sample prompt information into a preset data model to obtain the inference result data output by the data model, compare the correct result data with the inference result data, and determine the target inference result data with errors from the inference result data based on the comparison result.
[0120] Step 403, obtain the first thought chain of the model reasoning process of the target reasoning result data, split the first thought chain to obtain multiple first logic blocks, verify the correctness of the multiple first logic blocks respectively, and determine the target first logic block with errors from the multiple first logic blocks according to the correctness verification results.
[0121] Step 404, obtain the second thinking chain of the model reasoning process of the correct result data, split the second thinking chain to obtain multiple second logic blocks, and determine the target second logic block corresponding to the target first logic block from the multiple second logic blocks.
[0122] Step 405: training the data model according to the target first logic block and the target second logic block.
[0123] Step 406, obtaining target prompt information, inputting the target prompt information into the trained data model, and obtaining target result data output by the trained data model.
[0124] The following combination Figure 5 The present invention is exemplified as follows:
[0125] 1. Enter Prompt (i.e. sample prompt information);
[0126] 2. Start generating step-by-step code (i.e. the first logic block);
[0127] 3. After the code is generated, input it into the verify model for verification;
[0128] 4. Filter out the error module of the generated code (i.e. the target first logic block);
[0129] 5. Cut out the content above the error part and put it into the big model (i.e. the preset data model) and regenerate it until it is correct;
[0130] 6. Construct a comparative learning sample of the correct part and the wrong part (i.e., the target first logic block and the target second logic block);
[0131] 7. Construct contrastive learning training samples;
[0132] 8. Put it into the big model to train and optimize the model;
[0133] 9. Recycle the new version of the model (i.e. the trained data model).
[0134] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0135] Reference Figure 6, shows a schematic diagram of the structure of a data processing device provided by some embodiments of the present invention, which may specifically include the following modules:
[0136] The correct result data acquisition module 601 is used to acquire sample prompt information and the correct result data of the sample prompt information.
[0137] The target reasoning result data determination module 602 is used to input the sample prompt information into a preset data model, obtain the reasoning result data output by the data model, and determine the target reasoning result data with errors from the reasoning result data.
[0138] The target first logic block determination module 603 is used to split the target reasoning result data into thought chains to obtain multiple first logic blocks, and determine the target first logic block with errors from the multiple first logic blocks.
[0139] The target second logic block determination module 604 is used to perform thought chain splitting on the correct result data to obtain multiple second logic blocks, and determine the target second logic block corresponding to the target first logic block from the multiple second logic blocks.
[0140] The data model training module 605 is used to train the data model according to the target first logic block and the target second logic block.
[0141] The target result data output module 606 is used to obtain target prompt information, input the target prompt information into the trained data model, and obtain the target result data output by the trained data model.
[0142] In some embodiments of the present invention, the determining of target reasoning result data having errors from the reasoning result data includes:
[0143] The correct result data is compared with the inference result data, and according to the comparison result, the target inference result data with errors is determined from the inference result data.
[0144] In some embodiments of the present invention, the target reasoning result data is split into thought chains to obtain a plurality of first logic blocks, including:
[0145] Acquire a first thinking chain of the model reasoning process of the target reasoning result data, and split the first thinking chain to obtain a plurality of first logic blocks;
[0146] The correct result data is split into thought chains to obtain a plurality of second logic blocks, including:
[0147] A second thinking chain of the model reasoning process of the correct result data is obtained, and the second thinking chain is split to obtain multiple second logic blocks.
[0148] In some embodiments of the present invention, determining a target first logic block having an error from the plurality of first logic blocks includes:
[0149] Correctness verification is performed on the plurality of first logic blocks respectively, and according to the correctness verification result, a target first logic block having an error is determined from the plurality of first logic blocks.
[0150] In some embodiments of the present invention, the step of training the data model according to the target first logic block and the target second logic block includes:
[0151] determining a loss value according to the target first logic block and the target second logic block;
[0152] According to the loss value, the parameters of the data model are adjusted to train the data model.
[0153] In some embodiments of the present invention, the correct result data, the inference result data, and the target result data are code data, and the first logic block and the second logic block are code blocks in the code data.
[0154] In some embodiments of the present invention, the correct result data, the reasoning result data, and the target result data are answers to math problems, and the first logic block and the second logic block are problem-solving steps for calculating the answers to the math problems.
[0155] In some embodiments of the present invention, the data model is a large model.
[0156] In an embodiment of the present invention, sample prompt information and correct result data of the sample prompt information are obtained; the sample prompt information is input into a preset data model to obtain the inference result data output by the data model, and the target inference result data with errors is determined from the inference result data; the target inference result data is split into a thinking chain to obtain a plurality of first logic blocks, and the target first logic block with errors is determined from the plurality of first logic blocks; the correct result data is split into a thinking chain to obtain a plurality of second logic blocks, and the target second logic block corresponding to the target first logic block is determined from the plurality of second logic blocks; the data model is trained according to the target first logic block and the target second logic block; the target prompt information is obtained, and the target prompt information is input into the trained data model to obtain the target result data output by the trained data model, thereby realizing the decomposition of the model processing process into a plurality of logic blocks by means of thinking chain splitting, and by means of comparative learning, the model is helped to learn the error points of each logic block according to the comparison between the correct logic block and the error logic block, thereby improving the accuracy of model processing.
[0157] Some embodiments of the present invention further provide an electronic device, comprising a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the above method is implemented when the computer program is executed by the processor.
[0158] Some embodiments of the present invention further provide a computer-readable storage medium, on which a computer program is stored, and the computer program implements the above method when executed by a processor.
[0159] Some embodiments of the present invention further provide a computer program product, including a computer program, which implements the above method when executed by a processor.
[0160] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0161] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0162] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0163] Those skilled in the art will appreciate that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0164] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0165] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0166] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0167] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0168] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the above elements.
[0169] The above provides a detailed introduction to a data processing method, device, electronic device and medium. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A method for data processing, characterized in that: The method comprises: Obtaining sample prompt information and correct result data of the sample prompt information; Inputting the sample prompt information into a preset data model to obtain inference result data output by the data model, and determining target inference result data with errors from the inference result data; Performing thought chain splitting on the target reasoning result data to obtain a plurality of first logic blocks, and determining a target first logic block with errors from the plurality of first logic blocks; Performing thought chain splitting on the correct result data to obtain a plurality of second logic blocks, and determining a target second logic block corresponding to the target first logic block from the plurality of second logic blocks; training the data model according to the target first logic block and the target second logic block; Target prompt information is obtained, and the target prompt information is input into a trained data model to obtain target result data output by the trained data model.
2. The method according to claim 1, characterized in that The determining of target reasoning result data having errors from the reasoning result data includes: The correct result data is compared with the inference result data, and according to the comparison result, the target inference result data with errors is determined from the inference result data.
3. The method according to claim 2, characterized in that The target reasoning result data is split into thought chains to obtain a plurality of first logic blocks, including: Acquire a first thinking chain of the model reasoning process of the target reasoning result data, and split the first thinking chain to obtain a plurality of first logic blocks; The correct result data is split into thought chains to obtain a plurality of second logic blocks, including: A second thinking chain of the model reasoning process of the correct result data is obtained, and the second thinking chain is split to obtain multiple second logic blocks.
4. The method according to claim 3, characterized in that The step of determining a target first logic block having an error from among the plurality of first logic blocks comprises: Correctness verification is performed on the plurality of first logic blocks respectively, and according to the correctness verification result, a target first logic block having an error is determined from the plurality of first logic blocks.
5. The method according to claim 1, characterized in that The step of training the data model according to the target first logic block and the target second logic block includes: determining a loss value according to the target first logic block and the target second logic block; According to the loss value, the parameters of the data model are adjusted to train the data model.
6. The method according to any one of claims 1 to 5, characterized in that: The correct result data, the inference result data, and the target result data are code data, and the first logic block and the second logic block are code blocks in the code data.
7. The method according to any one of claims 1 to 5, characterized in that: The correct result data, the inference result data, and the target result data are answers to math problems, and the first logic block and the second logic block are problem-solving steps for calculating the answers to math problems.
8. The method according to claim 1, characterized in that: The data model is a large model.
9. A data processing device, characterized in that: The device comprises: Obtaining sample prompt information and correct result data of the sample prompt information; Inputting the sample prompt information into a preset data model to obtain inference result data output by the data model, and determining target inference result data with errors from the inference result data; Performing thought chain splitting on the target reasoning result data to obtain a plurality of first logic blocks, and determining a target first logic block with errors from the plurality of first logic blocks; Performing thought chain splitting on the correct result data to obtain a plurality of second logic blocks, and determining a target second logic block corresponding to the target first logic block from the plurality of second logic blocks; training the data model according to the target first logic block and the target second logic block; Target prompt information is obtained, and the target prompt information is input into a trained data model to obtain target result data output by the trained data model.
10. An electronic device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the method according to any one of claims 1 to 8 when executed by the processor.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.