M ulti L ing P o T : Boosting Mathematical Reasoning in LLM s through Multilingual Program Integration (2025)

Abstract: Program-of-Thought, which aims to use program instead of natural language in reasoning, is an important way for LLMs to solve mathematical problems. Since different programming languages excel in different areas, it is natural to use the most suitable language for solving specific problems. However, current research only focuses on single language PoT, ignoring the differences between programming languages. Therefore, this paper proposes a multilingual programme reasoning method, MultiLingPoT, and deeply explores the impact of multilingual integration in the training and inference. This method allows the model to answer questions using multiple languages by fine-tuning on multilingual data and improving individual language’s reasoning accuracy by 2.5%. Additionally, prior and posterior selection methods are used to help the model select the most suitable language during inference, and achieves 8% performance gains. Finally, our code metric analysis shows that language differences manifest in encapsulation levels and implementation granularity, while strategic deviation from language conventions can enhances code performance.

## introduction program-of-thought (pot), which aims to use programming language instead of natural language as an intermediate step in reasoning in large language models (llms), is an important way for llms to solve mathematical problems @xcite . by generating programs and running them with a code interpreter, llms can not only exploit their reasoning capabilities but also avoid the computational errors. inspired by mathematical tasks, nowadays, pot is also widely used in other domains, such as pseudo-code olve the following system of linear quations: 2x + @xmath0, 3x + @xmath1::vector2d b(5, 6); igen::matrix2d a; ## related work program-of-thought program-of-thought, which aims to use programming language instead of natural language in llms' reasoning, is an important way to solve mathematical problems. by transferring the computation to code interpreter, llms are able to avoid computational errors while exploiting reasoning capabilities. in 2022, @xcite introduced the use of code as an intermediate step to assist llms, while @xcite proposed the program-aided language model. by building pot data and fine-tuning, llms are able to enhance their mathematical capabilities @xcite @xcite . further, some research combine chain-of-thought's(cot) reasoning with pot's computation as tool use @xcite , resulting in models such as math-coder @xcite and tora @xcite . however, these studies are limited to python-based pot, ignoring the differences between different programming languages. although, recent @xcite start to explore combining different languages. they only use different languages as an enhancement of diversity, without deeply analyzing the impacts of different language characteristics. therefore, this paper proposes multilingpot, an multi-programming language reasoning approach that explores multi-language integration in training and inference, and analyzes the language differences in view of the code metrics. multiple programming languages multiprogram languages processing is a classic research topic in code intelligence. it has been studied for a long time in tasks such as code repair @xcite , code search @xcite , code summarization @xcite and comment generation @xcite . for instance, multilingual encoders are trained for cross-lingual comment generation @xcite , and weak-language performance is enhanced via inter-language translation @xcite . however, there are fundamental differences between multilingual research on pot and code intelligence. while code intelligence focuses on code understanding and generation @xcite , pot emphasizes problem-solving through code execution, requiring task understanding, reasoning, and computational planning. in addition, multilingual code intelligence prioritizes cross-lingual generalization, whereas pot demands language-integrated problem-solving. therefore, although multilingual research has been explored in code intelligence, the multi-languages problem in pot remains an unexplored domain. ## multilingpot in this section, we present the construction of mul-tilingpot to answer three key questions, including foundation language selection, data construction, model training, model inference, and code analysis. the illustration is shown in figure 2 . ## experiments in this section, we first explore multilingpot's performance from both training and inference perspectives to answer q1 and q2. then, we measure the code metrics across language and response correctness for q3. in addition, we test multilingpot on multiple models to examine its generalisability. ## conclusion in this paper, we explore the impact of multilanguage pot in llm mathematical reasoning during training and inference, and propose multiling-pot, an multilingual program reasoning method. for training, we construct multilingual pot data to fine-tune the multilingpot model, achieving a 2% performance improvement. for inference, we design multiple language selection strategies that include prior and posterior, and select the appropriate language to answer during inference, improving accuracy to 8% vs. the best unchosen result. finally, we conduct analyses using software code metrics. we find that key differences cross-languages manifest in encapsulation dependency and step-by-step logic. and controlled divergence from programming language conventions can improve computational performance.