SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2505.18673 · ACL · 2025

Cross-Lingual Pitfalls: Automatic Probing Cross-Lingual Weakness of Multilingual Large Language Models

Xiangliang Zhang, Meng Jiang, Yanbo Wang, Xiuying Chen, Yue Huang, Jieyu Zhao, Zixiang Xu

arXiv · PDF · Open in the Atlas

Code that ran

6 of 15 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 5 have no contract verdict; 1 failure of our instrument; 9 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/2505.18673.json · badge: /api/ran/2505.18673.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
xzx34/Cross-Lingual-Pitfalls canonical (classifier label)
classifier basis not recorded on the link
6 ran · 9 no recorded run
FunctionStatusWhere it lives
extract_question Ran
ran on a synthesized input
xzx34/Cross-Lingual-Pitfalls/utils/prompt.py
code served (permissive licence) · get_code("99fb32bf3b96639a")
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 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 torch

torch.manual_seed(0)

ARGS = {
    "prompt": "The model responded with: This is a test response about machine learning concepts and their applications."
}
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 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
get_category Ran
ran on a synthesized input
xzx34/Cross-Lingual-Pitfalls/utils/prompt.py
code served (permissive licence) · get_code("2f6e51b4c650ee0c")
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 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 torch

torch.manual_seed(0)

# The function get_category takes a single parameter: question
# Looking at the function body, it uses the question parameter in an f-string
# The question should be a string

question = "What is the process of photosynthesis in plants?"

ARGS = {
    "question": question
}
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 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
get_distraction Ran
ran on a synthesized input
xzx34/Cross-Lingual-Pitfalls/utils/prompt.py
code served (permissive licence) · get_code("43d6f9f58b1cdd6e")
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 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 torch

# Call get_distraction with string arguments for question and wrong_answer
ARGS = {
    "question": "What is the capital of France?",
    "wrong_answer": "London"
}
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 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
read_json Ran
ran; our contract draft was wrong, not the code
xzx34/Cross-Lingual-Pitfalls/visualization.py
pointer only (licence: MIT); the stored copy get_code serves, from geoeval/geoeval, is pointer only (licence: NONE) · get_code("ee50a40e401c2b10")
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 geoeval/geoeval, 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.

retry_on_failure Ran
ran on a synthesized input
xzx34/Cross-Lingual-Pitfalls/utils/tools.py
code served (permissive licence) · get_code("8ee594df16d22dd6")
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 functools
import time
import logging
import torch

logger = logging.getLogger(__name__)

def retry_on_failure(max_retries=3, delay=1, backoff=2):
    def decorator_retry(func):
        @functools.wraps(func)
        def wrapper_retry(*args, **kwargs):
            retries = 0
            current_delay = delay
            while retries < max_retries:
                try:
                    result = func(*args, **kwargs)
                    if result is not None:
                        return result
                except Exception as e:
                    logger.warning(f'Exception occurred: {e}')
                retries += 1
                logger.info(f'Retrying ({retries}/{max_retries}) in {current_delay} seconds...')
                time.sleep(current_delay)
                current_delay *= backoff
            return None
        return wrapper_retry
    return decorator_retry


def sample_function():
    """A sample function that returns a value to be decorated."""
    return "success"


@retry_on_failure(max_retries=2, delay=0.1, backoff=1.5)
def decorated_function():
    """Function decorated with retry_on_failure."""
    return "decorated_result"


ARGS = {
    'max_retries': 3,
    'delay': 1,
    'backoff': 2
}
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 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
token_logger_decorator Ran
ran on a synthesized input
xzx34/Cross-Lingual-Pitfalls/utils/tools.py
code served (permissive licence) · get_code("0b85931c9d896479")
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 os
import tiktoken
from functools import wraps

class TokenLogger:

    def __init__(self, filename='token_original.txt'):
        self.filename = filename
        self.model_tokens = {}
        self.load_tokens()

    def log_tokens(self, model_name, input_tokens, output_tokens):
        if model_name not in self.model_tokens:
            self.model_tokens[model_name] = {'input_total': 0, 'output_total': 0, 'last_input': 0, 'last_output': 0}
        self.model_tokens[model_name]['input_total'] += input_tokens
        self.model_tokens[model_name]['output_total'] += output_tokens
        self.model_tokens[model_name]['last_input'] = input_tokens
        self.model_tokens[model_name]['last_output'] = output_tokens
        self.save_tokens()

    def get_total_tokens(self, model_name):
        if model_name in self.model_tokens:
            return (self.model_tokens[model_name]['input_total'], self.model_tokens[model_name]['output_total'])
        else:
            return (0, 0)

    def save_tokens(self):
        with open(self.filename, 'w') as file:
            for model_name, tokens in self.model_tokens.items():
                file.write(f"{model_name},{tokens['input_total']},{tokens['output_total']},{tokens['last_input']},{tokens['last_output']}\n")

    def load_tokens(self):
        if os.path.exists(self.filename):
            with open(self.filename, 'r') as file:
                for line in file:
                    model_name, input_total, output_total, last_input, last_output = line.strip().split(',')
                    self.model_tokens[model_name] = {'input_total': int(input_total), 'output_total': int(output_total), 'last_input': int(last_input), 'last_output': int(last_output)}
        else:
            self.model_tokens = {}

