Data processing method and device, nonvolatile storage medium and electronic equipment

By generating thinking chains and vertical calculation methods to process the output results of large language models, the problem of inaccurate answers and large computing resources occupancy when processing large numerical calculation mathematical problems is solved, and the accuracy and efficiency of answers are improved Effect.

CN118886504APending Publication Date: 2024-11-01CHINA TELECOM CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410917644.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-09
Publication Date
2024-11-01

AI Technical Summary

Technical Problem

When large language models deal with mathematical problems of large numerical calculations, the output answers are inaccurate, and the training process requires a large amount of computing resources, resulting in low processing efficiency.

Method used

By obtaining the output results of a large language model, a thinking chain is generated for processing the problem-solving process, and processing the target formula in the thinking chain based on the vertical calculation method, obtaining the final result, and using the thinking chain method and the vertical calculation method to train together Model to improve the accuracy of the answer.

Benefits of technology

It reduces the use of computing resources, improves the accuracy of output answers, and solves the problem of low answer accuracy when large language models deal with mathematical problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118886504A_ABST
    Figure CN118886504A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method and device, a nonvolatile storage medium and electronic equipment. The method comprises the steps that an output result, aiming at at least one input mathematical problem, of a large language model is obtained, and the output result at least comprises a problem solving process; thinking chains used for processing problem solving formulas contained in the problem solving process are generated, and each problem solving process corresponds to one thinking chain; the target formula contained in the thinking chain is processed based on a vertical calculation mode, a final result is obtained, and the final result is an answer output for the mathematical question. The technical problem that the accuracy of the output answer is low when a large language model is adopted to process the mathematical problem in the related technology is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular, to a data processing method and device, a non-volatile storage medium, and an electronic device. Background Art

[0002] At present, large language models (LLM) have made significant progress in mathematical reasoning tasks, but when large language models are used in related technologies to process mathematical problems, especially when processing mathematical problems with large numerical calculations, the output answers are inaccurate. In addition, when training large language models for processing mathematical problems with large numerical values ​​in related technologies, a large amount of mathematical problem data needs to be collected, and these mathematical problem data are marked as training data, and the large language model is trained and adjusted during the training process using the above training data; although the accuracy of large language models in processing mathematical problems can be improved through training, a large amount of labeled data and computing resources are required during the training process, so there is a problem of occupying a large amount of computing resources, resulting in a jam when the large language model processes mathematical problems, and low processing efficiency; therefore, when general large language models are used in related technologies to process mathematical problems, especially when processing mathematical problems with large numerical calculations, there are problems of low accuracy, high computing resource occupation, and low processing efficiency.

[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0004] The embodiments of the present application provide a data processing method and device, a non-volatile storage medium, and an electronic device to at least solve the technical problem of low accuracy of the output answers when the large language model used in the related art processes mathematical problems.

[0005] According to one aspect of an embodiment of the present application, a method for data processing is provided, including: obtaining an output result of a large language model for at least one input mathematical problem, wherein the output result includes at least a problem-solving process; generating a thinking chain for processing the problem-solving formulas contained in the problem-solving process, wherein each problem-solving process corresponds to a thinking chain; processing the target formula contained in the thinking chain based on a vertical calculation method to obtain a final result, wherein the final result is an answer output for the mathematical problem.

[0006] Optionally, a thought chain is generated for processing a problem-solving formula included in the problem-solving process, wherein, when there are no unknowns in the problem-solving formula, a first type of thought chain is generated, and the first type of thought chain includes the following steps: determining the problem-solving formula as a target formula.

[0007] Optionally, a thought chain is generated for processing a problem-solving formula included in the problem-solving process, wherein, when there is only one type of unknown number in the problem-solving formula, a second type of thought chain is generated, and the second type of thought chain includes the following steps: establishing a first target equation for solving the unknown number according to the problem-solving formula; determining the side of the first target equation that does not contain the unknown number as the target formula.

