paperbot · PL 论文追踪

全部论文 待读 收藏

P2 FAIR: Flow Type-Aware Pre-Training of Compiler Intermediate Representations

FAIR:面向流类型感知的编译器中间表示预训练
ICSE Proceedings of the IEEE/ACM 46th International Conference on Software Engineering2024匹配度 3/10 · 论文属于编译器IR的预训练与程序表示学习,虽处于ML+PL交叉领域,但与用户核心关注的静态分析、Agentic程序、LLM/Agent改进静态分析或形式化验证、浮点/贝叶斯程序分析均无直接交集。引用 7 inbox
Changan Niu, Chuanyi Li, Vincent Ng, David Lo, Bin Luo
crossref: 2026-09-12

AI 速览

一句话:提出流类型感知的IR预训练模型FAIR,用图Transformer与五项预训练任务,在四个下游任务上取得SOTA。

现有基于编译器中间表示(IR)的预训练模型通常利用指令、控制数据流图(CDFG)、调用图等特征,但它们在CDFG中混淆变量节点与指令节点,且不区分不同流类型;所用神经网络也难以捕获长距离依赖,并存在过平滑与过挤压问题。为此,本文提出FAIR,一种流类型感知的IR预训练模型。FAIR包含三方面设计:新的IR程序输入表示,用于区分变量/指令节点及流类型;采用Graph Transformer以缓解过平滑、过挤压并建模长距离依赖;提出五个预训练任务,使模型学习IR token语义、流类型信息以及IR整体表示。实验结果表明,FAIR在四个代码相关下游任务上均达到当时最优效果,验证了流类型感知表示与图Transformer在IR预训练中的有效性。

问题
现有IR预训练模型混淆CDFG中的变量节点与指令节点,忽略不同流类型,且神经网络难以捕获长距离依赖并存在过平滑、过挤压问题。
方法
FAIR设计新的IR输入表示以区分节点与流类型,使用Graph Transformer建模长距离依赖,并引入五个面向IR token语义、流类型和整体表示的预训练任务。
评估
在四个代码相关下游任务上进行实验,FAIR均取得state-of-the-art结果,表明其IR表示学习能力优于现有方法。
原文摘要(Abstract)

While the majority of existing pre-trained models from code learn source code features such as code tokens and abstract syntax trees, there are some other works that focus on learning from compiler intermediate representations (IRs). Existing IR-based models typically utilize IR features such as instructions, control and data flow graphs (CDFGs), call graphs, etc. However, these methods confuse variable nodes and instruction nodes in a CDFG and fail to distinguish different types of flows, and the neural networks they use fail to capture long-distance dependencies and have over-smoothing and over-squashing problems. To address these weaknesses, we propose FAIR, a Flow type-Aware pre-trained model for IR that involves employing (1) a novel input representation of IR programs; (2) Graph Transformer to address over-smoothing, over-squashing and long-dependencies problems; and (3) five pre-training tasks that we specifically propose to enable FAIR to learn the semantics of IR tokens, flow type information, and the overall representation of IR. Experimental results show that FAIR can achieve state-of-the-art results on four code-related downstream tasks.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot11470,
  title = {FAIR: Flow Type-Aware Pre-Training of Compiler Intermediate Representations},
  author = {Changan Niu and Chuanyi Li and Vincent Ng and David Lo and Bin Luo},
  booktitle = {ICSE},
  year = {2024},
  doi = {10.1145/3597503.3608136}
}