Universal Representation for Code

被引:3
|
作者
Liu, Linfeng [1 ]
Nguyen, Hoan [2 ]
Karypis, George [2 ]
Sengamedu, Srinivasan [2 ]
机构
[1] Tufts Univ, Medford, MA 02155 USA
[2] Amazon Web Serv, Seattle, WA 98109 USA
关键词
Code representation; Graph neural network; Pre-training;
D O I
10.1007/978-3-030-75768-7_2
中图分类号
TP18 [人工智能理论];
学科分类号
081104 ; 0812 ; 0835 ; 1405 ;
摘要
Learning from source code usually requires a large amount of labeled data. Despite the possible scarcity of labeled data, the trained model is highly task-specific and lacks transferability to different tasks. In this work, we present effective pre-training strategies on top of a novel graph-based code representation, to produce universal representations for code. Specifically, our graph-based representation captures important semantics between code elements (e.g., control flow and data flow). We pre-train graph neural networks on the representation to extract universal code properties. The pre-trained model then enables the possibility of fine-tuning to support various downstream applications. We evaluate our model on two real-world datasets - spanning over 30M Java methods and 770K Python methods. Through visualization, we reveal discriminative properties in our universal code representation. By comparing multiple benchmarks, we demonstrate that the proposed framework achieves state-of-the-art results on method name prediction and code graph link prediction.
引用
收藏
页码:16 / 28
页数:13
相关论文
共 50 条
  • [1] Universal representation for code
    Liu, Linfeng
    Nguyen, Hoan
    Karypis, George
    Sengamedu, Srinivasan
    arXiv, 2021,
  • [2] A UNIVERSAL CODE
    JOHNSTON, TY
    DATAMATION, 1968, 14 (09): : 11 - &
  • [3] Universal Code
    Stimson, Blake
    ARTFORUM INTERNATIONAL, 2009, 47 (09): : 151 - 151
  • [4] UNIVERSAL REPRESENTATION
    Nash, Lindsay
    FORDHAM LAW REVIEW, 2018, 87 (02) : 503 - 529
  • [5] Gray code representation of the universal genetic code: Generation of never born protein sequences using Toeplitz matrix approach
    Muthugobal, Bagayalakshmi Karuna Nidhi
    Ramesh, Ganapathy
    Parthasarathy, Subbiah
    Suvaithenamudhan, Suvaiyarasan
    Prasath, Karuppasamy Muthuvel
    BIOSYSTEMS, 2020, 198
  • [6] A UNIVERSAL CATALOGING CODE
    CHAPLIN, AH
    LIBRARY QUARTERLY, 1956, 26 (04): : 337 - 347
  • [7] The genetic code is not universal
    Di Giulio, Massimo
    BIOSYSTEMS, 2025, 247
  • [8] UNIVERSAL GENETIC-CODE LESS UNIVERSAL
    CURTIN, ME
    MICROBIOLOGICAL SCIENCES, 1985, 2 (08): : 242 - 242
  • [9] A universal hypercyclic representation
    Glasner, Eli
    Weiss, Benjamin
    JOURNAL OF FUNCTIONAL ANALYSIS, 2015, 268 (11) : 3478 - 3491
  • [10] Summarizing source code with hierarchical code representation
    Zhou, Ziyi
    Yu, Huiqun
    Fan, Guisheng
    Huang, Zijie
    Yang, Xingguang
    INFORMATION AND SOFTWARE TECHNOLOGY, 2022, 143