[0008] Optionally, a thinking chain is generated for processing a problem-solving formula included in the problem-solving process, wherein, when there are multiple types of unknowns in the problem-solving formula, a third type of thinking chain is generated, and the third type of thinking chain includes the following steps: establishing a second target equation according to the problem-solving formula, wherein both sides of the second target equation are different types of unknowns; establishing a third target equation according to the second target equation and the problem-solving formula, wherein there is only one type of unknowns on one side of the third target equation, and there are no unknowns on the other side of the third target equation; determining the formula on the side of the third target equation where there are no unknowns as the target formula.

[0009] Optionally, processing a target formula contained in a thinking chain based on vertical calculation includes: determining a calculation type corresponding to the target formula, wherein the calculation type includes at least one of the following: addition, subtraction, multiplication; executing a calculation process corresponding to the calculation type on the target formula through vertical calculation.

[0010] Optionally, the calculation process corresponding to the calculation type is executed on the target formula by means of vertical calculation to obtain the final result, including: obtaining identification information of each data to be processed in the target formula, wherein each identification information includes: data corresponding to each digit of the data to be processed; executing the calculation process on each data in order from low to high digits to obtain the calculation results corresponding to each digit; and merging multiple calculation results into the final result.

[0011] Optionally, multiple calculation results are combined into a final result, including: for each digit, adding the digits located at the same digit in multiple calculation results to obtain a cumulative result; when the digit of the cumulative result is one, determining the cumulative result as the target calculation result of the current digit; when the digit of the cumulative result is greater than one, determining the digit corresponding to the lowest digit of the cumulative result as the target calculation result of the current digit, wherein the digit corresponding to the highest digit of the cumulative result is used to accumulate with the cumulative result corresponding to the previous digit of the current digit; until the digit of the target calculation result corresponding to each digit is one, arranging the multiple target calculation results in order from low to high according to the digit corresponding to each target calculation result to generate a digital sequence, wherein the digital sequence is the final result.

[0012] According to another aspect of an embodiment of the present application, a data processing device is also provided, including: an acquisition module, used to obtain the output result of a large language model for at least one input mathematical problem, wherein the output result includes at least a problem-solving process; a generation module, used to generate a thinking chain for processing the problem-solving formula contained in the problem-solving process, wherein each problem-solving process corresponds to a thinking chain; a processing module, used to process the target formula contained in the thinking chain based on a vertical calculation method to obtain a final result, wherein the final result is the answer output for the mathematical problem.

[0013] According to another aspect of an embodiment of the present application, a non-volatile storage medium is provided, in which a computer program is stored, wherein the above-mentioned data processing method is executed by running the computer program on a device where the non-volatile storage medium is located.

[0014] According to another aspect of an embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to execute the above-mentioned data processing method through the computer program.

[0015] According to another aspect of an embodiment of the present application, a computer program product is also provided, including computer instructions, which implement the steps of the above-mentioned data processing method when executed by a processor.

[0016] In an embodiment of the present application, an output result of a large language model for at least one input math problem is obtained, wherein the output result includes at least a problem-solving process; a thought chain for processing the problem-solving formula contained in the problem-solving process is generated, wherein each problem-solving process corresponds to a thought chain; a target formula contained in the thought chain is processed based on a vertical calculation method to obtain a final result, wherein the final result is an answer output for the math problem, by introducing the data generated when the math problem is processed together by the thought chain method and the vertical calculation method in the training process of the model as training data, and processing the data using the large language model trained based on the thought chain method and the vertical calculation method Mathematical problems, wherein, when the trained large language model processes mathematical problems, it first decomposes the problem-solving process output by the general large language model through the method of thought chain, decomposing it into multiple intermediate steps suitable for vertical calculation, and then processes each intermediate step through vertical calculation, thereby achieving the technical effect of reducing the occupied computing resources and improving the accuracy of the output answers when processing large-value mathematical problems / complex mathematical problems, and using the vertical calculation method to process the multiple intermediate steps obtained by decomposition, thereby solving the technical problem of low accuracy of the output answers when the large language model used in the related technology processes mathematical problems. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0018] Figure 1 is a hardware structure block diagram of a computer terminal for implementing a data processing method according to an embodiment of the present application;

[0019] Figure 2 is a flowchart of a method for data processing according to an embodiment of the present application;

