Unverified Commit bb5b46d7 authored by Yu Shi Jie's avatar Yu Shi Jie Committed by GitHub
Browse files

Merge branch 'EleutherAI:main' into mmlu-pro

parents 1e4e058c 6f7b4a05
"dataset_name": "Primary Islamic Studies"
"group": "arabicmmlu_humanities"
"group_alias": "humanities"
"include": "_default_template_yaml"
"task": "arabicmmlu_primary_islamic_studies"
"task_alias": "Primary Islamic Studies"
"dataset_name": "Primary Math"
"group": "arabicmmlu_stem"
"group_alias": "stem"
"include": "_default_template_yaml"
"task": "arabicmmlu_primary_math"
"task_alias": "Primary Math"
"dataset_name": "Primary Natural Science"
"group": "arabicmmlu_stem"
"group_alias": "stem"
"include": "_default_template_yaml"
"task": "arabicmmlu_primary_natural_science"
"task_alias": "Primary Natural Science"
"dataset_name": "Primary Social Science"
"group": "arabicmmlu_social_science"
"group_alias": "social science"
"include": "_default_template_yaml"
"task": "arabicmmlu_primary_social_science"
"task_alias": "Primary Social Science"
"dataset_name": "Prof Law"
"group": "arabicmmlu_humanities"
"group_alias": "humanities"
"include": "_default_template_yaml"
"task": "arabicmmlu_prof_law"
"task_alias": "Prof Law"
"dataset_name": "Univ Accounting"
"group": "arabicmmlu_social_science"
"group_alias": "social science"
"include": "_default_template_yaml"
"task": "arabicmmlu_univ_accounting"
"task_alias": "Univ Accounting"
"dataset_name": "Univ Computer Science"
"group": "arabicmmlu_stem"
"group_alias": "stem"
"include": "_default_template_yaml"
"task": "arabicmmlu_univ_computer_science"
"task_alias": "Univ Computer Science"
"dataset_name": "Univ Economics"
"group": "arabicmmlu_social_science"
"group_alias": "social science"
"include": "_default_template_yaml"
"task": "arabicmmlu_univ_economics"
"task_alias": "Univ Economics"
"dataset_name": "Univ Management"
"group": "arabicmmlu_other"
"group_alias": "other"
"include": "_default_template_yaml"
"task": "arabicmmlu_univ_management"
"task_alias": "Univ Management"
"dataset_name": "Univ Political Science"
"group": "arabicmmlu_social_science"
"group_alias": "social science"
"include": "_default_template_yaml"
"task": "arabicmmlu_univ_political_science"
"task_alias": "Univ Political Science"
PROMPT = 'This is a {}. Select the correct answer!\n\nQuestion: {}\n{}\n\nAnswer:'
level_en = {
'Primary': 'primary school',
'Middle': 'middle school',
'High': 'high school',
'Univ': 'university',
'Prof': 'professional',
}
alpa = ['A.', 'B.', 'C.', 'D.', 'E.']
def doc_to_text(doc):
"""
Refactoring `prepare_data_en` to fit with the lm harness framework.
https://github.com/mbzuai-nlp/ArabicMMLU/blob/main/util_prompt.py
"""
level = "" if not doc['Level'] else " for " + level_en[doc['Level']]
country = "" if not doc['Country'] else " in " + doc['Country']
main_meta_data = f"{doc['Subject']} question{level}{country}"
question = doc['Question'] if doc['Context']=="" else f"{doc['Context']}\n\n{doc['Question']}"
options = []
for i, opt in enumerate(['Option 1', 'Option 2', 'Option 3', 'Option 4', 'Option 5']):
if not doc[opt]:
break
options.append(f"{alpa[i]} {doc[opt]}")
doc_text = PROMPT.format(main_meta_data, question, '\n'.join(options))
return doc_text
def doc_to_choice(doc):
return [alpa[i][0] for i in range(5) if doc[f'Option {i+1}']]
\ No newline at end of file
# BertaQA
### Paper
Title: BertaQA: How Much Do Language Models Know About Local Culture?
Abstract: https://arxiv.org/abs/2406.07302
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 pre-training 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.
Homepage: https://github.com/juletx/BertaQA
### Citation
```
@misc{etxaniz2024bertaqa,
title={BertaQA: How Much Do Language Models Know About Local Culture?},
author={Julen Etxaniz and Gorka Azkune and Aitor Soroa and Oier Lopez de Lacalle and Mikel Artetxe},
year={2024},
eprint={2406.07302},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
```
### Groups and Tasks
#### Groups
- `bertaqa`: Group of BertaQA tasks.
#### Tasks
- `bertaqa_eu`: Trivia questions in Basque.
- `bertaqa_en`: Trivia questions in English, human-translated from Basque.
- `bertaqa_en_mt_*`: Trivia questions in English, machine-translated from Basque with different models.
### Checklist
For adding novel benchmarks/datasets to the library:
- [ ] Is the task an existing benchmark in the literature?
- [ ] Have you referenced the original paper that introduced the task?
- [ ] If yes, does the original paper provide a reference implementation? If so, have you checked against the reference implementation and documented how to run such a test?
If other tasks on this dataset are already supported:
- [ ] Is the "Main" variant of this task clearly denoted?
- [ ] Have you provided a short sentence in a README on what each new variant adds / evaluates?
- [ ] Have you noted which, if any, published evaluation setups are matched by this variant?
group: bertaqa
dataset_path: HiTZ/BertaQA
dataset_name: null
validation_split: null
test_split: test
fewshot_split: test
output_type: multiple_choice
doc_to_choice: ["A", "B", "C"]
doc_to_target: answer
metric_list:
- metric: acc
aggregation: mean
higher_is_better: true
metadata:
version: 0.0
task: bertaqa_en
include: _bertaqa_template
dataset_name: en
doc_to_text: "Question: {{question}}\nA: {{candidates[0]}}\nB: {{candidates[1]}}\nC: {{candidates[2]}}\nAnswer:"
task: bertaqa_en_mt_gemma-7b
include: _bertaqa_template
dataset_name: en_mt_gemma-7b
doc_to_text: "Question: {{question}}\nA: {{candidates[0]}}\nB: {{candidates[1]}}\nC: {{candidates[2]}}\nAnswer:"
task: bertaqa_en_mt_hitz
include: _bertaqa_template
dataset_name: en_mt_hitz
doc_to_text: "Question: {{question}}\nA: {{candidates[0]}}\nB: {{candidates[1]}}\nC: {{candidates[2]}}\nAnswer:"
task: bertaqa_en_mt_itzuli
include: _bertaqa_template
dataset_name: en_mt_itzuli
doc_to_text: "Question: {{question}}\nA: {{candidates[0]}}\nB: {{candidates[1]}}\nC: {{candidates[2]}}\nAnswer:"
task: bertaqa_en_mt_latxa-13b-v1.1
include: _bertaqa_template
dataset_name: en_mt_latxa-13b-v1.1
doc_to_text: "Question: {{question}}\nA: {{candidates[0]}}\nB: {{candidates[1]}}\nC: {{candidates[2]}}\nAnswer:"
task: bertaqa_en_mt_latxa-13b-v1
include: _bertaqa_template
dataset_name: en_mt_latxa-13b-v1
doc_to_text: "Question: {{question}}\nA: {{candidates[0]}}\nB: {{candidates[1]}}\nC: {{candidates[2]}}\nAnswer:"
task: bertaqa_en_mt_latxa-70b-v1.1
include: _bertaqa_template
dataset_name: en_mt_latxa-70b-v1.1
doc_to_text: "Question: {{question}}\nA: {{candidates[0]}}\nB: {{candidates[1]}}\nC: {{candidates[2]}}\nAnswer:"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment