CODE-MVP: Learning to Represent Source Code from Multiple Views with Contrastive Pre-Training
Not on the map. Why?
Abstract (arXiv)
Recent years have witnessed increasing interest in code representation learning, which aims to represent the semantics of source code into distributed vectors. Currently, various works have been proposed to represent the complex semantics of source code from different views, including plain text, Abstract Syntax Tree (AST), and several kinds of code graphs (e.g., Control/Data Flow Graph). However, most of them only consider a single view of source code independently, ignoring the correspondences among different views. In this paper, we propose to integrate different views with the natural-language description of source code into a unified framework with Multi-View contrastive Pre-training, and name our model as CODE-MVP. Specifically, we first extract multiple code views using compiler tools, and learn the complementary information among them under a contrastive learning framework. Inspired by the type checking in compilation, we also design a fine-grained type inference objective in the pre-training. Experiments on three downstream tasks over five datasets demonstrate the superiority of CODE-MVP when compared with several state-of-the-art baselines. For example, we achieve 2.4/2.3/1.1 gain in terms of MRR/MAP/Accuracy metrics on natural language code retrieval, code similarity, and code defect detection tasks, respectively.
Key facts. Cited by 15 papers in the map (data through 7 Oct 2026). Builds on 38 of its 70 references that are in the map. First posted on arXiv 4 May 2022.
Builds on
38 of 70 references.
References · 38
- 2017Attention Is All You Needcited by 59,932
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
- 2020A Simple Framework for Contrastive Learning of Visual Representationscited by 11,979
- 2016Semi-Supervised Classification with Graph Convolutional Networkscited by 11,282
- 2019BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehensioncited by 5,874
- 2013Distributed Representations of Words and Phrases and their Compositionalitycited by 3,462
- 2015Neural Machine Translation of Rare Words with Subword Unitscited by 2,898
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
26 more
- 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 638
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 600
- 2021Unified Pre-training for Program Understanding and Generationcited by 361
- 2018code2vec: Learning Distributed Representations of Codecited by 249
- 2020IntelliCode Compose: Code Generation Using Transformercited by 225
- 2017A Survey of Machine Learning for Big Code and Naturalnesscited by 220
- 2019Graph Matching Networks for Learning the Similarity of Graph Structured Objectscited by 202
- 2018Learning to Mine Aligned Code and Natural Language Pairs from Stack Overflowcited by 165
- 2018Improving Automatic Source Code Summarization via Deep Reinforcement Learningcited by 99
- 2020Contrastive Code Representation Learningcited by 76
- 2021CoSQA: 20,000+ Web Queries for Code Search and Question Answeringcited by 74
- 2020Code Prediction by Feeding Trees to Transformerscited by 70
- 2021SynCoBERT: Syntax-Guided Multi-Modal Contrastive Pre-Training for Code Representationcited by 63
- 2021CoTexT: Multi-task Learning with Code-Text Transformercited by 61
- 2018Neural Code Comprehension: A Learnable Representation of Code Semanticscited by 59
- 2022What Do They Capture? -- A Structural Analysis of Pre-Trained Language Models for Source Codecited by 50
- 2020Self-Supervised Contrastive Learning for Code Retrieval and Summarization via Semantic-Preserving Transformationscited by 49
- 2022Compilable Neural Code Generation with Compiler Feedbackcited by 46
- 2018Ithemal: Accurate, Portable and Fast Basic Block Throughput Estimation using Deep Neural Networkscited by 43
- 2019Multi-Modal Attention Network Learning for Semantic Source Code Retrievalcited by 40
- 2021TreeBERT: A Tree-Based Pre-Trained Model for Programming Languagecited by 40
- 2020ProGraML: Graph-based Deep Learning for Program Optimization and Analysiscited by 23
- 2020InferCode: Self-Supervised Learning of Code Representations by Predicting Subtreescited by 23
- 2020Deep Graph Matching and Searching for Semantic Code Retrievalcited by 20
- 2022Scalpel: The Python Static Analysis Frameworkcited by 9
- 2020Software Language Comprehension using a Program-Derived Semantics Graphcited by 2
Built on by
Citing papers per year: 2022: 4; 2023: 6; 2024: 3; 2025: 1; 2026: 1.
15 papers.
Sort:
- 2023CodeT5+: Open Code Large Language Models for Code Understanding and Generationcited by 327
- 2022PanGu-Coder: Program Synthesis with Function-Level Language Modelingcited by 47
- 2023CodeTF: One-stop Transformer Library for State-of-the-art Code LLMscited by 21
- 2023Rethinking Negative Pairs in Code Searchcited by 14
- 2024Uncovering LLM-Generated Code: A Zero-Shot Synthetic Code Detector via Code Rewritingcited by 11
- 2022Soft-Labeled Contrastive Pre-training for Function-level Code Representationcited by 7
- 2022NS3: Neuro-Symbolic Semantic Code Searchcited by 3
- 2022Finding Reusable Machine Learning Components to Build Programming Language Processing Pipelinescited by 3
- 2024Towards Better Code Understanding in Decoder-Only Models with Contrastive Learningcited by 3
- 2024Code LLMs: A Taxonomy-based Surveycited by 3
- 2025On The Role of Pretrained Language Models in General-Purpose Text Embeddings: A Surveycited by 3
- 2023Neuro-symbolic Zero-Shot Code Cloning with Cross-Language Intermediate Representationcited by 2
3 more
- 2023Contrastive Learning for API Aspect Analysiscited by 0
- 2023Contrastive Prompt Learning-based Code Search based on Interaction Matrixcited by 0
- 2026The Patchwork Problem in LLM-Generated Codecited by 0
- 2026The Patchwork Problem in LLM-Generated Code9 Jul 2026
- 2025On The Role of Pretrained Language Models in General-Purpose Text Embeddings: A Survey28 Jul 2025
- 2024Code LLMs: A Taxonomy-based Survey11 Dec 2024
- 2024Towards Better Code Understanding in Decoder-Only Models with Contrastive Learning18 Jun 2024
- 2024Uncovering LLM-Generated Code: A Zero-Shot Synthetic Code Detector via Code Rewriting25 May 2024
- 2023Rethinking Negative Pairs in Code Search12 Oct 2023
- 2023Contrastive Prompt Learning-based Code Search based on Interaction Matrix10 Oct 2023
- 2023Contrastive Learning for API Aspect Analysis31 Jul 2023
- 2023CodeTF: One-stop Transformer Library for State-of-the-art Code LLMs31 May 2023
- 2023CodeT5+: Open Code Large Language Models for Code Understanding and Generation13 May 2023
- 2023Neuro-symbolic Zero-Shot Code Cloning with Cross-Language Intermediate Representation26 Apr 2023
- 2022Soft-Labeled Contrastive Pre-training for Function-level Code Representation18 Oct 2022
3 more
- 2023CodeT5+: Open Code Large Language Models for Code Understanding and Generationcited by 327
- 2022PanGu-Coder: Program Synthesis with Function-Level Language Modelingcited by 47
- 2023CodeTF: One-stop Transformer Library for State-of-the-art Code LLMscited by 21
- 2023Rethinking Negative Pairs in Code Searchcited by 14
- 2024Uncovering LLM-Generated Code: A Zero-Shot Synthetic Code Detector via Code Rewritingcited by 11
- 2022Soft-Labeled Contrastive Pre-training for Function-level Code Representationcited by 7
- 2022NS3: Neuro-Symbolic Semantic Code Searchcited by 3
- 2022Finding Reusable Machine Learning Components to Build Programming Language Processing Pipelinescited by 3
- 2024Towards Better Code Understanding in Decoder-Only Models with Contrastive Learningcited by 3
- 2024Code LLMs: A Taxonomy-based Surveycited by 3
- 2025On The Role of Pretrained Language Models in General-Purpose Text Embeddings: A Surveycited by 3
- 2023Neuro-symbolic Zero-Shot Code Cloning with Cross-Language Intermediate Representationcited by 2
12 most cited of 15 All 15 (JSON)
- 2026The Patchwork Problem in LLM-Generated Code9 Jul 2026
- 2025On The Role of Pretrained Language Models in General-Purpose Text Embeddings: A Survey28 Jul 2025
- 2024Code LLMs: A Taxonomy-based Survey11 Dec 2024
- 2024Towards Better Code Understanding in Decoder-Only Models with Contrastive Learning18 Jun 2024
- 2024Uncovering LLM-Generated Code: A Zero-Shot Synthetic Code Detector via Code Rewriting25 May 2024
- 2023Rethinking Negative Pairs in Code Search12 Oct 2023
- 2023Contrastive Prompt Learning-based Code Search based on Interaction Matrix10 Oct 2023
- 2023Contrastive Learning for API Aspect Analysis31 Jul 2023
- 2023CodeTF: One-stop Transformer Library for State-of-the-art Code LLMs31 May 2023
- 2023CodeT5+: Open Code Large Language Models for Code Understanding and Generation13 May 2023
- 2023Neuro-symbolic Zero-Shot Code Cloning with Cross-Language Intermediate Representation26 Apr 2023
- 2022Soft-Labeled Contrastive Pre-training for Function-level Code Representation18 Oct 2022
12 newest of 15 All 15 (JSON)