MLAgentBench: Evaluating Language Agents on Machine Learning Experimentation

Qian Huang, Jian Vora, Percy Liang, Jure Leskovec

TL;DR

MLAgentBench is a new benchmark designed to see if LLM agents can autonomously handle the iterative "design-run-analyze" cycle of machine learning research. The study finds that while state-of-the-art models like Claude v3 Opus can successfully improve model performance on established tasks, they still struggle significantly with recent, complex research problems and long-term planning.

What Problem Does This Paper Address?

Machine learning research is fundamentally experimental. A researcher doesn't just write a script; they engage in a continuous loop: proposing a hypothesis (e.g., "adding dropout will help"), writing code, running experiments, interpreting logs, and refining the approach. While tools like AutoML have automated hyperparameter tuning, the high-level reasoning and open-ended coding required for full ML experimentation have remained a human-centric domain.

The authors ask: Can we develop an autonomous agent capable of conducting end-to-end ML experimentation? To answer this, they needed a way to measure progress, leading to the creation of MLAgentBench.

Methods

The authors built a framework where an agent interacts with a "workspace" (a directory of files and data). The agent can perform several actions:

  • Primitive Actions: Listing files, reading/writing code, and executing Python scripts.
  • Compound Actions: Higher-level tasks like "Understand File" (summarizing code) or "Edit Script" (where the agent describes a change and a sub-module implements it).

The agent itself is built on a modified ReAct framework. Before taking any action, the agent must generate a structured response containing:

  1. Reflection: Analyzing the results of the previous step.
  2. Research Plan and Status: Maintaining a high-level "to-do" list.
  3. Fact Check: A crucial step where the agent double-checks if its plan is based on actual experimental results or just "hallucinated" assumptions.
  4. Thought: The immediate reasoning for the next action.
Overview of the MLAgentBench environment and agent interaction loop.

Datasets

The benchmark consists of 13 diverse tasks categorized by difficulty and recency:

  • Canonical Tasks: Well-known problems like image classification on CIFAR-10 and sentiment analysis on IMDB.
  • Classic Kaggle: Introductory challenges like House Prices regression.
  • Kaggle Challenges: Recent, complex competitions (e.g., FathomNet, Feedback Prize) launched after the training cutoff of many LLMs to test generalization.
  • Recent Research: Cutting-edge problems like the BabyLM challenge (training on limited data) and CLRS (algorithmic reasoning).
  • Code Improvement: Tasks focused on optimizing runtime rather than accuracy, such as speeding up llama-inference.

Key Insights and Ideas

  • The "Recency" Wall: Agents perform exceptionally well on older, "canonical" datasets (often achieving 100% success) but their performance drops to near 0% on very recent Kaggle challenges. This suggests that agents might be relying on "memorized" solutions from their training data rather than pure reasoning.
  • Hallucination is a Research Killer: A common failure mode is the agent claiming a model improved without ever actually running the training script. The authors' "Fact Check" mechanism was specifically designed to combat this tendency.
  • Planning vs. Execution: Many failures aren't due to bad coding, but "Bad Plans"—such as dropping essential data features early on—from which the agent struggles to recover.
  • Claude vs. GPT: While GPT-4 models are more "efficient" (using fewer tokens to reach a conclusion), Claude v3 Opus proved more "competent," showing a higher overall success rate by being more methodical.

Key Results

  • Top Performer: Claude v3 Opus achieved the highest average success rate at 37.5%.
  • Baseline Comparison: Most agents significantly outperformed simple baselines, but the gap between the best models and human-level reliability remains wide.
  • Success Variance: On the "House-Price" task, Claude v3 Opus had a 100% success rate, but it dropped to 0% on the BabyLM research task.
  • Cost of Research: The authors estimate that using GPT-4 Turbo to successfully complete a task costs roughly $231 on average, accounting for the multiple failed attempts and high token usage required for complex iterations.

Limitations and Future Work

The authors identify several major hurdles for the next generation of AI researchers:

  1. Long-term Planning: Agents often get "stuck" in local minima or debugging loops, losing sight of the overall research goal.
  2. Environment Constraints: The current benchmark limits actions to 30-50 steps. Real-world research often requires hundreds of iterations.
  3. Data Contamination: As LLMs are trained on more of the web, it becomes harder to find "unseen" tasks to truly test their reasoning.

Future work will focus on making agents more robust to errors and expanding MLAgentBench to include more creative, open-ended scientific discovery tasks.

Summary updated

BibTeX
@inproceedings{huang2024mlagentbench,
  author = {Qian Huang and Jian Vora and Percy Liang and Jure Leskovec},
  title = {{MLAgentBench: Evaluating Language Agents on Machine Learning Experimentation}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=1Fs1LvjYQW},
}
Figure