Abstract
Data Science tasks are multifaceted, dynamic, and often domain-specific. Existing LLM-based approaches largely concentrate on isolated phases, neglecting the interdependent nature of many data science tasks and limiting their capacity for comprehensive end-to-end support. We propose DatawiseAgent, a notebook-centric LLM agent framework that unifies interactions among user, agent and the computational environment through markdown and executable code cells, supporting flexible and adaptive automated data science. Built on a Finite State Transducer(FST), DatawiseAgent orchestrates four stages, including DSF-like planning, incremental execution, self-debugging, and post-filtering. Specifically, the DFS-like planning stage systematically explores the solution space, while incremental execution harnesses real-time feedback and accommodates LLM's limited capabilities to progressively complete tasks. The self-debugging and post-filtering modules further enhance reliability by diagnosing and correcting errors and pruning extraneous information. Extensive experiments on diverse tasks, including data analysis, visualization, and data modeling, show that DatawiseAgent consistently outperforms or matches state-of-the-art methods across multiple model settings. These results highlight its potential to generalize across data science scenarios and lay the groundwork for more efficient, fully automated workflows.
1. Introduction
Automating data science (DS) is notoriously difficult because the field is inherently exploratory, interdependent, and iterative. While traditional AutoML tools excel at specific "siloed" tasks like hyperparameter tuning, they struggle with the holistic data science pipeline. Current Large Language Model (LLM) agents face three primary hurdles: isolated phase focus, limited adaptability in specialized scenarios, and a heavy reliance on state-of-the-art (SOTA) models like GPT-4. Furthermore, when agents fail and attempt to self-correct, the resulting "context pollution"—a history filled with messy error logs and failed attempts—often confuses the LLM, leading to a performance decline.
2. Methodology
DatawiseAgent introduces a notebook-centric paradigm and a dynamic multi-stage architecture to address these challenges.
2.1 Unified Interaction Representation
The framework operates entirely within a notebook-centric paradigm. Every interaction between the agent, the user, and the environment is represented as a sequence of interleaved Markdown and executable code cells. This mirrors the way human data scientists work in computational notebooks and provides a structured, interpretable execution trace.
2.2 FST-Based Multi-Stage Architecture
Instead of a rigid, linear pipeline, the agent’s behavior is governed by a Finite State Transducer (FST). This allows the agent to transition dynamically between four functional stages:
- DFS-like Planning: The agent uses a Depth-First Search strategy to propose subgoals, allowing it to backtrack and revise its plan if a chosen path proves suboptimal.
- Incremental Execution: Rather than generating massive blocks of code, the agent develops solutions step-by-step, receiving fine-grained feedback after each cell.
- Self-Debugging: Triggered by execution errors, this stage allows the agent to iteratively refine faulty code.
- Post-Filtering: This "clean-up" phase distills successful solutions and discards messy intermediate debugging traces, preventing context pollution and keeping the LLM focused on the correct path.
3. Experimental Evaluation
The authors evaluated DatawiseAgent on three diverse benchmarks:
- InfiAgent-DABench: 257 challenges focused on data analysis.
- MatplotBench: 100 expert-verified cases for scientific visualization.
- DSBench: 74 real-world Kaggle competitions testing end-to-end predictive modeling, from data cleaning to model submission.
4. Results and Discussion
DatawiseAgent consistently outperformed strong baselines like AutoGen, TaskWeaver, and ReAct across multiple metrics.
4.1 Performance and Efficiency
In predictive modeling (DSBench), the framework achieved over a 90% task success rate. Notably, DatawiseAgent using GPT-4o mini outperformed AutoGen using the full GPT-4 model, demonstrating significant cost-efficiency. In visualization tasks, it set a new SOTA on MatplotBench with an average score of 64.33.
4.2 Robustness to Scale
Perhaps the most significant insight is that a well-structured framework can make a "weak" model perform like a "strong" one. While other frameworks saw performance crater as model size decreased, DatawiseAgent’s performance degraded gracefully. On the InfiAgent-DABench, the performance gap between DatawiseAgent and its competitors actually widened as the models got smaller.
5. Conclusion
DatawiseAgent demonstrates that a notebook-centric, FST-governed architecture can effectively automate complex data science workflows. By breaking down reasoning into manageable chunks and maintaining context hygiene through post-filtering, the framework achieves high reliability and efficiency. Future work will explore expanding tool integration and enhancing human-in-the-loop collaboration within the notebook format.
Summary updated