Higher mathematics problem solving model reasoning reinforcement method based on hierarchical thinking chain

By obtaining and calculating the similarity between the reasoning thinking chain and the standard thinking chain of advanced mathematics problems, clustering and model fine-tuning are performed, which solves the problem of unclear logical links in solving advanced mathematics problems and achieves a more accurate and transparent problem-solving process.

CN120654837BActive Publication Date: 2025-10-21CHANGSHA PURAN NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511171917.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-21
Publication Date
2025-10-21
Estimated Expiration
2045-08-21

AI Technical Summary

Technical Problem

Existing large-scale language models have unclear logical links and lack of reasoning transparency in solving advanced mathematics problems, resulting in a lack of orderliness and accuracy in the problem-solving process, and are particularly prone to errors when processing multi-step reasoning and complex formulas.

Method used

By obtaining the reasoning thinking chain and the standard thinking chain, calculating the sentence similarity and clustering, and using the similarity value to fine-tune the problem-solving model, the problem-solving model's logical link accuracy and transparency are enhanced.

Benefits of technology

Improve the accuracy and transparency of the problem-solving model's thinking chain in solving advanced mathematics problems, and enhance the model's ability to solve multi-step reasoning and complex formulas.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120654837B_ABST
    Figure CN120654837B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of artificial intelligence, in particular to a higher mathematics problem solving model reasoning reinforcement method based on a hierarchical thinking chain, which comprises the following steps: obtaining a target title, a reasoning thinking chain output by a problem solving model and a preset standard thinking chain; performing similarity calculation on each reasoning sentence in the reasoning thinking chain and each standard sentence in the standard thinking chain to obtain a plurality of first similarity degrees; clustering the plurality of reasoning sentences in the reasoning thinking chain according to the first similarity degrees to obtain a plurality of class clusters; performing similarity calculation on each class cluster and each step in the standard thinking chain to obtain a plurality of second similarity degrees; calculating a similarity value according to the second similarity degrees, and fine-tuning the problem solving model based on the similarity value to obtain a fine-tuned model. The problem solving model can output a more accurate problem solving thinking chain through fine-tuning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of artificial intelligence, and in particular to a method for reinforcing reasoning of a high-level mathematics problem-solving model based on a hierarchical thinking chain. Background Art

[0002] With the rapid development of large-scale language models (LLMs), models such as GPT and PaLM have demonstrated strong performance in fields such as natural language processing and mathematical computation. However, automated problem-solving systems in the highly structured and symbol-intensive field of advanced mathematics still face numerous challenges. Advanced mathematical problems require not only accurate computational results but also rigorous logical reasoning, symbolic operations, and step-by-step derivation. Existing large models are often trained on general corpora and lack specialized knowledge and thought chain annotation for advanced mathematics. Consequently, they exhibit problems such as unclear logical links and lack of reasoning transparency when processing complex formulas, multi-step reasoning, and symbolic expressions. For example, when solving complex problems, models often focus solely on the final answer, ignoring the integrity and rationality of intermediate reasoning steps. This results in a disorganized and unexplainable problem-solving process. This not only reduces user trust in the model's results but also makes the model prone to skipping steps or making incorrect generalizations when faced with problems requiring multi-step reasoning, complex formulas, and unusual symbolic structures.

[0003] That is to say, the accuracy of the problem-solving thinking chain output by the problem-solving model in the prior art is relatively poor. Summary of the Invention

[0004] In order to solve the technical problem of poor accuracy of the problem-solving thought chain output by the problem-solving model in the prior art, the present invention provides a method for strengthening reasoning of a higher mathematics problem-solving model based on a hierarchical thought chain. The technical solution adopted is as follows:

[0005] In a first aspect, an embodiment of the present invention provides a method for strengthening reasoning of a higher mathematics problem-solving model based on a hierarchical thinking chain, the method comprising:

[0006] Obtaining a reasoning chain of thought and a standard chain of thought for a target problem, wherein the target problem is an advanced mathematics problem, the reasoning chain of thought is a chain of thought obtained after inputting the target problem into a problem-solving model, and the standard chain of thought is a chain of thought preconfigured for the target problem;

[0007] Performing similarity calculation on each inference sentence in the inference thinking chain and each standard sentence in the standard thinking chain to obtain a plurality of first similarities, where the first similarities are used to indicate the degree of similarity between the corresponding inference sentence and the corresponding standard sentence;

[0008] Clustering the multiple reasoning sentences in the reasoning thought chain according to the multiple first similarities to obtain multiple clusters;

[0009] Performing similarity calculations on each cluster and multiple steps in the standard thinking chain to obtain multiple second similarities, where the second similarities are used to indicate the degree of similarity between the corresponding cluster and the corresponding steps in the standard thinking chain;

[0010] A similarity value is calculated according to the multiple second similarities, and the problem-solving model is fine-tuned based on the similarity value to obtain a fine-tuned model.

[0011] Furthermore, performing similarity calculation on each inference sentence in the inference thinking chain and each standard sentence in the standard thinking chain to obtain a plurality of first similarities includes:

[0012] Performing vector extraction on a first inference sentence to obtain first vector data, and performing vector extraction on a first standard sentence to obtain second vector data, wherein the first inference sentence is any one of the multiple inference sentences included in the inference thinking chain, and the first standard sentence is any one of the multiple standard sentences included in the standard thinking chain;

[0013] Calculating the cosine similarity between the first vector data and the second vector data to obtain a vector similarity value;

[0014] A first similarity between the first inference sentence and the first standard sentence is determined according to the vector similarity value.

[0015] Furthermore, determining a first similarity between the first inference sentence and the first standard sentence based on the vector similarity value includes:

[0016] Converting multiple formulas in the first inference sentence into multiple first abstract syntax trees, and converting multiple formulas in the first standard sentence into multiple second abstract syntax trees;

[0017] calculating an edit distance between each of the first abstract syntax trees and each of the second abstract syntax trees to obtain a plurality of edit distances;

[0018] Calculating an average of the plurality of edit distances, and determining the average as a formula difference value;

[0019] A ratio of the vector similarity value to the formula difference value is determined as a first similarity between the first inference sentence and the first standard sentence.

[0020] Furthermore, the plurality of reasoning sentences in the reasoning chain are clustered according to the plurality of first similarities to obtain a plurality of clusters, including:

[0021] Determining, based on the multiple first similarities, multiple third similarities associated with each of the inference sentences, wherein the multiple third similarities correspond one-to-one to multiple steps in the standard thought chain, and the third similarity is: the largest first similarity among the multiple first similarities between the associated inference sentence and the multiple standard sentences included in the corresponding step;

