SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2308.04948 · 2023

Extrapolating Large Language Models to Non-English by Aligning Languages

arXiv · PDF · Open in the Atlas

Code that ran

5 of 7 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; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 4 failures of our instrument; 2 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/2308.04948.json · badge: /api/ran/2308.04948.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
NJUNLP/x-LLM canonical (classifier label)
classifier basis: census
5 ran · 2 no recorded run
FunctionStatusWhere it lives
encode_prompt Ran
ran; our contract draft was wrong, not the code
NJUNLP/x-LLM/generate_instruction.py
code served (permissive licence) · get_code("9b2dd0265fc6e6b6")
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) and returned str. 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 re
import tempfile
import os

# Create a temporary prompt.txt file
temp_dir = tempfile.mkdtemp()
prompt_file = os.path.join(temp_dir, 'prompt.txt')
with open(prompt_file, 'w') as f:
    f.write('You are a helpful assistant.\n')

# Change to temp directory so the function can find prompt.txt
original_dir = os.getcwd()
os.chdir(temp_dir)

# Define the prompt_instructions parameter
prompt_instructions = [
    {
        'instruction': 'Classify  the   sentiment',
        'input': 'This movie is great!',
        'output': 'Positive'
    },
    {
        'instruction': 'Translate to French',
        'input': 'Hello world',
        'output': 'Bonjour le monde'
    },
    {
        'instruction': 'Summarize the text',
        'input': '',
        'output': 'This is a summary'
    }
]

ARGS = {
    'prompt_instructions': prompt_instructions
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
find_word_in_string Ran
ran; our contract draft was wrong, not the code
NJUNLP/x-LLM/generate_instruction.py
code served (permissive licence) · get_code("8ca6a5f9f77053c2")
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) and returned Match. 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 re

# The function find_word_in_string takes two parameters:
# w: a word (string) to search for
# s: a string to search in
# It uses re.compile with word boundary matching and case-insensitive flag

ARGS = {
    "w": "hello",
    "s": "Hello world, this is a test string with HELLO in it"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Match — a Match output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Match 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
gen_prompt Ran
ran; our contract draft was wrong, not the code
NJUNLP/x-LLM/eval/mieval.eval.py
code served (permissive licence) · get_code("b934977219a4b0ec")
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 1, 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

ARGS = {
    'ques': 'What is the capital of France?',
    'ans1': 'The capital of France is Paris, a major city in north-central France.',
    'ans2': 'Paris is the capital and most populous city of France.'
}
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 tuple, ndim 1, 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
jload Ran
ran; our contract draft was wrong, not the code
NJUNLP/x-LLM/utils.py
code served (permissive licence) · get_code("d07d04439cd1d44f")
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) 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 io
import json
import tempfile
import os

# Create a temporary JSON file with test data
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test.json")

test_data = {
    "key1": "value1",
    "key2": [1, 2, 3],
    "key3": {"nested": "dict"}
}

with open(temp_file, 'w') as f:
    json.dump(test_data, f)

# Define ARGS with the file path
ARGS = {
    "f": temp_file,
    "mode": "r"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — 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
post_process_gpt3_response Ran
ran, honoured the contract we drafted
NJUNLP/x-LLM/generate_instruction.py
code served (permissive licence) · get_code("a5e4ad4e11cf2143")
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) and returned list, ndim 1, 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 re
import string

# Construct valid arguments for post_process_gpt3_response
ARGS = {
    'num_prompt_instructions': 2,
    'response': {
        'text': '\n### 3. Instruction: Write a summary of the text\nInput: The quick brown fox jumps over the lazy dog\nOutput: A fast fox jumps over a slow dog\n### 4. Instruction: Translate to Spanish\nInput: Hello world\nOutput: Hola mundo',
        'finish_reason': 'stop'
    }
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list 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
load_datasets Not yet run
unverified (harvested, no recorded run)
NJUNLP/x-LLM/utils.py
code served (permissive licence) · get_code("57bd6a217c768db9")
How it ran

no invocation recorded.

query_gpt Not yet run
unverified (harvested, no recorded run)
NJUNLP/x-LLM/eval/mieval.eval.py
code served (permissive licence) · get_code("6e52ceed817396ba")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 1 the same month, 4 later) and 3 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
jload 46 other papers
5 dated earlier, 3 the same month, 38 later
2302.13971 (2023-02)
LLaMA: Open and Efficient Foundation Language Models
2305.12870 (2023-05)
Lion: Adversarial Distillation of Proprietary Large Language Models
2305.13068 (2023-05)
Making Language Models Better Tool Learners with Execution Feedback
and 43 more not named here
find_word_in_string 11 other papers
3 dated earlier, 7 later, 1 same year, order not determinable
2212.10560 (2022-12)
SELF-INSTRUCT: Aligning Language Models with Self-Generated Instructions
2023.findings-emnlp.836 (2023 (year only))
Ensemble-Instruct: Generating Instruction-Tuning Data with a Heterogeneous Mixture of LMs
2302.13971 (2023-02)
LLaMA: Open and Efficient Foundation Language Models
and 8 more not named here
encode_prompt 7 other papers
2 dated earlier, 5 later
2302.13971 (2023-02)
LLaMA: Open and Efficient Foundation Language Models
2305.14825 (2023-05)
Large Language Models are In-Context Semantic Reasoners rather than Symbolic Reasoners
2312.11875 (2023-12)
Sparse is Enough in Fine-tuning Pre-trained Large Language Models
and 4 more not named here
post_process_gpt3_response 7 other papers
2 dated earlier, 5 later
2302.13971 (2023-02)
LLaMA: Open and Efficient Foundation Language Models
2305.14825 (2023-05)
Large Language Models are In-Context Semantic Reasoners rather than Symbolic Reasoners
2312.11875 (2023-12)
Sparse is Enough in Fine-tuning Pre-trained Large Language Models
and 4 more not named here

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 large language models show disparate capability across different languages, due to the imbalance in the training data. Their performances on English tasks are often stronger than on tasks of other languages. In this paper, we empower pre-trained LLMs on non-English languages by building semantic alignment across languages. We start from targeting individual languages by performing cross-lingual instruction-tuning (CoIT) on LLaMA, i.e. tuning it with translation task data and cross-lingual general task data to obtain cross-lingual models (x-LLaMAs), and formulate underlying scaling laws to investigate the advantages of using scalable translation data. Then we perform multilingual instruction-tuning (MuIT) with mixed resources to build multilingual m-LLaMA. We also illustrate how we leverage the scaling laws to optimize data allocation in a resource-constrained setting. Experiment results on cross-lingual benchmarks XQUAD and MLQA show that x-LLaMAs surpass the English instruction-tuned counterpart (Alpaca) by an average of 27.83% across six non-English languages. Evaluation results on translation dataset Flores-101 show that x-LLaMAs outperform previous LLaMA-based models by an average of 18.89%. Encouragingly, m-LLaMA achieves comparable performance to x-LLaMAs on individual languages and demonstrates the ability to follow multilingual instructions. Further analysis on response content and representation space reveals the alignment of the multilingual semantic space within the middle layers of m-LLaMA.

For agents

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

get_harvested_code_for_paper("2308.04948")
get_code_for_paper("2308.04948")
have("2308.04948")

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

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

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

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

Connect an agent — have() is free.