SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2106.06937 · ACL · 2021

Common Sense Beyond English: Evaluating and Improving Multilingual Language Models for Commonsense Reasoning

Xiang Ren, Bill Lin, Seyeon Lee, Xiaoyang Qiao

arXiv · PDF · Open in the Atlas

Code that ran

4 of 5 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 4 have no contract verdict; 0 failures of our instrument; 1 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/2106.06937.json · badge: /api/ran/2106.06937.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
INK-USC/XCSR canonical (classifier label)
classifier basis: census
4 ran · 1 no recorded run
FunctionStatusWhere it lives
convert_ABC_to_123 Ran
ran on a synthesized input
INK-USC/XCSR/xcsr_experiments/utils_multiple_choice.py
code served (permissive licence) · get_code("01dbc46b29880c2d")
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 int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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 = {
    's': 'A'
}
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 int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
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
convert_examples_to_features Ran
ran on a synthesized input
INK-USC/XCSR/xcsr_experiments/utils_multiple_choice.py
code served (permissive licence) · get_code("c04ec1353ed9d926")
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 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 logging
from transformers import AutoTokenizer
from transformers.tokenization_utils_base import TruncationStrategy

logging.basicConfig(level=logging.INFO)

# Import the classes from the function definition
from dataclasses import dataclass
from typing import List, Optional

@dataclass(frozen=True)
class InputExample:
    example_id: str
    question: str
    contexts: List[str]
    endings: List[str]
    label: Optional[str]

# Create a minimal tokenizer stand-in that behaves like a PreTrainedTokenizer
class MinimalTokenizer:
    def __call__(self, text_a, text_b=None, add_special_tokens=True, max_length=128, 
                 padding='max_length', truncation=True, truncation_strategy=None, 
                 return_overflowing_tokens=False):
        # Simulate tokenization output
        input_ids = [101] + [1000, 1001] * 10 + [102]  # Simulate tokens
        if text_b:
            input_ids += [1002, 1003] * 5 + [102]
        
        # Pad to max_length
        if len(input_ids) < max_length:
            input_ids = input_ids + [0] * (max_length - len(input_ids))
        else:
            input_ids = input_ids[:max_length]
        
        attention_mask = [1 if token_id != 0 else 0 for token_id in input_ids]
        token_type_ids = [0] * len(input_ids)
        
        result = {
            'input_ids': input_ids,
            'attention_mask': attention_mask,
            'token_type_ids': token_type_ids,
        }
        
        if return_overflowing_tokens:
            result['num_truncated_tokens'] = 0
        
        return result

# Create sample InputExample objects
examples = [
    InputExample(
        example_id="ex1",
        question="What is the capital of France?",
        contexts=["France is a country in Europe.", "Paris is a city."],
        endings=["Paris", "London"],
        label="Paris"
    ),
    InputExample(
        example_id="ex2",
        question="What is 2+2?",
        contexts=["Math is useful.", "Numbers matter."],
        endings=["4", "5"],
        label="4"
    ),
]

# Create label list
label_list = ["Paris", "London", "4", "5"]

# Create tokenizer
tokenizer = MinimalTokenizer()

# Define max_length
max_length = 128