[0020] Figure 3 is a schematic diagram of a vertical calculation process for an addition operation according to an embodiment of the present application;

[0021] Figure 4 is a schematic diagram of a vertical calculation process for a multiplication operation according to an embodiment of the present application;

[0022] Figure 5 is a structural diagram of a data processing device according to an embodiment of the present application;

[0023] Figure 6 It is a workflow diagram of a data processing device according to an embodiment of the present application. DETAILED DESCRIPTION

[0024] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0026] In order to better understand the embodiments of the present application, the technical terms involved in the embodiments of the present application are explained as follows:

[0027] Chain of Thought (CoT): Decompose a multi-step reasoning problem into many intermediate steps, assign more calculations to them, generate more tokens (in this embodiment, tokens represent formulas to be processed using vertical calculations), and then piece these answers together to solve them.

[0028] Large language models: AI models with large-scale parameters and complex structures, such as Generative Pre-trained Transformer 3 (GPT-3), Bidirectional Encoder Representations from Transformers (BERT), etc., are used to handle natural language processing tasks. These models are usually built based on deep learning technology and can handle a variety of natural language processing tasks such as text generation, machine translation, semantic understanding, and dialogue systems.

[0029] In the related art, there are two ways to process mathematical problems. One is to collect and annotate a large amount of mathematical problem data, use the annotated mathematical problems as training data to train a large language model, and then use the trained large language model to process mathematical problems; however, this method requires the collection and annotation of a large amount of mathematical problem data, and there are problems of occupying a lot of computing resources and low processing efficiency. The other is to introduce plug-ins and use plug-ins to process mathematical problems. This method relies on external symbolic calculation libraries or mathematical calculation functions built into programming languages. Therefore, there is a need to rely on specific tools and plug-ins, and compatibility needs to be considered and the implementation is more complex; and this method cannot show the processing process of mathematical problems. Therefore, the related art has the problems of occupying a lot of computing resources, low processing efficiency, and low accuracy. In order to solve this problem, a relevant solution is provided in the embodiment of the present application, which is described in detail below.

[0030] According to an embodiment of the present application, an embodiment of a method for data processing is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0031] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal for implementing a data processing method. Figure 1As shown, the computer terminal 10 may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.

[0032] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10. As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0033] The memory 104 can be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the data processing method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, realizing the above-mentioned data processing method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0034] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0035] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 .

[0036] The present application embodiment provides a data processing method capable of running in the above-mentioned operating environment. Figure 2 is a flow chart of the steps of the data processing method, such as Figure 2 As shown, the method comprises the following steps:

[0037] Step S202, obtaining an output result of the large language model for at least one input mathematical problem, wherein the output result at least includes a problem-solving process.

[0038] The method provided in the embodiment of the present application can be applied in a computer and implemented in a scenario of human-computer interaction and / or interaction of different language models running in a computer. In step S202, a large language model (i.e., a target model) trained based on the thinking chain method and the vertical calculation method obtains the result output by any large language model running in the computer for the input mathematical problem, wherein the input mathematical problem can be input by the user in the interactive interface, or can be converted according to the voice information input by the user. The input mathematical problem can be one or more. When the input mathematical problem is multiple, the large language model usually outputs one output result for each mathematical problem, and the target model can obtain the output results in sequence according to the preset order, and only obtain one output result each time, or obtain multiple output results at the same time. The target model obtains the output result after any large language model outputs the result, and the large language model sends a trigger message to the target model, or it can be executed after the trigger instruction sent by the user is triggered. The output result output for each input mathematical problem at least includes a problem-solving process composed of problem-solving steps and problem-solving formulas.

[0039] Step S204, generating a thought chain for processing the problem-solving formulas included in the problem-solving process, wherein each problem-solving process corresponds to a thought chain.

[0040] In step S204, after obtaining the output result of the general large language model for the input mathematical problem, the target model extracts the problem-solving formula from the problem-solving process contained in the output result, and generates a thinking chain for solving / processing the problem-solving formula, wherein each thinking chain contains multiple problem-solving steps for solving the problem-solving formula contained in the output result, and these multiple problem-solving steps together constitute the problem-solving process of the output result.

