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 evaluate whether AI agents can handle the end-to-end process of machine learning experimentation. While top-tier models like Claude v3 Opus show flashes of brilliance—achieving a 37.5% success rate across diverse tasks—the study reveals that autonomous ML research is still hampered by "hallucinated" results and a struggle to generalize to novel, post-training data.

What Problem Does This Paper Address?

Machine learning research is a grueling, iterative cycle: you design an experiment, write the code, analyze the logs, and tweak your approach based on the results. While tools like AutoML have automated hyperparameter tuning, the high-level "reasoning" and "coding" parts of the workflow have remained firmly in human hands.

Overview of the MLAgentBench task setup and agent interaction loop.

With the rise of Large Language Models (LLMs), there is a growing hope that these models can act as autonomous agents. However, we lacked a rigorous way to measure this. This paper introduces the first systematic framework to test if an LLM can act as an end-to-end ML researcher—not just writing a single function, but managing a whole workspace to improve a model's performance.

Methods

The authors built an agent framework based on ReAct (Reason + Act), but they added several "meta-cognitive" steps to make the agent more robust:

The agent's reasoning loop, highlighting the Reflection, Research Plan, and Fact Check steps.
  • Reflection: The agent looks at the previous observation and asks, "What does this mean? Was there an error?"
  • Research Plan and Status: A living document where the agent maintains its high-level strategy and tracks progress.
  • Fact Check: A crucial step where the agent must verify if its claims (e.g., "I improved accuracy by 5%") are actually supported by the logs.
  • Compound Actions: Instead of just "write file," the authors provided higher-level tools like Understand File (which summarizes a script) and Edit Script (which uses a secondary LLM call to perform precise code modifications).

Datasets

The authors curated 13 tasks across five distinct categories to test different aspects of ML experimentation:

  1. Canonical Tasks: Well-known problems like CIFAR-10 (image) and IMDb (text).
  2. Classic Kaggle: Introductory tabular data problems (House Prices, Titanic).
  3. Kaggle Challenges: Recent, complex competitions (e.g., Parkinson’s disease progression) launched after most models' training cutoffs.
  4. Recent Research: Cutting-edge benchmarks like BabyLM (training on limited data) and CLRS (algorithmic reasoning).
  5. Code Improvement: Tasks focused on optimizing runtime (e.g., vectorizing Python loops).

Key Insights and Ideas

  • The "Contamination" Reality Check: Agents performed exceptionally well on older, well-established datasets (achieving 100% success on the House Prices task). However, success plummeted on recent Kaggle challenges and research tasks. This suggests that agents often rely on "memorized" solutions rather than true first-principles reasoning.
  • The Hallucination Hurdle: One of the most frequent failure modes was "hallucinated improvement." Without the "Fact Check" module, agents would often claim they had improved a model's accuracy without ever actually running the training script.
  • Planning is the Bottleneck: Agents often fail not because they can't code, but because they make a "Bad Plan" early on—such as dropping essential features from a dataset—and find it nearly impossible to recover from that initial strategic error.
  • Interpretable Research: Despite the failures, the agents produced highly readable research plans and logs, suggesting they could eventually serve as "human-in-the-loop" assistants where a researcher can intervene and correct a plan mid-stream.

Key Results

  • Top Performer: Claude v3 Opus emerged as the most capable agent, with a 37.5% average success rate.
  • GPT-4 Family: GPT-4-turbo was the most efficient (using 51% fewer tokens than the average), but it was more prone to hallucinations and poor planning compared to Claude v3 Opus.
  • Success Metric: Success was defined as improving the baseline performance metric by at least 10%.
  • The "Long Tail" of Failure: Most agents struggled significantly as the number of steps increased. Performance generally degraded over longer horizons (50+ actions), except for Claude v3 Opus, which showed better stability.

Limitations and Future Work

The authors identify three primary areas for improvement:

  1. Long-term Planning: Current agents lose the "big picture" as the interaction trace grows.
  2. Reliability: The gap between 37.5% and 100% is vast; agents need to be much more consistent before they can be trusted with expensive compute resources.
  3. Human-AI Collaboration: The paper suggests that the next step isn't just "full autonomy," but building interfaces that allow human researchers to edit the agent's workspace or plans in real-time.

By providing a standardized "gym" for ML agents, MLAgentBench sets the stage for the next generation of AI-driven scientific discovery.

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