DACO:面向应用驱动的综合数据分析的代码生成方法
DACO: Towards Application-Driven and Comprehensive Data Analysis via Code Generation
AI总结:
本研究构建了包含真实场景数据库、弱监督查询-答案对及人工标注测试集的DACO数据集,提出结合多轮提示的代码生成标注方法与DACO-RL强化学习算法,提升了大模型的数据分析效果。
摘要:
数据分析是生成深度研究与结论性见解、以全面解答用户针对表格数据提出的查询的关键分析流程。本研究旨在提出新的资源与基准,推动这一关键但具挑战性、探索不足的任务的未来研究。然而,收集由专家整理的数据分析标注成本极高。我们提出利用大语言模型(LLM)的代码生成能力,结合多轮提示技术,自动生成高质量答案标注。我们构建了DACO数据集,包含:(1)从真实场景收集的440个(表格数据)数据库;(2)约2000个查询-答案对,可作为模型训练的弱监督数据;(3)一个规模集中但经人工优化标注的高质量测试集,作为主要评估基准。我们在DACO数据集上训练了一个6B参数的监督微调(SFT)模型,发现该SFT模型习得了合理的数据分析能力。为进一步使模型与人类偏好对齐,我们使用强化学习鼓励生成人类认为有帮助的分析结果,并设计了一组密集奖励,将稀疏的人类偏好奖励传播到中间代码生成步骤。经人工标注者评估,我们的DACO-RL算法在57.72%的案例中生成的答案比SFT模型更有帮助,验证了所提算法的有效性。数据与代码已发布于https://github.com/shirley-wu/daco。
英文摘要:
Data analysis is a crucial analytical process to generate in-depth studies and conclusive insights to comprehensively answer a given user query for tabular data. In this work, we aim to propose new resources and benchmarks to inspire future research on this crucial yet challenging and under-explored task. However, collecting data analysis annotations curated by experts can be prohibitively expensive. We propose to automatically generate high-quality answer annotations leveraging the code-generation capabilities of LLMs with a multi-turn prompting technique. We construct the DACO dataset, containing (1) 440 databases (of tabular data) collected from real-world scenarios, (2) ~2k query-answer pairs that can serve as weak supervision for model training, and (3) a concentrated but high-quality test set with human refined annotations that serves as our main evaluation benchmark. We train a 6B supervised fine-tuning (SFT) model on DACO dataset, and find that the SFT model learns reasonable data analysis capabilities. To further align the models with human preference, we use reinforcement learning to encourage generating analysis perceived by human as helpful, and design a set of dense rewards to propagate the sparse human preference reward to intermediate code generation steps. Our DACO-RL algorithm is evaluated by human annotators to produce more helpful answers than SFT model in 57.72% cases, validating the effectiveness of our proposed algorithm. Data and code are released at https://github.com/shirley-wu/daco
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。