遇见数据集

RioLee/ToolPref-Pairwise-30K

收藏
Hugging Face2025-11-10 更新2025-11-15 收录
官方服务:

资源简介:

--- license: cc-by-nc-sa-4.0 task_categories: - text-classification language: - en tags: - function-calling - LLM agent - reward modeling size_categories: - 10K<n<100K --- # ToolPref-Pairwise-30K <p align="left"> <a href="https://arxiv.org/abs/2510.26167">[Paper]</a> | <a href="https://huggingface.co/RioLee/ToolRM-Qwen3-4B-Thinking-2507">[Model]</a> | <a href="https://huggingface.co/datasets/RioLee/TRBench-BFCL">[Benchmark]</a> | <a href="https://github.com/lirenhao1997/ToolRM">[Code]</a> </p> ## 💡 Summary This dataset is a part of [One Model to Critique Them All: Rewarding Agentic Tool-Use via Efficient Reasoning](https://arxiv.org/abs/2510.26167). It comprises 30,000 preference annotations in agentic tool-use scenarios and was used to train the [ToolRM](https://huggingface.co/RioLee/ToolRM-Qwen3-4B-Thinking-2507) model series. ## 🌟 Overview ToolRM is a family of lightweight generative reward models tailored for general tool-use scenarios. To build these models, we propose a novel pipeline that constructs pairwise preference data using rule-based scoring and multidimensional sampling. This yields [ToolPref-Pairwise-30K](https://huggingface.co/datasets/RioLee/ToolPref-Pairwise-30K), a diverse, balanced, and challenging dataset of critique tasks that supports reinforcement learning with verifiable feedback. To evaluate tool-use RMs, we also introduce [TRBench-BFCL](https://huggingface.co/datasets/RioLee/TRBench-BFCL), a benchmark built on the agentic evaluation suite BFCL. Trained on our constructed data, models from the Qwen3-4B/8B series outperform several giant LLMs in pairwise reward judgments. Beyond training objectives, ToolRM generalizes to broader critique tasks, including Best-of-N sampling and self-correction. ## 🔧 Usage The datasets are saved as parquet files. You can easily load them with `datasets` library: ```python from datasets import load_dataset dataset = load_dataset('parquet', data_files=<your_local_dataset_path>) data_list = dataset['train'].to_list() ``` For each JSON-formatted data sample, you can either use the templated prompt in the `prompt` field for the critique task or use the original messages in `chat_history`, `chosen_response`, and `reject_response`, as you prefer. The ground truth answer of each sample is saved as a string in `reward_model`->`ground_truth`. Please refer to this [github repo](https://github.com/lirenhao1997/ToolRM) for guidelines on training generative reward models with this dataset. Note that we respectively use the `think` and `no_think` prompt templates to create the datasets. Upon training, use the `*_think` dataset for reasoning models and the `*_no_think` dataset for non-reasoning models. ## 🚦 Data Licenses ToolRM is a research project developed by Alibaba Cloud and licensed under the CC BY-NC-SA 4.0 License. A part of this dataset was generated using Gemini-2.5 / Claude-3.7 and should not be used to develop models that compete with Google / Anthropic. ## 🙏 Acknowledgments We are grateful to the following projects for contributing high-quality tool-use trajectories, which underpinned the construction of the ToolPref dataset: [APIGen](https://huggingface.co/datasets/Salesforce/xlam-function-calling-60k), [APIGen-MT](https://huggingface.co/datasets/Salesforce/APIGen-MT-5k), [BUTTON](https://github.com/PKU-Baichuan-MLSystemLab/BUTTON/tree/main/data), [ComplexFuncBench](https://huggingface.co/datasets/zai-org/ComplexFuncBench), [Glaive-Function-Calling](https://huggingface.co/datasets/glaiveai/glaive-function-calling-v2), [Hermes-Function-Calling](https://huggingface.co/datasets/NousResearch/hermes-function-calling-v1), [ToolAlpaca](https://github.com/tangqiaoyu/ToolAlpaca/tree/main/data). ## 📝 Citation If you find our work helpful, feel free to give us a cite. ``` @misc{li2025modelcritiqueallrewarding, title={One Model to Critique Them All: Rewarding Agentic Tool-Use via Efficient Reasoning}, author={Renhao Li and Jianhong Tu and Yang Su and Hamid Alinejad-Rokny and Derek F. Wong and Junyang Lin and Min Yang}, year={2025}, eprint={2510.26167}, archivePrefix={arXiv}, primaryClass={cs.AI}, url={https://arxiv.org/abs/2510.26167}, } ```

The ToolPref-Pairwise-30K dataset consists of 30,000 preference annotations in agentic tool-use scenarios and is used to train the ToolRM model series. The dataset is constructed with rule-based scoring and multidimensional sampling to create pairwise preference data, forming a diverse, balanced, and challenging dataset of critique tasks that support reinforcement learning with verifiable feedback.

