Skip to main content
QUICK REVIEW

[Paper Review] Deep Learning Meets Software Engineering: A Survey on Pre-Trained Models of Source Code

Changan Niu, Chuanyi Li|arXiv (Cornell University)|May 24, 2022
Software Engineering ResearchComputer Science10 citations
TL;DR

This survey provides a comprehensive overview of pre-trained models for source code (CodePTMs), detailing their architecture, pre-training methods, and applications across 18 software engineering tasks. It highlights the limitations of adapting NLP pre-trained models to code and advocates for code-specific designs in tokenization, pre-training tasks, and model adaptation to improve performance and efficiency in code understanding and generation tasks.

ABSTRACT

Recent years have seen the successful application of deep learning to software engineering (SE). In particular, the development and use of pre-trained models of source code has enabled state-of-the-art results to be achieved on a wide variety of SE tasks. This paper provides an overview of this rapidly advancing field of research and reflects on future research directions.

Motivation & Objective

  • To raise awareness among AI researchers about the growing impact of pre-trained models on software engineering.
  • To systematically survey existing pre-trained models of source code (CodePTMs) and their applications to diverse SE tasks.
  • To identify key challenges in adapting NLP-based pre-training to code, including tokenization, structural awareness, and pre-training tasks.
  • To propose future research directions for improving CodePTMs, such as code-specific design, joint learning of code form and function, and task-specific adaptation.
  • To advocate for unified evaluation frameworks to enable fair and comprehensive comparison of CodePTMs across benchmark datasets.

Proposed method

  • Surveying 185+ recent studies on CodePTMs from 2016 to 2022, focusing on model architectures, pre-training objectives, and downstream task performance.
  • Classifying CodePTMs based on their architectural design: token-based (e.g., BERT-style), tree-based (e.g., AST-aware), and sequence-to-sequence (e.g., T5-style).
  • Analyzing pre-training tasks such as masked language modeling (MLM), identifier masking (IMLM), and code-specific objectives like clone detection and control flow reconstruction.
  • Evaluating CodePTMs across 18 SE tasks, including code classification, defect detection, code search, code summarization, and code generation.
  • Proposing methodological improvements, such as code-specific tokenization, structure-aware pre-training, and efficient adaptation via prompt tuning or adapter modules.
  • Recommending a unified evaluation protocol involving standardized benchmarks and qualitative error analysis to improve model interpretability and comparability.

Experimental results

Research questions

  • RQ1How do pre-trained models of source code differ from their NLP counterparts in architecture and pre-training objectives?
  • RQ2What are the key limitations of applying general-purpose NLP pre-trained models to software engineering tasks?
  • RQ3Which pre-training tasks and architectural designs lead to the best performance on code understanding and generation tasks?
  • RQ4How can CodePTMs be efficiently fine-tuned or adapted for downstream SE tasks without retraining all parameters?
  • RQ5What are the most effective strategies for evaluating and comparing CodePTMs across diverse SE benchmarks?

Key findings

  • Existing CodePTMs primarily learn representations from code form (i.e., lexical tokens) rather than code functionality, limiting their semantic understanding.
  • Pre-training on identifier masking (IMLM) yields worse results than standard masked language modeling (MLM) in some cases, indicating suboptimal design for code-specific characteristics.
  • Code-specific tokenization and embedding methods are needed, as standard NLP techniques do not fully capture code’s syntactic and semantic structure.
  • Model adaptation via prompt tuning or adapter modules can improve efficiency and reduce parameter updates during fine-tuning, offering a promising alternative to full fine-tuning.
  • Specialized CodePTMs tailored for specific task classes (e.g., understanding vs. generation) can outperform general-purpose models due to better alignment with downstream task objectives.
  • A unified evaluation framework across all 18 SE tasks and standardized benchmarks is essential for fair comparison and deeper insight into model strengths and weaknesses.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.