Deep learning (DL) techniques have been used to support several code-related tasks such as code summarization and bug-fixing. In particular, pre-trained transformer models are on the rise, also thanks to the excellent results they achieved in Natural Language Processing (NLP) tasks. The basic idea behind these models is to first pre-train them on a generic dataset using a self-supervised task (e.g, filling masked words in sentences). Then, these models are fine-tuned to support specific tasks of interest (e.g, language translation). A single model can be fine-tuned to support multiple tasks, possibly exploiting the benefits of transfer learning. This means that knowledge acquired to solve a specific task (e.g, language translation) can be useful to boost performance on another task (e.g, sentiment classification). While the benefits of transfer learning have been widely studied in NLP, limited empirical evidence is available when it comes to code-related tasks. In this paper, we assess the performance of the Text-To-Text Transfer Transformer (T5) model in supporting four different code-related tasks: (i) automatic bug-fixing, (ii) injection of code mutants, (iii) generation of assert statements, and (iv) code summarization. We pay particular attention in studying the role played by pre-training and multi-task fine-tuning on the model's performance. We show that (i) the T5 can achieve better performance as compared to state-of-the-art baselines; and (ii) while pre-training helps the model, not all tasks benefit from a multi-task fine-tuning.
CodeChemist: Test-Time Scaling for Low-Resource Code Generation via Functional Knowledge Transfer
School of Computer Science and Technology, Xi’an Jiaotong University(西安交通大学计算机科学与技术学院);Beihang University(北京航空航天大学);Nanyang Technological University(南洋理工大学);Ant Group(蚂蚁集团);National Engineering Research Center for Visual Information and Applications(视觉信息与应用国家工程研究中心)
What You See is What it Means! Semantic Representation Learning of Code based on Visualization and Transfer Learning
最近在为NLP任务训练词嵌入方面的成功鼓励了对源代码的表示学习的研究浪潮,它建立在类似的NLP方法之上。总的目标是产生最大限度地捕捉程序语义的代码嵌入。现有技术的方法总是依赖于句法表示(即,原始词汇标记、抽象语法树或中间表示标记)来生成嵌入,这在文献中被批评为非鲁棒的或不可推广的。在这项工作中,我们研究了一种新的嵌入方法的基础上的直觉,源代码具有视觉模式的语义。我们进一步使用这些模式来解决识别语义代码克隆的突出挑战。我们提出了WYSIWIM(“What You See Is What It Means”)方法,其中源代码的视觉表示被馈送到来自计算机视觉领域的强大的预训练图像分类神经网络中,以受益于迁移学习的实际优势。我们评估所提出的嵌入方法的语义代码克隆识别的任务的两个变化:代码克隆检测(二进制分类问题),和代码分类(多分类问题)。我们通过在BigCloneBench(Java)和Open Judge(C)数据集上的实验表明,虽然简单,但我们的WYSIWIM方法与ASTNN或TBCNN等最先进的方法一样有效。我们进一步探讨了我们的方法中不同步骤的影响,如视觉表示或分类算法的选择,最终讨论这个研究方向的承诺和局限性。
CLAP: Learning Transferable Binary Code Representations with Natural Language Supervision
Tsinghua University(清华大学);Information Engineering University(信息工程大学);University of Electronic Science and Technology of China(电子科技大学);Beijing University of Technology(北京工业大学)