Skip to main content
Cornell University
We gratefully acknowledge support from the Simons Foundation, member institutions, and all contributors. Donate
arxiv logo > cs > arXiv:2009.02731

Help | Advanced Search

arXiv logo
Cornell University Logo

quick links

  • Login
  • Help Pages
  • About

Computer Science > Software Engineering

arXiv:2009.02731 (cs)
[Submitted on 6 Sep 2020 (v1), last revised 23 May 2021 (this version, v8)]

Title:Self-Supervised Contrastive Learning for Code Retrieval and Summarization via Semantic-Preserving Transformations

Authors:Nghi D. Q. Bui, Yijun Yu, Lingxiao Jiang
View a PDF of the paper titled Self-Supervised Contrastive Learning for Code Retrieval and Summarization via Semantic-Preserving Transformations, by Nghi D. Q. Bui and 2 other authors
View PDF
Abstract:We propose Corder, a self-supervised contrastive learning framework for source code model. Corder is designed to alleviate the need of labeled data for code retrieval and code summarization tasks. The pre-trained model of Corder can be used in two ways: (1) it can produce vector representation of code which can be applied to code retrieval tasks that do not have labeled data; (2) it can be used in a fine-tuning process for tasks that might still require label data such as code summarization. The key innovation is that we train the source code model by asking it to recognize similar and dissimilar code snippets through a contrastive learning objective. To do so, we use a set of semantic-preserving transformation operators to generate code snippets that are syntactically diverse but semantically equivalent. Through extensive experiments, we have shown that the code models pretrained by Corder substantially outperform the other baselines for code-to-code retrieval, text-to-code retrieval, and code-to-text summarization tasks.
Comments: Accepted at SIGIR 2021
Subjects: Software Engineering (cs.SE); Artificial Intelligence (cs.AI); Machine Learning (cs.LG); Programming Languages (cs.PL)
Cite as: arXiv:2009.02731 [cs.SE]
  (or arXiv:2009.02731v8 [cs.SE] for this version)
  https://doi.org/10.48550/arXiv.2009.02731
arXiv-issued DOI via DataCite
Related DOI: https://doi.org/10.1145/3404835.3462840
DOI(s) linking to related resources

Submission history

From: Nghi D. Q. Bui [view email]
[v1] Sun, 6 Sep 2020 13:31:16 UTC (1,365 KB)
[v2] Fri, 9 Oct 2020 05:38:39 UTC (1,364 KB)
[v3] Sat, 16 Jan 2021 12:12:51 UTC (2,101 KB)
[v4] Tue, 19 Jan 2021 11:46:56 UTC (2,100 KB)
[v5] Wed, 20 Jan 2021 09:49:11 UTC (2,101 KB)
[v6] Sun, 2 May 2021 19:25:45 UTC (2,149 KB)
[v7] Mon, 17 May 2021 18:01:27 UTC (2,165 KB)
[v8] Sun, 23 May 2021 12:10:55 UTC (2,165 KB)
Full-text links:

Access Paper:

    View a PDF of the paper titled Self-Supervised Contrastive Learning for Code Retrieval and Summarization via Semantic-Preserving Transformations, by Nghi D. Q. Bui and 2 other authors
  • View PDF
  • TeX Source
  • Other Formats
view license
Current browse context:
cs.SE
< prev   |   next >
new | recent | 2020-09
Change to browse by:
cs
cs.AI
cs.LG
cs.PL

References & Citations

  • NASA ADS
  • Google Scholar
  • Semantic Scholar

DBLP - CS Bibliography

listing | bibtex
Nghi D. Q. Bui
a export BibTeX citation Loading...

BibTeX formatted citation

×
Data provided by:

Bookmark

BibSonomy logo Reddit logo

Bibliographic and Citation Tools

Bibliographic Explorer (What is the Explorer?)
Connected Papers (What is Connected Papers?)
Litmaps (What is Litmaps?)
scite Smart Citations (What are Smart Citations?)

Code, Data and Media Associated with this Article

alphaXiv (What is alphaXiv?)
CatalyzeX Code Finder for Papers (What is CatalyzeX?)
DagsHub (What is DagsHub?)
Gotit.pub (What is GotitPub?)
Hugging Face (What is Huggingface?)
Papers with Code (What is Papers with Code?)
ScienceCast (What is ScienceCast?)

Demos

Replicate (What is Replicate?)
Hugging Face Spaces (What is Spaces?)
TXYZ.AI (What is TXYZ.AI?)

Recommenders and Search Tools

Influence Flower (What are Influence Flowers?)
CORE Recommender (What is CORE?)
  • Author
  • Venue
  • Institution
  • Topic

arXivLabs: experimental projects with community collaborators

arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.

Which authors of this paper are endorsers? | Disable MathJax (What is MathJax?)
  • About
  • Help
  • contact arXivClick here to contact arXiv Contact
  • subscribe to arXiv mailingsClick here to subscribe Subscribe
  • Copyright
  • Privacy Policy
  • Web Accessibility Assistance
  • arXiv Operational Status
    Get status notifications via email or slack