naf-bench
收藏资源简介:
NAF-Bench是一个用于评估大语言模型在默认否定推理(指定否定逻辑编程语义,如SLDNF、well-founded、credulous和skeptical stable-model)下表现的数据集。其主要指标是联合准确率(JOINT accuracy),即仅当模型对四种指定阅读方式都给出正确回答时,才计为一个正确样本。数据集由生成器新鲜生成,确保无污染,且生成器开源,可无限生成新的无污染实例。数据共有三个标准划分:训练集(1320个样本,带gold标签)、验证集(495个样本,带gold标签)和测试集(495个样本,gold为null,用于竞赛排行榜)。每个样本包含字段:id(唯一标识)、prompt(问题文本)、cond(条件)、gold(正确答案:A表示肯定yes,B表示肯定no,C表示无法确定)、rec_id(记录ID)、axis(轴)、difficulty(难度)。其中none条件的gold为null且不计分。此外,还提供了三个上下文预算层级的测试文件(inputs_8k-lite、inputs_16k、inputs_full)以及早期版本(dev_v1、dev_v2)和示例文件(sample_with_gold)。数据集可通过HuggingFace Datasets库直接加载,使用方式为:load_dataset("qbao775/naf-bench")。提交预测需生成JSONL格式的文件(每行包含id和prediction,prediction为A/B/C),并通过GitHub PR提交至仓库。该数据集适用于文本分类、逻辑推理、否定理解等任务,许可证为MIT,语言为英语。
NAF-Bench is a dataset for evaluating the performance of large language models under default negation inference (specifying negation logic programming semantics such as SLDNF, well-founded, credulous, and skeptical stable-model). Its main metric is JOINT accuracy, which counts a sample as correct only if the model gives correct answers for all four specified reading approaches. The dataset is freshly generated by a generator to ensure no contamination, and the generator is open-source, allowing infinite generation of new uncontaminated instances. The data has three standard splits: training set (1320 samples with gold labels), validation set (495 samples with gold labels), and test set (495 samples with gold as null, used for leaderboard). Each sample contains fields: id (unique identifier), prompt (question text), cond (condition), gold (correct answer: A for yes, B for no, C for uncertain), rec_id (record ID), axis (axis), difficulty (difficulty). Samples with none condition have gold as null and are not scored. Additionally, three context budget level test files are provided (inputs_8k-lite, inputs_16k, inputs_full), along with early versions (dev_v1, dev_v2) and an example file (sample_with_gold). The dataset can be loaded via the HuggingFace Datasets library using: load_dataset("qbao775/naf-bench"). Submissions should be in JSONL format (each line with id and prediction, prediction as A/B/C) and submitted via GitHub PR. This dataset is suitable for tasks such as text classification, logical reasoning, and negation understanding. License: MIT, Language: English.
NAF-Bench 数据集概述
基本信息
- 数据集名称:NAF-Bench
- 许可证:MIT
- 任务类型:文本分类(text-classification)
- 语言:英语(en)
- 标签:推理(reasoning)、逻辑(logic)、否定(negation)、基准测试(benchmark)
数据集目的
NAF-Bench 用于评估大语言模型(LLM)是否能够遵循指定的默认否定阅读方式(包括 SLDNF、良基语义、可信语义、怀疑稳定模型四种)。数据集由求解器认证且全新生成,确保无污染。主要指标为联合准确率(JOINT accuracy)——一个程序只有在四种指定阅读方式全部正确时才被计数。
数据划分
| 划分 | 行数 | 说明 |
|---|---|---|
| train | 1320 行 | 含金标签(gold),全新实例,用于训练 |
| validation | 495 行 | 含金标签(gold),公开 hard_v3 开发集 |
| test | 495 行 | 金标签为 null(竞赛测试集,标签隐藏) |
三个划分之间互不重叠(训练/验证/隐藏测试之间无共享实例)。
数据格式
每一行包含字段:{id, prompt, cond, gold, rec_id, axis, difficulty}。其中:
- gold 取值为
A(确定是)、B(确定否)、C(无法确定) none条件下的实例gold=null,不计分
提交与排行榜
在测试集上预测,逐行输出 {"id": ..., "prediction": "A|B|C"},在 GitHub 的 submissions/ 目录下提交 PR。GitHub Action 会根据私有金标签评分并更新排行榜。
其他文件(非默认划分的额外配置)
inputs_8k-lite.jsonl/inputs_16k.jsonl/inputs_full.jsonl:三个上下文预算层级的测试集(8k-lite ⊂ 16k ⊂ full),排行榜会分别评分dev_v1.jsonl/dev_v2.jsonl:早期基准版本(含金标签),供溯源使用,但可猜测(基线准确率 76.5% / 100%),已被 hard_v3 取代sample_with_gold.jsonl:少量带金标签的示例,用于格式参考
生成训练数据
生成器是开源的,可使用新种子重新生成无限的全新、认证、无污染实例。命令示例: bash python leaderboard/make_hard_v3.py --out more_train.jsonl --seed-offset 999 --variants 40
加载方式
python from datasets import load_dataset ds = load_dataset("qbao775/naf-bench") ds["train"] # 训练集 ds["validation"] # 验证集 ds["test"] # 测试集
参考资源





