atlas

Research map / Large language models / Agents, code and math

Can Large Language Models Understand Intermediate Representations in Compilers?

ICML 2025 · Large language models › Agents, code and math · approach: Code generation benchmarks · 0 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Empirical study evaluating six LLMs (GPT-4, GPT-3, DeepSeek R1, Gemma 2, Llama 3.1, Code Llama) on four LLVM IR comprehension tasks (CFG reconstruction, decompilation, summarization, execution reasoning) built from HumanEval, finding strong gaps in control-flow and instruction-level reasoning.

Problem

Whether LLMs can understand and reason over compiler intermediate representations (LLVM IR), covering structural, syntactic, semantic, and execution understanding, remains underexplored.

Approach

Builds an evaluation framework that compiles HumanEval C++ programs to LLVM IR at -O0 to -O3 and probes LLMs with four IR tasks, with compiler-generated ground truth for CFGs, and compares IR execution reasoning against source-code execution reasoning.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use DeepSeek R1 rather than GPT-4 for CFG reconstructionLLM CFG reconstruction · HumanEval IRsfull CFG accuracy (count): 39 -> 57Helped
Apply Chain-of-Thought prompting for stepwise CFG reconstructionLLM CFG reconstruction · HumanEval IRsfull CFG accuracyHelped
Compile IR at -O0 rather than -O1, -O2, or -O3LLM IR decompilation · HumanEval IRre-execution successMixed
Use DeepSeek R1 rather than GPT-4 for IR summarizationLLM code summarization · HumanEval IR summariesBLEU: 0.35 -> 0.42Helped
Use DeepSeek R1 rather than GPT-4 for IR summarizationLLM code summarization · HumanEval IR summariesROUGE-L: 0.56 -> 0.64Helped
Use DeepSeek R1 rather than GPT-4 for IR summarizationLLM code summarization · HumanEval IR summariesMETEOR: 0.63 -> 0.705Helped
Provide LLVM IR rather than source code for execution reasoningLLM execution reasoning · HumanEvalpass rate: 0.36 -> 0.72Hurt
Provide LLVM IR rather than source code for execution reasoningLLM execution reasoning · HumanEvalpass rate: 0.195 -> 0.804Hurt
Provide LLVM IR rather than source code for execution reasoningLLM execution reasoning · HumanEvalassertion pass rateHurt
Use chain-of-thought prompting for execution reasoningLLMs reasoning over IR · HumanEval IR execution reasoningexecution correctnessNo clear effect

Surprising findings

Limitations

Experimental setup

Datasets: HumanEval

Benchmarks: HumanEval-derived LLVM IR benchmark

Metrics: task completion CFG node accuracy full CFG accuracy partial CFG accuracy re-execution success BLEU ROUGE-L METEOR assertion pass rate

Baselines: NCC IR2Vec FAIR

Builds on: HumanEval LLVM chain-of-thought prompting

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy