NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

An LLM Compiler for Parallel Function Calling

Sehoon Kim, Suhong Moon, Ryan Tabrizi, Nicholas Lee, Michael W. Mahoney, Kurt Keutzer, Amir Gholami

TL;DR

LLMCompiler is a novel framework that significantly speeds up LLM-based agents by orchestrating function calls in parallel rather than sequentially. By treating tool use like a compilation problem, it achieves up to 3.7x latency speedup, 6.7x cost savings, and a ~9% accuracy improvement over standard sequential methods like ReAct.

What Problem Does This Paper Address?

Modern Large Language Models (LLMs) often use external tools—like search engines or calculators—to overcome their internal limitations. However, most current frameworks (like the popular ReAct pattern) operate in a "reason-then-act" loop: the model thinks, calls one tool, waits for the result, and then repeats.

This sequential approach creates three major bottlenecks:

  1. High Latency: Waiting for multiple tool calls one-by-one is slow.
  2. High Cost: Each "reasoning" step requires a new LLM invocation, which quickly becomes expensive.
  3. Inaccuracy: Long sequential chains are prone to "drifting," where the model might repeat the same search or stop prematurely before gathering all necessary information.

Methods

Drawing inspiration from classical computer compilers, the authors introduce LLMCompiler, which decomposes a user's request into a dependency graph of tasks that can be executed concurrently.

The framework consists of three main components:

  • Function Calling Planner: An LLM that takes the user input and generates a Directed Acyclic Graph (DAG) of tasks. It identifies which tasks are independent and which rely on the output of others (using placeholder variables like $1, $2).
  • Task Fetching Unit: This unit acts like an instruction fetcher in a CPU. It dispatches tasks to the Executor as soon as their dependencies are met, ensuring maximum parallelism.
  • Executor: A multi-threaded unit that runs the actual tool calls (APIs, code, or other agents) in parallel.
Overview of the LLMCompiler framework showing the Planner, Task Fetching Unit, and Executor.

To further optimize performance, the authors implemented a Streamed Planner, which allows the Executor to start running the first few tasks while the LLM is still generating the rest of the plan. For complex, non-static problems, they also include a Dynamic Replanning loop that allows the system to update its plan based on intermediate results.

Datasets

The authors evaluated LLMCompiler across several challenging benchmarks:

  • HotpotQA: A multi-hop reasoning dataset used here for 2-way parallel searches.
  • Movie Recommendation: A task requiring 8-way parallel searches to find similar movies.
  • ParallelQA (New): A benchmark introduced in this paper containing 113 complex questions that require a mix of factual searches and mathematical operations with intricate dependencies.
  • Game of 24: Used to test dynamic replanning capabilities.
  • WebShop: A simulated online shopping environment for interactive decision-making.

Key Insights and Ideas

  • Parallelism as an Accuracy Booster: Surprisingly, executing tasks in parallel often improves accuracy. In sequential models, the LLM's "scratchpad" gets cluttered with intermediate observations, which can distract the model. LLMCompiler provides only the relevant context to each tool, reducing "noise."
  • The "Early Stopping" Trap: Sequential agents often stop too early because they think they have enough info when they don't. By forcing a comprehensive plan upfront, LLMCompiler ensures all necessary data is gathered.
  • Hiding Latency with Streaming: By streaming the plan, the system can effectively "hide" the time it takes for the LLM to think behind the time it takes for the tools to run.

Key Results

LLMCompiler consistently outperformed the sequential ReAct baseline:

  • Speed: Achieved a 1.8x to 3.7x speedup on standard benchmarks. In the interactive WebShop environment, it reached a staggering 101.7x speedup by parallelizing product explorations.
  • Cost: Reduced token usage and API costs by up to 6.7x because it requires fewer total LLM reasoning steps.
  • Accuracy: Improved accuracy by up to 9% on the ParallelQA benchmark. It specifically solved the "infinite loop" and "repetitive call" issues common in sequential agents.
Comparison of runtime dynamics between ReAct (sequential) and LLMCompiler (parallel).

Limitations and Future Work

While powerful, LLMCompiler has a few areas for improvement:

  • Planner Overhead: For very simple tasks, the time taken to generate a plan might exceed the time saved by parallel execution (though streaming helps).
  • The Straggler Effect: In a parallel batch, the total time is dictated by the slowest tool call. If one API is very slow, it can bottleneck the entire process.
  • Complex Branching: While the framework supports replanning, extremely complex "if-then-else" logic that changes every step might still be better suited for sequential agents.

The authors suggest that future work could involve optimizing the "agent scratchpad" structure further to minimize failures in the final output generation phase.

Summary updated

BibTeX
@inproceedings{kim2024llm,
  author = {Sehoon Kim and Suhong Moon and Ryan Tabrizi and Nicholas Lee and Michael W. Mahoney and Kurt Keutzer and Amir Gholami},
  title = {{An LLM Compiler for Parallel Function Calling}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=uQ2FUoFjnF},
}
Figure