MLCopilot: Unleashing the Power of Large Language Models in Solving Machine Learning Tasks

Lei Zhang, Yuge Zhang, Kan Ren, Dongsheng Li, Yuqing Yang

TL;DR

This paper introduces MLCopilot, a novel framework that leverages Large Language Models (LLMs) to automatically generate machine learning (ML) solutions for new tasks. By learning from historical ML experiences and human knowledge, MLCopilot offers a more intuitive and efficient approach to ML task automation compared to traditional AutoML methods.

What Problem Does This Paper Address?

Developing effective machine learning solutions for new tasks is a complex and time-consuming process. Traditional AutoML methods, while aiming for automation, are often slow, require extensive computational resources, and lack interpretability, making it difficult for human developers to understand and control the process. On the other hand, human experts possess valuable experience and knowledge, but this is hard to quantify and integrate into automated systems. This paper bridges this gap by proposing a system that combines the reasoning power of LLMs with the accumulated experience from past ML tasks to generate competitive ML solutions.

Methods

MLCopilot operates in two stages:

  • Offline Stage:
    • Canonicalization: Raw historical ML task data (tasks, solutions, performance metrics) is converted into a standardized, natural language format. This is crucial because LLMs excel at processing text. Numerical values are discretized to avoid direct numerical input.
  • Knowledge Elicitation: LLMs are used to read and understand the canonicalized historical experiences. Through an iterative process involving prompting and validation, LLMs extract high-level knowledge (e.g., "For small datasets, control regularization parameters to prevent overfitting"). This knowledge is stored in a knowledge pool.
  • Online Stage:
    • Retrieval: Given a new task description, MLCopilot retrieves relevant historical ML experiences (as demonstrations) and knowledge from the pre-built pools.
  • LLM Prompting: The retrieved experiences and knowledge are used to construct a prompt for the LLM.
  • Solution Generation: The LLM generates a proposed ML solution for the new task based on the prompt.

Datasets

The paper evaluates MLCopilot on three ML benchmarks:

  • HPO-B: A benchmark with 16 solution spaces for 101 datasets, focusing on hyperparameter optimization for fixed ML algorithms.
  • PD1: A dataset for neural network tuning with 24 classification tasks, involving CNNs and transformers.
  • HyperFD: A benchmark for optimizing neural face detectors, including data augmentation, architecture, and loss function configuration.

The authors also mention using data crawled from benchmark websites for task descriptions.

Key Insights and Ideas

  • LLMs as ML Solution Generators: The core idea is that LLMs, with their natural language understanding and reasoning capabilities, can be effectively repurposed to generate ML solutions, not just code or text.
  • Bridging Human Knowledge and ML Automation: MLCopilot successfully integrates human-like reasoning and experience into an automated ML task-solving framework.
  • Importance of Canonicalization: Converting diverse ML data formats into natural language is critical for LLMs to process and reason effectively. Discretizing numerical values is a key part of this.
  • Knowledge Elicitation is Key: The extracted knowledge, beyond just raw examples, provides crucial guidance for LLMs, enabling them to generalize better and avoid trivial or hallucinated solutions.
  • Natural Language Task Descriptions: Using natural language for task descriptions makes the system more user-friendly and leverages the LLM's inherent strengths.

Key Results

  • MLCopilot achieved the highest normalized accuracy (nAcc) across all three tested benchmarks (HPO-B, PD1, HyperFD), outperforming traditional AutoML methods and simpler LLM-based approaches.
  • Even with a few demonstrations (few-shot learning), LLM-FS (a baseline without retrieval and knowledge) surpassed traditional baselines, highlighting the power of LLMs.
  • MLCopilot's performance was robust to different LLMs, though stronger models generally yielded better results.
  • Ablation studies showed that both experience retrieval and knowledge elicitation are crucial for MLCopilot's performance. Removing knowledge significantly degraded results, while removing demonstrations led to a complete collapse.
  • The system demonstrated robustness to variations in task description formats, although anonymizing task names led to performance drops.

Limitations and Future Work

  • Data Leakage: LLMs might have encountered benchmark data during pre-training, potentially biasing results. The authors mitigated this by evaluating on HyperFD, a more recent and private benchmark.
  • LLM Limitations: LLMs still have limitations in performing complex mathematical computations, which might prevent MLCopilot from surpassing state-of-the-art Bayesian optimization methods in certain scenarios.
  • Prompt Sensitivity: Performance can degrade with severely limited prompt context windows or when task names are removed from descriptions.
  • Future Work: The authors envision combining MLCopilot with existing AutoML methods to leverage its strengths in handling diverse task descriptions and generating multiple solutions quickly. They also suggest further exploring the robustness of the system to noisy data and flawed canonicalization.

Summary updated

BibTeX
@inproceedings{zhang2024mlcopilot,
  author = {Lei Zhang and Yuge Zhang and Kan Ren and Dongsheng Li and Yuqing Yang},
  title = {{MLCopilot: Unleashing the Power of Large Language Models in Solving Machine Learning Tasks}},
  booktitle = {EACL},
  year = {2024},
  url = {https://openreview.net/forum?id=6ij0jahfpK},
}
Figure