Data Interpreter: An LLM Agent for Data Science (2025)

Abstract: Large Language Model (LLM)-based agents have excelled in various domains but face significant challenges when applied to data science workflows due to their complex, multi-stage nature. Current LLM-based agents struggle with non-linear relationships, recursive dependencies, implicit data- and logic-dependent reasoning, and managing extensive context. In this paper, we introduce Data Interpreter, an LLM-based agent that addresses these challenges through hierarchical graph-based modeling to represent the complexity and a progressive strategy for step-by-step verification, refinement, and consistent context management. Extensive experiments confirm the effectiveness of Data Interpreter. On InfiAgent-DABench, it boosts performance by 25% (from 75.9% to 94.9%), and on machine learning and open-ended tasks, it lifts accuracy from 88% to 95% and from 60% to 97%, respectively. Moreover, our method surpasses state-of-the-art baselines by 26% on the MATH dataset. We will release the code upon publication.

## introduction large language models (llms) have demonstrated remarkable capabilities in various reasoning tasks @xcite @xcite @xcite , showcasing their ability to understand complex contexts, generate coherent responses, and even tackle multi-step problem-solving tasks. among the many areas where llms have been applied, data science stands out as a field of particular importance, but also one that presents unique challenges @xcite . data science tasks, including machine learning, data analysis, table-based question answering, and mathematical reasoning, involve multi-stage workflows that require both precise logical and numerical reasoning across various datasets. these data science workflows are inherently complex and involve multiple steps, with each task building upon the results of previous ones @xcite @xcite . the complexity arises from the interdependencies across different stages, where tasks are not only sequential, but may also involve parallel processes, feedback loops, and recursive relationships. furthermore, many data science tasks require reasoning that is both data-and logic-dependent, introducing implicit dependencies that are not always clearly stated. for example, in machine learning workflows, the transformation of categorical variables across different stages of a pipeline (e.g., encoding methods) may not always be consistent, leading to misalignments that degrade model performance. llms may struggle to capture these implicit dependencies, applying different methods inconsistently, which can result in erroneous conclusions and degraded performance. to address these challenges, several (llm agentbased) frameworks have been proposed, as shown in to address the above challenges, we propose data interpreter, a framework that leverages hierarchical graph-based modeling to systematically structure and manage task relationships, as shown in figure 1 . by explicitly organizing both highlevel task relationships and low-level computational (i.e., action) dependencies into a structured graph format, data interpreter ensures a clear representation of the workflow's complexity. building on this graph-based structure, data interpreter implements a progressive strategy for managing long-term dependencies. the framework identifies task dependencies and represents them as a reasoning graph, progressively verifying and refining each node to ensure the continuity of context throughout the process. this progressive verification ensures that earlier steps inform later ones, allowing data interpreter to handle complex, multistep workflows while maintaining coherence and accuracy across extended tasks. this results in a graph-based memory that ensures each task is grounded in a consistent context, minimizing the risk of errors propagating through the workflow. our experiments demonstrate that data interpreter significantly outperforms existing methods across several benchmarks, achieving a 25% performance boost on the public dataset infiagent-dabench @xcite and a 26% improve-ment on the math dataset @xcite . compared to other open-source frameworks, data interpreter consistently shows notable advancements in machine learning and open-ended tasks. project read csv fill missing value minmax scale 1 -data exploration correlation descriptive statistics 2 -correlati on analysis isolation forest 3 -outliers detection general selection target mean encoder variance based selection 4 -feature engineering data splitting xgboost random forest 5 -model training evaluation 6 -model evaluation model serialization confusion matrix classificat -ion report ## methodology in this section, we first present the foundational formulation of hierarchical graph modeling for data science problems, defining the task graph and ac-tion graph in section 3.1. next, we detail the iterative process of the hierarchical graph structure in section 3.2 and illustrate how our data interpreter benefits from the graph-based structured memory. finally, in section 3.3, we introduce programmable node generation, explaining how we integrate expertise at different granularities to improve the performance of llms. ## conclusion we introduced data interpreter, an llm-based agent that addresses data science challenges through a novel hierarchical graph representation. by continuously monitoring data changes and adapting to dynamic environments via iterative task refinement and graph optimization, it robustly manages data analysis, machine learning, and reasoning tasks. leveraging hierarchical decomposition, fine-grained execution, validation, and iterative modifications, data interpreter harnesses the llm's planning and coding abilities to tackle complex multi-step workflows. extensive experiments confirm its superiority over state-of-the-art opensource frameworks in machine learning, mathematical problem-solving, and real-world applications, marking a significant advance in llm-driven data science solutions.