SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.07302 · NeurIPS · 2024

BERTAQA: How Much Do Language Models Know About Local Culture?

Mikel Artetxe, Julen Gorka, Azkune Aitor, Soroa Oier Lopez De Lacalle

arXiv · PDF · Open in the Atlas

Code that ran

8 of 12 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; 7 failures of our instrument; 4 no recorded run), measured 2026-11-22; 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/2406.07302.json · badge: /api/ran/2406.07302.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
juletx/bertaqa canonical (classifier label)
classifier basis: census
5 ran · 4 no recorded run
juletx/BertaQA canonical (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
FunctionStatusWhere it lives
count_lines Ran
ran, honoured the contract we drafted
juletx/bertaqa/translate/dataset.py
code served (permissive licence) · get_code("c74ca09cfdbb61f9")
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
import torch.nn as nn

# Set seed for reproducibility
torch.manual_seed(0)

# Construct arguments for count_lines function
input_list = [
    "line 1",
    "line 2",
    "line 3",
    "line 4",
    "line 5"
]

ARGS = {
    "input_list": input_list
}
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
encode_string Ran
ran; our contract draft was wrong, not the code
juletx/bertaqa/translate/translate.py
code served (permissive licence) · get_code("9a4a652e139275a2")
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

def encode_string(text):
    return text.replace('\r', '\\r').replace('\n', '\\n').replace('\t', '\\t')

ARGS = {
    'text': 'hello\rworld\nfoo\tbar'
}
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
few_shot_messages Ran
ran; our contract draft was wrong, not the code
juletx/BertaQA/openai/evaluate.py
code served (permissive licence) · get_code("294fccd9026f79d1")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 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.

few_shot_examples = [
    {
        'question': 'What is the capital of France?',
        'candidates': ['London', 'Paris', 'Berlin'],
        'answer': 1
    },
    {
        'question': 'What color is the sky?',
        'candidates': ['Green', 'Blue', 'Red'],
        'answer': 1
    },
    {
        'question': 'How many legs does a dog have?',
        'candidates': ['Two', 'Four', 'Six'],
        'answer': 1
    }
]

config = 'eu'

ARGS = {
    'few_shot_examples': few_shot_examples,
    'config': config
}
Setup block drafted by
a language model, Claude Sonnet 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
few_shot_messages Ran
ran; our contract draft was wrong, not the code
juletx/bertaqa/anthropic/evaluate.py
code served (permissive licence) · get_code("77874b775ba08799")
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 torch
import numpy as np

answer2letter = {0: 'A', 1: 'B', 2: 'C'}

def format_question(item, config='eu'):
    question = item['question']
    candidates = item['candidates']
    if config == 'eu':
        formatted_question = f'Galdera: {question}\nA: {candidates[0]}\nB: {candidates[1]}\nC: {candidates[2]}\nErantzuna:'
    elif config in ['en', 'en_mt']:
        formatted_question = f'Question: {question}\nA: {candidates[0]}\nB: {candidates[1]}\nC: {candidates[2]}\nAnswer:'
    else:
        raise ValueError("config must be 'eu', 'en' or 'en_mt'")
    return formatted_question

def few_shot_messages(few_shot_examples, config='eu'):
    messages = []
    for example in few_shot_examples:
        messages.append({'role': 'user', 'content': format_question(example, config)})
        messages.append({'role': 'assistant', 'content': answer2letter[example['answer']]})
    return messages

few_shot_examples = [
    {
        'question': 'What is the capital of France?',
        'candidates': ['Paris', 'London', 'Berlin'],
        'answer': 0
    },
    {
        'question': 'What is 2 + 2?',
        'candidates': ['3', '4', '5'],
        'answer': 1
    }
]

ARGS = {
    'few_shot_examples': few_shot_examples,
    'config': 'eu'
}
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 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
format_question Ran
ran; our contract draft was wrong, not the code
juletx/BertaQA/openai/evaluate.py
code served (permissive licence) · get_code("7151aae860cbcdd0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 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 torch
import numpy as np

# The function expects an 'item' dict with 'question' and 'candidates' keys,
# and a 'config' string parameter

item = {
    'question': 'What is the capital of France?',
    'candidates': ['London', 'Paris', 'Berlin']
}

config = 'eu'

ARGS = {
    'item': item,
    'config': config
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
numpy, 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_texts Ran
ran; our contract draft was wrong, not the code
juletx/BertaQA/translate/translate_dataset_nllb.py
code served (permissive licence) · get_code("4fbde4146ac83d26")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned defaultdict. 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 numpy as np

torch.manual_seed(0)

# The function accesses dataset[config][field], so dataset needs to be a nested dict-like structure
# dataset_args needs 'dataset_configs' (list of config names) and 'dataset_fields' (list of field names)

class DatasetDict:
    def __init__(self):
        self.data = {}
    
    def __getitem__(self, key):
        return self.data[key]
    
    def __setitem__(self, key, value):
        self.data[key] = value

# Create a dataset with nested structure
dataset = DatasetDict()

# Create two configs with two fields each
config1_data = {
    'text': ['This is sample text 1', 'This is sample text 2'],
    'label': [0, 1]
}

config2_data = {
    'text': ['Another sample text 1', 'Another sample text 2'],
    'label': [1, 0]
}

dataset['config1'] = config1_data
dataset['config2'] = config2_data

# Create dataset_args with configs and fields
dataset_args = {
    'dataset_configs': ['config1', 'config2'],
    'dataset_fields': ['text', 'label']
}

ARGS = {
    'dataset': dataset,
    'dataset_args': dataset_args
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type defaultdict — a defaultdict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a defaultdict 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_texts Ran
ran; our contract draft was wrong, not the code
juletx/bertaqa/translate/translate_dataset_few_shot.py
code served (permissive licence) · get_code("80b18c3134e34e8a")
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. 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.

from collections import defaultdict
from datasets import DatasetDict, Dataset

# Create minimal stand-in datasets
config1_data = {
    'field1': [['sentence1', 'sentence2'], ['sentence3']],
    'field2': ['text1', 'text2']
}

config2_data = {
    'field1': [['s1', 's2', 's3'], ['s4']],
    'field2': ['t1', 't2']
}

dataset = DatasetDict({
    'config_a': Dataset.from_dict(config1_data),
    'config_b': Dataset.from_dict(config2_data)
})

dataset_args = {
    'dataset_configs': ['config_a', 'config_b'],
    'dataset_fields': ['field1', 'field2']
}

ARGS = {
    'dataset': dataset,
    'dataset_args': dataset_args
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
datasets — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is 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_texts Ran
ran; our contract draft was wrong, not the code
juletx/bertaqa/translate/translate_dataset_madlad.py
code served (permissive licence) · get_code("c735fa8c6de07b1b")
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 defaultdict. 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
from collections import defaultdict

# The function expects:
# 1. dataset: a dict-like object with config keys, each containing field keys with list values
# 2. dataset_args: a dict with 'dataset_configs' and 'dataset_fields' keys

# Create a simple dataset structure
dataset = {
    'config1': {
        'field1': ['hello world', 'foo bar'],
        'field2': [['nested', 'list'], ['another', 'nested']],
    },
    'config2': {
        'field1': ['text1', 'text2'],
        'field2': [['a', 'b'], ['c', 'd']],
    }
}

# Create dataset_args
dataset_args = {
    'dataset_configs': ['config1', 'config2'],
    'dataset_fields': ['field1', 'field2']
}

ARGS = {
    'dataset': dataset,
    'dataset_args': dataset_args
}
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 defaultdict — a defaultdict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a defaultdict 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_dataset Not yet run
unverified (harvested, no recorded run)
juletx/bertaqa/translate/translate_dataset_few_shot.py
code served (permissive licence) · get_code("e859752b12f6b7b5")
How it ran

no invocation recorded.

get_dataset Not yet run
unverified (harvested, no recorded run)
juletx/bertaqa/translate/translate_dataset_madlad.py
code served (permissive licence) · get_code("2be3ed4b02dce2bf")
How it ran

no invocation recorded.

get_few_shot_dataset Not yet run
unverified (harvested, no recorded run)
juletx/bertaqa/translate/translate_dataset_few_shot.py
code served (permissive licence) · get_code("6d9a2be0e8aaa21a")
How it ran

no invocation recorded.

load_bertaqa Not yet run
unverified (harvested, no recorded run)
juletx/bertaqa/anthropic/evaluate.py
code served (permissive licence) · get_code("1b85278ca24c90ca")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 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 11 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
encode_string 1 other paper
1 dated earlier
2010.11125 (2020-10)
Beyond English-Centric Multilingual Machine Translation

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-22.

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) exhibit extensive knowledge about the world, but most evaluations have been limited to global or anglocentric subjects. This raises the question of how well these models perform on topics relevant to other cultures, whose presence on the web is not that prominent. To address this gap, we introduce BERTAQA, a multiple-choice trivia dataset that is parallel in English and Basque. The dataset consists of a local subset with questions pertinent to the Basque culture, and a global subset with questions of broader interest. We find that state-of-the-art LLMs struggle with local cultural knowledge, even as they excel on global topics. However, we show that continued pretraining in Basque significantly improves the models' performance on Basque culture, even when queried in English. To our knowledge, this is the first solid evidence of knowledge transfer from a low-resource to a high-resource language. Our analysis sheds light on the complex interplay between language and knowledge, and reveals that some prior findings do not fully hold when reassessed on local topics. Our dataset and evaluation code are available under open licenses at https://github.com/juletx/BertaQA.

For agents

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

get_harvested_code_for_paper("2406.07302")
get_code_for_paper("2406.07302")
have("2406.07302")

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

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

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

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

Connect an agent — have() is free.