Home Community Large Language Models Surprise Meta AI Researchers at Compiler Optimization!

Large Language Models Surprise Meta AI Researchers at Compiler Optimization!

0
Large Language Models Surprise Meta AI Researchers at Compiler Optimization!

 Researchers at Meta AI

Meta AI Researchers were attempting to make Large Language Models (LLMs) do the identical type of code optimizations that regular compilers, like LLVM, do. LLVM’s optimizer is incredibly complex, with hundreds of rules and algorithms written in over 1 million lines of code within the C++ programming language.

They didn’t think LLMs could handle this complexity because they’re typically used for tasks like translating languages and generating code. Compiler optimizations involve loads of several types of considering, maths, and using complex techniques, which they didn’t think LLMs were good at. But post methodology the outcomes were absolutely surprising. 

The above image demonstrates the overview of the methodology, showing the model input (Prompt) and output (Answer) during training and inference. The prompt incorporates unoptimized code. The reply incorporates an optimization pass list, instruction counts, and the optimized code. During inference, only the optimization pass list is generated, which is then fed into the compiler, ensuring that the optimized code is correct.

Their approach is easy, starting with a 7-billion-parameter Large Language Model (LLM) architecture sourced from LLaMa 2 [25] and initializing it from scratch. The model is then trained on an enormous dataset consisting of thousands and thousands of LLVM assembly examples, each paired with the perfect compiler options determined through a search process for every assembly, in addition to the resulting assembly code after applying those optimizations. Through these examples alone, the model acquires the power to optimize code with remarkable precision.

The notable contribution of their work lies in being the primary to use LLMs to the duty of code optimization. They create LLMs specifically tailored for compiler optimization, demonstrating that these models achieve a 3.0% improvement in code size reduction on a single compilation in comparison with a search-based approach that attains 5.0% improvement with 2.5 billion compilations. In contrast, state-of-the-art machine learning approaches result in regressions and require hundreds of compilations. The researchers also include supplementary experiments and code examples to offer a more comprehensive understanding of the potential and limitations of LLMs in code reasoning. Overall, they find the efficacy of LLMs on this context to be remarkable and imagine that their findings will probably be of interest to the broader community.


Try the Paper. All Credit For This Research Goes To the Researchers on This Project. Also, don’t forget to affix our 30k+ ML SubReddit, 40k+ Facebook Community, Discord Channel, and Email Newsletter, where we share the newest AI research news, cool AI projects, and more.

For those who like our work, you’ll love our newsletter..


Janhavi Lande, is an Engineering Physics graduate from IIT Guwahati, class of 2023. She is an upcoming data scientist and has been working on the earth of ml/ai research for the past two years. She is most fascinated by this ever changing world and its constant demand of humans to maintain up with it. In her pastime she enjoys traveling, reading and writing poems.


🚀 The top of project management by humans (Sponsored)

LEAVE A REPLY

Please enter your comment!
Please enter your name here