[0022] Determining, based on the multiple third similarities associated with each of the inference sentences, multiple fourth similarities commonly associated with any two different inference sentences, wherein the multiple fourth similarities correspond one-to-one to multiple steps in the standard thought chain, and the fourth similarity is: the product of the third similarity of the corresponding step associated with one of the inference sentences in the any two different inference sentences and the third similarity of the corresponding step associated with the other of the any two different inference sentences;

[0023] Among a plurality of fourth similarities commonly associated with any two different inference sentences, determining the largest fourth similarity as the fifth similarity value between the any two different inference sentences;

[0024] The multiple inference sentences are clustered according to the fifth similarity value between the any two different inference sentences to obtain the multiple clusters.

[0025] Furthermore, calculating the similarity value according to the multiple second similarities includes:

[0026] In the plurality of clusters, a plurality of sixth similarities are obtained for each cluster, wherein the sixth similarity is a similarity between any two different inference sentences in the corresponding cluster;

[0027] Determine the largest sixth similarity among the multiple sixth similarities of each cluster as the iterative fixed probability corresponding to each cluster;

[0028] According to the iterative fixed probability corresponding to each cluster, the second similarity between the cluster and each step in the standard thinking chain is corrected to obtain a corrected similarity between each cluster and each step in the standard thinking chain;

[0029] Taking the multiple clusters as a first step sequence, the multiple steps in the standard thinking chain as a second step sequence, and the corrected similarity between each cluster and each step in the standard thinking chain as a measurement indicator, dynamic time regularization is performed on the multiple clusters and the multiple steps in the standard thinking chain to calculate the similarity value.

[0030] Furthermore, when there are multiple standard thinking chains for the target question, fine-tuning the problem-solving model based on the similarity value to obtain a fine-tuned model includes:

[0031] Calculating the average of multiple similarity values ​​corresponding to multiple standard thinking chains to obtain a similarity average;

[0032] The problem-solving model is fine-tuned based on the similarity mean to obtain a fine-tuned model.

[0033] Furthermore, fine-tuning the problem-solving model based on the similarity mean to obtain a fine-tuned model includes:

[0034] Normalizing the similarity mean to obtain a similarity normalized value;

[0035] Calculating a product of the similarity normalized value and a preset minimum learning rate to obtain a first product, and calculating a product of a supplementary value and a preset maximum learning rate to obtain a second product, wherein a sum of the supplementary value and the similarity normalized value is 1;

[0036] The sum of the first product and the second product is used as a target learning rate, and the parameters in the problem-solving model are fine-tuned according to the target learning rate to obtain a fine-tuned model.

[0037] Furthermore, the step of obtaining the reasoning chain includes:

[0038] The target question and preset prompt information are combined to obtain model input information, wherein the prompt information is used to guide the problem-solving model to output a more complete reasoning chain;

[0039] The model input information is inferred based on the problem-solving model to obtain the inference thinking chain.

[0040] Furthermore, in the model input information, the tail of the target question is adjacent to the head of the prompt information.

[0041] Furthermore, the first similarity between the first inference sentence and the first standard sentence is the vector similarity value.

[0042] In a second aspect, another embodiment of the present invention provides a system for reinforcing a high-level mathematics problem-solving model reasoning based on a hierarchical thinking chain, the system comprising:

[0043] A thinking chain acquisition module is used to obtain a reasoning thinking chain and a standard thinking chain of a target problem, wherein the target problem is an advanced mathematics problem, the reasoning thinking chain is a thinking chain obtained after inputting the target problem into a problem-solving model, and the standard thinking chain is a thinking chain pre-configured for the target problem;

[0044] a first calculation module, configured to perform similarity calculation on each inference sentence in the inference thinking chain and each standard sentence in the standard thinking chain to obtain a plurality of first similarities, wherein the first similarities are used to indicate the degree of similarity between the corresponding inference sentence and the corresponding standard sentence;

[0045] A clustering module, configured to cluster the plurality of reasoning sentences in the reasoning thought chain according to the plurality of first similarities to obtain a plurality of clusters;

[0046] a second calculation module, configured to perform similarity calculations on each cluster and a plurality of steps in the standard thinking chain to obtain a plurality of second similarities, wherein the second similarities are used to indicate the degree of similarity between the corresponding cluster and the corresponding steps in the standard thinking chain;

[0047] A model fine-tuning module is used to calculate a similarity value according to the multiple second similarities, and fine-tune the problem-solving model based on the similarity value to obtain a fine-tuned model.

[0048] In a third aspect, another embodiment of the present invention further provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the method described in the first aspect when executed by the processor.

[0049] In a fourth aspect, another embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method described in the first aspect are implemented.

[0050] The present invention has the following beneficial effects:

[0051] After obtaining the reasoning thinking chain output by the problem-solving model after problem-solving reasoning for the target question, and the standard thinking chain pre-set for the target question, the present invention first calculates the first similarity between each sentence in the reasoning thinking chain and each sentence in the standard thinking chain, and uses the first similarity as a distance measurement indicator for clustering to complete the clustering processing of multiple sentences in the reasoning thinking chain, thereby achieving accurate division of multiple steps in the reasoning thinking chain, and then calculates the similarity between each step obtained by the division of the reasoning thinking chain and each step in the standard thinking chain, and calculates the similarity value based on this, so as to quantify the similarity between the reasoning thinking chain and the standard thinking chain through the similarity value, and finally fine-tunes the parameters in the problem-solving model according to the calculated similarity value, so as to guide the problem-solving model to reduce the learning of the problem-solving knowledge that has been mastered during the fine-tuning process, and increase the learning of the problem-solving knowledge that has not been mastered, so that the fine-tuned problem-solving model can support the output of a more accurate problem-solving thinking chain. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0053] Figure 1 A flowchart of a method for reinforcing a model of reasoning for solving advanced mathematics problems based on a hierarchical thinking chain provided by one embodiment of the present invention;

[0054] Figure 2 A schematic diagram of an abstract syntax tree of a formula provided by one embodiment of the present invention;

[0055] Figure 3 A schematic diagram of a structure of a high-level mathematics problem-solving model reasoning reinforcement system based on a hierarchical thinking chain provided by one embodiment of the present invention;

[0056] Figure 4 The present invention provides a schematic structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0057] In order to further illustrate the technical means and effects adopted by the present invention to achieve the predetermined purpose of the invention, the following, in conjunction with the accompanying drawings and preferred embodiments, describes in detail the specific implementation method, structure, features and effects of a method for strengthening the reasoning of a high-level mathematical problem-solving model based on a hierarchical thinking chain proposed by the present invention. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics of one or more embodiments may be combined in any suitable form.

[0058] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.

