MLR-Copilot: Autonomous Machine Learning Research based on Large Language Models Agents

Ruochen Li, Teerth Patel, Qingyun Wang, Xinya Du · OpenReview

Abstract

Machine learning research, crucial for technological advancements and innovation, often faces significant challenges due to its inherent complexity, slow pace of experimentation, and the necessity for specialized expertise. Motivated by this, we present a new systematic framework, autonomous Machine Learning Research with large language models (MLR-Copilot), designed to enhance machine learning research productivity through the automatic generation and implementation of research ideas using Large Language Model (LLM) agents. The framework consists of three phases: research idea generation, experiment implementation, and implementation execution. First, existing research papers are used to generate hypotheses and experimental plans via IdeaAgent powered by LLMs. Next, the implementation generation phase translates these plans into executables with ExperimentAgent. This phase leverages retrieved prototype code and optionally retrieves candidate models and data. Finally, the execution phase, also managed by ExperimentAgent, involves running experiments with mechanisms for human feedback and iterative debugging to enhance the likelihood of achieving executable research outcomes. We evaluate our framework on five machine learning research tasks and the experimental results show the framework's potential to facilitate the research progress and innovations.

Introduction

The accelerating pace of scientific discovery has led to a "knowledge explosion," making it increasingly difficult for researchers to keep pace with literature, identify novel gaps, and execute complex experiments. The traditional machine learning (ML) research workflow—encompassing literature review, hypothesis formulation, experimental design, and iterative debugging—is highly labor-intensive and requires deep domain expertise. While Large Language Models (LLMs) have shown potential in assisting individual tasks, existing solutions are often fragmented, prone to hallucinations, or lack the "big picture" context necessary for end-to-end research.

MLR-Copilot addresses these challenges by providing a unified, autonomous framework that manages the entire research lifecycle. By integrating specialized agents for ideation and execution, the system bridges the gap between conceptualizing a research idea and producing a verified, high-performance implementation.

The MLR-Copilot Framework

The MLR-Copilot architecture is structured into three integrated stages, designed to mimic the workflow of a human researcher while leveraging the scale and speed of LLMs.

The detailed three-stage workflow of MLR-Copilot, highlighting the roles of IdeaAgent and ExperimentAgent.

Stage 1: Idea Generation (IdeaAgent)

The IdeaAgent is responsible for identifying research opportunities. Unlike generic LLMs, it is fine-tuned using Reinforcement Learning (RL) on a curated dataset of over 4,000 top-tier conference papers (ICLR and NeurIPS 2023-2024). This tuning optimizes for novelty, feasibility, and clarity, allowing the agent to propose structured methodologies and experimental plans that go beyond generic suggestions.

Stage 2: Experiment Implementation (ExperimentAgent)

The ExperimentAgent translates the proposed research plan into executable code. To ensure scientific grounding and reduce hallucinations, the agent utilizes a retrieval-augmented approach. It retrieves "prototype code" from the original research papers and can optionally pull relevant models and datasets from repositories like Hugging Face.

Stage 3: Implementation Execution (ExperimentAgent)

In the final stage, the ExperimentAgent executes the code, monitors performance metrics, and performs iterative debugging. It utilizes a suite of "Utility Modules"—including a Filesystem, Code Inspector, and Model Evaluator—to interact with the execution environment and refine the implementation based on real-time feedback.

Experimental Evaluation

The framework was evaluated across five diverse ML domains: Semantic Textual Relatedness (SemRel), student writing feedback prediction (ELLIPSE), sentiment analysis (IMDB), passenger classification (Spaceship-Titanic), and satellite image classification (Identify-Contrails).

Key Results

MLR-Copilot demonstrated significant improvements over both base LLMs and existing research agents. Human experts rated the IdeaAgent higher across all qualitative metrics, including rigor (4.3/5) and clarity (4.4/5).

Comparative evaluation of IdeaAgent against BaseLLM and ResearchAgent across manual and automated criteria.

Quantitatively, the system achieved a 50% success rate in improving upon state-of-the-art (SOTA) prototypes, defined as achieving at least a 10% performance gain. On average, using Claude-3.7 as a backbone, the framework yielded a 44.16% performance improvement over baseline prototypes. This stands in stark contrast to "1-Prompt" baselines, which typically failed to produce executable code for complex tasks.

Discussion and Conclusion

The success of MLR-Copilot highlights the importance of RL-tuning for research creativity and the necessity of retrieval-based grounding for code generation. By maintaining a transparent "Action Log," the system allows for human oversight and iterative refinement, which is critical for scientific integrity.

Current limitations include the sequential nature of the pipeline. Future iterations will focus on "backward transitions," allowing the agent to revise hypotheses based on failed experimental outcomes. Additionally, the authors aim to enhance human-agent collaboration, making the "copilot" more intuitive for researchers to guide without requiring specialized prompt engineering. Ultimately, MLR-Copilot represents a significant step toward autonomous scientific discovery in the machine learning domain.

Summary updated

BibTeX
@misc{li2024mlr,
  author = {Ruochen Li and Teerth Patel and Qingyun Wang and Xinya Du},
  title = {{MLR-Copilot: Autonomous Machine Learning Research based on Large Language Models Agents}},
  year = {2024},
  eprint = {2408.14033},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2408.14033},
}
Figure