mlsanityData to 7 Oct 2026

Soft-Labeled Contrastive Pre-training for Function-level Code Representation

arXiv 2210.09597 ↗First posted 18 Oct 2022cs.CL cs.PL cs.SEcited by 7

Not on the map. Why?

Abstract (arXiv)

Code contrastive pre-training has recently achieved significant progress on code-related tasks. In this paper, we present SCodeR, a Soft-labeled contrastive pre-training framework with two positive sample construction methods to learn functional-level Code Representation. Considering the relevance between codes in a large-scale code corpus, the soft-labeled contrastive pre-training can obtain fine-grained soft-labels through an iterative adversarial manner and use them to learn better code representation. The positive sample construction is another key for contrastive pre-training. Previous works use transformation-based methods like variable renaming to generate semantically equal positive codes. However, they usually result in the generated code with a highly similar surface form, and thus mislead the model to focus on superficial code structure instead of code semantics. To encourage SCodeR to capture semantic information from the code, we utilize code comments and abstract syntax sub-trees of the code to build positive samples. We conduct experiments on four code-related tasks over seven datasets. Extensive experimental results show that SCodeR achieves new state-of-the-art performance on all of them, which illustrates the effectiveness of the proposed pre-training method.

Key facts. Cited by 7 papers in the map (data through 7 Oct 2026). Builds on 30 of its 43 references that are in the map. First posted on arXiv 18 Oct 2022.

Builds on

30 of 43 references.

References · 30

  1. 2017Attention Is All You Needcited by 59,932
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  3. 2020Language Models are Few-Shot Learnerscited by 32,199
  4. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  5. 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
  6. 2015Distilling the Knowledge in a Neural Networkcited by 10,076
  7. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  8. 2019BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehensioncited by 5,874
  9. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
  10. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
  11. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
  12. 2019Latent Retrieval for Weakly Supervised Open Domain Question Answeringcited by 691
18 more
  1. 2019Unified Language Model Pre-training for Natural Language Understanding and Generationcited by 668
  2. 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 638
  3. 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 600
  4. 2021Unified Pre-training for Program Understanding and Generationcited by 361
  5. 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 355
  6. 2018code2vec: Learning Distributed Representations of Codecited by 249
  7. 2020IntelliCode Compose: Code Generation Using Transformercited by 225
  8. 2018The Adverse Effects of Code Duplication in Machine Learning Models of Codecited by 123
  9. 2020Boosting Contrastive Self-Supervised Learning with False Negative Cancellationcited by 119
  10. 2021Adversarial Retriever-Ranker for dense text retrievalcited by 82
  11. 2020Contrastive Code Representation Learningcited by 76
  12. 2021CoSQA: 20,000+ Web Queries for Code Search and Question Answeringcited by 74
  13. 2021SynCoBERT: Syntax-Guided Multi-Modal Contrastive Pre-Training for Code Representationcited by 63
  14. 2020Self-Supervised Contrastive Learning for Code Retrieval and Summarization via Semantic-Preserving Transformationscited by 49
  15. 2021Incremental False Negative Detection for Contrastive Learningcited by 48
  16. 2019Learning and Evaluating Contextual Embedding of Source Codecited by 33
  17. 2021Towards Learning (Dis)-Similarity of Source Code from Program Contrastscited by 17
  18. 2022CODE-MVP: Learning to Represent Source Code from Multiple Views with Contrastive Pre-Trainingcited by 15

Built on by

Cited by year

Citing papers per year: 2023: 2; 2024: 3; 2025: 2.

7 papers.