[0059] The specific scheme of the method for strengthening the reasoning of a high-level mathematics problem-solving model based on a hierarchical thinking chain provided by the present invention is described in detail below with reference to the accompanying drawings.

[0060] This paper proposes a method for strengthening the reasoning of advanced mathematics problem-solving models based on hierarchical thinking chains. Figure 1 , which shows a schematic flow chart of a method for strengthening reasoning of a high-level mathematics problem-solving model based on a hierarchical thinking chain provided by one embodiment of the present invention, the method comprising the following steps:

[0061] Step S1: Obtain the reasoning thinking chain and standard thinking chain of the target question.

[0062] The target question is an advanced mathematics question, the inference thinking chain is a thinking chain obtained after inputting the target question into a problem-solving model, and the standard thinking chain is a thinking chain pre-configured for the target question.

[0063] It should be understood that both the inference thinking chain and the standard thinking chain are used to answer the target question.

[0064] The above-mentioned target questions are advanced mathematics questions included in any one of the multiple samples used to fine-tune the problem-solving model. The above-mentioned multiple samples can be obtained from sources such as public mathematics question banks, mathematics textbooks, actual mathematics test questions, and mathematics exercise collections, so as to ensure that the number of samples of the multiple samples is sufficient (for example, more than 2,000) while covering various types and difficulty levels of advanced mathematics questions, so that the problem-solving model fine-tuned by multiple samples can have stronger versatility while ensuring the accuracy and completeness of the output problem-solving thinking chain.

[0065] For example, according to the types of advanced mathematics questions, the above different types may include calculation questions, application questions, proof questions, comprehensive questions, etc.; according to the knowledge points, the above different types may include calculus, linear algebra, spatial analytic geometry, series, differentials, etc.; the above difficulty levels may be divided into 1-5 levels, among which level 1 corresponds to the lowest problem-solving difficulty, and the problem-solving difficulty of subsequent levels increases successively, and level 5 corresponds to the highest problem-solving difficulty.

[0066] In the application, the format of several advanced mathematics problems collected from different sources can be unified. The unified format of the problems at least includes: problem description, problem label, and problem answer, etc. Among them, the problem description can be understood as the stem of the corresponding advanced mathematics problem itself, the problem label is used to indicate the type of question, difficulty level, etc. of the corresponding advanced mathematics problem, and the problem answer is used to solve the corresponding advanced mathematics problem, which can be obtained directly from the source of the corresponding advanced mathematics problem, or obtained through manual annotation by experts.

[0067] The answers to the above questions should at least include: derivation of intermediate results (formulas, symbols, and operators may be introduced), key logical inferences (such as induction, substitution, limits, and other operations), and the final conclusion or answer.

[0068] In an example, a high-level mathematics question and its answer (in JSON format) are represented as follows:

[0069] "question": "Find lim_{x→0} (sin x) / x",

[0070] "cot_steps": [

[0071] "As x→0, sin x approximates x in the limit (small angle approximation)",

[0072] “Thus, lim_{x→0} (sin x) / x ≈ lim_{x→0} x / x = 1”

[0073] ],

[0074] "answer": "1"

[0075] }

[0076] In this example, the data content corresponding to the "question" item can be understood as the stem of the advanced mathematics question itself, the data content corresponding to the "cot_steps" item can be understood as the pre-configured problem-solving thinking chain for the advanced mathematics question (that is, the aforementioned target thinking chain), and the data content corresponding to the "answer" item can be understood as the final conclusion or answer to the advanced mathematics question.

[0077] In the present invention, the problem-solving model can be understood as a large-scale language model (such as the DeepSeek Math model or the Wolfram Alpha model) used to solve advanced mathematics problems.

[0078] Step S2: perform similarity calculation on each reasoning sentence in the reasoning thinking chain and each standard sentence in the standard thinking chain to obtain multiple first similarities, where the first similarities are used to represent the degree of similarity between the corresponding reasoning sentence and the corresponding standard sentence.

[0079] Exemplarily, the process of performing similarity calculation on the current inference sentence and the current standard sentence to obtain the corresponding first similarity may be:

[0080] By extracting the first word vector of each word in the current inference sentence, and taking the average of the first word vectors of each word in the current inference sentence, the average is used as the sentence vector of the current inference sentence;

[0081] By extracting the second word vector of each word in the current standard sentence, and taking the average of the second word vectors of each word in the current standard sentence, the average is used as the sentence vector of the current standard sentence;

[0082] The cosine similarity between the sentence vector of the current inference sentence and the sentence vector of the current standard sentence is calculated, and the cosine similarity is determined as the first similarity between the current inference sentence and the current standard sentence.

[0083] Among them, the above-mentioned word vector extraction operation can be completed through the Word2Vec model, BERT model, etc.

[0084] Step S3: Clustering the multiple reasoning sentences in the reasoning thought chain according to the multiple first similarities to obtain multiple clusters.

[0085] The multiple clusters can be understood as multiple steps in the reasoning chain.

[0086] In step S3, compared with the method of performing correlation analysis on multiple reasoning sentences in the reasoning thinking chain (such as adopting the attention mechanism in the BERT model) and clustering the multiple reasoning sentences according to the correlation analysis results to divide the multiple steps in the reasoning thinking chain, based on the first similarity between each of the reasoning sentences and each of the standard sentences, clustering the multiple reasoning sentences in the reasoning thinking chain with reference to the standard thinking chain can make the step division of the reasoning thinking chain more accurate and reliable.

[0087] Furthermore, the plurality of reasoning sentences in the reasoning chain are clustered according to the plurality of first similarities to obtain a plurality of clusters, including:

[0088] Determining, based on the multiple first similarities, multiple third similarities associated with each of the inference sentences, wherein the multiple third similarities correspond one-to-one to multiple steps in the standard thought chain, and the third similarity is: the largest first similarity among the multiple first similarities between the associated inference sentence and the multiple standard sentences included in the corresponding step;

[0089] Determining, based on the multiple third similarities associated with each of the inference sentences, multiple fourth similarities commonly associated with any two different inference sentences, wherein the multiple fourth similarities correspond one-to-one to multiple steps in the standard thought chain, and the fourth similarity is: the product of the third similarity of the corresponding step associated with one of the inference sentences in the any two different inference sentences and the third similarity of the corresponding step associated with the other of the any two different inference sentences;

[0090] Among a plurality of fourth similarities commonly associated with any two different inference sentences, determining the largest fourth similarity as the fifth similarity value between the any two different inference sentences;

[0091] The multiple inference sentences are clustered according to the fifth similarity value between the any two different inference sentences to obtain the multiple clusters.

