LongProc
收藏LongProc 数据集概述
数据集简介
LongProc(Long Procedural Generation)是一个用于评估长上下文语言模型(LLMs)的基准测试,要求模型遵循指定的程序并生成结构化输出。该数据集通过长程序生成任务来测试模型的性能。
数据集任务
LongProc 包含 6 个任务,每个任务通常包含三个难度级别,输出标记的最大数量分别为 500、2K 和 8K。具体任务如下:
- html_to_tsv(HTML 转 TSV):从 HTML 页面中提取指定信息并结构化为表格格式(TSV)。
- pseudo_to_code(伪代码转代码):将逐行结构化的伪代码翻译为相应的 C++ 代码。
- path_traversal(路径遍历):在图中遍历连接两个城市的路径,每个城市只有一个出站连接。
- tom_tracking(心智理论追踪):追踪故事中关于物体放置的位置和信念,并回答相关问题。
- countdown(倒计时):通过基本算术运算将一组数字组合以达到目标数字。
- travel_planning(旅行规划):根据停留时间和直飞航班等约束条件创建旅行计划。
数据集使用
数据加载与评估
- 使用
load_longproc_data函数加载数据,返回一个包含数据点的列表,每个数据点包含input_prompt(提示字符串)、reference_output(真实程序跟踪)和item(数据点的元信息)。 - 每个任务都有对应的评估函数,评估函数接收预测结果和数据点,返回指标和附加信息(如解析输出或错误描述)。
示例代码
- 安装必要的包:
pip install -r requirements.txt。 - 使用
example_usage.py中的示例代码加载数据并评估结果。示例代码使用gpt-4o-miniAPI,需安装openai并设置OPENAI_API_KEY。
bash python example_usage.py --dataset path_traversal_0.5k
数据集名称格式为 [task_name]_[length]
评估工具
推荐使用 HELMET 代码库进行更便捷的评估。请参考 HELMET 的 LongProc 分支(正在建设中)以使用 HELMET 评估 LongProc。
引用
数据集引用
bibtex @article{ye25longproc, title={LongProc: Benchmarking Long-Context Language Models on Long Procedural Generation}, author={Ye, Xi and Yin, Fangcong and He, Yinghui and Zhang, Joie and Howard, Yen and Gao, Tianyu and Durrett, Greg and Chen, Danqi}, journal={arXiv preprint}, year={2025} }
HELMET 引用
bibtex @misc{yen2024helmet, title={HELMET: How to Evaluate Long-Context Language Models Effectively and Thoroughly}, author={Howard Yen and Tianyu Gao and Minmin Hou and Ke Ding and Daniel Fleischer and Peter Izsak and Moshe Wasserblat and Danqi Chen}, year={2024}, eprint={2410.02694}, archivePrefix={arXiv}, primaryClass={cs.CL}, url={https://arxiv.org/abs/2410.02694}, }
原始数据集引用
LongProc 基准测试改编自多个现有数据集,请同时引用以下原始数据集: bibtex @article{arborist, author = {Li, Xiang and Zhou, Xiangyu and Dong, Rui and Zhang, Yihong and Wang, Xinyu}, title = {Efficient Bottom-Up Synthesis for Programs with Local Variables}, year = {2024}, issue_date = {January 2024}, publisher = {Association for Computing Machinery}, address = {New York, NY, USA}, volume = {8}, number = {POPL}, url = {https://doi.org/10.1145/3632894}, doi = {10.1145/3632894}, journal = {Proc. ACM Program. Lang.}, month = jan, articleno = {52}, numpages = {29}, keywords = {Observational Equivalence, Program Synthesis, Web Automation} }
@inproceedings{spoc, author = {Kulal, Sumith and Pasupat, Panupong and Chandra, Kartik and Lee, Mina and Padon, Oded and Aiken, Alex and Liang, Percy S}, booktitle = {Proceedings of the Conference on Advances in Neural Information Processing Systems (NeurIPS)}, title = {{SPoC: Search-based Pseudocode to Code}}, }
@inproceedings{ gandhi2024stream, title={{Stream of Search (SoS): Learning to Search in Language}}, author={Kanishk Gandhi and Denise H J Lee and Gabriel Grand and Muxin Liu and Winson Cheng and Archit Sharma and Noah Goodman}, booktitle={First Conference on Language Modeling}, year={2024}, }
@article{natplan, title={{NATURAL PLAN: Benchmarking LLMs on Natural Language Planning}}, author={Zheng, Huaixiu Steven and Mishra, Swaroop and Zhang, Hugh and Chen, Xinyun and Chen, Minmin and Nova, Azade and Hou, Le and Cheng, Heng-Tze and Le, Quoc V and Chi, Ed H and others}, journal={arXiv preprint arXiv:2406.04520}, year={2024} }
联系方式
如有问题,请通过 xi.ye@princeton.edu 联系。




