A data processing method to improve the advanced arithmetic capabilities of small-scale large language models
By constructing an instruction dataset and performing three-stage supervised fine-tuning, the advanced arithmetic computation capabilities of small LLMs are improved, solving the problem of balancing complex mathematical operations and natural language processing, and achieving high efficiency and reliability in multi-tasking environments.
Patent Information
- Application Number
- CN202510015889.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-06
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2045-01-06
AI Technical Summary
Existing methods face significant challenges in improving the advanced arithmetic computation capabilities of small large language models (LLMs), particularly in handling complex mathematical operations while maintaining their natural language processing capabilities, and are prone to catastrophic forgetting problems.
By constructing an instruction dataset and implementing a three-stage supervised fine-tuning strategy, including standardization of arithmetic expressions, natural language processing, and mathematical application datasets, encapsulating arithmetic expressions with special labels, and employing a greedy search method to determine the appropriate amount of training data, the advanced arithmetic skills of the model are gradually improved.
It significantly enhances the advanced arithmetic computing capabilities of small LLMs, enabling them to handle complex arithmetic operations while maintaining natural language understanding and generation capabilities, avoiding catastrophic forgetting, and making them suitable for complex mathematical calculations in education and scientific research.
Smart Images

Figure CN119940466B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer technology, and in particular relates to a data processing method for improving the advanced arithmetic capabilities of small-scale large language models. Background Technology
[0002] Large Language Models (LLMs) have demonstrated exceptional capabilities in understanding and generating language, finding wide application in fields such as finance, education, psychology, and healthcare. These models, trained on large-scale, diverse text data, are able to generate high-quality natural language text and perform admirably across a variety of tasks. However, despite significant progress in many areas, LLMs still face considerable challenges in advanced arithmetic computation, particularly for smaller LLMs.
[0003] Advanced arithmetic computation involves more than just basic arithmetic operations; it also includes logarithmic, exponential, trigonometric, and mixed operations involving various advanced functions. These complex computational tasks place higher demands on LLMs, as they require models with stronger mathematical reasoning and more precise computational capabilities. While several methods have been developed and successfully applied to improve the mathematical reasoning abilities of LLMs, these methods still have many limitations in practical applications.
[0004] First, decomposing the problem into natural language steps (Chain-of-Thought, CoT) or generating code / program integrated reasoning steps (Program-of-Thought, PoT) are common solutions. These methods help the model solve complex mathematical problems step by step by generating intermediate reasoning steps. However, these methods typically require large-scale LLMs to generate and process these intermediate steps. While large-scale LLMs perform excellently in reasoning capabilities, their high computational cost and resource requirements make them difficult to deploy and apply economically in real-world production environments.
[0005] Secondly, enhancing the computational capabilities of LLMs by invoking calculator tools is another common approach. For example, Toolformer enhances LLMs' ability to handle basic arithmetic operations (such as addition, subtraction, multiplication, and division) by integrating external calculator tools. However, these methods rely on few-shot learning or prompting, meaning the model needs explicit prompts to invoke the calculator tool on each computation. This not only increases the complexity of use but also limits the model's autonomy and flexibility. Furthermore, these methods typically only handle basic arithmetic operations and cannot accurately compute advanced arithmetic operations.
[0006] Furthermore, while existing methods improve mathematical reasoning abilities, they often lead to catastrophic forgetting of the model's original capabilities (such as common sense reasoning and reading comprehension). That is, when a model focuses on learning mathematical reasoning tasks, it may lose its performance on other tasks. This catastrophic forgetting problem makes it difficult for the model to meet the needs of multiple tasks in practical applications, limiting its potential for widespread use.
[0007] In summary, while existing solutions have made some progress in improving the mathematical reasoning capabilities of LLMs, they still face many challenges in practical applications. Particularly for small LLMs, significantly enhancing their advanced arithmetic computation capabilities while maintaining their existing natural language processing abilities remains a pressing issue. Therefore, developing a data processing technology that empowers small LLMs with advanced arithmetic skills has significant practical implications and application value. Summary of the Invention
[0008] To address the aforementioned technical problems, this invention proposes a data processing method to improve the advanced arithmetic capabilities of small-scale large language models, thereby enhancing the advanced arithmetic skills of LLMs.
[0009] To achieve the above objectives, the present invention provides a data processing method for improving the advanced arithmetic capabilities of small-scale large language models, comprising:
[0010] A command dataset is constructed, and the command dataset is standardized to obtain standardized data; the command dataset includes an arithmetic expression dataset, a natural language processing dataset, and a mathematical application dataset.
[0011] The standardized formula expression data is input into the small LLM using different amounts of formula expression data. The small LLM is then evaluated on the arithmetic test set. The amount of formula expression data used by the model with the highest score is taken as the first stage of fine-tuning.
[0012] The small LLM was fine-tuned using the formula expression data of the model with the highest score and the natural language processing data after different amounts of normalization. The fine-tuned small LLM was evaluated on the joint test set of arithmetic, MWP and NLP tasks. The amount of natural language processing data used by the model with the highest average score in arithmetic, natural language processing and mathematical word problem datasets was obtained as the second stage of fine-tuning.
[0013] The mini-LLM was fine-tuned using the mathematical expression data of the model with the highest score, the natural language processing data of the model with the highest average score, and different amounts of standardized mathematical application data. The fine-tuned mini-LLM was evaluated on a joint test set of arithmetic, MWP, and NLP tasks. The mathematical application data of the model with the highest average score was used as the third stage of fine-tuning.
[0014] Optionally, the arithmetic expression dataset includes 4 basic operators and 8 advanced arithmetic operators.
[0015] Optionally, the natural language processing dataset may include a multilingual dataset.
[0016] Optionally, the mathematical application dataset includes several MWP instances collected from various educational websites.
[0017] Optionally, a special marker for calling the calculator can be added to the arithmetic expressions in the arithmetic expression dataset and the mathematical application dataset.
[0018] Optionally, the construction process of the addition operation in the basic arithmetic expression during the first stage of fine-tuning includes:
[0019] The number of randomly generated items;
[0020] Randomly generate the number of digits for each item;
[0021] Generate a random number with a corresponding number of digits for each item;
[0022] By combining each item using addition, the basic operational expression for the addition operation is constructed.
[0023] Optionally, the construction process of mixed operations in the basic operational expression during the first stage of fine-tuning includes:
[0024] Randomly generate a number of combinations;
[0025] For each combination type, randomly generate an arithmetic operator type;
[0026] Construct subcombination expressions using the corresponding arithmetic operator type constructor;
[0027] By combining all sub-combinations using randomly generated basic operators, the basic operational expressions in the mixed operation process are constructed.
[0028] Optionally, the special marker is " <thought>"and" <api>".
[0029] Technical Effects of this Invention: This invention discloses a data processing method to improve the advanced arithmetic capabilities of Small Large Language Models (LLMs). It significantly enhances the advanced arithmetic computation capabilities of LLMs, enabling them to handle various complex arithmetic operations, including logarithms, trigonometric functions, and composite functions, while maintaining their original natural language understanding and generation capabilities, avoiding catastrophic forgetting problems. Through a three-stage supervised fine-tuning strategy and the introduction of special tags, the model can not only autonomously call calculator APIs and seamlessly perform complex arithmetic calculations within natural language sentences, but also achieves significant improvements in its overall performance across arithmetic tasks, mathematical word problems, and natural language processing tasks. This invention has broad application prospects in multiple fields, particularly in scenarios requiring precise calculations. By significantly improving the advanced arithmetic computation capabilities of LLMs, this method can help students solve complex mathematical problems in education, thereby improving learning outcomes and teaching quality. In scientific research, this method can be used to process and analyze experimental data, perform complex mathematical calculations, and significantly improve research efficiency and the reliability of results. Through these applications, this invention demonstrates its strong adaptability and efficiency in multi-task environments, proving its feasibility and great potential in practical applications. Attached Figure Description
[0030] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0031] Figure 1 This is a schematic flowchart of a data processing method for improving the advanced arithmetic capabilities of a small-scale large language model according to an embodiment of the present invention;
[0032] Figure 2 This is a schematic diagram illustrating the process of constructing basic arithmetic expressions according to an embodiment of the present invention;
[0033] Figure 3 This is a schematic diagram illustrating the process of constructing a mixed-operation arithmetic expression according to an embodiment of the present invention. Detailed Implementation
[0034] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0035] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0036] like Figure 1 As shown, this embodiment provides a data processing method to improve the advanced arithmetic capabilities of small-scale large language models, including:
[0037] A command dataset is constructed, and the command dataset is standardized to obtain standardized data; the command dataset includes an arithmetic expression dataset, a natural language processing dataset, and a mathematical application dataset.
[0038] The standardized formula expression data is input into the small LLM using different amounts of formula expression data. The small LLM is then evaluated on the arithmetic test set. The amount of formula expression data used by the model with the highest score is taken as the first stage of fine-tuning.
[0039] The small LLM was fine-tuned using the formula expression data of the model with the highest score and the natural language processing data after different amounts of normalization. The fine-tuned small LLM was evaluated on the joint test set of arithmetic, MWP and NLP tasks. The amount of natural language processing data used by the model with the highest average score in arithmetic, natural language processing and mathematical word problem datasets was obtained as the second stage of fine-tuning.
[0040] The mini-LLM was fine-tuned using the mathematical expression data of the model with the highest score, the natural language processing data of the model with the highest average score, and different amounts of standardized mathematical application data. The fine-tuned mini-LLM was evaluated on a joint test set of arithmetic, MWP, and NLP tasks. The mathematical application data of the model with the highest average score was used as the third stage of fine-tuning.
[0041] Furthermore, the arithmetic expression dataset includes 4 basic operators and 8 advanced arithmetic operators.
[0042] Specifically, existing research mainly focuses on basic arithmetic operations with low digits (such as addition and subtraction), but these simple forms and structures cannot fully reflect the computational power of LLMs. Therefore, this invention systematically reviews the types of arithmetic operators and arithmetic tasks, and creates a comprehensive dataset of arithmetic expressions. This dataset contains four basic operators (such as addition and multiplication) and eight advanced arithmetic operators (including logarithms, trigonometric functions, and composite functions). All of the above arithmetic operators can handle low-digit, high-digit, or decimal numbers.
[0043] Furthermore, the dataset of this invention also supports mathematical operation instructions for complex numbers. In real-world dialogue scenarios, arithmetic operations may be embedded in natural language, such as "the square root of 9" or "the remainder of 412 divided by 57". To improve the generalization and robustness of LLMs to arithmetic operators, this invention generates arithmetic alias expressions as an important supplement to the AI-1 dataset. These alias expressions can help LLMs effectively solve and handle problems containing different descriptions or terms, improving their ability to interpret and perform mathematical operations in different language environments. Detailed information about the arithmetic expression dataset is shown in Table 1.
[0044] Table 1
[0045]
[0046] Furthermore, the construction process of the addition operation in the basic operational expression during the first stage of fine-tuning includes:
[0047] The number of randomly generated items;
[0048] Randomly generate the number of digits for each item;
[0049] Generate a random number with a corresponding number of digits for each item;
[0050] By combining each item using addition, the basic operational expression for the addition operation is constructed.
[0051] Specifically, for each arithmetic type, this invention uses a constructor to generate expressions from low to high digits. For basic operations, such as constructing an addition operation, first, the number of terms is randomly generated to represent how many terms the expression has. Then, for each term number, the number of digits is randomly generated to represent how many digits the term has. Finally, each term number is combined using addition. The construction process of the basic operation expression is as follows: Figure 2 As shown.
[0052] Furthermore, the construction process of mixed operations in the basic operational expressions during the first stage of fine-tuning includes:
[0053] Randomly generate a number of combinations;
[0054] For each combination type, randomly generate an arithmetic operator type;
[0055] Construct subcombinatorial expressions using the corresponding arithmetic type constructor;
[0056] By combining all sub-combinations using randomly generated basic operators, the basic operational expressions in the mixed operation process are constructed.
[0057] Specifically, for advanced operations, expressions are constructed based on the characteristics of the operation. For example, with logarithms, the number of digits in the base and argument is first determined, and then the base and argument with the corresponding number of digits are randomly generated. Another example is trigonometric functions. First, the form of the angle is determined—whether it's expressed in radians (in π) or degrees. Then, the number of terms in the trigonometric function is randomly generated, followed by the number of digits in each term and the basic operators between terms. Finally, all the generated values are combined.
[0058] For mixed operations, first, a number of combinations is randomly generated, i.e., how many combination types there are. For each combination type, an arithmetic operator type is randomly generated. Then, the corresponding arithmetic type constructor constructs sub-combination expressions. Finally, all sub-combinations are combined using randomly generated basic operators. The construction process is as follows: Figure 3 As shown.
[0059] For text-embedded types, this invention first constructs an expression without text embedding, and then replaces the mathematical arithmetic symbols in the expression with text-type arithmetic symbols. For example, first construct 5×3, and then replace the "×" arithmetic symbol with "multiply" or "times" to get: 5 multiplied by 3 or 5times 3.
[0060] Furthermore, the natural language processing dataset includes multilingual datasets.
[0061] Specifically, to mitigate the catastrophic forgetting phenomenon that occurs when LLMs are fine-tuned using AI-1 and AI-2, it is necessary to combine dialogue and common-sense knowledge, i.e., Natural Language Processing (NLP) datasets, during supervised training. In this invention, the well-known multilingual dataset Alpaca (dataset name) was chosen as the NLP dataset due to its diversity and complexity. The Alpaca dataset covers various fields such as literature, science, and social sciences. 52,002 English data points and 48,818 Chinese data points were randomly selected from the original Alpaca dataset to form the AI-3 dataset. Examples are shown in Table 2.
[0062] Table 2
[0063]
[0064] Furthermore, the mathematical applications dataset includes 100,000 MWP instances collected from various educational websites.
[0065] Specifically, to further enhance LLMs' problem-solving and reasoning abilities in complex mathematical tasks, a comprehensive Mathematical Word Problems (MWP) dataset, AI-2, was constructed. This dataset consists of 100,000 MWP instances collected from various educational websites, each accompanied by a detailed analysis of the solution process. The AI-2 dataset covers difficulty levels from elementary to high school, ensuring that LLMs' abilities to handle mathematical problems of varying complexity are comprehensively improved. Examples of AI-2 are shown in Table 3.
[0066] Table 3
[0067]
[0068]
[0069] Furthermore, during the fine-tuning in the first and third stages, a special marker for invoking the calculator needs to be added; this special marker is " <thought>"and" <api>Specifically, to enable small LLMs to autonomously invoke the calculator without explicit instructions and seamlessly perform any complex arithmetic calculations within natural language sentences, this invention uses special markers in the AI-1 and AI-2 datasets involving computation. <thought>"and" <api>This is used to encapsulate arithmetic expressions, thereby enabling accurate recognition of mathematical expressions in natural language.
[0070] Since all data entries in AI-1 are simulated, a special tagging feature is automatically encapsulated in each arithmetic expression. For each MWP in AI-2, it is desirable to apply the special tagging feature to the corresponding part of its problem analysis. Using few-shot learning and prompting, GPT4 is used to generate instructions containing special tags for calling the computation API, as shown below.
[0071] I will give you a math problem and its solution. You need to encapsulate the corresponding arithmetic expression in the solution using a calculator token. The output format of the encapsulated expression is as follows:
[0072] {expression} <thought>This involves calculations; I need to call the calculator API here. <api> [{"ActionName":"Calculator","Args":{"equation":{expression}}}]< / api> => {Result}
[0073] Example as follows:
[0074] Original answer:
[0075] Cost price: $15 \div(1+50\%)$$=15 \div 1.5$$=10$ (yuan) Profit: $15 \times 0.8 - 10$$=12 - 10$$=2$ (yuan) Answer: Selling at 80% of the list price will yield a profit of $2. Therefore, the answer is: $2.
[0076] Answer encapsulation:
[0077] In this problem, the cost price of each book is $15, and the profit after sale is 50%. Therefore, the cost price of each book can be calculated as $15 ÷ (1 + 50%) = $ <thought>This requires performing division; I need to call the calculator API here. <api> [{\"ActionName\":\"Calculator\",\"Args\":{\"equation\":\"15 / 1.5"}}]< / api> =>10< / thought> $10. Then, we can calculate the profit per book as $15 × 0.8 - 10 = $ <thought>This requires calculating algebraic expressions, which I can call the Calculator API from here. <api> [{\"ActionName\":\"Calculator\",\"Args\":{\"equation\":\"15*0.8-10\"}}]< / api> =>2< / thought> $2. Therefore, if the price of each book is set at 80% of the original price, a profit of $2 can be made. Therefore, the answer is $2.
[0078] Please encapsulate the answers to the following questions based on the requirements and examples above:
[0079] {Questions and Answers}
[0080] These encapsulated instructions from AI-1 and AI-2 not only enhance LLMs' understanding of problems but also teach them how to autonomously invoke precise computations when faced with similar problems. Examples of specially marked encapsulations are shown in Table 4. Furthermore, to ensure the correctness of the data constructed by AI-1 and AI-2, the encapsulated expressions are calculated using a calculator to filter out erroneous data that cannot be computed. The processing of these datasets aims to preserve the inherent capabilities of small LLMs while enhancing their ability to handle complex arithmetic and large numbers.
[0081] Table 4
[0082]
[0083]
[0084] AI-1, AI-2, and AI-3 represent three different data types: an arithmetic expression dataset, a mathematical word problem (MWP) dataset, and a natural language processing (NLP) dataset. To ensure these datasets can be efficiently processed and utilized by small LLMs, all data underwent format normalization, and the processed data was used to fine-tune the models. Normalization not only improves data readability and consistency but also significantly enhances the efficiency and accuracy of the models during training and inference. The processed AI-1 training data is shown in Table 5 below. Training examples for AI-1, AI-2, and AI-3 are also provided.
[0085] Table 5
[0086]
[0087]
[0088] The construction and standardization of the ArithInstruct arithmetic instruction dataset provides a solid foundation for model training. This invention proposes a three-stage supervised fine-tuning strategy that, through reasonable data ratios and order, not only endows small LLMs with arithmetic capabilities but also maintains their original natural language understanding capabilities.
[0089] Inspired by curriculum learning theory, this application's supervised fine-tuning strategy attempts to mimic the process of human mathematical learning, namely, first learning to recognize mathematical symbols and numerical expressions, and then learning to understand logical reasoning steps. Furthermore, to avoid the classic catastrophic forgetting problem in LLMs, a natural language understanding fine-tuning task is incorporated into the mathematical learning process. Specifically, this application first fine-tunes small LLMs using AI-1 data to enable them to recognize various mathematical expressions. In the second stage, it combines AI-3 and AI-1 data to help the fine-tuned model maintain its natural language capabilities. Finally, it enhances the reasoning ability of small LLMs using all available data (AI-1, AI-2, and AI-3) through detailed annotated step-level MWP data.
[0090] Besides the dataset order used in this invention for supervised fine-tuning, determining the appropriate amount of training data is also crucial. The notion that more data is always better is not always correct. The quality and relevance of training examples are often more important than quantity. In supervised fine-tuning, training samples not only need to provide correct solutions but must also teach the model how to arrive at those answers. Since different LLMs are trained from different data mixtures, it is difficult to propose a general method to determine the appropriate amount of data to improve the advanced arithmetic and reasoning capabilities of small LLMs.
[0091] In this invention, the aforementioned three-stage model training is performed using a greedy search heuristic. Specifically, firstly, small LLMs are fine-tuned using different amounts of AI-1 data, such as 1,000, 5,000, 10,000, 20,000, 50,000, and 100,000. Only the model that achieves the highest accuracy on the arithmetic validation set is retained, and the corresponding arithmetic training amount is denoted as A. * For example, 50,000.
[0092] Then, in the second round of fine-tuning, the invention maintains the size of the arithmetic training data at A. * Different amounts of NLP training data from AI-3 were added. This invention evaluates different fine-tuned LLMs using a joint validation set of arithmetic, MWP, and NLP tasks. Since natural language training data can enhance LLMs' understanding of MWP, this invention selects the model that achieves the highest average score on the joint validation dataset, and denotes the corresponding amount of natural language training data as L. * .
[0093] In the third stage of fine-tuning, this invention fixes the size of the arithmetic and natural language training data to A. * and L * The invention modulates the training data by varying the amount of MWP data, i.e., AI-2. Finally, it selects the fine-tuned model that achieves the highest average score on the joint evaluation dataset and denotes the corresponding amount of MWP training data as M.
[0094] Ultimately, the best model was chosen by A. * The amount of AI-1 data, L * The quantity of AI-3 data and M * The AI-2 data was fine-tuned to obtain the optimal training data A for AI-1, AI-2, and AI-3 for Baichuan2-13B-chat. * M * and L * The figures are 50,000, 10,000, and 5,000 respectively.
[0095] By employing this three-stage fine-tuning strategy based on curriculum learning, this invention can progressively enhance the advanced arithmetic skills of small LLMs while maintaining their original natural language processing capabilities, avoiding catastrophic forgetting problems, thereby achieving comprehensive performance of the model in multiple tasks.
[0096] The performance of Baichuan2-13B-chat, fine-tuned using the three-stage fine-tuning strategy proposed in this invention, was compared with that of the original Baichuan2-13B-chat on two arithmetic test sets: Arith3K and math401, four MWP (Mathematical Problem Solving) datasets: MAWPS, ASDiv-A, GSM8K, and SVAMP, and four NLP (Natural Language Processing) datasets: PIQA, BoolQ, HellaSwag, and RACE. The comparison results are shown in Table 6 below.
[0097] Table 6
[0098]
[0099] The results above demonstrate that the three-stage fine-tuning strategy proposed in this invention significantly improves the model's arithmetic and mathematical reasoning abilities while maintaining its original natural language processing capabilities and avoiding catastrophic forgetting. Below are output examples of Arithmetic-Baichuan2-13B and Baichuan2-13B-chat on the Arith3K arithmetic test set:
[0100] Input Example 1:
[0101] <reserved_106> Calculate the following arithmetic problem:-581682167-119927\nAnswer:<reserved_107>
[0102] Correct answer:
[0103] -581802094
[0104] Output of Baichuan2-13B-chat:
[0105] The answer to the given arithmetic problem is:-581704175
[0106] Output of Arithmetic-Baichuan2-13B:
[0107] The result of -581682167-119927 is <thought>Involving calculations, I need to call the Calculator API here. <api> [{\"ActionName\":\"Calculator\",\"Args\":{\"equation\":\"-581682167-119927\"}}]< / api> >-581802094< / thought> -581802094
[0108] In the example above, the original Baichuan2-13B-chat cannot correctly solve the mathematical arithmetic problem, while Arithmetic-Baichuan2-13B can correctly solve the mathematical arithmetic problem, even when faced with more complex compound operations, as shown below.
[0109] Input Example 2:
[0110] <reserved_106> Calculate the following mathematical problem: sin(8.51π)^(1 / 9) + sqrt(sqrt(358))\nAnswer:<reserved_107>
[0111] Correct answer: 5.3498
[0113] Output of Arithmetic-Baichuan2-13B:
[0114] Involving calculations, I need to call the Calculator API here. <api> [{\"ActionName\":\"Calculator\",\"Args\":{\"equation\":\"sin(8.51*pi)^(1 / 9)+sqrt(sqrt(358))\"}}]< / api> >5.3498< / thought> 5.3498
[0115] This invention discloses a method for improving the advanced arithmetic capabilities of Small Large Language Models (LLMs). This method significantly enhances the advanced arithmetic computation capabilities of LLMs, enabling them to handle various complex arithmetic operations, including logarithms, trigonometric functions, and composite functions, while maintaining their original natural language understanding and generation capabilities, thus avoiding catastrophic forgetting problems. Through a three-stage supervised fine-tuning strategy and the introduction of special tags, the model can not only autonomously invoke calculator APIs and seamlessly perform complex arithmetic calculations within natural language sentences, but also achieves significant improvements in its overall performance across arithmetic tasks, mathematical word problems, and natural language processing tasks. This invention has broad application prospects in multiple fields, particularly in scenarios requiring precise calculations. By significantly improving the advanced arithmetic computation capabilities of LLMs, this method can help students solve complex mathematical problems in education, thereby improving learning outcomes and teaching quality. In scientific research, this method can be used to process and analyze experimental data, perform complex mathematical calculations, and significantly improve research efficiency and the reliability of results. Through these applications, this invention demonstrates its strong adaptability and efficiency in multi-task environments, proving its feasibility and great potential in practical applications.
[0116] The above are merely preferred embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.< / api> < / thought> < / api> < / thought> < / api> < / thought>
Claims
1. A data processing method for improving the advanced arithmetic capabilities of small-scale large language models, characterized in that, include: Construct an instruction dataset, and perform standardization processing on the instruction dataset to obtain standardized data; The instruction dataset includes arithmetic expression dataset, natural language processing dataset, and mathematical application dataset; The standardized formula expression data is input into the small LLM to fine-tune it using different amounts of formula expression data. The fine-tuned small LLM is evaluated on the arithmetic test set, and the amount of formula expression data used by the model with the highest score is taken as the first stage of fine-tuning. The small LLM was fine-tuned using the formula expression data of the model with the highest score and different amounts of the normalized natural language processing data. The fine-tuned small LLM was evaluated on a joint test set of arithmetic, MWP and NLP tasks. The amount of natural language processing data used by the model with the highest average score in arithmetic, natural language processing and mathematical word problem datasets was obtained as the second stage of fine-tuning. The mini-LLM was fine-tuned using the mathematical expression data of the model with the highest score, the natural language processing data of the model with the highest average score, and different amounts of standardized mathematical application data. The fine-tuned mini-LLM was evaluated on a joint test set of arithmetic, MWP, and NLP tasks. The mathematical application data of the model with the highest average score was used as the third stage of fine-tuning.
2. The data processing method for improving the advanced arithmetic capabilities of small-scale large language models as described in claim 1, characterized in that, The arithmetic expression dataset includes 4 basic operators and 8 advanced arithmetic operators.
3. The data processing method for improving the advanced arithmetic capabilities of small-scale large language models as described in claim 1, characterized in that, The natural language processing dataset includes multilingual datasets.
4. The data processing method for improving the advanced arithmetic capabilities of small-scale large language models as described in claim 1, characterized in that, The mathematical applications dataset includes several MWP instances collected from various educational websites.
5. The data processing method for improving the advanced arithmetic capabilities of small-scale large language models as described in claim 1, characterized in that, Add special tags to the arithmetic expressions in the arithmetic expression dataset and the mathematical application dataset to call the calculator.
6. The data processing method for improving the advanced arithmetic capabilities of small-scale large language models as described in claim 1, characterized in that, The construction process of the addition operation in the basic arithmetic expression during the first stage of fine-tuning includes: The number of randomly generated items; Randomly generate the number of digits for each item; Generate a random number with a corresponding number of digits for each item; By combining each item using addition, the basic operational expression for the addition operation is constructed.
7. The data processing method for improving the advanced arithmetic capabilities of small-scale large language models as described in claim 1, characterized in that, The construction process of mixed operations in the basic operational expressions during the first stage of fine-tuning includes: Randomly generate a number of combinations; For each combination type, randomly generate an arithmetic operator type; Construct subcombination expressions using the corresponding arithmetic operator type constructor; By combining all sub-combinations using randomly generated basic operators, the basic operational expressions in the mixed operation process are constructed.
8. The data processing method for improving the advanced arithmetic capabilities of small-scale large language models as described in claim 5, characterized in that, The special mark is " <thought>"and" <api> ”。< / api> < / thought>
Citation Information
Patent Citations
Mathematical big language model fine tuning method, system and equipment with cooperation of data enhancement method and prediction enhancement method and medium
CN118014056A
Generation method of commodity copywriting information
CN118941349A