[0092] Through the above setting, based on the first similarity between each of the said reasoning sentences and each of the said standard sentences, multiple first similarities of each reasoning sentence and the multiple standard sentences included in each step of the standard thinking chain can be obtained, and the largest first similarity is determined as the index value of the degree of association between the corresponding reasoning sentence and the corresponding step in the standard thinking chain (that is, the aforementioned third similarity), so as to realize the association judgment between each reasoning sentence and each step in the standard thinking chain; then, based on this, the multiple reasoning sentences are combined in pairs, and the index values ​​of the degree of association between the two different reasoning sentences in the combination and the corresponding steps in the standard thinking chain are calculated accordingly (that is, the aforementioned fourth similarity), and then the step that is most likely to be associated with each combination in the standard thinking chain (that is, the step corresponding to the fifth similarity value in the standard thinking chain) is selected, and based on the index value of the degree of association between each combination and the step that is most likely to be associated with it in the standard thinking chain (that is, the aforementioned fifth similarity value), the distance index value between the two different reasoning sentences in the combination is adaptively determined (the larger the fifth similarity value, the smaller the distance index value), and the clustering operation is completed accordingly to obtain multiple clusters, that is, the accurate division of multiple steps in the reasoning thinking chain is completed with reference to the step setting of the standard thinking chain.

[0093] Further explanation is that when the first Sentences and When the similarity between the first and second sentences (referring to any two different reasoning sentences in the reasoning chain) and the sentences in the same step of the standard thinking chain is high, it can be considered that the first sentence in the reasoning chain is Sentences and There is a high probability that the sentences belong to the same logical step in the chain of reasoning thinking. Sentences and Step similarity between sentences (i.e. the aforementioned fifth similarity value) is:

[0094]

[0095] in, Indicates the total number of steps in the standard thinking chain; Indicates the first in the standard thinking chain A collection of sentences for steps; Indicates the first The sentence is the same as the first sentence in the standard thinking chain The logical similarity of the sentences (i.e. The sentence is the same as the first sentence in the standard thinking chain the first similarity of the sentences), Indicates the first The sentence is the same as the first sentence in the standard thinking chain The logical similarity of the sentences.

[0096] The reciprocal of the fifth similarity value between any two different inference sentences may be used as a distance value between the corresponding two different inference sentences in the clustering process.

[0097] In one example, the above clustering process can use the DBSCAN clustering algorithm, and set the minimum number of samples to form a cluster to 3, the radius of the core sample in the cluster to 5, and the samples referred to in the clustering process should be understood as reasoning sentences in the reasoning thinking chain.

[0098] In the application, after obtaining multiple clusters, the clusters can be sorted according to the order in which the core samples (also called cluster centers) of each cluster appear in the reasoning chain.

[0099] Step S4: perform similarity calculation on each cluster and multiple steps in the standard thinking chain to obtain multiple second similarities, where the second similarities are used to represent the degree of similarity between the corresponding cluster and the corresponding steps in the standard thinking chain.

[0100] Exemplarily, the process of obtaining the second similarity between each cluster and each step in the standard thinking chain includes:

[0101] Arbitrarily combining the several reasoning sentences included in each cluster and the several standard sentences included in each step of the standard thinking chain in pairs to obtain several target combinations corresponding to each cluster and each step in the standard thinking chain (the number of target combinations is the product of the number of corresponding reasoning sentences and the number of corresponding standard sentences);

[0102] The second similarity (ie, the average of the first similarities) can be obtained by calculating the average of several first similarities of several target combinations corresponding to each cluster and each step in the standard thinking chain.

[0103] This step calculates the mean of the sentence similarities (i.e., the aforementioned first similarity) between each reasoning sentence of the steps in the reasoning thinking chain and each standard sentence of the steps in the standard thinking chain, and determines the calculated mean as the index value (i.e., the second similarity) for measuring the similarity between the steps in the reasoning thinking chain and the steps in the standard thinking chain. This can fully consider the sentences included in the steps, avoid the influence of extreme values, and make the similarity judgment between the steps in the reasoning thinking chain and the steps in the standard thinking chain more accurate and comprehensive, that is, make the calculated second similarity more accurate and reliable.

[0104] Step S5: Calculate a similarity value based on the second similarity between each cluster and each step in the standard thinking chain, and fine-tune the parameters in the problem-solving model based on the similarity value to obtain a fine-tuned model.

[0105] Exemplarily, the multiple steps in the reasoning thinking chain corresponding to the multiple clusters can be taken as the first time series (each step corresponding to each cluster is regarded as each node in the first time series), and the multiple steps in the standard thinking chain can be taken as the second time series (each step in the standard thinking chain is each node in the second time series). The inverse of the second similarity between the steps corresponding to each cluster and each step in the standard thinking chain is taken as the distance between nodes to calculate the dynamic time warping (DTW) distance between the first time series and the second time series, and the DTW distance is determined as the aforementioned similarity value to use the similarity value to quantify the degree of similarity between the reasoning thinking chain and the standard thinking chain.

[0106] In the application, the learning rate (Learning Rate, used to control the size of the update step of the problem-solving model during the parameter update process) of the problem-solving model for the target problem can be dynamically set according to the similarity value, and the parameters in the problem-solving model can be fine-tuned based on the set learning rate and the target problem to obtain a fine-tuned model. Among them, the larger the similarity value, the better the problem-solving reasoning effect of the problem-solving model for the target problem. Therefore, a smaller learning rate can be selected to guide the problem-solving model to reduce the knowledge learning of the solved problems and instead focus more on the problem-solving knowledge learning of weak or more erroneous samples (referring to advanced mathematics problems corresponding to smaller numerical similarity values), thereby enhancing the final fine-tuning effect of the problem-solving model, so that the problem-solving model after multiple fine-tuning can be applicable to more diverse and complex problem-solving scenarios.

[0107] It should be understood that the fine-tuning operation on the problem-solving model will be performed multiple times in succession, and the advanced mathematics questions used in each execution are different. Among them, the fine-tuned model referred to in step S5 can be understood as: the problem-solving model before the next model fine-tuning operation, or the problem-solving model after the model fine-tuning processing is completed.

[0108] After obtaining the reasoning thinking chain output by the problem-solving model after problem-solving reasoning for the target question, and the standard thinking chain pre-set for the target question, the present invention first calculates the first similarity between each sentence in the reasoning thinking chain and each sentence in the standard thinking chain, and uses the first similarity as a distance measurement indicator for clustering to complete the clustering processing of multiple sentences in the reasoning thinking chain, thereby achieving accurate division of multiple steps in the reasoning thinking chain, and then calculates the similarity between each step obtained by the division of the reasoning thinking chain and each step in the standard thinking chain, and calculates the similarity value based on this, so as to quantify the similarity between the reasoning thinking chain and the standard thinking chain through the similarity value, and finally fine-tunes the parameters in the problem-solving model according to the calculated similarity value, so as to guide the problem-solving model to reduce the learning of the problem-solving knowledge that has been mastered during the fine-tuning process, and increase the learning of the problem-solving knowledge that has not been mastered, so that the fine-tuned problem-solving model can support the output of a more accurate problem-solving thinking chain.

