SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2024.findings-emnlp.365 · EMNLP Findings · 2024

M2QA: Multi-domain Multilingual Question Answering

Iryna Gurevych, Jonas Pfeiffer, Clifton Poth, Ilia Kuznetsov, Hannah Sterz, Leon Engländer

Code that ran

8 of 14 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; 3 failures of our instrument; 6 no recorded run), measured 2026-11-24; 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/2024.findings-emnlp.365.json · badge: /api/ran/2024.findings-emnlp.365.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
UKPLab/m2qa canonical (classifier label)
classifier basis: census
8 ran · 6 no recorded run
FunctionStatusWhere it lives
add_spaces Ran
ran on a synthesized input
UKPLab/m2qa/Experiments/evaluate_model.py
code served (permissive licence) · get_code("4c5509ae6404506e")
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 jieba

ARGS = {
    'text': '这是一个中文测试句子',
    'language': 'chinese'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jieba — 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
batch_predict_answers_llama Ran
ran on a synthesized input
UKPLab/m2qa/Experiments/LLM_evaluation/generate_local_llm_answers.py
code served (permissive licence) · get_code("0f14c81cb8afcafb")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 torch.nn as nn
from unittest.mock import Mock

torch.manual_seed(0)

# Create a minimal LlamaTokenizer stand-in
class MockLlamaTokenizer:
    def __init__(self):
        self.pad_token_id = 0
        
    def __call__(self, text, return_tensors=None, padding=None, max_length=None):
        # Simulate tokenization: create mock input_ids
        if isinstance(text, list):
            # Batch of texts
            batch_size = len(text)
            seq_len = max_length if max_length else 10
            input_ids = torch.randint(0, 1000, (batch_size, seq_len))
            attention_mask = torch.ones(batch_size, seq_len)
        else:
            # Single text
            seq_len = max_length if max_length else 10
            input_ids = torch.randint(0, 1000, (1, seq_len))
            attention_mask = torch.ones(1, seq_len)
        
        return {
            'input_ids': input_ids,
            'attention_mask': attention_mask
        }
    
    def batch_decode(self, sequences, skip_special_tokens=False, clean_up_tokenization_spaces=False):
        # Return mock decoded sequences
        batch_size = sequences.shape[0]
        return [f"[/INST] Sample answer {i}" for i in range(batch_size)]

# Create a minimal LlamaForCausalLM stand-in
class MockLlamaForCausalLM(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def generate(self, input_ids, max_new_tokens=None, do_sample=False):
        # Return mock generated sequences
        batch_size = input_ids.shape[0]
        seq_len = input_ids.shape[1] + (max_new_tokens if max_new_tokens else 10)
        return torch.randint(0, 1000, (batch_size, seq_len))

# Set up arguments
prompts_list = [
    "What is the capital of France?",
    "What is the largest planet?",
    "Who wrote Romeo and Juliet?",
    "What is 2+2?"
]

example_id = ["id_1", "id_2", "id_3", "id_4"]

model = MockLlamaForCausalLM()

tokenizer = MockLlamaTokenizer()

prompt_name = "zero_shot_german"

model_name = "llama2"

ARGS = {
    "prompts_list": prompts_list,
    "example_id": example_id,
    "model": model,
    "tokenizer": tokenizer,
    "prompt_name": prompt_name,
    "model_name": model_name
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, 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
context_question_string_english Ran
ran on a synthesized input
UKPLab/m2qa/Experiments/LLM_evaluation/prompts.py
code served (permissive licence) · get_code("bbe4d6770cf4c85e")
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
import numpy as np

# Set seed for reproducibility
torch.manual_seed(0)

# The function takes two string parameters: context and question
# Based on the function body, it simply formats these strings into a prompt template

context = "The Earth is the third planet from the Sun. It was formed approximately 4.54 billion years ago. The capital of France is Paris."

question = "What is the capital of France?"

ARGS = {
    "context": context,
    "question": question,
}
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 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
create_prompt Ran
ran on a synthesized input
UKPLab/m2qa/Experiments/LLM_evaluation/prompts.py
code served (permissive licence) · get_code("1f8df1be24e8f46c")
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

# Define the system prompts and helper functions (copied from the function definition)
ENGLISH_SYSTEM_PROMPT = "Task Description: Answer the question from the given passage. Your answer should be directly extracted from the passage, and it should be a single entity, name, or number, not a sentence. If the passage doesn't contain a suitable answer, please respond with 'unanswerable'."

GERMAN_SYSTEM_PROMPT = "Aufgabenbeschreibung: Beantworte die Frage anhand der gegebenen Textpassage. Die Antwort sollte direkt aus der Textpassage extrahiert werden und aus einer einzelnen Entität, einem Namen oder einer Zahl bestehen, nicht aus einem Satz. Wenn die Textpassage keine passende Antwort enthält, antworte bitte mit 'unbeantwortbar'."

TURKISH_SYSTEM_PROMPT = "Görev Tanımı: Soruyu verilen pasajdan yanıtlayın. Cevabınız doğrudan pasajdan alınmalı ve cevabınız bir cümle değil, tek bir varlık, isim veya sayı olmalıdır. Eğer pasaj uygun bir cevap içermiyorsa, lütfen 'cevaplanamaz' şeklinde yanıtlayın."

CHINESE_SYSTEM_PROMPT = '任务描述: 基于给定段落回答问题。答案应直接摘自文段,且应是一个实体、名称或数字,而不是一个句子。如果段落中没有合适的答案,请回答 "无法回答"。'

def context_question_string_english(context, question):
    return f"Passage: {context}\nQuestion: {question}\nNote: Your answer should be directly extracted from the passage and be a single entity, name, or number, not a sentence. If the passage doesn't contain a suitable answer, respond with 'unanswerable'."

def context_question_string_german(context, question):
    return f"Textpassage: {context}\nFrage: {question}\nHinweis: Die Antwort sollte direkt aus dem Text extrahiert werden und aus einer einzelnen Entität, einem Namen oder einer Zahl bestehen, nicht aus einem Satz. Wenn die Textpassage keine passende Antwort enthält, antworte mit 'unbeantwortbar'."

# Create sample data for examples
examples_list = [
    {
        'context': 'The capital of France is Paris.',
        'question': 'What is the capital of France?',
        'answers': 'Paris'
    },
    {
        'context': 'Albert Einstein was born in 1879.',
        'question': 'When was Albert Einstein born?',
        'answers': '1879'
    },
    {
        'context': 'The Pacific Ocean is the largest ocean.',
        'question': 'Which is the largest ocean?',
        'answers': 'Pacific Ocean'
    }
]

examples_number_list = [0, 1]

# Main arguments for create_prompt
ARGS = {
    'language': 'english',
    'context': 'The Eiffel Tower is located in Paris, France and was built in 1889.',
    'question': 'In what year was the Eiffel Tower built?',
    'examples_list': examples_list,
    'examples_number_list': examples_number_list
}
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
create_prompt_llama Ran
ran on a synthesized input
UKPLab/m2qa/Experiments/LLM_evaluation/prompts.py
code served (permissive licence) · get_code("7464afb26625dded")
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

# Create sample examples for demonstration
examples_list = [
    {
        'context': 'Paris is the capital of France. It is located in northern France.',
        'question': 'What is the capital of France?',
        'answers': 'Paris'
    },
    {
        'context': 'The Great Wall of China is one of the most impressive structures in the world.',
        'question': 'What is one of the most impressive structures in the world?',
        'answers': 'The Great Wall of China'
    },
    {
        'context': 'Albert Einstein was born in Germany in 1879.',
        'question': 'When was Albert Einstein born?',
        'answers': '1879'
    },
    {
        'context': 'Berlin ist die Hauptstadt von Deutschland.',
        'question': 'Was ist die Hauptstadt von Deutschland?',
        'answers': 'Berlin'
    }
]

# Define the ARGS dictionary with all parameters
ARGS = {
    'language': 'english',
    'context': 'The Eiffel Tower is located in Paris, France and was completed in 1889.',
    'question': 'In what year was the Eiffel Tower completed?',
    'examples_list': examples_list,
    'examples_number_list': [0, 1]
}
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
make_qid_to_has_ans Ran
ran; our contract draft was wrong, not the code
UKPLab/m2qa/Experiments/M2QA_Metric/m2qa_metric_official_squad_v2_eval_script.py
code served (permissive licence) · get_code("e91c44f5680827e2")
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 torch
import numpy as np

# Construct a minimal dataset matching the expected structure
dataset = [
    {
        'paragraphs': [
            {
                'qas': [
                    {
                        'id': 'q1',
                        'answers': [{'text': 'answer1', 'answer_start': 0}]
                    },
                    {
                        'id': 'q2',
                        'answers': []
                    }
                ]
            },
            {
                'qas': [
                    {
                        'id': 'q3',
                        'answers': [{'text': 'answer3', 'answer_start': 5}]
                    }
                ]
            }
        ]
    },
    {
        'paragraphs': [
            {
                'qas': [
                    {
                        'id': 'q4',
                        'answers': []
                    }
                ]
            }
        ]
    }
]

ARGS = {
    'dataset': dataset
}
Setup block drafted by
a language model, Claude Haiku 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 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
make_qid_to_has_ans Ran
ran; our contract draft was wrong, not the code
UKPLab/m2qa/Experiments/M2QA_Metric/m2qa_metric.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from nusnlp/complex-tr, is pointer only (licence: NONE) · get_code("41e5ac23be97994b")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from nusnlp/complex-tr, 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.

normalize_answer Ran
ran; our contract draft was wrong, not the code
UKPLab/m2qa/Experiments/M2QA_Metric/m2qa_metric.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from nusnlp/complex-tr, is pointer only (licence: NONE) · get_code("2d391d2daa3c57fe")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from nusnlp/complex-tr, 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.

answerable_unanswerable Not yet run
unverified (harvested, no recorded run)
UKPLab/m2qa/Experiments/LLM_evaluation/analyse_llm_answer.py
code served (permissive licence) · get_code("67c2826b0c10669d")
How it ran

no invocation recorded.

get_tokens Not yet run
unverified (harvested, no recorded run)
UKPLab/m2qa/Experiments/M2QA_Metric/m2qa_metric.py
code served (permissive licence) · get_code("c74510c72823459a")
How it ran

no invocation recorded.

init_llama_model Not yet run
unverified (harvested, no recorded run)
UKPLab/m2qa/Experiments/LLM_evaluation/generate_local_llm_answers.py
code served (permissive licence) · get_code("81fad1790c414226")
How it ran

no invocation recorded.

load_m2qa_dataset Not yet run
unverified (harvested, no recorded run)
UKPLab/m2qa/Experiments/evaluate_model.py
code served (permissive licence) · get_code("b7cf8c6e53a9b81f")
How it ran

no invocation recorded.

load_mmqa_dataset Not yet run
unverified (harvested, no recorded run)
UKPLab/m2qa/Experiments/LLM_evaluation/generate_local_llm_answers.py
code served (permissive licence) · get_code("302830bcc50656de")
How it ran

no invocation recorded.

load_opus_books Not yet run
unverified (harvested, no recorded run)
UKPLab/m2qa/Experiments/mad-x-2/load_datasets.py
code served (permissive licence) · get_code("66915b6cb29c05f0")
How it ran

no invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 1 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
make_qid_to_has_ans 9 other papers
8 dated earlier, 1 later
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1908.08962 (2019-08)
Well-Read Students Learn Better: On the Importance of Pre-training Compact Models
1910.01244 (2019-10)
Linking artificial and human neural representations of language
and 6 more not named here
make_qid_to_has_ans 2 other papers
2 dated earlier
2308.16475 (2023-08)
$\rm SP^3$: Enhancing Structured Pruning via PCA Projection
2311.09821 (2023-11)
Towards Robust Temporal Reasoning of Large Language Models via a Multi-Hop QA Dataset and Pseudo-Instruction Tuning
normalize_answer 2 other papers
2 dated earlier
2308.16475 (2023-08)
$\rm SP^3$: Enhancing Structured Pruning via PCA Projection
2311.09821 (2023-11)
Towards Robust Temporal Reasoning of Large Language Models via a Multi-Hop QA Dataset and Pseudo-Instruction Tuning

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

Repositories linked to this paper

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

Abstract

Generalization and robustness to input variation are core desiderata of machine learning research. Language varies along several axes, most importantly, language instance (e.g. French) and domain (e.g. news). While adapting NLP models to new languages within a single domain, or to new domains within a single language, is widely studied, research in joint adaptation is hampered by the lack of evaluation datasets. This prevents the transfer of NLP systems from well-resourced languages and domains to non-dominant language-domain combinations. To address this gap, we introduce M2QA, a multi-domain multilingual question answering benchmark. M2QA includes 13,500 SQuAD 2.0-style question-answer instances in German, Turkish, and Chinese for the domains of product reviews, news, and creative writing. We use M2QA to explore cross-lingual cross-domain performance of fine-tuned models and state-of-the-art LLMs and investigate modular approaches to domain and language adaptation. We witness 1) considerable performance variations across domain-language combinations within model classes and 2) considerable performance drops between source and target language-domain combinations across all model sizes. We demonstrate that M2QA is far from solved, and new methods to effectively transfer both linguistic and domain-specific information are necessary. 1 * Authors contributed equally. † Jonas did not run any experiments or use the data in this paper. No other GDM/Google employee was part of this project. No GDM resources were used in this project. 1 We make M2QA publicly available at https:// github.com/UKPLab/m2qa [...] Auf der französischen Regionalebene gelangt eine Partei in die Finalrunde, wenn sie im ersten Durchgang mehr als zehn Prozent Stimmen erzielt hat.

For agents

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

get_harvested_code_for_paper("2024.findings-emnlp.365")
get_code_for_paper("2024.findings-emnlp.365")
have("2024.findings-emnlp.365")

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

curl https://syntology.ai/api/ran/2024.findings-emnlp.365.json

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

[![Syntology run record](https://syntology.ai/api/ran/2024.findings-emnlp.365.svg)](https://syntology.ai/paper/2024.findings-emnlp.365)

Connect an agent — have() is free.