[0041] Optionally, a thought chain is generated for processing a problem-solving formula included in the problem-solving process, wherein, when there are no unknowns in the problem-solving formula, a first type of thought chain is generated, and the first type of thought chain includes the following steps: determining the problem-solving formula as a target formula.

[0042] In an embodiment of the present application, the target model is related to the number of types of unknowns contained in the problem-solving formula when generating a thinking chain, and is divided into three types of thinking chains according to the number of types of unknowns contained in the problem-solving formula; wherein the first type of thinking chain indicates direct calculation of the problem-solving formula, the second type of thinking chain indicates converting the problem-solving formula into a first target equation for solving the unknowns, and further calculating the (target) formula that does not contain the unknowns in the first target equation; the third type of thinking chain indicates generating a (second target) equation that can represent the mathematical relationship between different types of unknowns according to the target formula; further generating a (third target) equation for solving the unknowns, and finally calculating the (target) formula on the side that does not contain the unknowns in the third target equation that only contains one type of unknowns. In this embodiment, when there are no unknowns in the problem-solving formula in the output result, the target model determines the problem-solving formula as a direct calculation type. At this time, the thinking chain generated for the problem-solving formula is the first type of thinking chain, and the first type of thinking chain contains only one step: the step indicates directly solving the formula (i.e., the target formula) contained in the thinking chain. For example, if the formula for solving a problem is “3+2=”, then the first type of thinking chain generated by the target model for the specific formula for solving the problem only contains one step, and the content of the step is: “3+2=?”.

[0043] According to an optional embodiment of the present application, a thought chain is generated for processing a problem-solving formula included in the problem-solving process, wherein, when there is only one type of unknown number in the problem-solving formula, a second type of thought chain is generated, and the second type of thought chain includes the following steps: establishing a first target equation for solving the unknown number according to the problem-solving formula; determining the side of the first target equation that does not contain the unknown number as the target formula.

[0044] In this real-time example, when the problem-solving formula contains only one type of unknown number, the target model determines the problem-solving formula as a single conversion type. At this time, the thinking chain generated for the problem-solving formula is a second-type thinking chain, which includes the following steps: 1) converting the problem-solving formula into a (first) target equation that contains unknown numbers on one side and does not contain unknown numbers on the other side; 2) solving the first target equation; the target model generates the corresponding above steps for a specific problem-solving formula, for example, the unknown number is x, and the problem-solving formula is "x+4=10"; the target generates the second-type thinking chain for it including the following steps: 1) "x=10-4" (ie, the first target equation), 2) "10-4=?", where "10-4" (ie, the target formula).

[0045] According to another optional embodiment of the present application, a thinking chain is generated for processing a problem-solving formula included in the problem-solving process, wherein, when there are multiple types of unknowns in the problem-solving formula, a third type of thinking chain is generated, and the third type of thinking chain includes the following steps: establishing a second target equation according to the problem-solving formula, wherein both sides of the second target equation are different types of unknowns; establishing a third target equation according to the second target equation and the problem-solving formula, wherein only one type of unknowns exists on one side of the third target equation, and no unknowns exist on the other side of the third target equation; determining the formula on the side of the third target equation where there are no unknowns as the target formula.

[0046] In this embodiment, when the problem-solving formula contains multiple different types of unknowns, the target model determines the problem-solving formula as a multiple conversion class. At this time, the thinking chain generated for the problem-solving formula is a third type of thinking chain, which includes the following steps: 1) Establish one or more equations containing different unknowns on both sides of the equal sign (i.e., the second target equation), wherein the number of the second target equations is the same as the number of types of unknowns contained in the problem-solving formula; for each second target equation, ensure that at least one side of the formulas on both sides of the equal sign in the second target equation contains only one type of unknowns. 2) Establish an equation containing unknowns on one side of the equal sign and not containing unknowns on the other side of the equal sign (i.e., the third target equation) based on at least one second target equation and the problem-solving formula, wherein, in this embodiment, the number of the generated third target equations is the same as the number of types of unknowns contained in the problem-solving formula, and when creating the third target equation, ensure that the side that does not contain unknowns in the third target equation that only contains one type of unknowns is in the form of a formula, not a number; 3) Solve the formula corresponding to the side that does not contain unknowns (i.e., the target formula). For example, the unknown numbers include x and y, and the solution formulas are x+y=48 and 4x+2y=112. The steps included in the third type of thinking chain generated by the target model for the above solution formulas are expressed in the following form: 1) Establish the second target equation: x=48-y; 2) Establish the third target equation: -4y+2y=112-192, x=48-y; 3) "112-192=?" (that is, the target formula).