token_logger = TokenLogger()

def num_tokens_from_string(string: str, encoding_name='cl100k_base') -> int:
    """Returns the number of tokens in a text string."""
    encoding = tiktoken.get_encoding(encoding_name)
    num_tokens = len(encoding.encode(string))
    return num_tokens

def token_logger_decorator(func):

    @wraps(func)
    def wrapper(*args, **kwargs):
        model_name = args[0] if len(args) > 0 else kwargs.get('model', '')
        prompt = args[1] if len(args) > 1 else kwargs.get('prompt', '')
        input_tokens = num_tokens_from_string(prompt)
        response = func(*args, **kwargs)
        output_tokens = num_tokens_from_string(response)
        token_logger.log_tokens(model_name, input_tokens, output_tokens)
        return response
    return wrapper


def mock_api_call(model_name, prompt):
    """Mock function that simulates an API call."""
    return "This is a mock response from the model."


decorated_func = token_logger_decorator(mock_api_call)

ARGS = {
    'func': mock_api_call
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tiktoken — 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
check_format Not yet run
unverified (harvested, no recorded run)
xzx34/Cross-Lingual-Pitfalls/utils/check.py
code served (permissive licence) · get_code("9db9d1e2d0dd0bab")
How it ran

no invocation recorded.

check_multiple Not yet run
unverified (harvested, no recorded run)
xzx34/Cross-Lingual-Pitfalls/utils/check.py
code served (permissive licence) · get_code("4ab54a84ec558774")
How it ran

no invocation recorded.

check_semantic Not yet run
unverified (harvested, no recorded run)
xzx34/Cross-Lingual-Pitfalls/utils/check.py
code served (permissive licence) · get_code("60f1e77421c373b1")
How it ran

no invocation recorded.

generate_ideas Not yet run
unverified (harvested, no recorded run)
xzx34/Cross-Lingual-Pitfalls/utils/ideas.py
code served (permissive licence) · get_code("d079e9d72790326b")
How it ran

no invocation recorded.

generate_question Not yet run
unverified (harvested, no recorded run)
xzx34/Cross-Lingual-Pitfalls/utils/question.py
code served (permissive licence) · get_code("b359e98e028239a3")
How it ran

no invocation recorded.

num_tokens_from_string Not yet run
unverified (harvested, no recorded run)
xzx34/Cross-Lingual-Pitfalls/utils/tools.py
code served (permissive licence) · get_code("1ab2a84c0b4c9b0a")
How it ran

no invocation recorded.

simulate Not yet run
unverified (harvested, no recorded run)
xzx34/Cross-Lingual-Pitfalls/utils/answers.py
code served (permissive licence) · get_code("6af661cb96adc80d")
How it ran

no invocation recorded.

translate_question Not yet run
unverified (harvested, no recorded run)
xzx34/Cross-Lingual-Pitfalls/utils/translate.py
code served (permissive licence) · get_code("67987740b72e6ef2")
How it ran

no invocation recorded.

translate_text Not yet run
unverified (harvested, no recorded run)
xzx34/Cross-Lingual-Pitfalls/utils/translate.py
code served (permissive licence) · get_code("a6fd2a473f66f0c1")
How it ran

no invocation recorded.

Also present in other papers' code

Of 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 15 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 0 later) and 14 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
read_json 1 other paper
1 dated earlier
2402.10104 (2024-02)
GeoEval: Benchmark for Evaluating LLMs and Multi-Modal Models on Geometry Problem-Solving

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

Large Language Models (LLMs) have achieved remarkable success in Natural Language Processing (NLP), yet their cross-lingual performance consistency remains a significant challenge. This paper introduces a novel methodology for efficiently identifying inherent crosslingual weaknesses in LLMs. Our approach leverages beam search and LLM-based simulation to generate bilingual question pairs that expose performance discrepancies between English and target languages. We construct a new dataset of over 6,000 bilingual pairs across 16 languages using this methodology, demonstrating its effectiveness in revealing weaknesses even in state-of-the-art models. The extensive experiments demonstrate that our method precisely and cost-effectively pinpoints crosslingual weaknesses, consistently revealing over 50% accuracy drops in target languages across a wide range of models. Moreover, further experiments investigate the relationship between linguistic similarity and cross-lingual weaknesses, revealing that linguistically related languages share similar performance patterns and benefit from targeted post-training. Code is available at https://github.com/xzx34/Cross-Lingual-Pitfalls.

For agents

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

get_harvested_code_for_paper("2505.18673")
get_code_for_paper("2505.18673")
have("2505.18673")

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

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

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

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

Connect an agent — have() is free.