SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2310.20246 · 2023

Breaking Language Barriers in Multilingual Mathematical Reasoning: Insights and Observations

arXiv · PDF · Open in the Atlas

Code that ran

8 of 11 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 7 failures of our instrument; 3 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2310.20246.json · badge: /api/ran/2310.20246.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
microsoft/MathOctopus canonical (classifier label)
classifier basis: census
8 ran · 3 no recorded run
FunctionStatusWhere it lives
generate Ran
ran; our contract draft was wrong, not the code
microsoft/MathOctopus/step1_supervised_finetuning/prompt_eval.py
pointer only (licence: MIT); the stored copy get_code serves, from JiancongXiao/PM_RLHF, is pointer only (licence: NONE) · get_code("451c619b9609c3c0")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from JiancongXiao/PM_RLHF, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

generate_constrastive_search Ran
ran; our contract draft was wrong, not the code
microsoft/MathOctopus/step1_supervised_finetuning/prompt_eval.py
pointer only (licence: MIT); the stored copy get_code serves, from JiancongXiao/PM_RLHF, is pointer only (licence: NONE) · get_code("385922750eb70702")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from JiancongXiao/PM_RLHF, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_batch_llama Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
microsoft/MathOctopus/step1_supervised_finetuning/generate_and_eval.py
code served (permissive licence) · get_code("2e064bd50d861c4d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned function. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from transformers import GenerationConfig

torch.manual_seed(0)

# Minimal LlamaForCausalLM stand-in
class MinimalLlamaForCausalLM(nn.Module):
    def __init__(self):
        super().__init__()
        self.device_attr = 'cpu'
        self.lm_head = nn.Linear(4, 32000)
        self.model = nn.ModuleDict({
            'embed_tokens': nn.Embedding(32000, 4)
        })
    
    @property
    def device(self):
        return torch.device(self.device_attr)
    
    def generate(self, input_ids, attention_mask, generation_config):
        # Return dummy output_ids with batch_size=2, seq_length=input_ids.shape[1]+1
        batch_size = input_ids.shape[0]
        seq_length = input_ids.shape[1] + 1
        return torch.randint(0, 32000, (batch_size, seq_length))

# Minimal LlamaTokenizer stand-in
class MinimalLlamaTokenizer:
    def __init__(self):
        self.vocab_size = 32000
    
    def __call__(self, text, padding=False, return_tensors=None):
        if isinstance(text, str):
            text = [text]
        
        batch_size = len(text)
        max_len = 3
        
        input_ids = torch.randint(0, 32000, (batch_size, max_len))
        attention_mask = torch.ones(batch_size, max_len)
        
        class TokenizerOutput:
            def __init__(self, input_ids, attention_mask):
                self.input_ids = input_ids
                self.attention_mask = attention_mask
            
            def to(self, device):
                return self
        
        return TokenizerOutput(input_ids, attention_mask)
    
    def batch_decode(self, token_ids, skip_special_tokens=False):
        # Return list of dummy strings matching number of inputs
        return ["output text " + str(i) for i in range(len(token_ids))]

model = MinimalLlamaForCausalLM()
tokenizer = MinimalLlamaTokenizer()

ARGS = {
    'model': model,
    'tokenizer': tokenizer
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_eval_ds_config Ran
ran; our contract draft was wrong, not the code
microsoft/MathOctopus/utils/ds_utils.py
code served (permissive licence) · get_code("7f4bdf1898ad0544")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'offload': False,
    'stage': 0,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_train_ds_config Ran
ran on a synthesized input
microsoft/MathOctopus/utils/ds_utils.py
code served (permissive licence) · get_code("311aba0a9b717df8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'offload': False,
    'stage': 2,
    'enable_hybrid_engine': False,
    'inference_tp_size': 1,
    'release_inference_cache': False,
    'pin_parameters': True,
    'tp_gather_partition_size': 8,
    'max_out_tokens': 512,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
gsm8k_batch_gen Ran
ran; our contract draft was wrong, not the code
microsoft/MathOctopus/step1_supervised_finetuning/generate_and_eval.py
code served (permissive licence) · get_code("52f51e3b99457a09")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

class MockLLM:
    """Mock LLM that takes a list of prompts and returns mock responses."""
    def __call__(self, prompts):
        # Return a mock response for each prompt
        return [f"Mock response to: {prompt[:50]}..." for prompt in prompts]

# Setup
torch.manual_seed(0)

# Define arguments
lang_ = 'En_gsm8k'
gsm8k_questions = [
    "What is 2 + 2?",
    "If John has 5 apples and gives away 2, how many does he have left?"
]
batch_llm = MockLLM()

ARGS = {
    'lang_': lang_,
    'gsm8k_questions': gsm8k_questions,
    'batch_llm': batch_llm
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 2, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
only_optimize_lora_parameters Ran
ran; our contract draft was wrong, not the code
microsoft/MathOctopus/utils/module/lora.py
pointer only (licence: MIT); the stored copy get_code serves, from esyoon7/rlhf-tlcr, is pointer only (licence: NONE) · get_code("e617041853afd002")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from esyoon7/rlhf-tlcr, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

to_device Ran
ran; our contract draft was wrong, not the code
microsoft/MathOctopus/utils/utils.py
code served (permissive licence) · get_code("387b9e6c4f21dd62")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create a batch dictionary with various tensor types and non-tensor values
batch = {
    'input_ids': torch.randint(0, 100, (2, 4)),  # 2D tensor
    'attention_mask': torch.ones((2, 4), dtype=torch.long),  # 2D tensor
    'logits': torch.randn(2, 3),  # 2D tensor with different shape
    'label': torch.tensor([0, 1]),  # 1D tensor
    'metadata': 'some_string',  # Non-tensor value
    'count': 42,  # Non-tensor value
}

device = 'cpu'

ARGS = {
    'batch': batch,
    'device': device,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_model Not yet run
unverified (harvested, no recorded run)
microsoft/MathOctopus/step1_supervised_finetuning/generate_and_eval.py
code served (permissive licence) · get_code("016d55f875a4163a")
How it ran

no invocation recorded.

get_tokenizer Not yet run
unverified (harvested, no recorded run)
microsoft/MathOctopus/utils/utils.py
code served (permissive licence) · get_code("c791912844fe37e5")
How it ran

no invocation recorded.

load_hf_tokenizer Not yet run
unverified (harvested, no recorded run)
microsoft/MathOctopus/utils/utils.py
code served (permissive licence) · get_code("4573c4150d38e483")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 6 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 2 the same month, 6 later) and 5 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
only_optimize_lora_parameters 6 other papers
1 the same month, 5 later
2310.10505 (2023-10)
ReMax: A Simple, Effective, and Efficient Reinforcement Learning Method for Aligning Large Language Models
2024.naacl-long.326 (2024 (year only))
LSTDial: Enhancing Dialogue Generation via Long-and Short-Term Measurement Feedback
2402.14700 (2024-02)
Unveiling Linguistic Regions in Large Language Models
and 3 more not named here
to_device 6 other papers
6 later
2024.naacl-long.326 (2024 (year only))
LSTDial: Enhancing Dialogue Generation via Long-and Short-Term Measurement Feedback
2402.05808 (2024-02)
Training Large Language Models for Reasoning through Reverse Curriculum Reinforcement Learning
2402.18150 (2024-02)
Unsupervised Information Refinement Training of Large Language Models for Retrieval-Augmented Generation
and 3 more not named here
generate_constrastive_search 4 other papers
1 dated earlier, 1 the same month, 2 later
2308.02223 (2023-08)
ESRL: Efficient Sampling-based Reinforcement Learning for Sequence Generation
2310.10505 (2023-10)
ReMax: A Simple, Effective, and Efficient Reinforcement Learning Method for Aligning Large Language Models
2024.naacl-long.326 (2024 (year only))
LSTDial: Enhancing Dialogue Generation via Long-and Short-Term Measurement Feedback
and 1 more not named here
generate 3 other papers
1 dated earlier, 2 later
2308.02223 (2023-08)
ESRL: Efficient Sampling-based Reinforcement Learning for Sequence Generation
2024.naacl-long.326 (2024 (year only))
LSTDial: Enhancing Dialogue Generation via Long-and Short-Term Measurement Feedback
2405.16455 (2024-05)
On the Algorithmic Bias of Aligning Large Language Models with RLHF: Preference Collapse and Matching Regularization
get_tokenizer 2 other papers
2 later
2024.naacl-long.326 (2024 (year only))
LSTDial: Enhancing Dialogue Generation via Long-and Short-Term Measurement Feedback
2404.12253 (2024-04)
Toward Self-Improvement of LLMs via Imagination, Searching, and Criticizing
get_eval_ds_config 1 other paper
1 later
2402.14700 (2024-02)
Unveiling Linguistic Regions in Large Language Models

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Existing research predominantly focuses on developing powerful language learning models (LLMs) for mathematical reasoning within monolingual languages, with few explorations in preserving efficacy in a multilingual context. To bridge this gap, this paper pioneers exploring and training powerful Multilingual Math Reasoning (xMR) LLMs. Firstly, by utilizing translation, we construct the first multilingual math reasoning instruction dataset, MGSM8KInstruct, encompassing ten distinct languages, thus addressing the issue of training data scarcity in xMR tasks. Based on the collected dataset, we propose different training strategies to build powerful xMR LLMs, named MathOctopus, notably outperform conventional open-source LLMs and exhibit superiority over ChatGPT in few-shot scenarios. Notably, MathOctopus-13B reaches 47.6% accuracy which exceeds ChatGPT 46.3% on MGSM testset. Beyond remarkable results, we unearth several pivotal observations and insights from extensive experiments: (1) When extending the rejection sampling strategy to the multilingual context, it proves effective for model performances, albeit limited. (2) Employing parallel corpora for math Supervised Fine-Tuning (SFT) across multiple languages not only significantly enhances model performance multilingually but also elevates their monolingual performance. This indicates that crafting multilingual corpora can be regarded as a vital strategy for enhancing model performance in a specific language, especially in mathematical reasoning tasks. For instance, MathOctopus-7B improves its counterparts that trained on English from 42.2% to 50.8% on GSM8K testset. Codes are available at https://github.com/microsoft/MathOctopus.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2310.20246")
get_code_for_paper("2310.20246")
have("2310.20246")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2310.20246.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2310.20246.svg)](https://syntology.ai/paper/2310.20246)

Connect an agent — have() is free.