arXiv · 2025UMass Amherst · Adobe Research

ML-Tool-Bench: Tool-Augmented Planning for ML Tasks

1 University of Massachusetts Amherst  ·  2 Adobe Research

Can an LLM agent solve a Kaggle challenge end to end without writing any code? In ML-Tool-Bench it has to chain dozens of tool calls (load, clean, engineer features, train, predict), keeping every intermediate dataframe and model in a named scratchpad. Most tool-use benchmarks test choosing the right tool and filling in its arguments over short sequences. A full ML pipeline needs twenty or more dependent calls.

61
ML tools in 6 groups, built on pandas and scikit-learn
15
Kaggle challenges: 7 regression, 6 binary, 2 multiclass
+16.5
leaderboard percentile points over ReAct, GPT-4o (median over tasks)
80
tool calls in one successful Hierarchical MCTS run

The benchmark

Data never passes through the LLM

A dataframe with 10,000 rows cannot be pasted into a tool argument. In ML-Tool-Bench every artifact lives in a scratchpad, a key–value store of named objects. The agent passes names; tools read their inputs from the scratchpad by name and write their outputs back under names the agent picks. A bad call can't corrupt the only copy of the data, and the agent can keep several versions around and reuse them later.

Read the abstract

End-to-end machine learning requires coordinating long sequences of interdependent operations: data loading, preprocessing, feature engineering, model training, and prediction. While LLM agents have shown promise through direct code generation, such approaches are brittle and tightly couple reasoning with execution. Tool-augmented agents offer an alternative with modular building blocks that decouple planning from code, yet existing benchmarks evaluate only shallow trajectories (1-3 tool calls). Real ML workflows demand 20+ sequential invocations producing complex artifacts like dataframes and fitted models that must persist across the trajectory. We introduce ML-Tool-Bench, the first benchmark for long-horizon, tool-augmented planning on ML tasks, comprising 61 specialized tools and 15 Kaggle challenges. We show that ReAct and LATS fail to produce valid tool sequences for these complex pipelines. To address this, we propose shaped rewards with stage-wise feedback, hierarchical task decomposition with tool masking, and in-memory named object management for storing and retrieving intermediate results. With GPT-4o, our methods improve over ReAct by 16.52 percentile positions (median across challenges), demonstrating that structured guidance is critical for effective tool-augmented planning.

Spaceship Titanic · binary classification · predict Transported · metric: accuracy
Agent's tool callsnames in, short messages out
Scratchpad0 objects
call 0
set
Reads nothing and stores its result under the agent's output name.
get
Reads named objects and returns text only, such as a summary or a score.
get_set
Reads named objects and stores a new one.
override
Reads one named object and replaces it in place.

An illustrative trajectory, written in the benchmark's real call format and tool names. The shapes and messages are made up for the example. Tools that return several values (a train/test split, a tuned model with its parameters and score) store them under fixed names.

The action space

61 tools, and which ones each stage needs

Each call is a tool plus its arguments, so the effective action space is far larger than 61. Modeling uses tree ensembles (random forest, XGBoost, LightGBM, CatBoost) and linear or logistic regression, each tuned with cross-validation. Pick a stage to see the subset of tools Hierarchical MCTS exposes there.

set get get_set override

Planning approaches

Search needs a signal it can trust

We compare five planners. Each tree search keeps a path-local scratchpad: a node stores only the objects its own tool call produced, and can read anything stored along its path from the root. Because full rollouts are too expensive, every search variant scores a node by its immediate reward, which makes it a best-first search with a UCT exploration bonus.

Baseline

ReAct

Think, call one tool, observe, repeat. One pass, no backtracking.

Baseline

LATS

Tree search where an evaluator LLM scores each partial trajectory.

Baseline

MCTS-Outcome

Tree search rewarded only for a trained model or a valid submission.

Ours

MCTS-Shaped

Deterministic, verifiable rewards for each pipeline stage, plus textual feedback on failures.

Ours

Hierarchical MCTS

Solves the stages as subtasks in order, each with only its own tools.

Shaped rewards: ten checks, in order

A stage earns its reward once per trajectory, and only after every earlier stage has passed. Each check is a fixed rule applied to the node's scratchpad and tool log, for example "the combined dataframe has no NaNs". Unlike in LATS, the reward never comes from asking an LLM to score the trajectory.

    What the agent hears back

    When a check fails, the search returns a concrete explanation instead of a bare score. All MCTS variants get this feedback; failed tool calls also come back with the tool's docstring.

    • Why not let an LLM score the states? LATS does, and its scores grow inconsistent as trajectories get long and pile up messages and artifacts. It is also the most expensive planner: 3.5× the cost of our methods.
    • Why mask tools? At each stage only a few of the 61 tools are relevant. Showing just those cuts the branching factor, and removing the mask collapses Hierarchical MCTS (see below).
    Animation of Hierarchical MCTS. Four subtask panels (load train data, clean, engineer features, train model), each showing how many of the 61 tools are available. Inside each panel a small search tree grows; failed calls are marked with a cross, solution nodes are filled green, and the solution nodes become the roots of the next subtask's tree.
    Hierarchical MCTS. Each subtask searches with its masked tool set and enumerates every solution node up to a depth limit, rather than committing to the first one. All of them seed the next subtask, which avoids locally good but globally poor choices. The highest-value solution at the final subtask is returned; if a subtask finds none, the search stops.

    Results

    Structure beats free-form planning

    Each planner runs 10 times on every challenge. Consistency is the fraction of runs that end in a valid submission. Leaderboard percentile is the share of the public Kaggle leaderboard that the run's score beats, computed on our held-out split; an invalid run counts as 0. We report the median over the 10 runs, then the median over the 15 challenges.

    Median leaderboard percentile (higher is better)

    Consistency (fraction of valid runs)

    Per challenge · median leaderboard percentile over 10 runs; hover for consistency

    0100

    Ablations and checks

    What matters, what it costs, and how it compares with writing code

    Tool masking · GPT-4.1-mini · 5 challenges
    0.8 · 21.1with masking (consistency · percentile)
    0.3 · 0all 61 tools at every subtask

    Decomposition alone isn't enough. Without the mask, Hierarchical MCTS falls to the level of ReAct.

    Real Kaggle leaderboard · GPT-4.1-mini · 6 challenges
    20.8Hierarchical MCTS, median percentile
    0ReAct and LATS

    On the full Kaggle data, scored by real Kaggle submissions, the same pattern holds: MCTS-Shaped and Hierarchical MCTS lead. The benchmark's held-out split is a reasonable proxy.

    Cost · total $ for 10 runs on each of 5 challenges, GPT-4.1-mini

    LATS spends the most and gets the least: 0.2 consistency and a median percentile of 0 on these five challenges. ReAct is cheapest and nearly as poor.

    Versus writing code · real Kaggle leaderboard percentile, median over 6 challenges

    ReAct-Code writes and runs Python, refining it from execution feedback for up to 10 rounds. It is the strongest method overall. The best tool planners get within about 12 points while restricted to a fixed toolset, which suggests the 61 tools cover most of what these tabular tasks need.

    Baseline plannerOursCode generation

    Use the benchmark

    Evaluate your own agent

    The code installs the 61 tools, the scratchpad environment, the grader and all six planners. Datasets are not redistributed: they download through the Kaggle API, and you must accept each competition's rules first. Public leaderboards ship with the repo as score-only snapshots, so computing percentiles needs no Kaggle access.

    1 · Install and prepare the data

    git clone https://github.com/yaswanthchittepu/ML-Tool-Bench.git
    cd ML-Tool-Bench
    pip install -e ".[agents,prepare]"   # Python >= 3.11
    cp .env.example .env                 # OPENAI_MODEL, OPENAI_API_KEY
    mltoolbench prepare                  # needs ~/.kaggle/kaggle.json

    2 · Run a baseline

    mltoolbench run --config baselines/hierarchical_mcts.yaml \
                    --model gpt-4o --workers 8
    mltoolbench run --agent react --tasks spaceship_titanic --runs 3
    mltoolbench report runs/

    Each run writes submission.csv, trajectory.json (every LLM step and tool call) and result.json (grade, tokens, cost, wall time). Any OpenAI-compatible endpoint works, including vLLM.

    3 · Plug in your agent

    from mltoolbench.agents import Agent, RunContext
    from mltoolbench.env import ToolSession
    
    class MyAgent(Agent):
        name = "my_agent"
    
        def run(self, ctx: RunContext):
            session = ToolSession()          # 61 tools + empty scratchpad
            tools = session.openai_tools()   # function-calling schemas
            prompt = ctx.prompt()            # task + where to save
            ...  # your loop: text = session.call(name, args)
            # the submission must end up at ctx.submission_path
    mltoolbench run --agent my_pkg.my_module:MyAgent --model gpt-4o
    mltoolbench grade spaceship_titanic submission.csv

    ToolSession(stage="modeling") gives a stage's masked tool set. LangGraph users can call mltoolbench.env.langchain.langchain_tools(...).

    The 15 challenges

    Each uses up to 10,000 rows sampled with seed 42, with 20% held out (stratified for classification) as the test set. Scores use each competition's official metric.

    Use the results

    Every number on this page, as CSV

    Compare a new planner against ours without retyping tables from the PDF.

    Scope. GPT-4o and GPT-4.1-mini were chosen to fit a $5,000 budget: with 10 runs per planner and challenge and hundreds of LLM calls per tree search, frontier models would have cost several times more. The benchmark covers tabular classification and regression only.

    Citation

    BibTeX

    @article{chittepu2025mltoolbench,
      title   = {{ML-Tool-Bench}: Tool-Augmented Planning for {ML} Tasks},
      author  = {Chittepu, Yaswanth and Addanki, Raghavendra and Mai, Tung
                 and Rao, Anup and Kveton, Branislav},
      journal = {arXiv preprint arXiv:2512.00672},
      year    = {2025}
    }