[0109] In one embodiment, performing similarity calculation on each inference sentence in the inference chain and each standard sentence in the standard chain to obtain a plurality of first similarities includes:

[0110] Performing vector extraction on a first inference sentence to obtain first vector data, and performing vector extraction on a first standard sentence to obtain second vector data, wherein the first inference sentence is any one of the multiple inference sentences included in the inference thinking chain, and the first standard sentence is any one of the multiple standard sentences included in the standard thinking chain;

[0111] Calculating the cosine similarity between the first vector data and the second vector data to obtain a vector similarity value;

[0112] A first similarity between the first inference sentence and the first standard sentence is determined according to the vector similarity value.

[0113] This embodiment realizes sentence vector conversion through vector extraction (such as through the bag-of-words model (BoW), TF-IDF, word embedding (Word2Vec, GloVe), sentence embedding (Sentence-BERT)), etc.), and then calculates the cosine similarity between the two vectors as an indicator value for quantifying the similarity between the corresponding inference sentence and the corresponding standard sentence. This can accurately quantify the similarity between the corresponding inference sentence and the corresponding standard sentence, thereby ensuring the accuracy of the similarity value subsequently calculated based on this.

[0114] In one example, the vector similarity value may be directly determined as the first similarity between the first inference sentence and the first standard sentence.

[0115] Preferably, determining the first similarity between the first inference sentence and the first standard sentence according to the vector similarity value includes:

[0116] Converting multiple formulas in the first inference sentence into multiple first abstract syntax trees, and converting multiple formulas in the first standard sentence into multiple second abstract syntax trees;

[0117] calculating an edit distance between each of the first abstract syntax trees and each of the second abstract syntax trees to obtain a plurality of edit distances;

[0118] Calculating an average of the plurality of edit distances, and determining the average as a formula difference value;

[0119] A ratio of the vector similarity value to the formula difference value is determined as a first similarity between the first inference sentence and the first standard sentence.

[0120] In this embodiment, in the case where the thought chain sentences used to solve the problem contain many formulas, the formulas in the corresponding sentences are converted into the structure of an abstract syntax tree, and the edit distance between the abstract syntax trees is calculated to complete the quantitative representation of the similarity between different formulas, and the average of the multiple edit sentences corresponding to the reasoning sentence and the standard sentence is set as the formula difference value corresponding to the two, so as to suppress the influence of extreme values ​​and achieve accurate quantitative representation of the similarity between the reasoning sentence and the standard sentence in the formula dimension. Finally, the ratio of the vector similarity value and the formula difference value is determined as the first similarity between the corresponding reasoning sentence and the corresponding standard sentence, so as to comprehensively realize the quantification of the similarity between the reasoning sentence and the standard sentence from the vector dimension and the formula dimension, so that the calculated first similarity is more accurate and reliable.

[0121] The abstract syntax tree formed after the conversion of this formula can be Figure 2 shown.

[0122] In an example, if the first similarity between the pth sentence in the reasoning chain (which can be understood as the first reasoning sentence mentioned above) and the rth sentence in the annotated chain (which can be understood as the first standard sentence mentioned above) is ,but The mathematical representation of can be:

[0123]

[0124] in, Indicates the first The first vector data obtained after vector extraction of the sentences; It means that the first The second vector data obtained after vector extraction of the sentences; 、 Respectively represent the number of formulas in the two sentences; Indicates the aforementioned The abstract syntax tree of the i-th formula in the sentence and the aforementioned The edit distance between the abstract syntax trees of the j-th formula in the sentences.

[0125] In one embodiment, calculating the similarity value according to the plurality of second similarities includes:

[0126] In the plurality of clusters, a plurality of sixth similarities are obtained for each cluster, wherein the sixth similarity is a similarity between any two different inference sentences in the corresponding cluster;

[0127] Determine the largest sixth similarity among the multiple sixth similarities of each cluster as the iterative fixed probability corresponding to each cluster;

[0128] According to the iterative fixed probability corresponding to each cluster, the second similarity between the cluster and each step in the standard thinking chain is corrected to obtain a corrected similarity between each cluster and each step in the standard thinking chain, wherein the corrected similarity is the product of the corresponding second similarity and the corresponding iterative fixed probability;

[0129] Taking the multiple clusters as a first step sequence, the multiple steps in the standard thinking chain as a second step sequence, and the corrected similarity between each cluster and each step in the standard thinking chain as a measurement indicator, dynamic time regularization is performed on the multiple clusters and the multiple steps in the standard thinking chain to calculate the similarity value.

[0130] Among them, the similarity between any two different reasoning sentences in the corresponding cluster can refer to the calculation process of the aforementioned first similarity to jointly determine the similarity between any two different reasoning sentences in the corresponding cluster from the vector dimension and the formula dimension. To avoid repetition, it will not be repeated here.

[0131] The iterative fixed probability corresponding to each cluster is used to represent the probability of highly similar sentences appearing in the cluster.

[0132] For example, Fixed iterative probability of clusters It can be expressed as:

[0133]

[0134] in, Indicates the first The set of inference sentences included in each cluster; Indicates the The first of the steps The inference sentence and The first of the steps The similarity between the inference sentences.

[0135] In this embodiment, dynamic time regularization is used to support similarity calculations for step sequences of different lengths, adapt to the situation where the number of multiple steps (i.e., the aforementioned multiple clusters) obtained by dividing the reasoning thinking chain is different from the number of multiple steps in the standard thinking chain, and ensure the accuracy of the calculated similarity value.

[0136] Among them, the fixed iterative probability can be used to reflect the probability of highly similar sentences in the steps of the reasoning thinking chain, and based on it, the second similarity between the corresponding cluster and the corresponding steps in the standard thinking chain is corrected. Dynamic time regularization is performed accordingly, which can effectively inhibit the solidified logic generation of the problem-solving model through logical loop problem solving, and obtain a corrected similarity that can more accurately quantify the similarity between the corresponding cluster and the corresponding steps in the standard thinking chain, and make the final calculated similarity more accurately reflect the reasoning ability of the problem-solving model for the target question.

[0137] Exemplarily, according to the iterative fixed probability corresponding to each cluster, the second similarity between the cluster and each step in the standard thinking chain is corrected, and the process of obtaining the corrected similarity between each cluster and each step in the standard thinking chain can be:

