REFUTE
收藏资源简介:
REFUTE数据集用于评估语言模型是否能够推理出代码可能在何时失败。具体来说,给定一个问题描述和一个错误的代码,任务是找到一个有效的输入,使得这段代码不能产生期望的输出。
The REFUTE dataset is designed to evaluate whether language models can reason about when code might fail. Specifically, given a problem description and a buggy code snippet, the task is to find a valid input such that the code fails to produce the desired output.
REFUTE 数据集概述
数据集简介
REFUTE是一个用于评估语言模型是否能够推理代码可能失败情况的数据集。具体而言,给定一个问题描述和一个错误的代码,任务是在该代码未能产生期望输出的有效输入上找到反例。
数据集构成
- 数据集包含评估环境以及从论文中简化的代码,用于查询模型的解决方案。
安装
- 使用Git克隆和pip安装的方式进行安装。
bash git clone https://github.com/falsifiers/REFUTE.git cd REFUTE pip install -e .
环境变量
- 使用模型时需要设置
OPENROUTER_KEY和GOOGLE_API_KEY环境变量。
评估
- 评估需要准备特定格式的JSON文件,包含问题ID、方法和尝试列表。
- 方法可以是
standard、randsearch或randsearch_oracle。 - 评估结果存储在JSON文件中,包含每个尝试的
success状态和info反馈。
json [ { "problem_id": "1975F", "verdicts": [ { "success": true, "info": "" } ] } ]
查询模型
- 使用命令行工具查询模型,并将尝试写入
preds.json。
bash python -m refute.generate_preds --model MODEL_NAME --method few_shot
杂项
- 评估时编译的代码在第一次运行后会缓存。
- 需要确保防病毒软件不会干扰执行。
- 数据集包含Codeforces的精确语言版本。
引用
bibtex @article{sinha2025falsify, title={Can Language Models Falsify? Evaluating Algorithmic Reasoning with Counterexample Creation}, author={Sinha, Shiven and Goel, Shashwat and Kumaraguru, Ponnurangam and Geiping, Jonas and Bethge, Matthias and Prabhu, Ameya}, journal={arXiv preprint arXiv:2502.19414}, year={2025} }