ARGS = {
    "examples": examples,
    "label_list": label_list,
    "max_length": max_length,
    "tokenizer": tokenizer,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tqdm, transformers — 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
eval_npy Ran
ran on a synthesized input
INK-USC/XCSR/xcsr_experiments/eval_utils.py
code served (permissive licence) · get_code("77aa6eb953e2376d")
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 float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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 json
import pickle
import tempfile
import os

# Create temporary files for truth and predictions
temp_dir = tempfile.mkdtemp()
truth_file = os.path.join(temp_dir, "truth.jsonl")
prediction_file = os.path.join(temp_dir, "predictions.pkl")

# Create truth data (JSONL format)
truth_data = [
    {
        "question": {
            "choices": [
                {"label": "A", "text": "apple"},
                {"label": "B", "text": "banana"},
                {"label": "C", "text": "cherry"}
            ]
        },
        "answerKey": "A"
    },
    {
        "question": {
            "choices": [
                {"label": "A", "text": "dog"},
                {"label": "B", "text": "cat"},
                {"label": "C", "text": "bird"}
            ]
        },
        "answerKey": "B"
    }
]

with open(truth_file, 'w') as f:
    for item in truth_data:
        f.write(json.dumps(item) + '\n')

# Create predictions (list of lists with scores)
# Each prediction is a list of scores corresponding to each choice
predictions = [
    [0.8, 0.1, 0.1],  # First instance: highest score for choice A (correct)
    [0.2, 0.7, 0.1]   # Second instance: highest score for choice B (correct)
]

with open(prediction_file, 'wb') as f:
    pickle.dump(predictions, f)

ARGS = {
    "truth_file": truth_file,
    "prediction_file": prediction_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
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
output_labels Ran
ran on a synthesized input
INK-USC/XCSR/xcsr_experiments/eval_utils.py
code served (permissive licence) · get_code("95bb1d5c24ca301e")
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 json
import pickle
import tempfile
import os

# Create temporary files for data and predictions
data_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.jsonl')
prediction_file = tempfile.NamedTemporaryFile(mode='wb', delete=False, suffix='.pkl')

try:
    # Write test data to data_file
    test_instances = [
        {
            'id': 'q1',
            'question': {
                'choices': [
                    {'label': 'A'},
                    {'label': 'B'},
                    {'label': 'C'}
                ]
            }
        },
        {
            'id': 'q2',
            'question': {
                'choices': [
                    {'label': 'X'},
                    {'label': 'Y'}
                ]
            }
        }
    ]
    
    for instance in test_instances:
        data_file.write(json.dumps(instance) + '\n')
    data_file.close()
    
    # Write test predictions to prediction_file
    # Predictions should be list of lists where each inner list has scores for each choice
    test_predictions = [
        [0.1, 0.8, 0.1],  # 3 choices for q1, B has highest score
        [0.3, 0.7]         # 2 choices for q2, Y has highest score
    ]
    pickle.dump(test_predictions, prediction_file)
    prediction_file.close()
    
    ARGS = {
        'data_file': data_file.name,
        'prediction_file': prediction_file.name
    }
    
finally:
    # Clean up will happen after function execution
    pass
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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
simple_accuracy Not yet run
unverified (harvested, no recorded run)
INK-USC/XCSR/xcsr_experiments/run_mcqa.py
code served (permissive licence) · get_code("3c241ecfe3749a6d")
How it ran

no invocation recorded.

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 1 the same month, 1 later) and 4 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
simple_accuracy 59 other papers
29 dated earlier, 4 the same month, 26 later
1506.05865 (2015-06)
LCSTS: A Large Scale Chinese Short Text Summarization Dataset
1509.01626 (2015-09)
Character-level Convolutional Networks for Text Classification *
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
and 56 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

Commonsense reasoning research has so far been limited to English. We aim to evaluate and improve popular multilingual language models (ML-LMs) to help advance commonsense reasoning (CSR) beyond English. We collect the Mickey corpus, consisting of 561k sentences in 11 different languages, which can be used for analyzing and improving ML-LMs. We propose Mickey Probe, a languageagnostic probing task for fairly evaluating the common sense of popular ML-LMs across different languages. In addition, we also create two new datasets, X-CSQA and X-CODAH, by translating their English versions to 15 other languages, so that we can evaluate popular ML-LMs for cross-lingual commonsense reasoning. To improve the performance beyond English, we propose a simple yet effective method -multilingual contrastive pretraining (MCP). It significantly enhances sentence representations, yielding a large performance gain on both benchmarks (e.g., +2.7% accuracy for X-CSQA over XLM-R L ) 1 . . A) school B) drawer C) office The chef drops the piece of shrimp in the fryer. →

For agents

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

get_harvested_code_for_paper("2106.06937")
get_code_for_paper("2106.06937")
have("2106.06937")

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

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

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

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

Connect an agent — have() is free.