VarCLR: Variable Semantic Representation Pre-training via Contrastive Learning
Wed 11 May 2022 11:15 - 11:20 at ICSE room 1-odd hours - Machine Learning with and for SE 10 Chair(s): Preetha Chatterjee
Fri 27 May 2022 11:05 - 11:10 at Room 301+302 - Papers 19: Machine Learning with and for SE 2 Chair(s): Dalal Alrajeh
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 plug-in replacement for variable representations used in either existing or future program analyses that rely on variable names.
Mon 9 MayDisplayed time zone: Eastern Time (US & Canada) change
Wed 11 MayDisplayed time zone: Eastern Time (US & Canada) change
11:00 - 12:00 | Machine Learning with and for SE 10Technical Track / SEIP - Software Engineering in Practice / Journal-First Papers at ICSE room 1-odd hours Chair(s): Preetha Chatterjee Drexel University, USA | ||
11:00 5mTalk | Defect Reduction Planning (using TimeLIME) Journal-First Papers Authorizer link Pre-print Media Attached | ||
11:05 5mTalk | Automatic Fault Detection for Deep Learning Programs Using Graph Transformations Journal-First Papers Amin Nikanjam École Polytechnique de Montréal, Houssem Ben Braiek École Polytechnique de Montréal, Mohammad Mehdi Morovati École Polytechnique de Montréal, Foutse Khomh Polytechnique Montréal Link to publication DOI Media Attached | ||
11:10 5mTalk | Counterfactual Explanations for Models of Code SEIP - Software Engineering in Practice Jürgen Cito TU Wien and Meta, Işıl Dillig University of Texas at Austin, Vijayaraghavan Murali Meta Platforms, Inc., Satish Chandra Facebook Pre-print Media Attached | ||
11:15 5mTalk | VarCLR: Variable Semantic Representation Pre-training via Contrastive Learning Technical Track Qibin Chen Carnegie Mellon University, Jeremy Lacomis Carnegie Mellon University, Edward J. Schwartz Carnegie Mellon University Software Engineering Institute, Graham Neubig Carnegie Mellon University, Bogdan Vasilescu Carnegie Mellon University, USA, Claire Le Goues Carnegie Mellon University DOI Pre-print Media Attached | ||
11:20 5mTalk | Towards Training Reproducible Deep Learning Models Technical Track Boyuan Chen Centre for Software Excellence, Huawei Canada, Mingzhi Wen Huawei Technologies, Yong Shi Huawei Technologies, Dayi Lin Centre for Software Excellence, Huawei, Canada, Gopi Krishnan Rajbahadur Centre for Software Excellence, Huawei, Canada, Zhen Ming (Jack) Jiang York University Pre-print Media Attached | ||
11:25 5mTalk | Learning to Reduce False Positives in Analytic Bug Detectors Technical Track Anant Kharkar Microsoft, Roshanak Zilouchian Moghaddam Microsoft, Matthew Jin Microsoft Corporation, Xiaoyu Liu Microsoft Corporation, Xin Shi Microsoft Corporation, Colin Clement Microsoft, Neel Sundaresan Microsoft Corporation Pre-print Media Attached |