Data processing method and device, electronic equipment and storage medium

By using two different thinking and reasoning methods to reason and test mathematical problems in a large language model, the accuracy and direction selection difficulties of the model when dealing with mathematical problems are solved, and higher reasoning accuracy and output reliability are achieved.

CN118747532APending Publication Date: 2024-10-08SHANG HAI JIE YUE XING CHEN ZHI NENG KE JI YOU XIAN GONG SI

Patent Information

Application Number
CN202410830712.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-11-25
Filing Date
2024-06-25
Publication Date
2024-10-08

AI Technical Summary

Technical Problem

Large language models are prone to intermediate step errors or inability to find the correct direction of reasoning when dealing with mathematical problems, resulting in inaccurate output or hallucinations, and a single model of the thinking chain cannot adapt to different types of mathematical problems.

Method used

Use two different thinking and reasoning methods (such as forward and reverse reasoning) to reason about the problem to be processed. By gradually generating and testing local reasoning results, the accuracy of each step is ensured, and the most reasonable answer is comprehensively selected in the final result.

Benefits of technology

It effectively avoids the limitations of a single reasoning method in the thinking chain, improves the accuracy of reasoning in mathematical problems, reduces the probability of errors in intermediate steps, and ensures that the output is more accurate and reliable.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118747532A_ABST
    Figure CN118747532A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method and device, electronic equipment and a storage medium. The method comprises the steps of obtaining a to-be-processed problem; reasoning the to-be-processed problem according to a first thinking reasoning mode to obtain a first thinking reasoning result; reasoning the to-be-processed problem according to a second thinking reasoning mode to obtain a second thinking reasoning result, the second thinking mode being a thinking mode different from the first thinking reasoning mode; and generating a target reasoning result of the to-be-processed problem according to the first thinking reasoning result and the second thinking reasoning result. By applying the scheme, the problem that a large language model has a high probability of errors in intermediate steps when solving various mathematical problems can be avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence, and in particular to a data processing method, device, electronic device and storage medium. Background Art

[0002] With the continuous development of deep learning technology, large language models (LLM) for processing natural language have been more and more widely used. However, as the scale of large language models continues to increase, the cost of fine-tuning becomes higher and higher. For the increasing large-scale parameters, it is difficult to effectively migrate the model by relying solely on traditional fine-tuning technology. In addition, the increasing number of parameters has also dramatically increased the cost of gradient back propagation. Against this background, prompted learning came into being. Prompted learning makes the input and output of the target task more in line with the data during the original language model training by transforming downstream tasks and adding expert knowledge.

[0003] Chain-of-thought (CoT) is an improved prompting strategy used to improve the performance of large language models in complex reasoning tasks. The core idea of ​​CoT is to decompose the reasoning process into a series of intermediate reasoning steps, each of which is built on the previous step. This progressive chain of reasoning is similar to the logical continuity in thinking, which helps the model better understand the problem and generate more convincing answers. Large language models benefit from the "chain of thought" prompt in various reasoning tasks, and have a certain ability to handle complex problems, especially giving them the potential to complete mathematical tasks.

[0004] However, despite the introduction of thought chains, large language models still have a high probability of making mistakes in the intermediate steps when solving various mathematical problems, or failing to find the correct reasoning direction, resulting in failure to obtain correct results. On the one hand, the emphasis on intermediate reasoning steps in the reasoning process by large language models may inadvertently introduce hallucinations and cumulative errors, and it is difficult for language models to automatically identify and correct errors; on the other hand, different types of mathematical problems may be suitable for different reasoning methods, while the pattern of thought chains is relatively single. Summary of the invention

[0005] To this end, the present invention provides a data processing method, device, electronic device and storage medium based on a large language model, in an effort to solve or at least alleviate at least one of the above problems.

[0006] According to one aspect of the present invention, a data processing method based on a large language model is provided, which is suitable for execution in an electronic device, and the method comprises:

[0007] Obtain a problem to be processed; reason the problem to be processed according to a first thinking and reasoning method to obtain a first thinking and reasoning result; reason the problem to be processed according to a second thinking and reasoning method to obtain a second thinking and reasoning result, wherein the second thinking method is a thinking method different from the first thinking and reasoning method; generate a target reasoning result of the problem to be processed according to the first thinking and reasoning results and the second thinking and reasoning results.

[0008] In one example, the target reasoning result of the problem to be processed is one of the first thinking reasoning result and the second thinking reasoning result.

[0009] Furthermore, the reasoning of the problem to be processed according to the first thinking reasoning method to obtain the first thinking reasoning result includes: obtaining a first thinking reasoning prompt word. The problem to be processed is reasoned step by step according to the first thinking reasoning prompt word to generate the first local reasoning result of each step. After the first local reasoning result of each step is generated, the first local reasoning result of the step is subjected to a first inspection process to obtain the first inspection result of the step; wherein, if the first inspection result of the step is failed, the first local reasoning result of the step is deleted, and the first local reasoning result of the step is regenerated; otherwise, the next step of reasoning is continued until the reasoning is completed to obtain the first thinking reasoning result.

[0010] In one example, after generating the first local reasoning result of each step, performing a first inspection process on the first local reasoning result of the step to obtain the first inspection result of the step includes: obtaining a first inspection prompt word. Obtaining a first inspection object, wherein the first inspection object includes the first local reasoning result of the step. Performing a first inspection process on the first inspection object of the step according to the first inspection prompt word to obtain the inspection result of the first inspection object of the step; wherein, if the inspection result of the first inspection object is not passed, deleting the first inspection object, re-obtaining a new first inspection object, and performing a first inspection process on the new first inspection object to obtain a new inspection result of the first inspection object; if the inspection result of the first inspection object is still not passed, repeating the above steps until the inspection result of the first inspection object of the step is passed; if the number of consecutive failures of the inspection result of the first inspection object of the step reaches a first predetermined value, setting the inspection result of the first inspection object of the step to pass, and selecting the most recent first local reasoning result as the first local reasoning result of the step.

[0011] In one example, the reasoning of the problem to be processed according to the second thinking reasoning method to obtain the second thinking reasoning result includes: obtaining a second thinking reasoning prompt word. The problem to be processed is reasoned step by step according to the second thinking reasoning prompt word to generate the second partial reasoning result of each step. After the second partial reasoning result of each step is generated, the second partial reasoning result of the step is subjected to a second inspection process to obtain the second inspection result of the step; wherein, if the second inspection result of the step is not passed, the second partial reasoning result of the step is deleted, and the second partial reasoning result of the step is regenerated; otherwise, the next step of reasoning is continued until the reasoning is completed to obtain the second thinking reasoning result.

[0012] In one example, after generating the second local reasoning result of each step, performing a second inspection process on the second local reasoning result of the step to obtain the second inspection result of the step includes: obtaining a second inspection prompt word. Obtaining a second inspection object, wherein the second inspection object includes the second local reasoning result of the step. Performing a second inspection process on the second inspection object of the step according to the second inspection prompt word to obtain the inspection result of the second inspection object of the step; wherein, if the inspection result of the second inspection object is not passed, deleting the second inspection object, re-obtaining a new second inspection object, and performing a second inspection process on the new second inspection object to obtain a new inspection result of the second inspection object; if the inspection result of the second inspection object is still not passed, repeating the above steps until the inspection result of the second inspection object of the step is passed; if the number of consecutive failures of the inspection result of the second inspection object of the step reaches a second predetermined value, setting the inspection result of the second inspection object of the step to pass, and selecting the most recent second local reasoning result as the second local reasoning result of the step.

[0013] In one example, the first verification process includes fact checking, logic checking and data calculation checking, wherein the fact checking refers to checking whether the evidence cited in the current reasoning step is consistent with the facts, the logic checking refers to checking whether the logic used in the current reasoning step is correct, and the calculation checking refers to checking whether the calculation result of the current reasoning step is correct; if and only if the fact checking, the logic checking and the data calculation checking are all passed, the first verification result is passed, otherwise the first verification result is failed.

[0014] In another example, the second verification process includes fact checking, logic checking and data calculation checking, wherein the fact checking refers to checking whether the evidence cited in the current reasoning step is consistent with the facts, the logic checking refers to checking whether the logic used in the current reasoning step is correct, and the calculation checking refers to checking whether the calculation result of the current reasoning step is correct; if and only if the fact checking, the logic checking and the data calculation checking are all passed, the second verification result is passed, otherwise the second verification result is failed.

[0015] In one example, generating a target reasoning result of the problem to be processed according to the first thinking reasoning result and the second thinking reasoning result includes: obtaining a target result selection prompt word. Obtaining the target reasoning result according to the target result selection prompt word, the first thinking reasoning result, and the second thinking reasoning result. Furthermore, reasoning the problem to be processed according to the first thinking reasoning method and reasoning the problem to be processed according to the second thinking reasoning method are both performed based on a large language model.

[0016] In one example, the problem to be processed is a mathematical problem. In one example, the first thinking and reasoning method is forward reasoning, and the second thinking and reasoning method is reverse reasoning.

[0017] According to yet another aspect of the present invention, there is provided a data processing device, the device comprising:

[0018] The data acquisition module is used to obtain the problem to be processed. The first data reasoning module is used to reason the problem to be processed according to the first thinking reasoning method to obtain the first thinking reasoning result. The second data reasoning module is used to reason the problem to be processed according to the second thinking reasoning method to obtain the second thinking reasoning result. The target data reasoning module generates the target reasoning result of the problem to be processed according to the first thinking reasoning result and the second thinking reasoning result.

[0019] According to another aspect of the present invention, there is provided an electronic device, comprising: at least one processor; and a memory storing program instructions, wherein the program instructions are configured to be suitable for execution by the at least one processor, and the program instructions include instructions for executing any one of the above methods.

[0020] According to another aspect of the present invention, a readable storage medium storing program instructions is provided. When the program instructions are read and executed by a computing device, the computing device executes any one of the methods described above.

[0021] According to the data processing method based on the big model of the present invention, the problem to be processed is reasoned according to two thinking reasoning methods, and the first thinking reasoning result and the second thinking reasoning result are obtained respectively. Finally, the final target reasoning result is obtained by comprehensive judgment based on the two reasoning results. Thus, the existing single reasoning method of the thinking chain is effectively avoided. The output of complex problems such as hallucinations, inaccuracies, and generalizations is effectively avoided, and especially the problem of not being able to find the correct reasoning direction and giving the correct answer in the reasoning of mathematical problems is avoided. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments recorded in the present application. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings. The drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the drawings, the same reference numerals generally represent the same components or steps.

[0023] Figure 1 is a schematic block diagram of an electronic device according to an embodiment of the present invention;

[0024] Figure 2 is a schematic flow chart of a data processing method according to an embodiment of the present invention;

[0025] Figure 3 is a schematic flow chart of a reasoning process 300 for obtaining a first thinking reasoning result according to an embodiment of the present invention;

[0026] Figure 4 is a schematic flow chart of a reasoning process 400 for obtaining a second thinking reasoning result according to an embodiment of the present invention;

[0027] Figure 5 is a schematic block diagram of a data processing device 500 according to an embodiment of the present invention. DETAILED DESCRIPTION

[0028] The exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.

[0029] The embodiment of the present application provides a data processing method, device, electronic device and storage medium based on a large language model, which can be applied to the fields of natural language processing. Among them, according to the data processing method based on a large language model of the present invention, the problem to be processed is reasoned according to two thinking reasoning methods, and the first thinking reasoning result and the second thinking reasoning result are obtained respectively, and finally the final target reasoning result is obtained by comprehensive judgment based on the two reasoning results, thereby effectively avoiding the problems of hallucination, inaccuracy, and generalization of the output of complex problems by the existing single reasoning method of the thinking chain, especially avoiding the problem of not being able to find the correct reasoning direction and giving the correct answer in the reasoning of mathematical problems.

[0030] The data processing method provided in the embodiments of the present application can be applied to electronic devices with computing and processing capabilities, and the electronic devices can be mobile phones, tablet computers, desktop computers, laptop computers, servers, vehicle-mounted devices, netbooks, and augmented reality (AR) devices, virtual reality (VR) devices, smart speakers, artificial intelligence robots, etc. The embodiments of the present application do not impose any special restrictions on the specific form of the electronic devices.

[0031] Figure 1 FIG. 1 is a schematic diagram showing the structure of an electronic device 100 according to an embodiment of the present invention. The electronic device can be used to implement the methods of various embodiments of the present invention. Figure 1 As shown, in a basic configuration 102, the electronic device 100 typically includes a memory 106 and one or more processors 104. A memory bus 108 may be used for communication between the processor 104 and the memory 106.

[0032] Depending on the desired configuration, the processor 104 may be any type of processor, including but not limited to: a microprocessor, a microcontroller, a digital signal processor (DSP), or any combination thereof. The processor 104 may include one or more levels of cache, such as a primary cache 110 and a secondary cache 112, a processor core 114, and registers 116. An example processor core 114 may include an arithmetic logic unit (ALU), a floating point unit (FPU), a digital signal processing core, or any combination thereof. In some implementations, the memory controller 118 may be a separate component used with the processor 104; in some other implementations, the memory controller 118 may be an internal component of the processor 104.

[0033] Depending on the desired configuration, the memory 106 can be any type of memory, including but not limited to: volatile memory (such as RAM, etc.), non-volatile memory (such as ROM, flash memory, etc.) or any combination thereof. The physical memory in the electronic device generally refers to the volatile memory RAM, and the data in the disk needs to be loaded into the physical memory before it can be read by the processor 104. The memory 106 can store an operating system 120 and one or more applications 122. In some embodiments, the application 122 can be arranged to execute instructions on the operating system by one or more processors 104. The operating system 120 can be, for example, Linux, Windows, Android, Hongmeng, Apple iOS, etc., which includes program instructions for processing basic system services and performing hardware-dependent tasks. The application 122 includes program instructions for implementing various user-desired functions. The application 122 can be, for example, a browser, game software, business software, office software, instant messaging software, software development tools (such as integrated development environment IDE, compiler, etc.), etc., but is not limited thereto. When the application 122 is installed in the electronic device 100, a driver module can be added to the operating system 120 if necessary.

[0034] When the electronic device 100 starts running, the processor 104 reads and executes the program instructions of the operating system 120 from the memory 106. The application 122 runs on the operating system 120 and uses the interface provided by the operating system 120 and the underlying hardware to implement various functions desired by the user. When the user starts the application 122, the processor 104 reads and executes the program instructions of the application 122 from the memory 106.

[0035] The electronic device 100 may also include an interface bus 140 that facilitates communication from various interface devices (e.g., output devices 142, peripheral interfaces 144, and communication devices 146) to the basic configuration 102 via the bus / interface controller 130. Example output devices 142 include a graphics processing unit 148 and an audio processing unit 150. They can be configured to facilitate communication with various external devices such as a display or speakers via one or more A / V ports 152. Example peripheral interfaces 144 may include a serial interface controller 154 and a parallel interface controller 156, which may be configured to facilitate communication with external devices such as input devices (e.g., keyboards, mice, voice input devices, touch input devices, handwriting input devices, etc.) or other peripherals (e.g., printers, scanners, etc.) via one or more I / O ports 158. Example communication devices 146 may include a network controller 160, which may be configured to facilitate communication with one or more other electronic devices via a network communication link via one or more communication ports 164.

[0036] A network communication link can be an example of a communication medium. Communication media can generally be embodied as computer-readable instructions, data structures, program modules in a modulated data signal such as a carrier wave or other transmission mechanism, and can include any information delivery medium. As a non-limiting example, communication media can include wired media such as a wired network or a dedicated line network, and various wireless media such as sound, radio frequency (RF), microwave, infrared (IR) or other wireless media. The term computer-readable medium used herein can include both storage media and communication media.

[0037] In the electronic device 100 according to the present invention, the application 122 includes instructions for executing the data processing method of the present invention, and the instructions can instruct the processor 104 to execute the data processing method of the present invention.

[0038] It is to be understood that the structure shown in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include: Figure 1 More or fewer components are shown, or some components are combined, or some components are separated, or there are different component arrangements. The components shown can be implemented in hardware, software, firmware, or any combination of the three.

[0039] Below, based on the above-mentioned hardware involved in the embodiments of the present application, other embodiments of the present application will be described in detail in conjunction with the accompanying drawings.

[0040] The data processing method of the present invention is implemented based on a trained large language model. In the field of artificial intelligence technology, a large model refers to a deep neural network model with a large number of parameters (e.g., hundreds of millions of scale). Among them, a large language model (LLM) is a deep learning model that is trained with a large amount of text data and can process natural language (e.g., generate natural language text or understand the meaning of language text, etc.). The large language model can process not only text, but also images and sounds. The training text data used in the training of the large language model usually corresponds to at least one natural language task. Therefore, the large language model obtained by training has good natural language processing capabilities, and can realize the generation of natural language text or the understanding of language text and other functions. The large language model has a wide range of application scenarios, including but not limited to chatbots, language translation, content creation, etc.

[0041] Prompt is a method of using natural language to guide or inspire a large language model to complete a specific task. The core idea of ​​prompt is to use a large amount of knowledge and language rules that the pre-training model has learned, and by designing appropriate text forms and content, the input and output of downstream tasks are converted into the form that the pre-training model expects and is good at, so as to achieve the best effect. The advantage of prompt is that as long as a suitable prompt is found, a pre-training model can be used to complete multiple tasks, without the need to train and fine-tune each specific task. This can save a lot of time, resources and data, and can improve the performance of small sample learning or even zero sample learning. Prompt will be used in the following embodiments to guide the model to handle problems in an expected manner.

[0042] Figure 2 A schematic flow chart of a data processing method 200 according to an embodiment of the present invention is shown. As shown in the figure, the method may include:

[0043] Step S210: Obtain the problem to be processed. The problem to be processed may be obtained from the user or from other devices. The present invention does not limit the source and type of the problem to be processed.

[0044] Then, the process proceeds to step S220 and step S230 . Step S220 and step S230 may be performed in parallel or in series. In this embodiment, step S220 and step S230 are performed in parallel, which can improve the efficiency of the model in processing problems.

[0045] Step S220: Reasoning the problem to be processed according to the first thinking reasoning method to obtain a first thinking reasoning result. In this embodiment, the first thinking reasoning method is a forward thinking reasoning method.

[0046] In a specific example, step S220 may include the following steps:

[0047] Obtain a first thinking reasoning prompt word. The first thinking reasoning prompt word is used to guide the large language model to perform logical reasoning in an expected manner. Exemplarily, the first thinking reasoning is forward reasoning; the first thinking reasoning prompt word is characterized by reasoning layer by layer in a conditional order.

[0048] The problem to be processed is reasoned step by step according to the obtained first thinking reasoning prompt words to generate the first local reasoning result of each step.

[0049] After generating the first local reasoning result of each step, the first local reasoning result of the step is subjected to the first inspection process to generate the first inspection result of the step. The first inspection process is as follows: obtaining the first inspection prompt word and the first inspection object of the step, performing the first inspection process on the first inspection object according to the first inspection prompt word, generating the first inspection result of the inspection object, and determining the first inspection result of the step according to the first inspection result of the inspection object and the number of times the first inspection process is performed in the step.

[0050] According to the first test result of the current step (i.e. this step), it is determined whether to re-perform local reasoning on this step or to perform the first local reasoning of the next step.

[0051] After the first partial reasoning of this step is completed and the first partial reasoning result of this step is obtained, the subsequent step-by-step reasoning process is continued, that is, step-by-step reasoning is performed until the reasoning is completed and the first thinking reasoning result is obtained.

[0052] An exemplary specific process is as follows Figure 3 As shown, the following will Figure 3 A detailed explanation is given and no further elaboration is given here.

[0053] Step S220 uses a step-by-step reasoning method and verifies the reasoning results of each step in the process of reasoning the problem to be processed according to the first thinking reasoning method, which is conducive to ensuring the accuracy of the data processing results of the large language model.

[0054] Step S230: Reasoning the problem to be processed according to the second thinking reasoning mode to obtain a second thinking reasoning result. The second thinking reasoning mode is different from the first thinking reasoning mode. In one embodiment, the second thinking reasoning mode is a reverse thinking reasoning mode, corresponding to the first thinking reasoning mode being a forward thinking reasoning mode.

[0055] In a specific example, step S230 includes the following steps:

[0056] Get the second thinking cue word;

[0057] Reasoning the problem to be processed step by step according to the acquired second thinking reasoning prompt words, and generating the second partial reasoning result of each step;

[0058] After generating the second partial reasoning result of each step, a second inspection process is performed on the second partial reasoning result of the step to generate the second inspection result of the step, wherein the second inspection process is as follows: obtaining a second inspection prompt word and a second inspection object of the step, performing a second inspection process on the second inspection object according to the second inspection prompt word, generating a second inspection result of the inspection object, and determining whether the second inspection result of the step passes the inspection according to the second inspection object inspection result and the number of times the second inspection process is performed in the step;

[0059] Determine whether to re-perform local reasoning on the step or to proceed to the second local reasoning on the next step according to the second test result of the step;

[0060] Reason step by step until the reasoning result is reached and the second thinking reasoning result is obtained.

[0061] An exemplary specific process is as follows Figure 4 As shown, the following will Figure 4 A detailed explanation is given and no further elaboration is given here.

[0062] The second thinking reasoning result is obtained through the reverse thinking reasoning method. The large language model uses the second thinking reasoning result obtained by the reverse thinking reasoning method as one of the references when generating the target reasoning result, avoiding the limitations of the current single reasoning method of the thinking chain, allowing the large model to choose a more reasonable reasoning direction and output more accurate reasoning results.

[0063] After obtaining the first thinking reasoning result and the second thinking reasoning result through step S220 and step S230, proceed to step 240.

[0064] Step S240: Generate a target reasoning result of the problem to be processed based on the first thinking reasoning result and the second thinking reasoning result.

[0065] Exemplarily, step S240 includes:

[0066] Get the target result selection prompt word;

[0067] According to the target result, the prompt word, the first thinking reasoning result and the second thinking reasoning result are selected to obtain the target reasoning result.

[0068] In a specific example, the process of generating the target reasoning result is: splicing the first reasoning result and the second reasoning result in random order, and adding a "result selection prompt word". The characteristic of the result selection prompt word is: guiding the model to review the two reasoning results and select one reasoning result as the final answer. The format of the result selection prompt word is as follows:

[0069] {Pending Issues}

[0070] Here are two answers to the reasoning:

[0071] Answer 1:

[0072] {First thinking reasoning result}

[0073] Answer 2:

[0074] {Result of the second thinking reasoning}

[0075] Please judge which answer is more reasonable? Give the reason for your judgment and write your choice at the end: Answer X.

[0076] In the above result selection prompt word format example, the order of filling in the first thinking reasoning result and the second thinking reasoning result can be random. For example, they can be filled in as answer one and answer two according to the time order in which the two thinking reasoning results were generated, and finally the final target reasoning result is generated through the large language model.

[0077] According to the data processing method of the present invention, two ways of thinking are used to reason about the problem to be processed, and a comparison and selection are made between the two reasoning results to generate the final target reasoning result, so that the large language model can break through the reasoning limitation of a single reasoning method when outputting the target result, avoiding the drawbacks of a single reasoning method making mistakes when dealing with complex problems and failing to give accurate answers, especially avoiding the problem of not being able to find the correct reasoning direction and giving the correct answer in mathematical problems. Further, according to the data processing method of the present invention, more reasoning methods are used to reason about the problem to be processed, and a more accurate reasoning result is selected from multiple reasoning results, which also avoids the problems of hallucinations in the model, inaccurate answers to questions, and generalizations.

[0078] Figure 3 A schematic flow chart of a process 300 for obtaining a first thinking reasoning result according to an embodiment of the present invention is shown, comprising the following steps:

[0079] Step S221, obtaining a first thinking and reasoning prompt word.

[0080] In this embodiment, the first thinking reasoning mode is a forward thinking reasoning mode. Therefore, when designing the first thinking reasoning prompt, its feature should be to guide the large language model to reason layer by layer according to the order of conditions given by the problem to be processed. The first thinking reasoning prompt can be a text description that guides the model to reason according to the first thinking reasoning mode (i.e., forward thinking reasoning mode), can be a format that the model is expected to follow when reasoning, can be a reasoning example, or can be any combination of the above three contents.

[0081] In a specific example, the first thinking reasoning prompt word is a reasoning example, denoted as T1, specifically: {

[0082] question:

[0083] Alice buys 5 apples. Each apple costs $2. She gets a 50% discount. She decides after her purchase that she doesn't like 2 of them and sells them to her friend for $1. How much did she spend in total?

[0084] Answer:

[0085] First, let's list all the statements and relations in the problem using labels.

[0086] #1. Alice bought 5 apples.

[0087] #2. The price of each apple is $2, but Alice gets a 50% discount.

[0088] #3. Alice sells 2 of the apples to her friend for $1 each.

[0089] #4.How much did Alice spend in total?

[0090] Next, let’s answer the questions step by step based on the questions and reasoning process.

[0091] #5.(Based on #2)

[0092] Step 1: Calculate the price of each apple after the discount.

[0093] Original price per apple: $2

[0094] Discount: 50%

[0095] Price per apple after discount: $2*(1-0.50) = $2*0.50 = $1

[0096] #6.(Based on #1 and #5)

[0097] Step 2: Calculate the cost for Alice to buy 5 apples after receiving the 50% discount.

[0098] Price per apple after discount: $1

[0099] Total number of apples: 5

[0100] Alice's total cost of buying 5 apples: $1*5 = $5

[0101] #7.(Based on #3)

[0102] Step 3: Calculate the money Alice received from selling the 2 apples.

[0103] Alice's proceeds from selling 2 apples: $1

[0104] #8. (Based on #6 and #7)

[0105] Step 4: Calculate how much Alice spent in total.

[0106] Alice's total cost for buying 5 apples: $5

[0107] Alice's proceeds from selling 2 apples: $1

[0108] Alice's total spending: $5 - $1 = $4

[0109] #9. (Based on #4 and #8)

[0110] The original question is: #4. How much did Alice spend in total? So the answer is: $4.

[0111] Please answer the following questions using the template above.

[0112] }

[0113] The first thinking reasoning prompt word T1 is implemented by giving a reasoning example, guiding the large language model to complete reasoning according to the form of the reasoning example in T1 when performing thinking reasoning.

[0114] Step S222: Reasoning the problem to be processed according to the first thinking reasoning prompt word to obtain the first partial reasoning result of the current step. Figure 3 The entire reasoning process needs to loop into step S222 to complete the reasoning of each step. Each time step S222 is entered, only the first local reasoning result of the current step is generated. After the first local reasoning result is generated by step S222 at each step, subsequent steps S223, S224, S225, and S226 will be entered to test the step, and after the test passes, step S222 will be looped into for the next step of reasoning.

[0115] According to a specific embodiment of the present invention, the problem to be processed obtained in step S210 is: "Xiao Ming is planting a lemon tree. It will cost 90 yuan to plant the tree. It will grow 7 lemons every year, and he can sell them at 1.5 yuan each. The cost of watering and feeding the tree is 3 yuan per year. How many years will it take before you start making money on the lemon tree?", recorded as Q1, with the above T1 as the first thinking reasoning prompt word, then the first local reasoning result of step 1 is "#1. Planting a lemon tree will cost 90 yuan", and the first local reasoning result of step 2 is "#2. The lemon tree will grow 7 lemons every year". For the convenience of subsequent explanation, the final first thinking reasoning result of Q1 is given here, recorded as A1, specifically:

[0116] {

[0117] First, let's list all the statements and relations in the problem using labels.

[0118] #1. Planting a lemon tree will cost $90.

[0119] #2.A lemon tree will produce 7 lemons every year.

[0120] #3. Xiao Ming can sell lemons at 1.5 yuan each.

[0121] #4. The cost of watering and feeding a lemon tree is $3 per year.

[0122] #5. How many years will it take before lemon trees start making money?

[0123] Next, let’s answer the questions step by step based on the questions and reasoning process.

[0124] #6. (Based on #2 and #3)

[0125] Step 1: Calculate the annual revenue from the sale of lemons.

[0126] Total income from selling lemons each year: number of lemons per year * price of each lemon = 7 lemons * 1.5 yuan per lemon = 10.5 yuan

[0127] #7.(Based on #4)

[0128] Step 2: Calculate the annual cost of maintaining your lemon tree.

[0129] Annual cost of maintaining a lemon tree: $3

[0130] #8. (Based on #6 and #7)

[0131] Step 3: Calculate the net income from growing lemon trees each year.

[0132] Net income from growing lemon trees each year: Total income from selling lemons each year - Annual cost of maintaining lemon trees = 10.5 yuan - 3 yuan = 7.5 yuan

[0133] #9. (Based on #1 and #8)

[0134] Step 4: Calculate the number of years it will take to grow your lemon tree.

[0135] Cost of planting a lemon tree: $90

[0136] Net income from growing lemon trees per year: $7.5

[0137] Number of years required to grow a lemon tree: 90 yuan / 7.5 yuan = 12 years

[0138] #10. (Based on #5 and #9)

[0139] The original question was: #5. How many years will it take before the lemon trees start to make money? So the answer is: 12 years.

[0140] Therefore, it will take Xiao Ming 12 years to start making money from growing lemon trees.

[0141] }

[0142] According to the above description, after obtaining the first local reasoning result of each step in step S222, the first test of the first local reasoning result of the current step is entered to obtain the first test result of the current step. Continuing with the above-mentioned problem to be processed Q1 as an example, after generating the first local reasoning result of step 1 "#1. Planting a lemon tree will cost 90 yuan", enter step S223 to perform the subsequent first test step. After generating the first local reasoning result of step 2 "#2. The lemon tree will grow 7 lemons every year", enter step S223 to perform the subsequent first test step, and so on. In the step-by-step reasoning process of the problem to be processed Q1, each time the first local reasoning result of a step is generated, the first test processing procedure will be performed.

[0143] Step S223: Obtain a first inspection prompt word.

[0144] In this embodiment, the first test is also completed by guiding the model through prompt words. The first test prompt word can be a text description that guides the model to complete the first test, can be a test example, or can be a combination of the two. The first test prompt word is characterized by being able to guide the large language model to perform fact checking, logic checking, and data calculation checking.

[0145] In a specific example, the first inspection prompt word T2 is a text description prompt word, specifically:

[0146] {

[0147] Please analyze whether the current reasoning step is correct? You need to check three aspects: 1. Fact check: Does the evidence cited in the current reasoning step conform to the facts? 2. Logic check: Is the logic used in the current reasoning step correct? 3. Calculation check: If the current reasoning step performs calculations, please verify whether the calculation results are correct?

[0148] Please give the details of the three aspects of the check, and finally judge whether this reasoning has passed all the checks and give the answer "yes" or "no".

[0149] }

[0150] T2 explains that the model needs to perform fact checking, logic checking, and calculation checking when performing the first test. At the same time, it also explains the answer method of the check result, "yes" or "no". That is, when the first test object fails the test, the model will output the first test object test result as "no", indicating that the test failed. When the first test object passes the test, the model will output the first test object test result as "yes", indicating that the test passed.

[0151] Step S224: Obtain a first test object. The first test object may be the first partial reasoning result of the current step, or the first partial reasoning result of the current step and all steps before the current step.

[0152] In a specific example, the first test object is the first local reasoning result of the current step. Taking the reasoning process of the question Q1 to be processed according to the first thinking reasoning prompt word T1 as an example (such as the first thinking reasoning result A1 of Q1 mentioned above), the test object in step 7 is: "#7. (Based on #4) Step 2: Calculate the annual cost of maintaining lemon trees. The annual cost of maintaining lemon trees: 3 yuan".

[0153] In another specific example, the first test object is the first local reasoning result of the current step and all steps before the current step. Taking the problem Q1 to be processed as an example, the first test object in step 7 is:

[0154] “

[0155] #1. Planting a lemon tree will cost $90.

[0156] #2.A lemon tree will produce 7 lemons every year.

[0157] #3. Xiao Ming can sell lemons at 1.5 yuan each.

[0158] #4. The cost of watering and feeding a lemon tree is $3 per year.

[0159] #5. How many years will it take before lemon trees start making money?

[0160] Next, let’s answer the questions step by step based on the questions and reasoning process.

[0161] #6. (Based on #2 and #3)

[0162] Step 1: Calculate the annual revenue from the sale of lemons.

[0163] Total income from selling lemons each year: number of lemons per year * price of each lemon = 7 lemons * 1.5 yuan per lemon = 10.5 yuan

[0164] #7.(Based on #4)

[0165] Step 2: Calculate the annual cost of maintaining your lemon tree.

[0166] Annual cost of maintaining a lemon tree: $3".

[0167] That is, the first local reasoning results from step 1 to step 7 are collectively used as the first test object. The selection of the first test object can be set according to the capabilities learned by the model.

[0168] Step S225: Perform the first inspection of the current step according to the first inspection prompt word and the first inspection object, and obtain the inspection result of the first inspection object.

[0169] In a specific example, the specific splicing method of the first test prompt word and the first test object is as follows:

[0170] <Test Example>

[0171] {First test object}

[0172] {Test prompt words}.

[0173] In the <Test Example>, you can add a test example to guide the model to test according to the test example. In the {Test Prompt Word}, ​​you can add a text description prompt word to guide the model to test. You can only give the test example or the test prompt word, or both can be filled in the prompt word. Taking the first test prompt word T2 as an example, only the test prompt word is used in T2.

[0174] If the inspection result of the first inspection object of the current step is "No", it means that the first inspection has not passed. If the inspection result of the first inspection object of the current step is "Yes", it means that the first inspection has passed.

[0175] Step S226: Determine the first inspection result according to the inspection result of the first inspection object and the first inspection times of the current step. The first inspection times of the current step are used to record the times of the first inspection process performed in the current step. In the step-by-step reasoning process, before the first inspection of each step, the corresponding first inspection times are "0". When each first inspection is completed, the first inspection times corresponding to the step are "+1".

[0176] If the inspection result of the first inspection object is passed or the first inspection times of the current step reaches the first predetermined value (that is, the first inspection times = the first predetermined value), the first inspection result of the current step is passed; otherwise (the inspection result of the first inspection object is failed and the first inspection times of the current step < the first predetermined value), the first inspection result of the current step is failed.

[0177] In a specific example, the first test object test result of the current step is "no", that is, it fails, the first predetermined value is 3, and when the first test number of the current step is 1 (the first test number < the first predetermined value), the first test result fails, then step S227 is entered, the first local reasoning result of the current step is deleted, and regenerated. This method enables the large language model to reduce the probability of errors and hallucinations in the intermediate steps when solving problems, especially complex problems, avoid accumulating errors in the step-by-step reasoning process, and ensure that the reasoning process does not deviate from the correct reasoning direction.

[0178] In another specific example, if the inspection result of the first inspection object of the current step is "yes", that is, the inspection result of the first inspection object passes, then the first inspection result of the current step passes, and the process proceeds to step S228. Or if the number of first inspections of the current step reaches or exceeds the first predetermined value, the first inspection result of the current step is also set to pass, and the process proceeds to step S228 to continue the next reasoning. This protection mechanism prevents the large model from entering an infinite loop due to failure of the first inspection when the large model has not yet learned the relevant reasoning knowledge and cannot give the correct local reasoning result.

[0179] Step S227: Delete the first local reasoning result of the current step, and continue to take the above-mentioned reasoning process of Q1 based on T1 as an example, as shown in A1, such as step 6, when the first test result of step 6 is failed, then delete the first local reasoning result of the current step 6, that is, delete the following content: "#6. (Based on #2 and #3) Step 1: Calculate the annual income from the sale of lemons. The total income from the sale of lemons each year: the number of lemons per year * the price of each lemon = 7 lemons * 1.5 yuan / lemon = 10.5 yuan", and enter step S222 to regenerate the first local reasoning result of the current step (i.e., step 6) to ensure the correctness of each step of reasoning as much as possible and avoid accumulated errors in the reasoning process.

[0180] Step S228, determine whether the reasoning of the problem to be processed is completed, if the reasoning is not completed, then enter step S222 for the next reasoning. Whether the reasoning is completed can be determined by whether the original question of the problem to be processed is answered, and the present invention does not limit this.

[0181] If the reasoning on the problem to be processed has been completed, the reasoning is completed, and the entire reasoning process is the first thinking reasoning result (such as A1 above).

[0182] Figure 4 A schematic flow chart of a process 400 for obtaining a second thinking reasoning result according to an embodiment of the present invention is shown. As shown in the figure, the process includes:

[0183] Step S231: Obtain a second thinking and reasoning prompt word.

[0184] In this embodiment, the second thinking reasoning method can be a reverse thinking reasoning method different from the first thinking reasoning method (forward thinking reasoning method). Therefore, when designing the second thinking reasoning prompt, the characteristic is that it is necessary to guide the large language model to decompose layer by layer according to the problem target and reverse reasoning. Like the first thinking reasoning prompt, the second thinking reasoning prompt can be a text description that guides the model to perform thinking reasoning according to the second chain thinking method (i.e., reverse thinking method), or it can be a format that the model is expected to follow when performing reasoning, or it can be a reasoning example, or it can be any combination of the above three contents.

[0185] In a specific example, the second chain thinking reasoning prompt word is a combination of the above three contents, recorded as T3, specifically: {

[0186] You need to work backwards from the last problem to the information that needs to be solved, until all the information is found and the answer is solved. The answer format is: step 1: Summarize the current problem and find out which sub-problems it can be divided into (sub-problem 1 and sub-problem 2, ...) step 2: Solve sub-problem 1 step 2.1: xxxx step 2.2 xxxx step 3: Solve sub-problem 2 step 2.1: xxxx step 2.2 xxxx ... step N: Summarize the above sub-problems and give the final answer to the problem Now you need to use the above problem-solving format to solve the following problem. Here is an example:

[0187] question:

[0188] Xiao Ming bought 5 apples. Each apple cost her $2. After the discount she bought them at a 50% discount. After the purchase she decided she didn't like 2 of them and sold them to her friend for $1. How much did she lose?

[0189] answer:

[0190] Step 1: Break the problem down into three sub-problems:

[0191] Subproblem 1: Calculate the original cost of all apples

[0192] Subproblem 2: Calculate how much she saved from the discount

[0193] Sub-problem 3: Calculate how much money Xiao Ming made from selling two apples

[0194] Step 2: Solve subproblem 1

[0195] Step 2.1: Since each apple costs $2 and she buys 5, her total cost without any discount is 2*5=$10.

[0196] Step 3: Solve Subproblem 2

[0197] Step 3.1: If she gets a 50% discount on all apples, she saves 10*50% / 100% = $5.

[0198] Step 4: Solve Subproblem 3

[0199] Step 4.1: If she sells 2 apples at $1 each, she earns 2*1=$2.

[0200] Step 5: Subtract the amount saved and the amount earned from the original cost to find out how much money she lost after purchasing the apples.

[0201] Step 5.1: She loses $10 (original cost) - 5 (amount saved) - 2 (amount earned) = $3 after purchasing the apples.

[0202] So, Xiao Ming lost $3 after purchasing the apples, including purchasing the apples, getting the discount, and selling two of the apples.

[0203] So the answer is\n####3.

[0204] Please answer the following questions using the template above.

[0205] }

[0206] The second thinking reasoning prompt word T3 mentioned above includes text description, reasoning format and reasoning example at the same time, thereby guiding the large language model to perform step-by-step reasoning according to T3 when performing thinking reasoning.

[0207] Step S232, reasoning the problem to be processed according to the second thinking reasoning prompt word, generating the second partial reasoning result of the current step. Figure 4 The entire reasoning process needs to loop into step S232 to complete the reasoning of each step. Each time step S232 is entered, only the first local reasoning result of the current step is generated. After the first local reasoning result is generated by step S232 at each step, subsequent steps S233, S234, S235, and S236 will be entered to test the step, and after the test passes, step S232 will be looped to perform the next step of reasoning until the reasoning is completed.

[0208] Taking the reasoning process of the problem to be processed Q1 based on the second chain thinking reasoning prompt word T3 as an example, the second partial reasoning result of step 1 is:

[0209] Step 1: Break the problem down into three sub-problems:

[0210] Sub-problem 1: Calculate the annual income that Xiao Ming can get from selling lemons

[0211] Sub-problem 2: Calculate the expenses Xiao Ming needs to pay each year in addition to the income from selling lemons

[0212] Subproblem 3: Divide the cost of growing lemons by the annual net income to find how many years it will take to start making a profit.

[0213] The second local reasoning result of step 2 is:

[0214] Step 2: Solve subproblem 1

[0215] Step 2.1: The lemon tree can produce 7 lemons every year. Each lemon can be sold for 1.5 yuan. Therefore, he can earn 7*1.5=10.5 yuan every year by selling lemons.

[0216] For the convenience of subsequent explanation, the second thinking reasoning result of Q1 based on T3 is given here, recorded as A2, specifically:

