PulseExploreJournal ClubDebatesTrendingResearchersJournals
Instagram
HomeExploreJournal ClubTrending
Synapse
⌘+K
Synapse
June 17, 20245 citationsOpen Access

Should AI Optimize Your Code? A Comparative Study of Current Large Language Models Versus Classical Optimizing Compilers

View Full Paper
MRMiguel Romero RosasUniversity of DelawareMSMiguel Torres SanchezRERudolf EigenmannSouth College

Key Points

Key points are not available for this paper at this time.

Abstract

In the contemporary landscape of computer architecture, the demand for efficient parallel programming persists, needing robust optimization techniques. Traditional optimizing compilers have historically been pivotal in this endeavor, adapting to the evolving complexities of modern software systems. The emergence of Large Language Models (LLMs) raises intriguing questions about the potential for AI-driven approaches to revolutionize code optimization methodologies. This paper presents a comparative analysis between two state-of-the-art Large Language Models, GPT-4.0 and CodeLlama-70B, and traditional optimizing compilers, assessing their respective abilities and limitations in optimizing code for maximum efficiency. Additionally, we introduce a benchmark suite of challenging optimization patterns and an automatic mechanism for evaluating performance and correctness of the code generated by such tools. We used two different prompting methodologies to assess the performance of the LLMs -- Chain of Thought (CoT) and Instruction Prompting (IP). We then compared these results with three traditional optimizing compilers, CETUS, PLUTO and ROSE, across a range of real-world use cases. A key finding is that while LLMs have the potential to outperform current optimizing compilers, they often generate incorrect code on large code sizes, calling for automated verification methods. Our extensive evaluation across 3 different benchmarks suites shows CodeLlama-70B as the superior optimizer among the two LLMs, capable of achieving speedups of up to 2.1x. Additionally, CETUS is the best among the optimizing compilers, achieving a maximum speedup of 1.9x. We also found no significant difference between the two prompting methods: Chain of Thought (Cot) and Instructing prompting (IP).

Ask AI
Helpful
Bookmark
Share
View Full Paper

Cite This Study

Rosas et al. (2024) studied this question.

synapsesocial.com/papers/68e64677b6db6435875d7757https://doi.org/10.48550/arxiv.2406.12146
Ask AI
Helpful
Bookmark
Share
View Full Paper

Also Consider

Synapse has enriched 5 closely related papers on similar clinical questions. Consider them for comparative context:

  1. 1Strategic Optimization and Challenges of Large Language Models in Object-Oriented Programming2024
  2. 2Meta Large Language Model Compiler: Foundation Models of Compiler Optimization2024 · 2 citations
  3. 3Large Language Models for Machine Learning Design Assistance: Prompt-Driven Algorithm Selection and Optimization in Diverse Supervised Learning Tasks2025 · 1 citations
  4. 4POLO: An LLM-Powered Project-Level Code Performance Optimization Framework2025 · 1 citations
  5. 5Optimisation and Evolution of Stage-Classification Framework-Based Reasoning Large Language Models for Code Generation2026