[0138] The value obtained by subtracting the iterative fixed probability corresponding to each cluster from 1 is determined as the correction coefficient corresponding to each cluster;

[0139] According to the correction coefficient corresponding to each cluster, the second similarity between the cluster and each step in the standard thinking chain is corrected to obtain the corrected similarity between each cluster and each step in the standard thinking chain, wherein the modified similarity is the product of the corresponding second similarity and the corresponding correction coefficient.

[0140] In the application, the difference between 1 and the iterative fixed probability corresponding to each cluster can be calculated first, and then the difference can be normalized, and then the normalized difference can be determined as the correction coefficient corresponding to each cluster. The above normalization can be completed using linear normalization or norm normalization.

[0141] In one embodiment, when there are multiple standard thought chains for the target question, fine-tuning the problem-solving model based on the similarity value to obtain a fine-tuned model includes:

[0142] Calculating the average of multiple similarity values ​​corresponding to multiple standard thinking chains to obtain a similarity average;

[0143] The problem-solving model is fine-tuned based on the similarity mean to obtain a fine-tuned model.

[0144] There are multiple standard thinking chains for the target question, that is, there are multiple solutions pre-configured for the target question. In this case, by respectively calculating the multiple similarities between the reasoning thinking chain and the multiple standard thinking chains, and taking the average as an indicator value for quantifying the similarity between the reasoning thinking chain and the comprehensive thinking chain represented by the multiple standard thinking chains, the decryption model's ability to analyze the target question can be fully reflected through the similarity average, and then the model is fine-tuned accordingly to adapt to the situation where the target question is pre-configured with multiple solutions, thereby ensuring the fine-tuning effect obtained by the problem-solving model and enhancing the versatility of the higher mathematics problem-solving model reasoning enhancement method based on hierarchical thinking chains described in the present invention.

[0145] Preferably, fine-tuning the problem-solving model based on the similarity mean to obtain a fine-tuned model includes:

[0146] Normalizing the similarity mean to obtain a similarity normalized value;

[0147] Calculating a product of the similarity normalized value and a preset minimum learning rate to obtain a first product, and calculating a product of a supplementary value and a preset maximum learning rate to obtain a second product, wherein a sum of the supplementary value and the similarity normalized value is 1;

[0148] The sum of the first product and the second product is used as a target learning rate, and the parameters in the problem-solving model are fine-tuned according to the target learning rate to obtain a fine-tuned model.

[0149] For the case where the similarity mean is large, that is, the problem-solving model has a strong problem-solving reasoning ability for the target question, based on the above settings, the target learning rate can be dynamically reduced to reduce the problem-solving model's knowledge learning of the target question during the fine-tuning process. For the case where the similarity mean is small, that is, the problem-solving model has a weak problem-solving reasoning ability for the target question, based on the above settings, the target learning rate can be dynamically increased to increase the problem-solving model's knowledge learning of the target question during the fine-tuning process. In this way, different learning rates can be set according to the different problem-solving abilities demonstrated by the problem-solving model when dealing with different questions, so that the problem-solving model can focus on learning more knowledge on weak or erroneous samples, so that the problem-solving model can provide a more accurate output of the problem-solving thinking chain when facing various types of questions.

[0150] In one example, the learning rate may range from 1e-4 to 1e-3 (0.0001 to 0.001). In this example, the minimum learning rate may be 0.0001 and the maximum learning rate may be 0.001.

[0151] For example, the mathematical representation of the target learning rate can be:

[0152]

[0153] in, represents the target learning rate, represents the aforementioned similarity normalized value, represents the aforementioned similarity mean, 、 represent the minimum learning rate and the maximum learning rate respectively.

[0154] In this example, the LoRA fine-tuning algorithm can be used to fine-tune the parameters (usually represented in matrix form) in the problem-solving model according to the target learning rate.

[0155] In one embodiment, the target question and preset prompt information are combined to obtain model input information, wherein the prompt information is used to guide the problem-solving model to output a more complete reasoning chain;

[0156] The model input information is inferred based on the problem-solving model to obtain the inference thinking chain.

[0157] For example, the prompt information may be: “Please explain your reasoning process step by step” or “Derivation of each step step by step”.

[0158] In one example, the prompt information may be concatenated to the end of the target question to obtain the model input information, for example:

[0159] The target topic is "question": "Find lim_{x→0}(sin x) / x.";

[0160] The prompt message is "Please explain your reasoning steps in detail, and deduce each layer of logic step by step until you reach the final answer."

[0161] The model input information obtained by splicing in the above way is: "question": "Find lim_{x→0}(sinx) / x. Please explain your reasoning steps in detail, and deduce each layer of logic step by step until you reach the final answer."

[0162] In this embodiment, based on the addition of prompt information, the problem-solving model is guided to output a more complete problem-solving reasoning chain, so that the reasoning thinking chain can more accurately reflect the decryption model's problem-solving reasoning ability for the target question, and fine-tuning the model accordingly can achieve better fine-tuning effects.

[0163] It should be understood that when the problem-solving model completes fine-tuning and is officially put into use, the real questions (also highly mathematical questions) received by the problem-solving model will also be spliced ​​with the aforementioned prompt information and then input into the problem-solving model for problem-solving reasoning, so as to ensure the input consistency of the problem-solving model during the fine-tuning stage and the use stage.

[0164] This invention proposes a high-level mathematics problem-solving model reasoning reinforcement system based on hierarchical thinking chain, please refer to Figure 3 , which shows a schematic diagram of the structure of a high-level mathematics problem-solving model reasoning enhancement system 300 based on hierarchical thinking chain provided by one embodiment of the present invention, the system comprising:

[0165] The thinking chain acquisition module 301 is used to obtain the reasoning thinking chain and the standard thinking chain of the target problem, wherein the target problem is an advanced mathematics problem, the reasoning thinking chain is the thinking chain obtained after inputting the target problem into the problem-solving model, and the standard thinking chain is the thinking chain pre-configured for the target problem;

[0166] A first calculation module 302 is configured to perform similarity calculations on each inference sentence in the inference chain and each standard sentence in the standard chain to obtain a plurality of first similarities, wherein the first similarities are used to indicate the degree of similarity between the corresponding inference sentence and the corresponding standard sentence;

[0167] A clustering module 303 is configured to cluster the multiple reasoning sentences in the reasoning thought chain according to the multiple first similarities to obtain multiple clusters;

[0168] A second calculation module 304 is configured to perform similarity calculations between each cluster and multiple steps in the standard thinking chain to obtain multiple second similarities, wherein the second similarities are used to indicate the degree of similarity between the corresponding cluster and the corresponding steps in the standard thinking chain;

[0169] The model fine-tuning module 305 is configured to calculate similarity values ​​according to the multiple second similarities, and fine-tune the problem-solving model based on the similarity values ​​to obtain a fine-tuned model.

[0170] Furthermore, the first calculation module 302 includes:

[0171] a vector extraction unit, configured to perform vector extraction on a first inference sentence to obtain first vector data, and perform vector extraction on a first standard sentence to obtain second vector data, wherein the first inference sentence is any one of the multiple inference sentences included in the inference thinking chain, and the first standard sentence is any one of the multiple standard sentences included in the standard thinking chain;

[0172] a first calculating unit, configured to calculate a cosine similarity between the first vector data and the second vector data to obtain a vector similarity value;

[0173] A second calculation unit is configured to determine a first similarity between the first inference sentence and the first standard sentence according to the vector similarity value.

[0174] Furthermore, the second computing unit is specifically configured to:

[0175] Converting multiple formulas in the first inference sentence into multiple first abstract syntax trees, and converting multiple formulas in the first standard sentence into multiple second abstract syntax trees;

[0176] calculating an edit distance between each of the first abstract syntax trees and each of the second abstract syntax trees to obtain a plurality of edit distances;

[0177] Calculating an average of the plurality of edit distances, and determining the average as a formula difference value;

[0178] A ratio of the vector similarity value to the formula difference value is determined as a first similarity between the first inference sentence and the first standard sentence.

[0179] Furthermore, the clustering module 303 is specifically configured to:

[0180] Determining, based on the multiple first similarities, multiple third similarities associated with each of the inference sentences, wherein the multiple third similarities correspond one-to-one to multiple steps in the standard thought chain, and the third similarity is: the largest first similarity among the multiple first similarities between the associated inference sentence and the multiple standard sentences included in the corresponding step;

[0181] Determining, based on the multiple third similarities associated with each of the inference sentences, multiple fourth similarities commonly associated with any two different inference sentences, wherein the multiple fourth similarities correspond one-to-one to multiple steps in the standard thought chain, and the fourth similarity is: the product of the third similarity of the corresponding step associated with one of the inference sentences in the any two different inference sentences and the third similarity of the corresponding step associated with the other of the any two different inference sentences;

[0182] Among a plurality of fourth similarities commonly associated with any two different inference sentences, determining the largest fourth similarity as the fifth similarity value between the any two different inference sentences;

[0183] The multiple inference sentences are clustered according to the fifth similarity value between the any two different inference sentences to obtain the multiple clusters.

[0184] Furthermore, the model fine-tuning module 305 includes a similarity value calculation unit, which is specifically used to:

[0185] In the plurality of clusters, a plurality of sixth similarities are obtained for each cluster, wherein the sixth similarity is a similarity between any two different inference sentences in the corresponding cluster;

[0186] Determine the largest sixth similarity among the multiple sixth similarities of each cluster as the iterative fixed probability corresponding to each cluster;

[0187] According to the iterative fixed probability corresponding to each cluster, the second similarity between the cluster and each step in the standard thinking chain is corrected to obtain a corrected similarity between each cluster and each step in the standard thinking chain;

[0188] Taking the multiple clusters as a first step sequence, the multiple steps in the standard thinking chain as a second step sequence, and the corrected similarity between each cluster and each step in the standard thinking chain as a measurement indicator, dynamic time regularization is performed on the multiple clusters and the multiple steps in the standard thinking chain to calculate the similarity value.

[0189] Furthermore, when there are multiple standard thought chains for the target question, the model fine-tuning module 305 includes a mean calculation unit, which is specifically used to:

[0190] Calculating the average of multiple similarity values ​​corresponding to multiple standard thinking chains to obtain a similarity average;

[0191] The problem-solving model is fine-tuned based on the similarity mean to obtain a fine-tuned model.

[0192] Furthermore, the model fine-tuning module 305 includes a model fine-tuning unit, which is specifically configured to:

[0193] Normalizing the similarity mean to obtain a similarity normalized value;

[0194] Calculating a product of the similarity normalized value and a preset minimum learning rate to obtain a first product, and calculating a product of a supplementary value and a preset maximum learning rate to obtain a second product, wherein a sum of the supplementary value and the similarity normalized value is 1;

[0195] The sum of the first product and the second product is used as a target learning rate, and the parameters in the problem-solving model are fine-tuned according to the target learning rate to obtain a fine-tuned model.

[0196] Furthermore, the hierarchical thinking chain-based advanced mathematics problem-solving model reasoning enhancement system 300 further includes a reasoning module, which is specifically used to:

[0197] The target question and preset prompt information are combined to obtain model input information, wherein the prompt information is used to guide the problem-solving model to output a more complete reasoning chain;

[0198] The model input information is inferred based on the problem-solving model to obtain the inference thinking chain.

[0199] It should be noted that the system provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device can be divided into different functional modules to complete all or part of the functions described above. In addition, the above embodiment provides a system for strengthening the reasoning of a higher mathematics problem-solving model based on a hierarchical thinking chain and an embodiment of a method for strengthening the reasoning of a higher mathematics problem-solving model based on a hierarchical thinking chain. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0200] The embodiment of the present invention also provides an electronic device. Figure 4 , the electronic device may include a processor 401, a memory 402, and a program 4021 stored in the memory 402 and executable on the processor 401.

[0201] When the program 4021 is executed by the processor 401, it can achieve Figure 1 Any steps in the corresponding method embodiments and achieving the same beneficial effects will not be repeated here.

[0202] Those skilled in the art will appreciate that all or part of the steps of implementing the above-described embodiment method may be accomplished through hardware associated with program instructions, and the program may be stored in a readable medium.

[0203] The embodiment of the present invention further provides a readable storage medium, wherein the readable storage medium stores a computer program, and when the computer program is executed by a processor, the above Figure 1 Any steps in the corresponding method embodiments can achieve the same technical effects and will not be described again here to avoid repetition.

[0204] The computer-readable storage medium of the embodiments of the present invention may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device, or component.

[0205] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0206] The program code contained on the storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0207] Computer program code for performing the operations of the present invention may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or terminal. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0208] An embodiment of the present invention also provides a computer program product. When the computer program product runs on a computer, it enables the computer to execute the above-mentioned related steps to implement a method for reinforcing reasoning of a high-level mathematics problem-solving model based on a hierarchical thinking chain provided in the above embodiment.

[0209] It should be noted that the order in which the embodiments of the present invention are described above is for illustrative purposes only and does not necessarily represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0210] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments.

Claims