[0217] {

[0218] Step 1: Break the problem down into three sub-problems:

[0219] Sub-problem 1: Calculate the annual income that Xiao Ming can get from selling lemons

[0220] Sub-problem 2: Calculate the expenses Xiao Ming needs to pay each year in addition to the income from selling lemons

[0221] Subproblem 3: Divide the cost of growing lemons by the annual net income to find how many years it will take to start making money.

[0222] Step 2: Solve subproblem 1

[0223] Step 2.1: The lemon tree can produce 7 lemons every year. Each lemon can be sold for 1.5 yuan. Therefore, he can earn 7*1.5=10.5 yuan every year by selling lemons.

[0224] Step 3: Solve Subproblem 2

[0225] Step 3.1: Every year, he needs to pay 3 yuan for watering and feeding the lemon tree.

[0226] Step 4: Solve Subproblem 3

[0227] Step 4.1: Every year, his net income is 10.5 yuan from selling lemons - 3 yuan for watering and feeding = 7.5 yuan.

[0228] Step 5: First calculate how many years it will take to recover the principal of the 90 yuan invested

[0229] Step 5.1: If you want to use the annual net income of 7.5 yuan to pay for the planting cost of 90 yuan, it will take 90 / 7.5 = 12 years to start making money

[0230] Therefore, it will take 12 years for Xiao Ming to start making money from his lemon trees, including the cost of planting the lemon trees, the annual watering and feeding costs, and the annual income from selling lemons.

[0231] So the answer is\n####12.

[0232] }

[0233] According to the above description, after obtaining the second partial reasoning result of each step in step S232, the second verification process of the second partial reasoning result of the current step is entered. Taking the above-mentioned problem Q1 as an example of the step-by-step reasoning process according to the second thinking reasoning prompt word T3, after generating the second partial reasoning result of each step, step S233 is entered to perform the first verification process.

[0234] Step S233, obtaining a second verification prompt word. The second verification prompt word can reuse the first verification prompt word, or can be a different prompt word, which is characterized in that it needs to guide the large language model to perform fact checking, logic checking, and data calculation checking.

[0235] Step S234, obtaining a second inspection object.

[0236] The second test object may be the second local reasoning result of the current step, or the second local reasoning results of the current step and all steps before the current step, and may be set accordingly according to the capabilities learned by the current large language model.

[0237] In a specific example, the second test object is the second local reasoning result of the current step, and the reasoning process of the problem to be processed Q1 according to the second thinking reasoning prompt word T3 is described. The second test object of step 3 is

[0238] {

[0239] Step 3: Solve Subproblem 2

[0240] Step 3.1: If she gets a 50% discount on all apples, she saves 10*50% / 100% = $5.

[0241] }

[0242] In another specific example, the second test object is the second partial reasoning result of the current step and all the steps before the current step. The reasoning process of the problem to be processed Q1 according to the second thinking reasoning prompt word T3 is used to illustrate that the second test object of step 3 is:

[0243] {

[0244] Step 1: Break the problem down into three sub-problems:

[0245] Subproblem 1: Calculate the original cost of all apples

[0246] Subproblem 2: Calculate how much she saved from the discount

[0247] Sub-problem 3: Calculate how much money Xiao Ming made from selling two apples

[0248] Step 2: Solve subproblem 1

[0249] Step 2.1: Since each apple costs $2 and she buys 5, her total cost without any discount is 2*5=$10.

[0250] Step 3: Solve Subproblem 2

[0251] Step 3.1: If she gets a 50% discount on all apples, she saves 10*50% / 100% = $5.

[0252] }

[0253] Step S235: Perform the second inspection of the current step according to the second inspection prompt word and the second inspection object to obtain the inspection result of the second inspection object.

[0254] During implementation, the inspection procedure of the first inspection can be reused, and the splicing method of the second inspection prompt word and the second inspection object is the same as the splicing method of the first inspection prompt word and the first inspection object, which will not be repeated here.

[0255] Step S326: Determine the second inspection result according to the inspection result of the second inspection object and the second inspection number of the current step. The second inspection number of the current step is used to record the number of second inspection processes performed in the current step. In the step-by-step reasoning process, before the first inspection of each step, the corresponding second inspection number is "0". When each second inspection is completed, the corresponding second inspection number is "+1".

[0256] If the inspection result of the second inspection object is passed or the second inspection times of the current step reaches or exceeds the second predetermined value (i.e., the second inspection times >= the second predetermined value), the second inspection result of the current step is passed; otherwise (the inspection result of the second inspection object is failed and the second inspection times of the current step < the second predetermined value), the second inspection result of the current step is failed.

[0257] The judgment rule used here is consistent with the judgment rule in step S226. The second predetermined value can reuse the value of the first predetermined value.

[0258] In a specific example, if the second test object test result of the current step is failed, and the second test times of the current step is less than the second predetermined value (the second predetermined value is 3), then the second test result of the current step is failed, and the process enters step S237, and regenerates the first local reasoning result of the current step. This method enables the large language model to reduce the probability of errors and hallucinations in the intermediate steps when solving problems, especially complex problems, avoid the accumulation of errors in the step-by-step reasoning process, and ensure that the reasoning process does not deviate from the correct reasoning direction.

[0259] In another specific example, if the inspection result of the second inspection object of the current step is passed, then the first inspection result of the current step is passed, and the process goes to step S238; or if the number of second inspections of the current step reaches a second predetermined value, then the second inspection result of the current step is also passed, and the process goes to step S238 to continue the next reasoning. This protection mechanism prevents the large model from entering an infinite loop due to failure of the second inspection when the large model has not yet learned the relevant reasoning knowledge and cannot give the correct local reasoning results.

[0260] Step S237: Delete the second partial reasoning result of the current step. Take the reasoning process of Q1 according to T3 (as shown in A2) as an example. In step 3, when the second test result of step 3 is not passed and the second test number of step 3 is less than the second predetermined value, the reasoning content of the current step 3 is deleted, that is, {

[0261] Step 3: Solve Subproblem 2

[0262] Step 3.1: If she gets a 50% discount on all apples, she saves 10*50% / 100% = $5.

[0263] }

[0264] Then, the process proceeds to step S232 to regenerate the second local reasoning result of the current step (ie, step 3), thereby ensuring the correctness of each local reasoning step as much as possible and avoiding accumulated errors during the reasoning process.

[0265] Step S238: Determine whether the reasoning of the problem to be processed has been completed. If the reasoning has not been completed, go to step S232 to continue the next step of reasoning.

[0266] If the reasoning on the problem to be processed has been completed, the entire reasoning process is completed and the second thinking reasoning result is obtained.

[0267] Figure 5 A schematic block diagram of a data processing device 500 according to an embodiment of the present invention is shown. As shown in the figure, the device 500 includes a data acquisition module 510, a first data reasoning module 520, a second data reasoning module 530, and a target data reasoning module 540.

[0268] The data acquisition module 510 is used to acquire the issues to be processed.

[0269] The first data reasoning module 520 is used to reason about the problem to be processed according to the first thinking reasoning method to obtain a first thinking reasoning result.

[0270] The second data reasoning module 530 is used to reason about the problem to be processed according to a second thinking reasoning method to obtain a second thinking reasoning result, wherein the second thinking reasoning method is a thinking reasoning method different from the first thinking reasoning method.

[0271] The target data reasoning module 540 is used to generate a target reasoning result for the problem to be processed according to the target result selection prompt word, the first thinking reasoning result and the second thinking reasoning result.

[0272] The first data reasoning module 510 includes two submodules: a first local reasoning module and a first verification module.

[0273] The first local reasoning module is used to perform the following steps: obtain the first thinking reasoning prompt word; perform step-by-step reasoning on the problem to be processed according to the first thinking reasoning prompt word to generate each first local reasoning result. When the first test result of each step fails, regenerate the first local reasoning result of the current step.

[0274] The first inspection module is used to perform the following operation steps: perform a first inspection process on the first local reasoning result of each step to obtain a first inspection result; if the first inspection result of the current step is failed, delete the first local reasoning result of the current step, otherwise, continue with the next step of reasoning.

[0275] Among them, the first inspection process includes: obtaining a first inspection prompt word; obtaining a first inspection object; performing the first inspection processing of this step on the first inspection object according to the first inspection prompt word, and obtaining the inspection result of the first inspection object of this step; if the inspection result of the first inspection object is passed or the number of first inspections of this step exceeds a first predetermined value, then the first inspection result of this step is passed, wherein the number of first inspections of this step is used to record the number of times the first inspection processing is performed on this step; otherwise, the first inspection result of this step is failed.

