llama-mc-datasets
收藏资源简介:
该数据集是一个为 llama.cpp 准备的公开多项选择题基准测试集合,所有基准测试已序列化为二进制任务格式,可通过 llama-perplexity --multiple-choice 直接评分,无需中间评估框架。数据集包含多个源自不同来源的基准测试,包括 AQuA-RAT、BoolQ、CareQA(英语和西班牙语)、CommonsenseQA、MedConceptsQA、MedQA(USMLE-4-options)和 MMLU。每个基准测试以单独的文件提供,命名规则为“基准测试名称-拆分.bin”,并附带 manifest.json 记录 SHA256 校验和。文件包含任务数、选项数、随机基线、多数类准确率等信息。评分支持两种模式:text 模式(选项为答案文本本身)和 letter 模式(选项为字母,如 A、B、C、D),具体模式由基准测试的原始评估协议决定。llama.cpp 通过计算每个选项的 log 概率之和并除以 token 数得到 acc_norm 分数。对于 letter 模式,每个选项为单个 token,因此 acc_norm 即为普通准确率。使用时应通过 -bf 参数传递二进制文件,-np 参数需至少等于最大选项数(通常为 5),并验证评分的任务数是否与预期一致。该数据集适用于评估语言模型在多项选择任务上的零样本性能,但注意 letter 模式的分数通常是在小样本设置下发表的,此处为零样本,因此不可直接与排行榜数字比较。
This dataset is a collection of public multiple-choice benchmark tests prepared for llama.cpp. All benchmarks are serialized into binary task format and can be directly scored using llama-perplexity --multiple-choice without an intermediate evaluation framework. The dataset includes multiple benchmarks from various sources, such as AQuA-RAT, BoolQ, CareQA (English and Spanish), CommonsenseQA, MedConceptsQA, MedQA (USMLE-4-options), and MMLU. Each benchmark is provided as a separate file named benchmark_name-split.bin with a manifest.json recording SHA256 checksums. Files contain information such as number of tasks, number of options, random baseline, majority class accuracy, etc. Scoring supports two modes: text mode (where options are the answer text itself) and letter mode (where options are letters like A, B, C, D), with the specific mode determined by the original evaluation protocol of the benchmark. llama.cpp computes the sum of log probabilities of each option divided by the number of tokens to obtain the acc_norm score. For letter mode, each option is a single token, so acc_norm is just the ordinary accuracy. When using, pass the binary file via the -bf parameter, and the -np parameter must be at least the maximum number of options (usually 5), and verify that the number of scored tasks matches expectations. This dataset is suitable for evaluating the zero-shot performance of language models on multiple-choice tasks, but note that letter mode scores are typically published under few-shot settings, while here it is zero-shot, so they cannot be directly compared with leaderboard numbers.
llama.cpp 多项选择基准数据集
数据集概述
该数据集为 llama.cpp 的 llama-perplexity --multiple-choice 命令提供了公开的多项选择基准测试,以二进制任务格式序列化,可直接由 llama.cpp 评分,无需额外的评估框架。数据集包含英语和西班牙语两种语言。
文件构成
数据集包含 13 个二进制基准文件,每个文件对应一个基准测试及其分割,并附带 manifest.json 文件记录各文件的 SHA256 校验值。文件涵盖以下基准:
| 文件 | 模式 | 任务数 | 选项数 | 随机基线(%) | 多数类(%) | 来源 | 许可证 |
|---|---|---|---|---|---|---|---|
| aqua-rat-test.bin | 文本 | 254 | 5 | 20.00 | 24.80 | deepmind/aqua_rat | Apache-2.0 |
| aqua-rat-train.bin | 文本 | 97467 | 5 | 20.00 | 22.87 | deepmind/aqua_rat | Apache-2.0 |
| aqua-rat-validation.bin | 文本 | 254 | 5 | 20.00 | 27.17 | deepmind/aqua_rat | Apache-2.0 |
| boolq-train.bin | 文本 | 9427 | 2 | 50.00 | 62.31 | google/boolq | CC-BY-SA-3.0 |
| boolq-validation.bin | 文本 | 3270 | 2 | 50.00 | 62.17 | google/boolq | CC-BY-SA-3.0 |
| careqa-en-test.bin | 字母 | 5621 | 4 | 25.00 | 26.45 | HPAI-BSC/CareQA | Apache-2.0 |
| careqa-es-test.bin | 字母 | 5621 | 4 | 25.00 | 26.45 | HPAI-BSC/CareQA | Apache-2.0 |
| commonsense-qa-train.bin | 字母 | 9741 | 5 | 20.00 | 20.38 | tau/commonsense_qa | MIT |
| commonsense-qa-validation.bin | 字母 | 1221 | 5 | 20.00 | 20.88 | tau/commonsense_qa | MIT |
| medconceptsqa-test.bin | 字母 | 819772 | 4 | 25.00 | 25.03 | ofir408/MedConceptsQA | Apache-2.0 |
| medqa-test.bin | 字母 | 1273 | 4 | 25.00 | 27.73 | GBaker/MedQA-USMLE-4-options | CC-BY-4.0 |
| medqa-train.bin | 字母 | 10178 | 4 | 25.00 | 26.08 | GBaker/MedQA-USMLE-4-options | CC-BY-4.0 |
| mmlu-validation.bin | 字母 | 1531 | 4 | 25.00 | 25.28 | cais/mmlu | MIT |
二进制格式
文件采用小端字节序,包含任务数量、各任务的绝对字节偏移量,以及每个任务的问题、选项和标签。llama.cpp 要求选项数不超过 100。
提示格式
采用两种评分形式,每个基准仅使用其一:
- text 模式:延续部分本身就是答案,llama.cpp 将选项的累计对数概率除以其token 数进行归一化。
- letter 模式:选项移入提示中,延续部分为单个字母,每个字母为一个 token,分数即为准确率。
使用注意事项
- 必须使用
-bf参数传递文件,不能使用-f(二进制文件包含0x1A字节,Windows 文本模式会将其视为文件结束符)。 -np必须至少等于最宽任务的选项数(此处为 5),默认的-np 4会导致中途终止。- 评分时需检查评分的任务数是否与宣布的数量一致,因为失败不会设置非零退出码。
- 应对比 majority_class(多数类基线)而非 chance(随机基线),尤其对 BoolQ 而言。
- 未应用聊天模板,评分基于原始对数似然,因此指令调优模型按基础模型评估。
重建与验证
- 通过
convert.py --all重新生成文件,verify.py执行全量验证,所有任务均与源数据集进行完整往返比对。 manifest.json固定每个源的 HF 提交版本,确保重建的可复现性。
数据来源
数据集整合了 7 个来源的基准测试,包括 MedQA-USMLE、CareQA、MMLU、AQuA-RAT、BoolQ、MedConceptsQA 和 CommonsenseQA,并引用对应的学术论文。各来源均固定了具体的 HF 提交版本以保证可复现性。




