NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

ChatPipe: Orchestrating Data Preparation Program by Optimizing Human-ChatGPT Interactions

Sibei Chen, Hanbing Liu, Waiting Jin, Xiangyu Sun, Xiaoyao Feng, Ju Fan, Xiaoyong Du, Nan TangarXiv 2023 · DOI

TL;DR

This paper introduces ChatPipe, a system that streamlines the data preparation process for machine learning by optimizing interactions between humans and ChatGPT. It addresses the challenges of prompt engineering and version management by providing intelligent operation suggestions and robust rollback capabilities, making data prep more accessible and efficient.

What Problem Does This Paper Address?

Data preparation, a crucial step in machine learning, is notoriously time-consuming and requires significant expertise. While large language models like ChatGPT can generate code, effectively guiding them to create optimal data preparation programs is difficult. Users need to possess deep knowledge of programming, the dataset, and the ML task to craft precise prompts. Furthermore, iterating on generated code and reverting to previous versions is cumbersome, hindering experimentation and testing. ChatPipe aims to bridge this gap by providing a more intuitive and guided approach to data preparation program orchestration.

Methods

ChatPipe is built around three core modules:

  • Operation Recommendation: This module leverages a reinforcement learning (RL) approach, specifically a Deep Q-Network (DQN), to suggest the most effective data preparation operations. It treats operation selection as a sequential decision process, where the agent learns to recommend operations based on the current program state and dataset. The state is represented by statistical features of the dataset and program embeddings from a model like UniXcoder. The reward signal is derived from the performance improvement of the ML model after applying the recommended operation.
  • Program Generation: This module facilitates the interaction with ChatGPT. It employs a two-level hierarchy of operations (fine-grained and coarse-grained) to generate more effective prompts. When the confidence of a recommended operation is high, it uses the fine-grained version; otherwise, it opts for a more general prompt to allow ChatGPT more flexibility. The system also includes Program Refinement, allowing users to inject domain knowledge, and Program Checking, which runs generated code locally, identifies errors, and uses ChatGPT to fix them iteratively.
  • Version Management: This module provides robust support for managing multiple program versions generated through Human-ChatGPT interactions. It includes Program Versioning, which stores program, execution results, and prompts in a relational database, visualizing them as a tree structure. Data Caching across Versions is also implemented to accelerate version switching by caching intermediate data variables, using a binary classification model to predict beneficial variables and AST analysis to determine cache validity.

Datasets

The paper mentions using several real-world ML tasks from Kaggle for demonstration and evaluation. A specific example highlighted is the "diabetes.csv" dataset, which contains 769 tuples and eight numeric diagnostic measurements. The authors have curated a collection of 62 machine learning tasks from over 10 diverse domains, including education, medicine, and finance, sourced from Kaggle.

Key Insights and Ideas

  • Intelligent Operation Suggestions: The core innovation is moving beyond simple prompt-response interactions to actively guiding users with context-aware operation recommendations. This significantly lowers the barrier to entry for users who may not be ML experts.
  • Two-Level Operation Hierarchy: Using both fine-grained and coarse-grained operations for prompting ChatGPT allows for both precise control and creative exploration, leading to more tailored and effective data prep programs.
  • Iterative Error Correction: The Program Checking module, which uses ChatGPT to fix runtime errors, is a powerful mechanism for ensuring the generated code is functional and robust.
  • Efficient Version Management: The combination of program versioning and data caching is crucial for enabling rapid experimentation and comparison of different data preparation strategies. This is a significant improvement over manual version tracking.

Key Results

The paper demonstrates the utility of ChatPipe through several scenarios. In one example, the system helped improve the F1 score of a diabetes prediction model from 0.614 to 0.674 through iterative interactions, showcasing the effectiveness of the recommended operations and the overall orchestration process. The system is presented as a web application, and the authors have prepared several real-world ML tasks for attendees to experiment with.

Limitations and Future Work

The paper acknowledges that the effectiveness of the operation recommendation module relies on the quality of the RL training and the pre-defined operation set. While the system aims to simplify data prep, a certain level of understanding of ML tasks and datasets is still beneficial for users to fully leverage ChatPipe's capabilities. Future work could involve expanding the operation set, exploring more sophisticated RL techniques, and integrating with a wider range of ML frameworks and tools. The paper also hints at further research in optimizing the data caching strategy and exploring more advanced program refinement techniques.

Summary updated

BibTeX
@misc{chen2023chatpipe,
  author = {Sibei Chen and Hanbing Liu and Waiting Jin and Xiangyu Sun and Xiaoyao Feng and Ju Fan and Xiaoyong Du and Nan Tang},
  title = {{ChatPipe: Orchestrating Data Preparation Program by Optimizing Human-ChatGPT Interactions}},
  year = {2023},
  eprint = {2304.03540},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2304.03540},
}
Figure