mlsanityData to 7 Oct 2026

VarCLR: Variable Semantic Representation Pre-training via Contrastive Learning

arXiv 2112.02650 ↗First posted 5 Dec 2021cs.SE cs.CL cs.LGcited by 11

Not on the map. Why?

Abstract (arXiv)

Variable names are critical for conveying intended program behavior. Machine learning-based program analysis methods use variable name representations for a wide range of tasks, such as suggesting new variable names and bug detection. Ideally, such methods could capture semantic relationships between names beyond syntactic similarity, e.g., the fact that the names average and mean are similar. Unfortunately, previous work has found that even the best of previous representation approaches primarily capture relatedness (whether two variables are linked at all), rather than similarity (whether they actually have the same meaning). We propose VarCLR, a new approach for learning semantic representations of variable names that effectively captures variable similarity in this stricter sense. We observe that this problem is an excellent fit for contrastive learning, which aims to minimize the distance between explicitly similar inputs, while maximizing the distance between dissimilar inputs. This requires labeled training data, and thus we construct a novel, weakly-supervised variable renaming dataset mined from GitHub edits. We show that VarCLR enables the effective application of sophisticated, general-purpose language models like BERT, to variable name representation and thus also to related downstream tasks like variable name similarity search or spelling correction. VarCLR produces models that significantly outperform the state-of-the-art on IdBench, an existing benchmark that explicitly captures variable similarity (as distinct from relatedness). Finally, we contribute a release of all data, code, and pre-trained models, aiming to provide a drop-in replacement for variable representations used in either existing or future program analyses that rely on variable names.

Key facts. Cited by 11 papers in the map (data through 7 Oct 2026). Builds on 52 of its 87 references that are in the map. First posted on arXiv 5 Dec 2021.

Builds on

52 of 87 references.

References · 52

  1. 2017Attention Is All You Needcited by 59,932
  2. 2015Deep Residual Learning for Image Recognitioncited by 51,809
  3. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  4. 2014Adam: A Method for Stochastic Optimizationcited by 36,960
  5. 2020Language Models are Few-Shot Learnerscited by 32,199
  6. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  7. 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
  8. 2020A Simple Framework for Contrastive Learning of Visual Representationscited by 11,979
  9. 2016Semi-Supervised Classification with Graph Convolutional Networkscited by 11,282
  10. 2015Distilling the Knowledge in a Neural Networkcited by 10,076
  11. 2018Representation Learning with Contrastive Predictive Codingcited by 7,662
  12. 2019Momentum Contrast for Unsupervised Visual Representation Learningcited by 7,482
38 more
  1. 2019BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehensioncited by 5,874
  2. 2020Bootstrap your own latent: A new approach to self-supervised Learningcited by 4,712
  3. 2020Dense Passage Retrieval for Open-Domain Question Answeringcited by 3,779
  4. 2013Distributed Representations of Words and Phrases and their Compositionalitycited by 3,462
  5. 2015Neural Machine Translation of Rare Words with Subword Unitscited by 2,898
  6. 2020Exploring Simple Siamese Representation Learningcited by 2,853
  7. 2020Unsupervised Learning of Visual Features by Contrasting Cluster Assignmentscited by 2,845
  8. 2020Supervised Contrastive Learningcited by 2,803
  9. 2017Billion-scale similarity search with GPUscited by 2,477
  10. 2021SimCSE: Simple Contrastive Learning of Sentence Embeddingscited by 2,168
  11. 2018Unsupervised Feature Learning via Non-Parametric Instance-level Discriminationcited by 1,838
  12. 2021Align before Fuse: Vision and Language Representation Learning with Momentum Distillationcited by 1,612
  13. 2016Enriching Word Vectors with Subword Informationcited by 1,578
  14. 2019Contrastive Multiview Codingcited by 1,297
  15. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
  16. 2020What Makes for Good Views for Contrastive Learning?cited by 843
  17. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
  18. 2019Latent Retrieval for Weakly Supervised Open Domain Question Answeringcited by 691
  19. 2017Mean teachers are better role models: Weight-averaged consistency targets improve semi-supervised deep learning resultscited by 470
  20. 2020Towards a Human-like Open-Domain Chatbotcited by 467
  21. 2020GCC: Graph Contrastive Coding for Graph Neural Network Pre-Trainingcited by 461
  22. 2014SimLex-999: Evaluating Semantic Models with (Genuine) Similarity Estimationcited by 170
  23. 2020Self-training Improves Pre-training for Natural Language Understandingcited by 96
  24. 2020Spelling Error Correction with Soft-Masked BERTcited by 90
  25. 2020Contrastive Code Representation Learningcited by 76
  26. 2018DeepBugs: A Learning Approach to Name-based Bug Detectioncited by 65
  27. 2019A spelling correction model for end-to-end speech recognitioncited by 63
  28. 2015Towards Universal Paraphrastic Sentence Embeddingscited by 59
  29. 2019DIRE: A Neural Approach to Decompiled Identifier Namingcited by 36
  30. 2018Automated software vulnerability detection with machine learningcited by 34
  31. 2018Learning to Represent Editscited by 34
  32. 2020NeuSpell: A Neural Spelling Correction Toolkitcited by 31
  33. 2014Learning Natural Coding Conventionscited by 28
  34. 2017Sorting and Transforming Program Repair Ingredients via Deep Learning Code Similaritiescited by 26
  35. 2019GitHub Typo Corpus: A Large-Scale Multilingual Dataset of Misspellings and Grammatical Errorscited by 22
  36. 2021Paraphrastic Representations at Scalecited by 19
  37. 2019A Literature Study of Embeddings on Source Codecited by 18
  38. 2018Context2Name: A Deep Learning-Based Approach to Infer Natural Variable Names from Usage Contextscited by 11

50 most cited of 52 All 52 (JSON)

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2022: 3; 2023: 4; 2024: 2; 2025: 1; 2026: 1.

11 papers.