Towards Automated Data Sciences with Natural Language and SageCopilot: Practices and Lessons Learned
Yuan Liao, Jiang Bian, Yuhui Yun, Shuo Wang, Yubo Zhang, Jiaming Chu, Tao Wang, Kewei Li, Yuchen Li, Xuhong Li, Shilei Ji, Haoyi Xiong
TL;DR
The paper tackles the automation of end-to-end data science workflows by translating natural language instructions into SQL-based queries, analyses, visualizations, and reports using SageCopilot, an LLM-driven system that integrates AutoAgents, LUIs, databases, and visualization tools. It introduces a dual-phase framework consisting of an offline data-preparation phase (metadata governance, seed data, augmentation, and memory augmentation) and an online phase (intent understanding, multi-recall with schema linking, SQL generation via in-context prompting, SQL reflection, tool authentication, and result generation including text, charts, and forecasts). Through extensive deployment in industrial settings and rigorous ablation studies on real datasets (DuSQL and Real Traffic), SageCopilot demonstrates superior end-to-end performance over prompt-based baselines and provides detailed insights into the contributions of each component and design choice. The work highlights practical implications for deploying automated data science pipelines in enterprise environments and offers concrete lessons on handling token-length constraints, query complexity via views, and the importance of continuous demonstrations and feedback for maintaining end-to-end correctness.
Abstract
While the field of NL2SQL has made significant advancements in translating natural language instructions into executable SQL scripts for data querying and processing, achieving full automation within the broader data science pipeline - encompassing data querying, analysis, visualization, and reporting - remains a complex challenge. This study introduces SageCopilot, an advanced, industry-grade system system that automates the data science pipeline by integrating Large Language Models (LLMs), Autonomous Agents (AutoAgents), and Language User Interfaces (LUIs). Specifically, SageCopilot incorporates a two-phase design: an online component refining users' inputs into executable scripts through In-Context Learning (ICL) and running the scripts for results reporting & visualization, and an offline preparing demonstrations requested by ICL in the online phase. A list of trending strategies such as Chain-of-Thought and prompt-tuning have been used to augment SageCopilot for enhanced performance. Through rigorous testing and comparative analysis against prompt-based solutions, SageCopilot has been empirically validated to achieve superior end-to-end performance in generating or executing scripts and offering results with visualization, backed by real-world datasets. Our in-depth ablation studies highlight the individual contributions of various components and strategies used by SageCopilot to the end-to-end correctness for data sciences.
