LLM-Based Embeddings for Program Analysis and Optimization

Calvin Higgins, Marco Alvarez
8/8/2026
cs.LGcs.PL

No confident code implementation found for this paper.

Abstract

Recent advances have highlighted the potential of machine learning, particularly Large Language Models (LLMs), for analyzing and optimizing programs. We present the first application of program embeddings from LLMCompiler---an LLM massively pretrained on intermediate representation (IR) code---to representative program analysis and optimization tasks.

Show full abstract

We generate program embeddings directly from source and IR code using a simple approach: split programs into chunks, independently embed each chunk with pretrained LLMs, and then aggregate the chunk embeddings into a single program embedding. Our experiments show that combining source and IR code embeddings achieves an error rate of 1.54\% in algorithm classification, a 12\% improvement over the current state-of-the-art, and a competitive accuracy on heterogeneous device mapping. These findings suggest that training a performance-aware LLM for embedding IR code might yield state-of-the-art results in code optimization tasks.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{higgins2026llmbased,
  title  = {LLM-Based Embeddings for Program Analysis and Optimization},
  author = {Calvin Higgins and Marco Alvarez},
  year   = {2026},
  eprint = {2608.07894},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2608.07894v1}
}

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/2608.07894.svg)](https://codeofpaper.com/paper/2608.07894)

Discussion