提供机构:
RioLee
搜集汇总
数据集介绍
构建方式
在智能体工具调用场景中,奖励模型的构建面临数据稀缺与偏好标注不一致的挑战。为此,研究者提出了一种创新的流水线,通过基于规则的评分与多维采样策略,系统性地生成了成对偏好数据。该数据集从APIGen、ComplexFuncBench等多个高质量工具调用轨迹项目中提取原始交互,随后利用规则化评分机制对模型响应进行排序,并结合多样化的采样策略确保数据的平衡性与难度梯度。最终构建出包含三万个偏好标注样本的ToolPref-Pairwise-30K数据集,为强化学习提供可验证的反馈信号。
特点
该数据集专为智能体工具使用场景设计,具有鲜明的多维特性。首先,数据覆盖广泛的工具调用任务,从单一函数调用到复杂多步骤操作,呈现出丰富的场景多样性。其次,通过规则评分与多维采样,正负样本在难度与质量上达到均衡,避免了常见偏好数据中的偏向性问题。此外,数据集刻意引入具有挑战性的对比样本,迫使模型进行精细化的推理与判断,从而提升奖励模型的判别能力。这些特质使其成为训练轻量级、高精度工具使用奖励模型的理想基石。
使用方法
数据以Parquet格式存储,可通过Hugging Face的datasets库便捷加载。每个样本包含结构化字段,如对话历史、被选与拒绝响应,以及模板化提示。对于生成式奖励模型,可直接使用prompt字段进行批判任务,或利用原始消息自行构建输入;对于判别式奖励模型,chosen与rejected字段已预处理完毕,适用于偏好训练。数据集特别区分了推理与非推理模型的提示模板(think/no_think),用户应根据模型类型选择对应子集。详细的训练指南与代码示例可在配套的GitHub仓库中找到。
背景与挑战
背景概述
在大型语言模型(LLM)与外部工具交互的智能体场景中,如何精准评估模型调用工具的行为质量成为制约系统性能的关键瓶颈。针对这一需求,由阿里巴巴云研究团队于2025年主导构建的ToolPref-Pairwise-30K数据集应运而生。该数据集由Renhao Li、Jianhong Tu等学者联合开发,旨在为工具使用场景下的奖励建模提供高质量偏好数据。其核心研究问题聚焦于:如何通过规则化评分与多维采样构建兼具多样性、平衡性与挑战性的成对偏好数据集,以训练轻量级奖励模型。该数据集作为ToolRM项目的基石,不仅推动了Qwen3-4B/8B系列模型在成对奖励判断上超越多个大型语言模型,更在最佳采样、自我纠错等领域展现出泛化能力,对智能体工具使用奖励建模研究产生了深远影响。
当前挑战
该数据集所解决的领域挑战主要体现为:在智能体工具使用场景中,传统奖励模型因缺乏对工具调用行为的细粒度判别能力,难以准确评估模型生成动作的优劣。ToolPref-Pairwise-30K通过引入多维采样策略与规则化评分机制,构建了覆盖复杂工具调用链的成对偏好数据,使奖励模型能够学习到更精准的决策边界。构建过程中面临的挑战包括:如何从APIGen、ComplexFuncBench等多源数据中提取高质量的轨迹信息,并设计统一的评分标准;如何平衡数据集中“选择”与“拒绝”响应的难度分布,避免模型陷入简单模式学习;以及如何确保生成的偏好数据在不同工具调用场景下的泛化性,同时规避与竞品模型(如Gemini、Claude)的数据使用冲突。
常用场景
经典使用场景
ToolPref-Pairwise-30K数据集专为智能体工具调用场景下的偏好对齐而设计,其经典用途在于训练生成式与判别式奖励模型,以评判大语言模型在复杂工具编排任务中的行为优劣。数据集通过规则化评分与多维采样构建了3万对偏好标注,覆盖多样且具有挑战性的批判任务,为强化学习提供可验证的反馈信号。研究者可基于该数据集训练模型,使其在成对奖励判断中超越多个大型语言模型,从而优化智能体在函数调用、API交互等环节的决策质量。
实际应用
在实际应用中,该数据集训练的ToolRM模型可部署于智能客服、自动化工作流编排、企业级API管理平台等场景,用于筛选最优工具调用策略或纠正错误执行路径。例如,在自动化运维中,模型可基于偏好数据对候选函数调用序列进行排序,提升任务成功率;在代码生成助手领域,其支持Best-of-N采样与自我纠正机制,能显著减少无效API调用,降低系统延迟与计算成本。
衍生相关工作
围绕该数据集,研究团队提出了ToolRM系列轻量级奖励模型,并构建了TRBench-BFCL评估基准,相关成果已发表于arXiv。此外,数据集的构建管线启发了后续针对多轮工具交互的偏好数据合成方法,以及将奖励模型应用于智能体自我一致性校准的研究。其开源代码与模型权重促进了社区在工具调用偏好对齐方向的探索,催生了多项关于函数调用场景下强化学习算法的改进工作。
以上内容由遇见数据集搜集并总结生成
二维码
社区交流群
二维码
科研交流群
商业服务