[0276] The second data reasoning module 530 includes two submodules: a second local reasoning module and a second verification module.

[0277] The second local reasoning module is used to perform the following steps: obtaining the second thinking reasoning prompt words, performing step-by-step reasoning on the problem to be processed according to the second thinking reasoning prompt words, and generating the second local reasoning result of each step;

[0278] The second inspection module is used to perform the following steps: perform a second inspection on the second local reasoning result of each step to obtain a second inspection result; if the second inspection result of the current step is failed, delete the second local reasoning result of the current step, otherwise, continue with the next step of reasoning.

[0279] Among them, the second inspection process includes: obtaining a second inspection prompt word; obtaining a second inspection object; performing the second inspection processing of this step on the second inspection object according to the second inspection prompt word, and obtaining the inspection result of the second inspection object of this step; if the inspection result of the second inspection object is passed or the number of second inspections of this step exceeds a second predetermined value, then the second inspection result of this step is passed, wherein the first inspection number of this step is used to record the number of second inspection processings performed in this step; otherwise, the second inspection result of this step is failed.

[0280] The data processing device 500 of the embodiment of the present invention can be composed of Figure 1 The electronic device 100 shown runs program instructions to implement and execute various steps in the data processing method according to the embodiment of the present invention.

[0281] According to an exemplary embodiment of the present invention, an electronic device is provided. The electronic device may include at least one processor and at least one memory. The memory stores program codes for implementing the corresponding steps in the data processing method according to the embodiment of the present invention. The processor is used to run the program codes stored in the memory to execute the corresponding steps of the data processing method according to the embodiment of the present invention, and to implement the various modules in the data processing device according to the embodiment of the present invention. The electronic device may adopt the aforementioned Figure 1 The electronic devices in the illustrated embodiments and any other suitable electronic devices.

[0282] In one embodiment, when the program code is executed by a processor, the following steps are performed:

[0283] Get pending issues;

[0284] Reasoning the problem to be processed according to the first thinking and reasoning method to obtain a first thinking and reasoning result;

[0285] Reasoning the problem to be processed according to a second thinking and reasoning mode to obtain a second thinking and reasoning result, wherein the second thinking mode is a thinking mode different from the first thinking and reasoning mode;

[0286] A target reasoning result of the problem to be processed is generated according to the first thinking reasoning result and the second thinking reasoning result, wherein the target reasoning result of the problem to be processed is one of the first thinking reasoning result and the second thinking reasoning result. In addition, when the program code is executed by the processor, the other steps of the following method embodiments of the present invention are also executed. For details, please refer to the various method embodiments of the present invention and the statements of the claims of the present invention, which will not be repeated here.

[0287] In addition, according to another embodiment of the present invention, a computer-readable storage medium is also provided, on which program instructions are stored, and when the program instructions are run by a computer or a processor, they are used to perform the corresponding steps of the data processing method of the embodiment of the present invention, and are used to implement the corresponding modules in the data processing device according to the embodiment of the present invention. The storage medium may include, for example, a memory card of a smart phone, a storage component of a tablet computer, a hard disk of a personal computer, a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a portable compact disk read-only memory (CD-ROM), a USB memory, or any combination of the above storage media. The computer-readable storage medium may be any combination of one or more computer-readable storage media.

[0288] In one embodiment, the computer program instructions, when executed by a computer, can implement various functional modules of a data processing device according to an embodiment of the present invention, and / or can execute a data processing method according to an embodiment of the present invention.

[0289] In one embodiment, the computer program instructions, when executed by a computer, perform the following steps: obtaining a problem to be processed;

[0290] Reasoning the problem to be processed according to the first thinking and reasoning method to obtain a first thinking and reasoning result;

[0291] Reasoning the problem to be processed according to a second thinking and reasoning mode to obtain a second thinking and reasoning result, wherein the second thinking mode is a thinking mode different from the first thinking and reasoning mode;

[0292] The target reasoning result of the problem to be processed is generated according to the first thinking reasoning result and the second thinking reasoning result.

[0293] In addition, the computer program instructions also perform other steps of various method embodiments of the present invention when executed by the computer. For details, please refer to the various method embodiments of the present invention and the statements of the claims of the present invention, which will not be repeated here. Each module of the data processing device according to an embodiment of the present invention can be implemented by running the computer program instructions stored in the memory by the processor of the electronic device according to an embodiment of the present invention, or can be implemented when the computer instructions stored in the computer-readable storage medium according to an embodiment of the present invention are executed by the computer.

[0294] According to the data processing method and device, electronic device and storage medium of the embodiments of the present invention, the problem to be processed is reasoned according to two thinking reasoning methods to obtain a first thinking reasoning result and a second thinking reasoning result respectively, and finally the final target reasoning result is obtained by comprehensive judgment based on the two reasoning results, thereby effectively avoiding the problems of hallucination, inaccuracy, and generalization in the output of complex problems by the existing single reasoning method of the thinking chain, and especially avoiding the problem of not being able to find the correct reasoning direction and giving the correct answer in the reasoning of mathematical problems.

[0295] Although example embodiments have been described herein with reference to the accompanying drawings, it should be understood that the above example embodiments are merely exemplary and are not intended to limit the scope of the present invention thereto. Various changes and modifications may be made therein by one of ordinary skill in the art without departing from the scope and spirit of the present invention. All such changes and modifications are intended to be included within the scope of the present invention as required by the appended claims.

[0296] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0297] The various techniques described herein may be implemented in combination with hardware or software, or a combination thereof. Thus, the method, apparatus, and device of the present invention, or some aspects or portions of the method, apparatus, and device of the present invention may be in the form of program codes (i.e., instructions) embedded in a tangible medium, such as a removable hard disk, a USB flash drive, a floppy disk, a CD-ROM, or any other machine-readable storage medium, wherein when the program is loaded into a machine such as a computer and executed by the machine, the machine becomes a device for practicing the present invention.

[0298] In the case where the program code is executed on a programmable computer, the electronic device generally includes a processor, a storage medium readable by the processor (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device. The memory is configured to store the program code; the processor is configured to execute the remote assistance method of the present invention according to the instructions in the program code stored in the memory.

[0299] By way of example and not limitation, readable media include readable storage media and communication media. Readable storage media stores information such as computer-readable instructions, data structures, program modules or other data. Communication media generally embody computer-readable instructions, data structures, program modules or other data in modulated data signals such as carrier waves or other transmission mechanisms, and include any information transmission medium. Any combination of the above is also included in the scope of readable media. In the specification of the present application, algorithms and displays are not inherently related to any specific computer, virtual system or other device. Various general systems can also be used with the examples of the present invention. According to the above description, it is obvious to construct the structure required for such systems. In addition, the present invention is not directed to any specific programming language. It should be understood that various programming languages ​​can be used to implement the software and algorithm-related content of the present invention described herein, and the description of the specific language above is only to disclose some specific embodiments of the present invention, but not to limit the use of the specific language.

[0300] In the specification of the application, a lot of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this specification.

[0301] In the several embodiments provided in this application, it should be understood that the disclosed devices, equipment and methods can be implemented in other ways. For example, the above-described device and equipment embodiments are only illustrative, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed.

[0302] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0303] Similarly, it should be understood that in order to streamline the present invention and help understand one or more of the various inventive aspects, in the description of the exemplary embodiments of the present invention, the various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, the method of the present invention should not be interpreted as reflecting the following intention: the claimed invention requires more features than the features explicitly stated in each claim. More specifically, as reflected in the corresponding claims, the inventive point is that the corresponding technical problem can be solved with less than all the features of a single disclosed embodiment. Therefore, the claims following the specific embodiment are hereby expressly incorporated into the specific embodiment, wherein each claim itself serves as a separate embodiment of the present invention.

[0304] It will be understood by those skilled in the art that, except for mutually exclusive features, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this specification may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature that provides the same, equivalent or similar purpose.

[0305] In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, in the claims, any one of the claimed embodiments may be used in any combination.

