A Novel Instruction Tuning Method for V ietnamese Mathematical Reasoning using Trainable Open-Source Large Language Models (2024)

Abstract: This study introduces Simple Reasoning with Code (SiRC), a novel instruction fine-tuning method for solving mathematical reasoning problems, particularly effective for Vietnamese, which is considered a low-resource language. Specifically, solving mathematical problems requires strategic and logical reasoning, which remains challenging in this research area. This paper presents a simple yet effective instruction fine-tuning method for mathematical reasoning. Unlike previous approaches, our proposed method effectively combines chain-of-thought reasoning with code transfer methods without requiring a sophisticated inference procedure. Furthermore, we focus on exploiting small open-source large language models (LLMs) for the Vietnamese language. In this regard, we first introduce a trainable Vietnamese math reasoning dataset, which is named ViMath-InstructCode. The proposed dataset is then used for fine-tuning open-source LLMs (e.g., less than 10 billion parameters). Experiments conducted on our custom ViMath-Bench dataset, the largest benchmarking dataset focusing on Vietnamese mathematical problems, indicate the promising results of our proposed method. Our source code and dataset are available for further exploitation.

## introduction large language models (llms), including closed sources (e.g., gpt series @xcite ) and open sources (e.g., llama series @xcite ) have become fundamental in advancing natural language processing (nlp). these models achieve remarkable language comprehension figure 1: comparative analysis of previous works with our approach for mathematical reasoning task using llm with finetune instruction: traditional method using reasoning step (cot method); pot uses codex to generate text to programming language statements; tora employing multiple llm calls within an llm agent setting; our proposed method uses llm to generate both reasoning step and code generation within a single call llm. technically, a potential solution is to special-ize general-purpose llms in mathematics via supervised fine-tuning by distilling the knowledge from larger teacher models into smaller student models @xcite ). an early approach uses chain-of-thought (cot) explanations of existing data or extra cot-style data generated by the larger models to train the smaller student model @xcite . sequentially, @xcite proposes program of thoughts (pot), which uses codex @xcite to generate text-to-programming language statements to find the answer. a recent approach uses the emerging llm agent concept @xcite to combine the two aforementioned approaches to improve the performance of mathematical reasoning @xcite . despite various attempts to narrow the gap between closed-source and open-source models, the most cost-effective method for solving mathematical problems remains unresolved. naively applying strategies like using chain-of-thought (cot) or code generation to solve problems has not produced optimal results. furthermore, employing multiple llm calls within an agent setting @xcite ) incurs higher costs. additionally, research on solving mathematical problems in vietnamese, a low-resource language, is still nascent due to a lack of studies in this area. in this regard, this study proposes sirc, a simple effective instruction finetuning approach by combining chain-of-thought reasoning with code generation. conceptual comparisons among sirc and other previous approaches in this research field are illustrated in figure 1 . generally, our main contributions in this study are threefold as follows: to the best of our knowledge, this is the first comprehensive study of vietnamese mathematical reasoning. mathematical reasoning and tool integration: the chain-of-thought @xcite prompting technique, which instructs a model to divide a problem into smaller, manageable subproblems, enhances reasoning tasks significantly (referenced in cot and least-to-most papers). this method has its merits in mathematical reasoning as well (as seen in wizard math studies), but its effectiveness diminishes when tasks require symbolic manipulation and computations. an alternative strategy involves training models to create code that solves problems, then utilizing computational tools like a python interpreter to execute the code @xcite . however, relying solely on code generation is not effective for theoretical questions or in scenarios with complex natural language, as it may lack sufficient rationale. @xcite combines chain-of-thought with code generation to improve performance, though it requires multiple interactions with large language models (llm). all mentioned approaches are actively explored with english datasets in focus, however there has been no study on this subject in vietnamese. ## methodology we introduce simple reasoning with code (sirc) framework, which is a simplified approach to solving elementary mathematical problems using both cot reasoning and code generation. we leverage a teacher-student framework to distill knowledge from larger open-source llms to smaller, more resource-efficient models, tailored specifically for vietnamese mathematical reasoning tasks. ## conclusion this study proposes a novel fine-tuning instruction approach for mathematical reasoning, which is specified for the vietnamese language. specifically, we present sirc, an effective framework, which significantly enhances the mathematical reasoning capabilities of language models with minimal cost. furthermore, by leveraging the vimath-instructcode dataset and combining it with reasoning datasets, the proposed framework achieves superior performance, underscoring the effectiveness of our approach. accordingly, the experimental results indicate that diverse and com-prehensive training data is crucial for improving model accuracy in complex tasks such as mathematical reasoning.