Can Large Language Models Understand Intermediate Representations in Compilers?

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Jiang, Hailong, Zhu, Jianfeng, Wan, Yao, Fang, Bo, Zhang, Hongyu, Jin, Ruoming, Guan, Qiang
Formato: Preprint
Publicado: 2025
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866913876166049792
author Jiang, Hailong
Zhu, Jianfeng
Wan, Yao
Fang, Bo
Zhang, Hongyu
Jin, Ruoming
Guan, Qiang
author_facet Jiang, Hailong
Zhu, Jianfeng
Wan, Yao
Fang, Bo
Zhang, Hongyu
Jin, Ruoming
Guan, Qiang
contents Intermediate Representations (IRs) play a critical role in compiler design and program analysis, yet their comprehension by Large Language Models (LLMs) remains underexplored. In this paper, we present an explorative empirical study evaluating the capabilities of six state-of-the-art LLMs: GPT-4, GPT-3, DeepSeek, Gemma 2, Llama 3, and Code Llama, in understanding IRs. Specifically, we assess model performance across four core tasks: control flow graph reconstruction, decompilation, code summarization, and execution reasoning. While LLMs exhibit competence in parsing IR syntax and identifying high-level structures, they consistently struggle with instruction-level reasoning, especially in control flow reasoning, loop handling, and dynamic execution. Common failure modes include misinterpreting branching instructions, omitting critical operations, and relying on heuristic reasoning rather than precise instruction-level logic. Our findings highlight the need for IR-specific enhancements in LLM design. We recommend fine-tuning on structured IR datasets and integrating control-flow-sensitive architectures to improve model effectiveness. All experimental data and source code are publicly available at
format Preprint
id arxiv_https___arxiv_org_abs_2502_06854
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Can Large Language Models Understand Intermediate Representations in Compilers?
Jiang, Hailong
Zhu, Jianfeng
Wan, Yao
Fang, Bo
Zhang, Hongyu
Jin, Ruoming
Guan, Qiang
Machine Learning
Artificial Intelligence
Computation and Language
Intermediate Representations (IRs) play a critical role in compiler design and program analysis, yet their comprehension by Large Language Models (LLMs) remains underexplored. In this paper, we present an explorative empirical study evaluating the capabilities of six state-of-the-art LLMs: GPT-4, GPT-3, DeepSeek, Gemma 2, Llama 3, and Code Llama, in understanding IRs. Specifically, we assess model performance across four core tasks: control flow graph reconstruction, decompilation, code summarization, and execution reasoning. While LLMs exhibit competence in parsing IR syntax and identifying high-level structures, they consistently struggle with instruction-level reasoning, especially in control flow reasoning, loop handling, and dynamic execution. Common failure modes include misinterpreting branching instructions, omitting critical operations, and relying on heuristic reasoning rather than precise instruction-level logic. Our findings highlight the need for IR-specific enhancements in LLM design. We recommend fine-tuning on structured IR datasets and integrating control-flow-sensitive architectures to improve model effectiveness. All experimental data and source code are publicly available at
title Can Large Language Models Understand Intermediate Representations in Compilers?
topic Machine Learning
Artificial Intelligence
Computation and Language
url https://arxiv.org/abs/2502.06854