arXiv:2509.13487cs.SEcs.AI2025-09被引 4

用自然语言生成可运行的数据管道,提升自动化效率。

Prompt2DAG: A Modular Methodology for LLM-Based Data Enrichment Pipeline Generation

  • 结合提示词与模板的混合方法生成Airflow工作流。
  • 混合方法成功率78.5%,远超纯大模型(66.2%)和直接提示(29.2%)。
  • 适合希望自动化构建数据管道的工程师与数据科学家。

构建可靠的数据增强管道需要大量工程经验。我们提出Prompt2DAG,一种将自然语言描述转化为可执行Apache Airflow DAG的方法。在13个大模型上进行260次实验和5个案例研究,评估了四种生成方式:直接法、仅大模型法、混合法和基于模板法。采用惩罚评分框架,综合衡量可靠性(SAT)、结构完整性(DST)和可执行性(PCT)。混合方法表现最优,成功率78.5%,各项得分分别为SAT: 6.79,DST: 7.67,PCT: 7.76,显著优于仅大模型法(66.2%)和直接法(29.2%)。结果表明,可靠性是关键差异因素。成本效益分析显示,混合方法每成功生成一个DAG的效率是直接提示的两倍以上。结论指出,结构化的混合方法对平衡灵活性与可靠性至关重要,为数据管道自动开发提供了可行路径。

原文摘要 · Abstract (English)

Developing reliable data enrichment pipelines demands significant engineering expertise. We present Prompt2DAG, a methodology that transforms natural language descriptions into executable Apache Airflow DAGs. We evaluate four generation approaches -- Direct, LLM-only, Hybrid, and Template-based -- across 260 experiments using thirteen LLMs and five case studies to identify optimal strategies for production-grade automation. Performance is measured using a penalized scoring framework that combines reliability with code quality (SAT), structural integrity (DST), and executability (PCT). The Hybrid approach emerges as the optimal generative method, achieving a 78.5% success rate with robust quality scores (SAT: 6.79, DST: 7.67, PCT: 7.76). This significantly outperforms the LLM-only (66.2% success) and Direct (29.2% success) methods. Our findings show that reliability, not intrinsic code quality, is the primary differentiator. Cost-effectiveness analysis reveals the Hybrid method is over twice as efficient as Direct prompting per successful DAG. We conclude that a structured, hybrid approach is essential for balancing flexibility and reliability in automated workflow generation, offering a viable path to democratize data pipeline development.

大模型数据管道自动化Airflow

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。