1. A method for strengthening reasoning of advanced mathematics problem-solving models based on hierarchical thinking chains, characterized in that: The method comprises: Obtaining a reasoning chain of thought and a standard chain of thought for a target problem, wherein the target problem is an advanced mathematics problem, the reasoning chain of thought is a chain of thought obtained after inputting the target problem into a problem-solving model, and the standard chain of thought is a chain of thought preconfigured for the target problem; Performing similarity calculation on each inference sentence in the inference thinking chain and each standard sentence in the standard thinking chain to obtain a plurality of first similarities, where the first similarities are used to indicate the degree of similarity between the corresponding inference sentence and the corresponding standard sentence; Clustering the multiple reasoning sentences in the reasoning thought chain according to the multiple first similarities to obtain multiple clusters; Performing similarity calculation on each cluster and each step in the standard thinking chain to obtain multiple second similarities, where the second similarities are used to represent the degree of similarity between the corresponding cluster and the corresponding step in the standard thinking chain; Calculating a similarity value according to the multiple second similarities, and fine-tuning the problem-solving model based on the similarity value to obtain a fine-tuned model; The calculating of the similarity value according to the plurality of second similarities comprises: In the plurality of clusters, a plurality of sixth similarities are obtained for each cluster, wherein the sixth similarity is a similarity between any two different inference sentences in the corresponding cluster; Determine the largest sixth similarity among the multiple sixth similarities of each cluster as the iterative fixed probability corresponding to each cluster; According to the iterative fixed probability corresponding to each cluster, the second similarity between the cluster and each step in the standard thinking chain is corrected to obtain a corrected similarity between each cluster and each step in the standard thinking chain; Taking the multiple clusters as a first step sequence, the multiple steps in the standard thinking chain as a second step sequence, and the corrected similarity between each cluster and each step in the standard thinking chain as a measurement indicator, dynamic time regularization is performed on the multiple clusters and the multiple steps in the standard thinking chain to calculate the similarity value.

2. The method for strengthening the reasoning of a higher mathematics problem-solving model based on hierarchical thinking chain according to claim 1 is characterized in that: The performing similarity calculation on each inference sentence in the inference thinking chain and each standard sentence in the standard thinking chain to obtain a plurality of first similarities includes: Performing vector extraction on a first inference sentence to obtain first vector data, and performing vector extraction on a first standard sentence to obtain second vector data, wherein the first inference sentence is any one of the multiple inference sentences included in the inference thinking chain, and the first standard sentence is any one of the multiple standard sentences included in the standard thinking chain; Calculating the cosine similarity between the first vector data and the second vector data to obtain a vector similarity value; A first similarity between the first inference sentence and the first standard sentence is determined according to the vector similarity value.

3. The method for strengthening the reasoning of a higher mathematics problem-solving model based on hierarchical thinking chain according to claim 2 is characterized in that: Determining a first similarity between the first inference sentence and the first standard sentence according to the vector similarity value includes: Converting multiple formulas in the first inference sentence into multiple first abstract syntax trees, and converting multiple formulas in the first standard sentence into multiple second abstract syntax trees; calculating an edit distance between each of the first abstract syntax trees and each of the second abstract syntax trees to obtain a plurality of edit distances; Calculating an average of the plurality of edit distances, and determining the average as a formula difference value; A ratio of the vector similarity value to the formula difference value is determined as a first similarity between the first inference sentence and the first standard sentence.

4. The method for strengthening the reasoning of a higher mathematics problem-solving model based on hierarchical thinking chain according to claim 1 is characterized in that: The plurality of reasoning sentences in the reasoning chain are clustered according to the plurality of first similarities to obtain a plurality of clusters, including: Determining, based on the multiple first similarities, multiple third similarities associated with each of the inference sentences, wherein the multiple third similarities correspond one-to-one to multiple steps in the standard thought chain, and the third similarity is: the largest first similarity among the multiple first similarities between the associated inference sentence and the multiple standard sentences included in the corresponding step; Determining, based on the multiple third similarities associated with each of the inference sentences, multiple fourth similarities commonly associated with any two different inference sentences, wherein the multiple fourth similarities correspond one-to-one to multiple steps in the standard thought chain, and the fourth similarity is: the product of the third similarity of the corresponding step associated with one of the inference sentences in the any two different inference sentences and the third similarity of the corresponding step associated with the other of the any two different inference sentences; Among a plurality of fourth similarities commonly associated with any two different inference sentences, determining the largest fourth similarity as the fifth similarity value between the any two different inference sentences; The multiple inference sentences are clustered according to the fifth similarity value between the any two different inference sentences to obtain the multiple clusters.

5. The method for strengthening the reasoning of a higher mathematics problem-solving model based on hierarchical thinking chain according to claim 1 is characterized in that: When there are multiple standard thinking chains for the target question, fine-tuning the problem-solving model based on the similarity value to obtain a fine-tuned model includes: Calculating the average of multiple similarity values ​​corresponding to multiple standard thinking chains to obtain a similarity average; The problem-solving model is fine-tuned based on the similarity mean to obtain a fine-tuned model.

6. The method for strengthening the reasoning of a higher mathematics problem-solving model based on hierarchical thinking chain according to claim 5 is characterized in that: Fine-tuning the problem-solving model based on the similarity mean to obtain a fine-tuned model includes: Normalizing the similarity mean to obtain a similarity normalized value; Calculating a product of the similarity normalized value and a preset minimum learning rate to obtain a first product, and calculating a product of a supplementary value and a preset maximum learning rate to obtain a second product, wherein a sum of the supplementary value and the similarity normalized value is 1; The sum of the first product and the second product is used as a target learning rate, and the parameters in the problem-solving model are fine-tuned according to the target learning rate to obtain a fine-tuned model.

7. The method for strengthening the reasoning of a higher mathematics problem-solving model based on hierarchical thinking chain according to claim 1 is characterized in that: The steps of obtaining the reasoning chain include: The target question and preset prompt information are combined to obtain model input information, wherein the prompt information is used to guide the problem-solving model to output a more complete reasoning chain; The model input information is inferred based on the problem-solving model to obtain the inference thinking chain.

8. The method for strengthening the reasoning of a higher mathematics problem-solving model based on hierarchical thinking chain according to claim 7 is characterized in that: In the model input information, the tail of the target question is adjacent to the head of the prompt information.

9. The method for strengthening the reasoning of a higher mathematics problem-solving model based on hierarchical thinking chain according to claim 2 is characterized in that: The first similarity between the first inference sentence and the first standard sentence is the vector similarity value.

Citation Information

Patent Citations

  • Knowledge graph construction method and system based on large language model

    CN119047553A

  • Large model training data synthesis method, system and device and storage medium

    CN120409710A