Skip to content

Commit

Permalink
Added KMMLU evaluation method and changed ReadMe (EleutherAI#1447)
Browse files Browse the repository at this point in the history
* update kmmlu default formatting

* Update _default_kmmlu_yaml

* Delete lm_eval/tasks/kmmlu/utils.py

* new tasks implemented

* add direct tasks

* update direct evaluate

* update direct eval

* add cot sample

* update cot

* add cot

* Update _cot_kmmlu_yaml

* add kmmlu90

* Update and rename _cot_kmmlu.yaml to _cot_kmmlu_yaml

* Create kmmlu90.yaml

* Update _cot_kmmlu_yaml

* add direct

* Update _cot_kmmlu_yaml

* Update and rename kmmlu90.yaml to kmmlu90_cot.yaml

* Update kmmlu90_direct.yaml

* add kmmlu hard

* Update _cot_kmmlu_yaml

* Update _cot_kmmlu_yaml

* update cot

* update cot

* erase typo

* Update _cot_kmmlu_yaml

* update cot

* Rename dataset to match k-mmlu-hard

* removed kmmlu90

* fixed name 'kmmlu_cot' to 'kmmlu_hard_cot' and revised README

* applied pre-commit before pull requests

* rename datasets and add notes

* Remove DS_Store cache

* Update lm_eval/tasks/kmmlu/README.md

Co-authored-by: Hailey Schoelkopf <[email protected]>

* Change citations and reflect reviews on version

* Added kmmlu_hard and fixed other errors

* fixing minor errors

* remove duplicated

* Rename files

* try ".index"

* minor fix

* minor fix again

* fix revert.

* minor fix. thank for hailey

---------

Co-authored-by: GUIJIN SON <[email protected]>
Co-authored-by: Hailey Schoelkopf <[email protected]>
  • Loading branch information
3 people authored and wx-zhang committed Mar 13, 2024
1 parent 7533f24 commit c346707
Show file tree
Hide file tree
Showing 228 changed files with 5,896 additions and 144 deletions.
30 changes: 22 additions & 8 deletions lm_eval/tasks/kmmlu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,43 @@

### Paper

Title: `K-MMLU(work in progress) `
* ongoing project at publishing help/ non-english benchmark
Title: `KMMLU : Measuring Massive Multitask Language Understanding in Korean`

Abstract: `The K-MMLU (Korean-MMLU) is a comprehensive suite designed to evaluate the advanced knowledge and reasoning abilities of large language models (LLMs) within the Korean language and cultural context. This suite encompasses 45 topics, primarily focusing on expert-level subjects. It includes general subjects like Physics and Ecology, and law and political science, alongside specialized fields such as Non-Destructive Training and Maritime Engineering. The datasets are derived from Korean licensing exams, with about 90% of the questions including human accuracy based on the performance of human test-takers in these exams. K-MMLU is segmented into training, testing, and development subsets, with the test subset ranging from a minimum of 100 to a maximum of 1000 questions, totaling 35,000 questions. Additionally, a set of 10 questions is provided as a development set for few-shot exemplar development. At total, K-MMLU consists of 254,334 instances.`
Abstract: `We propose KMMLU, a new Korean benchmark with 35,030 expert-level multiple-choice questions across 45 subjects ranging from humanities to STEM. Unlike previous Korean benchmarks that are translated from existing English benchmarks, KMMLU is collected from original Korean exams, capturing linguistic and cultural aspects of the Korean language. We test 26 publicly available and proprietary LLMs, identifying significant room for improvement. The best publicly available model achieves 50.54% on KMMLU, far below the average human performance of 62.6%. This model was primarily trained for English and Chinese, not Korean. Current LLMs tailored to Korean, such as Polyglot-Ko, perform far worse. Surprisingly, even the most capable proprietary LLMs, e.g., GPT-4 and HyperCLOVA X, achieve 59.95% and 53.40%, respectively. This suggests that further work is needed to improve Korean LLMs, and KMMLU offers the right tool to track this progress. We make our dataset publicly available on the Hugging Face Hub and integrate the benchmark into EleutherAI's Language Model Evaluation Harness.`

Homepage: https://huggingface.co/datasets/HAERAE-HUB/K-MMLU-Preview
Note: lm-eval-harness is using the micro average as the default. To replicate the test results in the paper, take the macro average for the scores evaluated with lm-eval-harness

Homepage: https://huggingface.co/datasets/HAERAE-HUB/KMMLU

### Citation

```
We'll be updating this section soon.
```
@article{son2024kmmlu,
title={KMMLU: Measuring Massive Multitask Language Understanding in Korean},
author={Guijin Son and Hanwool Lee and Sungdong Kim and Seungone Kim and Niklas Muennighoff and Taekyoon Choi and Cheonbok Park and Kang Min Yoo and Stella Biderman},
journal={arXiv preprint arXiv:2402.11548},
year={2024}
}

### Groups and Tasks

#### Groups

* `kmmlu`: 'All 45 subjects of the KMMLU dataset, evaluated following the methodology in MMLU's original implementation'
* `kmmlu_direct`: 'kmmlu_direct solves questions using a straightforward *generative* multiple-choice question-answering approach'
* `kmmlu_hard`: 'kmmlu_hard comprises difficult questions that at least one proprietary model failed to answer correctly using log-likelihood approach'
* `kmmlu_hard_direct`: 'kmmlu_hard_direct solves questions of kmmlu_hard using direct(generative) approach'
* `kmmlu_hard_cot`: 'kmmlu_hard_cot includes 5-shot of exemplars for chain-of-thought approach'

#### Tasks

The following tasks evaluate subjects in the KMMLU dataset
- `kmmlu_{subject_english}`
- `kmmlu_direct_{subject_english}`

The following tasks evaluate subjects in the KMMLU-Hard dataset
- `kmmlu_hard_{subject_english}`
- `kmmlu_hard_cot_{subject_english}`
- `kmmlu_hard_direct_{subject_english}`


### Checklist

Expand Down
28 changes: 28 additions & 0 deletions lm_eval/tasks/kmmlu/cot_hard/_cot_kmmlu_yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
group:
- kmmlu
- kmmlu_hard_cot
dataset_path: HAERAE-HUB/KMMLU-HARD
output_type: generate_until
test_split: test
doc_to_target: "{{['A', 'B', 'C', 'D'][answer-1]}}"
metric_list:
- metric: exact_match
aggregation: mean
higher_is_better: true
ignore_case: true
ignore_punctuation: true
generation_kwargs:
until:
- "질문:"
do_sample: false
max_gen_toks: 2048
temperature: 0.0
filter_list:
- name: "get-answer"
filter:
- function: "regex"
regex_pattern: "(?<=정답은)(.*)(?=입니다.)"
regex_pattern: "(?<=정답은)\\s*[(]?(A|B|C|D)[)]?.*(?=입니다.)"
- function: "take_first"
metadata:
version: 2.0
113 changes: 113 additions & 0 deletions lm_eval/tasks/kmmlu/cot_hard/kmmlu_cot_hard_accounting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
dataset_name: accounting
doc_to_text: '질문: 수정 전 잔액시산표의 차변 합계액은 ₩1,000,000이다. 보험료 미경과액 ₩30,000과 이자수익 미수액 ₩20,000을
계상한 후의 수정 후 잔액시산표 차변 합계액은 얼마인가?
A.₩970,000
B.₩990,000
C.₩1,020,000
D.₩1,050,000
정답: 차근 차근 생각해봅시다. 회계학 관련 정보를 위해 위키피디아를 참조하겠습니다. 주어진 문제는 수정 후 시산표의 합계에 영향을 주는 요소와
주지 않는 요소를 구분하고 이해하는 문제입니다. 이 경우, 보험료 미경과액과 이자수익 미수액이 추가되었습니다. 보험료 미경과액은 차변에 계상되어
있는 보험료(비용)을 감소 하면서 자산계정인 선급보험료가 동일금액이 차변에 증가하므로 영향을 주지 않습니다. 다음으로 이자수익 미수액 ₩20,000은
아직 받지 않은 이자를 의미합니다. 이자미수액은 잔액시산표에서 차변에 기록됩니다. , 원래의 차변 합계액 ₩1,000,000에 이자수익 미수액
₩20,000을 더하면, 수정 후의 차변 합계액은 ₩1,020,000이 됩니다. 따라서, 정답은 (C) 입니다.
질문: 제조업을 영위하는 (주)상공이 결산 시 이자비용 미지급분에 대한 거래를 누락하였을 경우 재무제표에 미치는 영향으로 옳은 것은?
A.매출총이익이 과소계상된다.
B.영업이익이 과대계상된다.
C.비유동부채가 과소계상된다.
D.당기순이익이 과대계상된다.
정답: 차근 차근 생각해봅시다. 회계학 관련 정보를 위해 위키피디아를 참조하겠습니다. 먼저, 이자비용 미지급분이란, 회사가 이자를 지급해야 하지만
아직 지급하지 않은 금액을 말합니다. 이는 기업의 부채로 간주되며, 이를 누락하게 되면 회계상의 문제가 발생할 수 있습니다. (A) 선택지의 매출총이익은
판매액에서 제조비용을 뺀 금액으로, 이자비용과는 직접적인 관련이 없습니다. 이자비용 미지급분을 누락하였다고 해서 매출총이익이 과소계상되는 것은
아닙니다. (B) 선택지의 영업이익은 매출총이익에서 판매비와 관리비를 뺀 금액입니다. 이자비용은 판매비나 관리비에 포함되지 않으므로, 이자비용
미지급분을 누락하였다고 해서 영업이익이 과대계상되는 것은 아닙니다. (C) 선택지의 비유동부채는 장기적으로 변제해야 하는 부채를 말합니다. 이자비용
미지급분은 단기적으로 변제해야 하는 부채로 간주될 수 있으나, 이를 누락하게 되면 전체 부채가 과소계상되는 결과를 초래할 수 있습니다. (D)
선택지의 당기순이익은 수익에서 모든 비용을 뺀 금액입니다. 이자비용 미지급분을 누락하게 되면 이자비용이 과소계상되어 당기순이익이 과대계상되는 결과를
초래할 수 있습니다. , 이자비용 미지급분을 누락하였을 경우, 비유동부채와 당기순이익에 영향을 미칠 수 있습니다. 하지만, 주어진 선택지 중에서는
비유동부채가 아닌 당기순이익이 과대계상되는 것이 더 정확한 표현일 것입니다. 이는 이자비용이 누락되었을 때 비용이 과소계상되므로 순이익이 과대계상되기
때문입니다. 따라서, 정답은 (D) 입니다.
질문: 현금및현금성자산에 대한 설명으로 옳지 않은 것은?
A.현금성자산은 단기의 현금수요를 충족하기 위한 목적으로 보유한다.
B.현금성자산으로 분류되기 위해서는 확정된 금액이 현금으로의 전환이 용이하고, 가치변동의 위험이 경미하여야 한다.
C.취득당시 장기로 분류되었던 국ㆍ공채 중 결산일 현재 만기일이 3개월 이내인 국·공채를 현금성자산으로 분류한다.
D.상환일이 정해져 있고 취득일로부터 상환일까지 기간이 3개월 이내인 우선주의 경우 현금성자산으로 처리한다.
정답: 차근 차근 생각해봅시다. 회계학 관련 정보를 위해 위키피디아를 참조하겠습니다. 먼저, 현금성자산은 단기의 현금수요를 충족하기 위한 목적으로
보유하는 자산으로, 큰 거래비용 없이 현금으로 전환이 용이하고, 이자율 변동에 따른 가치 변동의 위험이 크지 않은 금융상품으로서, 취득 당시 만기일
또는 상환일이 3개월 이내인 것을 말합니다. (A)는 현금성자산의 정의와 일치하므로 옳은 설명입니다. (B)도 현금성자산의 분류 기준을 설명하고
있으므로 옳은 설명입니다. (C)의 경우, 취득당시 장기로 분류되었던 국ᆞ공채 중 결산일 현재 만기일이 3개월 이내인 국·공채는 단기금융상품으로
분류됩니다. 이 설명은 옳지 않습니다. (D)의 경우, 상환일이 정해져 있고 취득일로부터 상환일까지 기간이 3개월 이내인 우선주의 경우 현금성자산으로
처리할 수 있습니다. 이 설명도 옳은 설명입니다. 따라서, 정답은 (C) 입니다.
질문: 금융자산과 금융부채에 속하는 항목으로 바르게 나타낸 것은?
A.(금융자산) 선급금, (금융부채) 미지급비용
B.(금융자산) 미수금, (금융부채) 선수금
C.(금융자산) 단기대여금, (금융부채) 장기차입금
D.(금융자산) 재고자산, (금융부채) 선수수익
정답: 차근 차근 생각해봅시다. 회계학 관련 정보를 위해 위키피디아를 참조하겠습니다. 금융자산과 금융부채는 기업이 자금을 조달하고 운용하는 과정에서
발생하는 자산과 부채를 말합니다. 이 때, 금융자산은 기업이 보유하고 있는 자산 중에서 현금이나 현금성자산으로 전환이 용이하고, 가치변동의 위험이
상대적으로 작은 자산을 말합니다. 반면에 금융부채는 기업이 상환해야 할 의무가 있는 부채 중에서 금융기관으로부터 차입한 차입금이나 사채 등을 말합니다.
각 선택지를 살펴 보겠습니다. (A) 선급금은 상품이나 원재료 등을 매입하기 위해 미리 지급한 금액으로, 금융자산이 아닌 재고자산으로 분류됩니다.
미지급비용은 이미 발생한 비용 중에서 아직 지급하지 않은 금액으로, 금융부채가 아닌 부채로 분류됩니다. (B) 미수금은 상품이나 제품 등을 판매하고
아직 받지 못한 금액으로, 금융자산에 해당됩니다. 선수금은 상품이나 제품 등을 주문받고 미리 받은 금액으로, 금융부채가 아닌 부채로 분류됩니다.
(C) 단기대여금은 상대방에게 대여한 금액 중에서 1년 이내에 회수할 예정인 금액으로, 금융자산에 해당됩니다. 장기차입금은 금융기관으로부터 차입한
차입금 중에서 1년 이후에 상환할 예정인 금액으로, 금융부채에 해당됩니다. (D) 재고자산은 기업이 판매를 목적으로 보유하고 있는 상품이나 제품,
원재료 등을 말합니다. 선수수익은 고객으로부터 미리 받은 수익 중에서 아직 제공하지 않은 용역에 대한 대가로, 부채에 해당됩니다. 따라서, 정답은
(C) 입니다.
질문: 전기 말에 상품재고액 \560,000을 \650,000으로 잘못 계상한 경우, 당기의 매출원가와 당기순이익에 미치는 영향으로 옳은 것은?
(단, 재고자산 평가는 실지재고조사법을 적용 한다.)
A.(매출원가) 과대, (당기순이익) 과소
B.(매출원가) 과대, (당기순이익) 과대
C.(매출원가) 과소, (당기순이익) 과소
D.(매출원가) 과소, (당기순이익) 과대
정답: 차근 차근 생각해봅시다. 회계학 관련 정보를 위해 위키피디아를 참조하겠습니다. 먼저, 매출원가와 당기순이익에 대해 이해해야 합니다. 매출원가는
판매된 상품을 생산하는 데 들어간 비용을 의미하며, 당기순이익은 매출에서 모든 비용을 뺀 순수익을 의미합니다. 상품재고액을 과대 계상한 경우,
이는 회사가 실제로 보유하고 있는 재고보다 더 많은 재고를 보유하고 있다고 잘못 표시한 것을 의미합니다. 이는 재고자산의 가치를 과대평가한 것이므로,
이에 따른 비용(매출원가) 역시 과대 계상됩니다. 매출원가가 과대 계상되면, 매출에서 매출원가를 뺀 이익인 당기순이익은 과소 계상됩니다. 왜냐하면
매출원가가 더 높아지면 이익은 줄어들기 때문입니다. , 상품재고액을 과대 계상한 경우 매출원가는 과대 계상되고, 당기순이익은 과소 계상됩니다.
''따라서, 정답은 (A) 입니다.
질문: {{question}}
A.{{A}}
B.{{B}}
C.{{C}}
D.{{D}}
정답: 차근 차근 생각해봅시다. 회계학 관련 정보를 위해 위키피디아를 참조하겠습니다.'
include: _cot_kmmlu_yaml
task: kmmlu_hard_cot_accounting
Loading

0 comments on commit c346707

Please sign in to comment.