[0047] Step S206, processing the target formula contained in the thinking chain based on the vertical calculation method to obtain the final result, wherein the final result is the answer output for the mathematical problem.

[0048] In step S204, while generating a thinking chain, the problem-solving formula is converted to generate a target formula suitable for vertical calculation processing. In step S206, the target formula is extracted from the thinking chain, and the target formula is processed by the vertical calculation method to output the answer to the mathematical problem input in step S202; wherein, the types of mathematical problems include direct calculation type and unknown number solving type. When the type of the input mathematical problem is direct calculation type, the final result output by the target model is a numerical value; when the type of the input mathematical problem is unknown number solving type, the final result is in the form of an equation, wherein one end of the equation is an unknown number and the other end of the equation is a numerical value. The target model can display the generated thinking chain on the computer interaction interface where the target model runs, and at the same time, the target model can also display the processing process of processing the target formula contained in the thinking chain based on the vertical calculation method on the computer interaction interface where the target model runs.

[0049] Optionally, processing a target formula contained in a thinking chain based on vertical calculation includes: determining a calculation type corresponding to the target formula, wherein the calculation type includes at least one of the following: addition, subtraction, multiplication; executing a calculation process corresponding to the calculation type on the target formula through vertical calculation.

[0050] In this embodiment, when the target model processes the target formula based on the vertical calculation method, it first determines whether the calculation type corresponding to the target formula is addition, subtraction or multiplication. Since the target formula is obtained by converting the problem-solving formula when generating the thinking chain, no matter whether the problem-solving formula is an equation, integral, differential or other types of complex mathematical problems, the target formula generated after the thinking chain conversion only needs to perform simple addition and / or subtraction and / or multiplication (division will be converted to multiplication). Next, the target model will execute the calculation process corresponding to its calculation type on the target formula based on the vertical calculation method.

[0051] According to an optional embodiment of the present application, a calculation process corresponding to the calculation type is executed on the target formula by means of vertical calculation to obtain a final result, including: obtaining identification information of each data to be processed in the target formula, wherein each identification information includes: data corresponding to each digit of the data to be processed; executing the calculation process on each data in order from low to high digits to obtain calculation results corresponding to each digit; and merging multiple calculation results into a final result.

[0052] In this embodiment, when the target model executes the calculation process corresponding to its calculation type on the target formula based on the vertical calculation method, the numerical value of each data to be processed in the target formula is first determined. Specifically, the identification information of each data to be processed is obtained, wherein the identification information of each data to be processed includes the number of digits of each data to be processed and the specific data corresponding to each digit; multiple data to be processed are aligned in order of the number of digits from low to high to obtain the (vertical) calculation results of each / each digit, and finally the (vertical) calculation results on each digit are merged to generate the final result.

[0053] Optionally, multiple calculation results are combined into a final result, including: for each digit, adding the digits located at the same digit in multiple calculation results to obtain a cumulative result; when the digit of the cumulative result is one, determining the cumulative result as the target calculation result of the current digit; when the digit of the cumulative result is greater than one, determining the digit corresponding to the lowest digit of the cumulative result as the target calculation result of the current digit, wherein the digit corresponding to the highest digit of the cumulative result is used to accumulate with the cumulative result corresponding to the previous digit of the current digit; until the digit of the target calculation result corresponding to each digit is one, arranging the multiple target calculation results in order from low to high according to the digit corresponding to each target calculation result to generate a digital sequence, wherein the digital sequence is the final result.

[0054] In this embodiment, the target model combines the (vertical form) calculation results on each digit by sorting to generate a digital sequence. When the target model performs vertical form calculation on each digit, there are two situations: carry and no carry. Therefore, when sorting to generate a number sequence, there are two situations: changing the original (vertical form) calculation result and not changing the original (vertical form) calculation result. When merging, for each digit, the data of different data to be processed that are located on the same digit are accumulated; if the accumulated result is a single-digit number, the data on this digit in the final result (i.e., the target calculation result) is the accumulated result; otherwise, if the accumulated result is not a single-digit number but a double-digit number, the data on this digit in the final result (i.e., the target calculation result) is the data on the lowest digit of the accumulated result; and the data on the highest digit of the accumulated result will be accumulated with the accumulated result of the previous digit of the current digit to generate the accumulated result corresponding to the previous digit; when determining the data corresponding to the previous digit in the final result, the above method is still used: that is, it is determined based on whether the accumulated result is a single-digit or a double-digit number. If it is a single-digit number, the data corresponding to this digit in the final result is the accumulated result; if it is not a single-digit number but a double-digit number, the data corresponding to this digit in the final result is the data on the lowest digit in the accumulated result. The following example illustrates the process of the target model processing target data based on vertical calculation. Figure 3 This is a schematic diagram of the vertical calculation process for addition operations, such as Figure 3As shown, the target formula is "567+490=?". When the target model processes the target formula based on the vertical calculation method, it is divided into step 1 (Step 1): align the numbers in each digit. Specifically, for this target formula, align the 7 and 0 in the ones digit, the 6 and 9 in the tens digit, and the 5 and 4 in the hundreds digit. Step 2: Calculate the numbers in each digit, where the ones digit: 7+0=7, the tens digit: 6+9=15, and the hundreds digit: 5+4=9. Step 3: Get the overall result (i.e., the cumulative result), where the ones digit includes {current digit: 7, carry: 0}, the tens digit: {current digit: 5, carry: 1}, and the hundreds digit: {current digit: 9, carry: 0}. Step 4: Merge to generate the result, where the ones digit: 7, the tens digit: 5, and the hundreds digit: 1+9=10{current digit: 0, carry: 1}. Step 5: Generate the final result 1057. Figure 4 This is a schematic diagram of the vertical calculation process for multiplication operations, such as Figure 4 As shown, the target formula is: "34×68=?". When the target model processes the target formula based on the vertical calculation method, it is divided into Step 1: Align the numbers in each digit. Specifically for this target formula, align the 4 and 8 in the ones digit, and the 3 and 6 in the tens digit. Step 2: Calculate the numbers in each digit, first multiply the values ​​in the ones digit: 4×8=32. Then the current digit is 2, and the carry is 3, which is expressed as {current digit: 2, carry: 3}. Then multiply the 4 in the ones digit by the 6 in the tens digit: 4×6=24, which is expressed as {current digit: 4, carry: 2}. Next, multiply the 3 in the tens digit by 8: 3×8=24, which is expressed as {current digit: 4, carry: 2}, and the 3 in the tens digit by 6: 3×6=18, which is expressed as {current digit: 8, carry: 1}. Step 3: Align the results of each digit, where the ones digit: 2, tens digit: 3+4+4, hundreds digit: 2+2+8, thousands digit: 1; after further merging: ones digit: 2, tens digit: 11, hundreds digit: 12, thousands digit: 1. Step 4: Finally merge the accumulated results of each digit, ones digit: 2, tens digit: 1, hundreds digit: 3, thousands digit: 2; the final result is 2312.

[0055] Through the above steps, it is possible to process the input data in the large model using the thinking chain method and the vertical calculation method, limit the data to single-step calculation, and limit the calculation to less than 10; the purpose of decomposing the complex data processing process into multiple simple data processing processes is achieved, and the technical effect of improving the accuracy of the output results is achieved.

[0056] Figure 5 is a structural diagram of a data processing device provided according to an embodiment of the present application, such as Figure 5As shown, the data processing device includes: an acquisition module 50, which is used to obtain the output result of the large language model for at least one input mathematical problem, wherein the output result at least includes a problem-solving process; a generation module 52, which is used to generate a thinking chain for processing the problem-solving formula contained in the problem-solving process, wherein each problem-solving process corresponds to a thinking chain; a processing module 54, which is used to process the target formula contained in the thinking chain based on a vertical calculation method to obtain a final result, wherein the final result is the answer output for the mathematical problem.

[0057] Figure 6 is a workflow diagram of a data processing device. In this embodiment, the data processing device outputs the answer (final result) to the mathematical problem: "Suppose there are 2 rabbits and 2 chickens in a cage, and 6 legs in total. How many rabbits are there and how many chickens are there?" The data processing device starts working and obtains the result output by the 3.5th version of the general pre-trained model (GPT-3.5) for the mathematical problem through the acquisition module 50. The output result is as follows: "Suppose there are x rabbits and y chickens. According to the meaning of the question, the following two equations can be listed: x+y=48, 4x+2y=112. Now we can solve this system of equations to solve the number of rabbits and chickens. Quantity. By solving the system of equations, we get x=8 and y=40. So, there are 8 rabbits and 40 chickens. "Next, the data processing device calls the generation module 52 to extract the problem-solving formula from the output result: "x+y=48 and 4x+2y=112", and generates a thinking chain for processing the problem-solving formula, wherein the content of the thinking chain includes: rewriting the first equation as: x=48-y (the second target equation) and substituting it into the second equation: 4x+2y=112, and obtaining 4*(48-y)+2y=112 (i.e., the third target equation), and further processing the third target equation to obtain the target formula "112-192=?". Furthermore, the processing module 54 processes the target formula "112-192=?" based on the vertical calculation method as follows: units: 2-2=0, tens: 1-9=-8, hundreds: 1-1=0, combined result: 0*100+(-8)*10+0=0-80+0=-80+0=-80, therefore: 112-192=-80, -4y+2y=112-192 to obtain part of the final result "y=40". According to "y=40" and x=48-y (the second target equation), the formula x=48-40 is generated, and the target formula "48-40=?" is obtained again. The processing module 54 processes the target formula "48-40=?" based on the vertical calculation method as follows: units: 8-0=8, tens: 4-4=0, and the result is combined: 0*10+8=8, so x=8; the final result output by the processing module 54 is: x=8, y=40.

[0058] It should be noted that Figure 5The preferred implementation of the illustrated embodiment can be found in Figure 2 The relevant description of the illustrated embodiment will not be repeated here.

[0059] An embodiment of the present application further provides a non-volatile storage medium, in which a computer program is stored, wherein the above data processing method is executed by running the computer program on a device where the non-volatile storage medium is located.

[0060] The above-mentioned non-volatile storage medium is used to store programs that perform the following functions: obtain the output result of a large language model for at least one input mathematical problem, wherein the output result at least includes a problem-solving process; generate a thinking chain for processing the problem-solving formula contained in the problem-solving process, wherein each problem-solving process corresponds to a thinking chain; process the target formula contained in the thinking chain based on the vertical calculation method to obtain the final result, wherein the final result is the answer output for the mathematical problem.

[0061] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to execute the above data processing method through the computer program.

[0062] The processor in the above-mentioned electronic device is used to run a program that performs the following functions: obtain the output result of a large language model for at least one input mathematical problem, wherein the output result at least includes a problem-solving process; generate a thinking chain for processing the problem-solving formula contained in the problem-solving process, wherein each problem-solving process corresponds to a thinking chain; process the target formula contained in the thinking chain based on the vertical calculation method to obtain the final result, wherein the final result is the answer output for the mathematical problem.

[0063] An embodiment of the present application also provides a computer program product, including computer instructions, which implement the steps of the data processing method when the computer instructions are executed by a processor.

[0064] It should be noted that the various modules in the above-mentioned data processing device can be program modules (for example, a set of program instructions that implement a certain specific function) or hardware modules. For the latter, it can be expressed in the following forms, but is not limited to this: the expression form of each of the above-mentioned modules is a processor, or the functions of each of the above-mentioned modules are implemented by a processor.

[0065] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0066] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0067] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0068] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0069] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0070] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the relevant technology or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc. Various media that can store program codes.

