Introduction
In machine learning, data preparation often accounts for up to 80% of the total workload. Transforming raw, noisy, and heterogeneous datasets into "AI-ready" features is a significant bottleneck. While Large Language Models (LLMs) have shown promise in generating code for these tasks, they often suffer from a lack of automation, limited reliability due to hallucinations, and a heavy dependency on human expertise for prompting.
Dataforge addresses these challenges by introducing an autonomous "Data Agent." This platform bridges the gap between raw data and high-quality features through a reasoning-based framework that plans, executes, and validates transformations without human intervention.
Methodology: The Planning–Grounding–Execution Framework
Dataforge is built on a structured architecture designed to maximize reliability and efficiency through a Planning–Grounding–Execution cycle.
The system employs several key innovations:
- Hierarchical Routing: To manage complexity, Dataforge uses a two-stage routing process. It first performs "coarse-grained" routing to select an operation family (e.g., Feature Selection, Transformation, or Engineering) before identifying the specific tool or mathematical transformation required.
- Dual Feedback Loops:
- Safety Loop (Grounding): Before execution, actions are validated for logical feasibility and schema compatibility. This prevents common LLM errors like invalid mathematical operations on categorical data.
- Adaptiveness Loop (Optimization): The system evaluates the impact of each transformation on downstream model performance (e.g., F1-score). If an action fails to improve the result, the system automatically rolls back to the previous best state.
- Postfix Expressions: By using Reverse Polish Notation (RPN) for feature transformations, the agent reduces the search space and avoids the ambiguity of standard infix notation.
Key Insights
A central finding of this work is that LLMs excel as managers of tools rather than one-shot scriptwriters. By breaking the workflow into iterative loops, Dataforge maintains a high valid-action rate of 98-99%. Furthermore, the system is "zero-shot" ready, leveraging the pre-trained reasoning of models like Llama-3.2-3B without requiring additional dataset-specific training. Ablation studies highlight that "grounding" is the "secret sauce"; without these safety checks, the frequency of retries increases significantly, hindering overall performance.
Results and Case Studies
Dataforge was evaluated across nine diverse tabular benchmarks, consistently outperforming classical automated tools (e.g., AutoFeat, OpenFE) and reinforcement learning-based baselines.
In a practical case study involving heart disease detection (SPECTF Heart dataset), Dataforge demonstrated its efficiency by reducing the feature set from 44 to 20 while increasing diagnostic accuracy from 77.2% to 84.0% in just 100 seconds. The system typically achieves peak performance within 2 to 6 evaluator calls, making it significantly more cost-effective than exhaustive search methods.
Conclusion
Dataforge represents a significant step toward fully autonomous data engineering. While currently focused on tabular data, its agentic approach provides a robust template for handling complex data preparation tasks. Future work will explore expanding this framework to unstructured data types and implementing multi-agent collaborative environments to further streamline the machine learning lifecycle.
Summary updated