Skip to main content
QUICK REVIEW

[论文解读] IR2Vec: A Flow Analysis based Scalable Infrastructure for Program Encodings.

Venkata Keerthy S., Rohit Aggarwal|arXiv (Cornell University)|Sep 13, 2019
Software Engineering Research参考文献 44被引用 5
一句话总结

IR2Vec 提出了一种可扩展的、与语言和机器无关的程序编码框架,该框架利用中间表示(IR)和流分析生成捕捉语法和语义信息的分布式嵌入。通过从 IR 实体学习种子嵌入,并利用数据流和控制流进行分层组合,IR2Vec 在程序分类、异构设备映射和线程粗粒化等任务中实现了最先进性能,且仅使用简单的模型。

ABSTRACT

We propose IR2Vec, a Concise and Scalable encoding infrastructure to represent programs as a distributed embedding in continuous space. This distributed embedding is obtained by combining representation learning methods with data and control flow information to capture the syntax as well as the semantics of the input programs.
 Our embeddings are obtained from the Intermediate Representation (IR) of the source code, and are both
 language as well as machine independent. The entities of the IR are modelled as relationships, and their
 representations are learned to form a seed embedding vocabulary. This vocabulary is used along with the flow
 analyses information to form a hierarchy of encodings based on various levels of program abstractions.
 We show the effectiveness of our methodology on a software engineering task (program classification) as well as optimization tasks (Heterogeneous device mapping and Thread coarsening). The embeddings generated by IR2Vec outperform the existing methods in all the three tasks even when using simple machine learning models. As we follow an agglomerative method of forming encodings at various levels using seed embedding vocabulary, our encoding is naturally more scalable and not data-hungry when compared to the
 other methods.

研究动机与目标

  • 开发一种可扩展的、与语言和机器无关的程序编码方法,以同时捕捉程序的语法和语义信息。
  • 解决现有嵌入方法在程序分析中数据需求高且不可扩展的局限性。
  • 将数据流和控制流分析整合到分层嵌入框架中,实现多级程序抽象。
  • 在多样化的软件工程和优化任务中,使用简单的机器学习模型实现有效的程序表示。

提出的方法

  • IR2Vec 通过将 IR 实体建模为类似知识图谱的结构中的关系,构建种子嵌入。
  • 应用表示学习技术,从 IR 学习密集向量表示,形成基础嵌入词汇。
  • 利用流分析信息(数据流和控制流)指导在多个抽象层级上对嵌入进行分层聚合。
  • 采用凝聚式方法,将种子嵌入与基于流的结构上下文相结合,生成更高级别的程序编码。
  • 该方法设计为可扩展且高效,避免了大规模预训练或海量标注数据集的需求。
  • 生成的嵌入作为简单机器学习模型的输入,用于下游任务。

实验结果

研究问题

  • RQ1基于流分析的方法是否能在多样化的软件工程任务中生成比现有方法更有效的程序嵌入?
  • RQ2将数据流和控制流整合进来,如何提升程序嵌入中的语义表示能力?
  • RQ3可扩展的凝聚式嵌入框架在程序分类和优化任务中,能在多大程度上超越数据密集型模型?
  • RQ4IR2Vec 的语言和机器无关特性是否能实现跨不同编程语言和平台的泛化能力?
  • RQ5当使用 IR2Vec 嵌入时,简单模型是否能实现最先进性能?

主要发现

  • IR2Vec 在程序分类任务中优于现有方法,使用简单模型实现了更高的准确率。
  • 该框架在异构设备映射任务中表现出色,该任务是关键的优化任务。
  • IR2Vec 在线程粗粒化任务中实现了最先进结果,这是另一项关键的编译优化。
  • 凝聚式、流引导的编码过程实现了可扩展性,且无需大量训练数据。
  • 即使模型复杂度极低,嵌入依然有效,凸显了所学表示的质量。
  • 该方法本质上可扩展且不依赖大量数据,与许多竞争方法不同。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。