[0071] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for data processing, characterized in that: include: Obtaining an output result of the large language model for at least one input mathematical problem, wherein the output result at least includes a problem-solving process; Generate a thought chain for processing the problem-solving formulas included in the problem-solving process, wherein each problem-solving process corresponds to one thought chain; The target formula included in the thought chain is processed based on vertical calculation to obtain a final result, wherein the final result is an answer outputted for the mathematical problem.

2. The method according to claim 1, characterized in that: Generate a thought chain for processing the problem-solving formula included in the problem-solving process, wherein, when there are no unknowns in the problem-solving formula, generate a first type of thought chain, and the first type of thought chain includes the following steps: determine the problem-solving formula as the target formula.

3. The method according to claim 1, characterized in that Generate a thought chain for processing a problem-solving formula included in the problem-solving process, wherein, when there is only one type of unknown number in the problem-solving formula, generate a second type of thought chain, and the second type of thought chain includes the following steps: establish a first target equation for solving the unknown number according to the problem-solving formula; determine the side of the first target equation that does not contain the unknown number as the target formula.

4. The method according to claim 1, characterized in that: Generate a thinking chain for processing a problem-solving formula included in the problem-solving process, wherein, when there are multiple types of unknowns in the problem-solving formula, generate a third type of thinking chain, and the third type of thinking chain includes the following steps: establish a second target equation according to the problem-solving formula, wherein both sides of the second target equation are different types of the unknowns; establish a third target equation according to the second target equation and the problem-solving formula, wherein only one type of the unknowns exists on one side of the third target equation, and the unknowns do not exist on the other side of the third target equation; determine the formula on the side of the third target equation where the unknowns do not exist as the target formula.

5. The method according to claim 1, characterized in that The target formula contained in the thought chain is processed based on vertical calculation, including: Determine a calculation type corresponding to the target formula, wherein the calculation type includes at least one of the following: addition, subtraction, multiplication; The calculation process corresponding to the calculation type is executed on the target formula by means of the vertical calculation method.

6. The method according to claim 5, characterized in that The calculation process corresponding to the calculation type is executed on the target formula by the vertical calculation method to obtain a final result, including: Obtaining identification information of each to-be-processed data in the target formula, wherein each of the identification information includes: data corresponding to each digit of the to-be-processed data; Execute the calculation process on each of the data in order from low to high digits to obtain the calculation results corresponding to each of the digits; The plurality of calculation results are combined into the final result.

7. The method according to claim 6, characterized in that Combining the plurality of calculation results into the final result comprises: For each of the digits, accumulating the digits located at the same digit in the plurality of calculation results to obtain an accumulated result; When the number of digits of the accumulated result is one, determining the accumulated result as the target calculation result of the current number of digits; In the case where the number of digits of the accumulated result is greater than one, the number corresponding to the lowest digit of the accumulated result is determined as the target calculation result of the current digit, wherein the number corresponding to the highest digit of the accumulated result is used to accumulate with the accumulated result corresponding to the previous digit of the current digit; Until the number of digits of the target calculation results corresponding to each of the digits is one digit, the multiple target calculation results are arranged in order from low to high according to the number of digits corresponding to each of the target calculation results to generate a digital sequence, wherein the digital sequence is the final result.

8. A data processing device, characterized in that: include: An acquisition module, configured to acquire an output result of the large language model for at least one input mathematical problem, wherein the output result at least includes a problem-solving process; A generating module, used for generating a thinking chain for processing the problem-solving formula contained in the problem-solving process, wherein each problem-solving process corresponds to one thinking chain; The processing module is used to process the target formula contained in the thinking chain based on the vertical calculation method to obtain a final result, wherein the final result is an answer outputted for the mathematical problem.

9. A non-volatile storage medium, characterized in that: The non-volatile storage medium stores a computer program, wherein the data processing method according to any one of claims 1 to 7 is executed by running the computer program on the device where the non-volatile storage medium is located.

10. An electronic device comprising a memory and a processor, characterized in that: The memory stores a computer program, and the processor is configured to execute the data processing method according to any one of claims 1 to 7 through the computer program.

11. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by a processor, the steps of the data processing method described in any one of claims 1 to 7 are implemented.