[0306] The components in the various embodiments of the present application can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that computers, servers, microprocessors or digital signal processors (DSPs) can be used in practice to implement some or all of the functions of some modules in the equipment and devices according to embodiments of the present invention. The present invention can also be implemented as a device program (e.g., computer program and computer program product) for executing part or all of the methods described herein. Such a program implementing the present invention can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0307] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets should not be constructed as a limitation to the claims. Nouns such as "comprise", "include", "have" do not exclude the presence of elements or steps not listed in the claims. The quantifier "one" or "a" preceding an element does not exclude the presence of multiple such elements. The present invention can be implemented by means of hardware including several different elements and by means of appropriately programmed computers. In a unit claim that lists several devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order, and these words may be interpreted as names.

[0308] In addition, in the embodiments of the present application, the expression "and / or" includes any and all combinations of the associated listed words. For example, the expression "A and / or B" may include A, may include B, or may include both A and B. Words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way. In the description of the embodiments of the present application, unless otherwise specified, the meaning of "multiple" refers to two or more.

[0309] In the description of the embodiments of the present application, when a component is referred to as being "connected" or "accessed" to other components, it should be understood that: the component is not only directly connected to or accessed to other components, but also another component may exist between the component and the other components. On the other hand, when a component is referred to as being "directly connected" or "directly accessed" to other components, it should be understood that there is no component between them. When a component is referred to as being "movably connected" to other components, it means that the positional relationship between the component and the other components is changeable, such as the relationship between a slide rail and a slider, the slider can slide on the slide rail, and the slide rail and the track are movably connected. When a component is referred to as being "fixedly connected" to other components, it means that the positional relationship between the component and the other components after being assembled together is relatively fixed.

[0310] The above is only a specific embodiment of the present invention or an explanation of a specific embodiment. The protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or replacements within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Although the present application is described according to a limited number of embodiments, it is understood by the technicians in the technical field that other embodiments can be envisioned within the scope of the present application described thereby, thanks to the above description. In addition, it should be noted that the language used in this specification is mainly selected for the purpose of readability and teaching, rather than for explaining or limiting the subject matter of the present application. Therefore, without departing from the scope and spirit of the attached claims, many modifications and changes are obvious to ordinary technicians in the technical field. For the scope of the present application, the disclosure made in the present application is illustrative, not restrictive, and the protection scope of the present application shall be subject to the protection scope of the claims.

Claims

1. A data processing method based on a large language model, It is characterized in that The method comprises: Get pending issues; Reasoning the problem to be processed according to the first thinking and reasoning method to obtain a first thinking and reasoning result; Reasoning the problem to be processed according to a second thinking and reasoning mode to obtain a second thinking and reasoning result, wherein the second thinking mode is a thinking mode different from the first thinking and reasoning mode; The target reasoning result of the problem to be processed is generated according to the first thinking reasoning result and the second thinking reasoning result.

2. The method according to claim 1, in, The reasoning of the problem to be processed according to the first thinking and reasoning mode to obtain the first thinking and reasoning result includes: Get the first thinking reasoning prompt words; Reasoning the problem to be processed step by step according to the first thinking reasoning prompt words, generating a first local reasoning result of each step; After generating the first local reasoning result of each step, the first local reasoning result of the step is subjected to a first inspection process to obtain the first inspection result of the step; wherein, if the first inspection result of the step is failed, the first local reasoning result of the step is deleted and the first local reasoning result of the step is regenerated; otherwise, the next step of reasoning is continued until the reasoning is completed to obtain the first thinking reasoning result.

3. The method according to claim 2, It is characterized in that After generating the first local reasoning result of each step, performing a first inspection process on the first local reasoning result of the step to obtain the first inspection result of the step includes: Obtaining a first inspection prompt word; Acquire a first test object, wherein the first test object includes a first local reasoning result of the step; According to the first inspection prompt word, the first inspection process of this step is performed on the first inspection object to obtain the inspection result of the first inspection object of this step; wherein, if the inspection result of the first inspection object is failed, the first inspection object is deleted, a new first inspection object is re-acquired, and the first inspection process is performed on the new first inspection object to obtain a new inspection result of the first inspection object; if the inspection result of the first inspection object is still failed, the aforementioned steps are repeated until the inspection result of the first inspection object of this step is passed; if the number of consecutive failures of the inspection result of the first inspection object of this step reaches a first predetermined value, the inspection result of the first inspection object of this step is set to passed, and the most recent first local reasoning result is selected as the first local reasoning result of this step.

4. The method according to claim 1, in, The reasoning of the problem to be processed according to the second thinking and reasoning mode to obtain the second thinking and reasoning result includes: Get the second thought reasoning prompt words; Reasoning the problem to be processed step by step according to the second thinking reasoning prompt words, generating a second partial reasoning result for each step; After generating the second local reasoning result of each step, a second inspection process is performed on the second local reasoning result of the step to obtain the second inspection result of the step; wherein, if the second inspection result of the step is failed, the second local reasoning result of the step is deleted and the second local reasoning result of the step is regenerated; otherwise, the next step of reasoning is continued until the reasoning is completed to obtain the second thinking reasoning result.

5. The method according to claim 4, It is characterized in that After generating the second local reasoning result of each step, performing a second inspection process on the second local reasoning result of the step to obtain the second inspection result of the step includes: Obtaining a second inspection prompt word; Acquire a second test object, wherein the second test object includes the second local reasoning result of this step; According to the second inspection prompt word, the second inspection process of this step is performed on the second inspection object to obtain the inspection result of the second inspection object of this step; wherein, if the inspection result of the second inspection object is failed, the second inspection object is deleted, a new second inspection object is re-acquired, and the second inspection process is performed on the new second inspection object to obtain a new inspection result of the second inspection object; if the inspection result of the second inspection object is still failed, the aforementioned steps are repeated until the inspection result of the second inspection object of this step is passed; if the number of consecutive failures of the inspection result of the second inspection object of this step reaches a second predetermined value, the inspection result of the second inspection object of this step is set to passed, and the most recent second local reasoning result is selected as the second local reasoning result of this step.

6. The method according to claim 2 or 5, It is characterized in that The first verification process includes fact checking, logic checking and data calculation checking, wherein the fact checking refers to checking whether the evidence cited in the current reasoning step is consistent with the facts, the logic checking refers to checking whether the logic used in the current reasoning step is correct, and the calculation checking refers to checking whether the calculation result of the current reasoning step is correct; if and only if the fact checking, the logic checking and the data calculation checking are all passed, the first verification result is passed, otherwise the first verification result is failed; or, The second verification process includes fact checking, logic checking and data calculation checking, wherein the fact checking refers to checking whether the evidence cited in the current reasoning step is consistent with the facts, the logic checking refers to checking whether the logic used in the current reasoning step is correct, and the calculation checking refers to checking whether the calculation result of the current reasoning step is correct; if and only if the fact checking, the logic checking and the data calculation checking are all passed, the second verification result is passed, otherwise the second verification result is failed.

7. The method according to any one of claims 1 to 5, It is characterized in that Generating the target reasoning result of the problem to be processed according to the first thinking reasoning result and the second thinking reasoning result includes: Get the target result selection prompt word; According to the target result, a prompt word is selected, the first thinking reasoning result, and the second thinking reasoning result to obtain the target reasoning result; And / or, the reasoning on the problem to be processed according to the first thinking reasoning method, and the reasoning on the problem to be processed according to the second thinking reasoning method, are both performed based on a large language model; and / or, the problem to be processed is a mathematical problem; and / or, the first thinking reasoning method is forward reasoning, and the second thinking reasoning method is reverse reasoning.

8. A data processing device, It is characterized in that The device comprises: A data acquisition module is used to obtain problems to be processed; A first data reasoning module is used to reason about the problem to be processed according to a first thinking reasoning method to obtain a first thinking reasoning result; A second data reasoning module is used to reason about the problem to be processed according to a second thinking reasoning method to obtain a second thinking reasoning result; The target data reasoning module generates a target reasoning result of the problem to be processed according to the first thinking reasoning result and the second thinking reasoning result.

9. An electronic device, It is characterized in that include: at least one processor; as well as A memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, and the program instructions include instructions for executing the method according to any one of claims 1 to 7.

10. A readable storage medium storing program instructions, It is characterized in that When the program instructions are read and executed by a computing device, the computing device is caused to execute the method as claimed in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Complex problem processing method and device, equipment and medium

    CN116737912A

Cited By

  • Major language model-based mathematical problem solving step weight optimization method

    CN119046454A