REASONING COMPILER: LLM-Guided Optimizations for Efficient Model Serving

Annabelle Sujun Tang, Christopher Priebe, R. Mahapatra, Lian-Hui Qin, Hadi Esmaeilzadeh
6/1/2025
10 citations

No official code found. Best implementation: Anna-Bele/REASONING_COMPILER (105 stars).

Abstract

While model serving has unlocked unprecedented capabilities, the high cost of serving large-scale models continues to be a significant barrier to widespread accessibility and rapid innovation. Compiler optimizations have long driven substantial performance improvements, but existing compilers struggle with neural workloads due to the exponentially large and highly interdependent space of possible transformations.

Show full abstract

Although existing stochastic search techniques can be effective, they are often sample-inefficient and fail to leverage the structural context underlying compilation decisions. We set out to investigate the research question of whether reasoning with large language models (LLMs), without any retraining, can leverage the context-aware decision space of compiler optimizations to significantly improve sample efficiency. To that end, we introduce a novel compilation framework (dubbed REASONING COMPILER) that formulates optimization as a sequential, context-aware decision process guided by a large language model and structured Monte Carlo tree search (MCTS). The LLM acts as a proposal mechanism, suggesting hardware-informed transformations that reflect the current program state and accumulated performance feedback. MCTS incorporates the LLM-generated proposals to balance exploration and exploitation, facilitating a structured, context-sensitive traversal of the expansive compiler optimization space. By achieving substantial speedups with markedly fewer samples than leading neural compilers, our approach demonstrates the potential of LLM-guided reasoning to transform the landscape of compiler optimization.

View on arXivView PDF

Code Implementations(1)

Official implementation of "REASONING COMPILER: LLM-Guided Optimizations for Efficient Model Serving" (NeurIPS 2025)

10513

Similar Papers

Cite this paper

@article{tang2025reasoning,
  title  = {REASONING COMPILER: LLM-Guided Optimizations for Efficient Model Serving},
  author = {Annabelle Sujun Tang and Christopher Priebe and R. Mahapatra and Lian-Hui Qin and Hadi Esmaeilzadeh},
  year   = {2025},
  eprint = {2506.01374},
  archivePrefix = {arXiv},
  doi    = {10.52202/085713-3565},
  url    = {https://doi.org/10.52202/085713-3565},
  journal = {Neural Information Processing Systems}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2506.01374.svg)](https://codeofpaper.com/paper/2506.01374)

Discussion