Towards Better Understanding of Program-of-Thought Reasoning in Cross-Lingual and Multilingual Environments

Patomporn Payoungkhamdee, Pume Tuchinda, Jinheon Baek, Samuel Cahyawijaya, Can Udomcharoenchaikit, Potsawee Manakul, Peerat Limkonchotiwat, Ekapol Chuangsuwanich, Sarana Nutanong · OpenReview

Abstract

Multi-step reasoning is essential for large language models (LLMs), yet multilingual performance remains challenging. While Chain-of-Thought (CoT) prompting improves reasoning, it struggles with non-English languages due to the entanglement of reasoning and execution. Program-of-Thought (PoT) prompting separates reasoning from execution, offering a promising alternative but shifting the challenge to generating programs from non-English questions. We propose a framework to evaluate PoT by separating multilingual reasoning from code execution to examine (i) the impact of fine-tuning on question-reasoning alignment and (ii) how reasoning quality affects answer correctness. Our findings demonstrate that PoT fine-tuning substantially enhances multilingual reasoning, outperforming CoT fine-tuned models. We further demonstrate a strong correlation between reasoning quality (measured through code quality) and answer accuracy, highlighting its potential as a test-time performance improvement heuristic.

Introduction

Large Language Models (LLMs) have demonstrated impressive mathematical reasoning capabilities, yet they often encounter a "fluency bottleneck" in multilingual contexts. Standard Chain-of-Thought (CoT) prompting, where models articulate reasoning in natural language, suffers from two primary issues: entanglement and computation errors. Entanglement occurs when a model must simultaneously manage complex logic and linguistic grammar; in lower-resource languages, this often leads to logical collapse. Furthermore, LLMs are prone to arithmetic errors during internal execution.

Program-of-Thought (PoT) reasoning addresses these challenges by tasking the model with generating a Python script to solve the problem. By delegating computation to an external interpreter, the LLM can focus exclusively on the logical structure of the solution.

Methodology

The researchers developed a two-stage framework to evaluate and improve PoT reasoning in multilingual environments. The process is divided into $Q \to R$ (Question to Reasoning/Code) and $R \to A$ (Reasoning to Answer via interpreter).

The PoT reasoning framework: Q-R alignment and R-A execution.

Key methodological innovations include:

  • CoT-Guided PoT Generation: High-quality training data was synthesized using an "Oracle" model (Llama-3.1 405B). The authors found that prompting the Oracle with a natural language CoT explanation prior to code generation significantly improved program correctness (96.1%).
  • Inline Comment Strategies: The study explored various strategies for code comments—English, translated, or removed—to determine their impact on cross-lingual alignment.
  • Soft Self-Consistency (Soft-SC): Moving beyond simple majority voting, Soft-SC weights candidate answers based on an ICE-Score, which evaluates the functional correctness and structural "usefulness" of the generated code.

Experimental Setup

The study utilized several key datasets:

  • GSM8K & MGSM: Standard grade school math benchmarks in English and 10 diverse languages (e.g., French, Chinese, Thai, Swahili, Bengali).
  • GSM8KPoT & MGSM8KPoT: Custom variants created for this study, featuring structured Python reasoning steps aligned with the original questions.

Key Insights and Results

The research yielded several critical findings regarding the nature of multilingual reasoning:

  1. PoT Superiority: PoT outperformed CoT in 39 out of 40 tested scenarios, demonstrating its robustness across languages and model scales.
  2. Comments as Alignment Anchors: In multilingual fine-tuning, translating inline comments acts as a semantic bridge. However, in zero-shot cross-lingual settings (training on English, testing on others), removing comments entirely often yielded better results, preventing distraction from English-centric training.
  3. Code Quality as a Proxy for Truth: A significant discovery was the high correlation (up to 0.91 Spearman rank) between code quality (ICE-Score) and final answer accuracy. This suggests that the structural "sanity" of the code is a reliable indicator of its correctness.
Correlation between Code Quality (ICE-Score) and MGSM Accuracy across cross-lingual and multilingual setups.
  1. Performance Gains: Implementing Soft-SC led to dramatic improvements. For instance, a Llama2-7B model in a cross-lingual setup saw accuracy jump from 31.6% to 56.6%. Llama3-8B emerged as the strongest performer, reaching 76.5% accuracy in English.

Conclusion

This work highlights the potential of PoT to overcome the linguistic barriers inherent in natural language reasoning. By decoupling logic from execution and leveraging code quality as a heuristic for performance, the authors provide a path toward more reliable multilingual LLMs. Future work will focus on generalizing these findings beyond mathematical reasoning and reducing the computational cost of high-quality code evaluation.

Summary updated

BibTeX
@inproceedings{payoungkhamdee2025towards,
  author = {Patomporn Payoungkhamdee and Pume Tuchinda and Jinheon Baek and Samuel Cahyawijaya and Can Udomcharoenchaikit and Potsawee Manakul and Peerat Limkonchotiwat and Ekapol Chuangsuwanich and Sarana Nutanong},
  title = {{Towards Better Understanding of Program-of-Thought Reasoning in Cross-Lingual and Multilingual Environments}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure