(Preprint) CLSEBERT: Contrastive Learning for Syntax Enhanced Code Pre-Trained Model
Xin Wang ¹, Yasheng Wang ², Pingyi Zhou ², Meng Xiao ², Yadao Wang ², Li Li ³, Xiao Liu ⁴, Hao Wu 武浩 ⁵, Jin Liu 刘进 ¹, Xin Jiang ²
¹ School of Computer Science, Wuhan University 武汉大学 计算机学院
² Noah's Ark Lab, Huawei 华为 诺亚方舟实验室
³ Faculty of Information Technology, Monash University
⁴ School of Information Technology, Deakin University
⁵ School of Information Science and Engineering, Yunnan University 云南大学 信息学院
arXiv
, 2021-08-10
Abstract
Pre-trained models for programming languages have proven their significant values in various code-related tasks, such as code search, code clone detection, and code translation. Currently, most pre-trained models treat a code snippet as a sequence of tokens or only focus on the data flow between code identifiers.
However, rich code syntax and hierarchy are ignored which can provide important structure information and semantic rules of codes to help enhance code representations. In addition, although the BERT-based code pre-trained models achieve high performance on many downstream tasks, the native derived sequence representations of BERT are proven to be of low-quality, it performs poorly on code matching and similarity tasks.
To address these problems, we propose CLSEBERT, a Constrastive Learning Framework for Syntax Enhanced Code Pre-Trained Model, to deal with various code intelligence tasks. In the pre-training stage, we consider the code syntax and hierarchy contained in the Abstract Syntax Tree (AST) and leverage the constrastive learning to learn noise-invariant code representations. Besides the masked language modeling (MLM), we also introduce two novel pre-training objectives. One is to predict the edges between nodes in the abstract syntax tree, and the other is to predict the types of code tokens. Through extensive experiments on four code intelligence tasks, we successfully show the effectiveness of our proposed model.
Review for wireless communication technology based on digital encoding metasurfaces
Haojie Zhan, Manna Gu, Ying Tian, Huizhen Feng, Mingmin Zhu, Haomiao Zhou, Yongxing Jin, Ying Tang, Chenxia Li, Bo Fang, Zhi Hong, Xufeng Jing, Le Wang
Opto-Electronic Advances
2025-07-17
Multiphoton intravital microscopy in small animals of long-term mitochondrial dynamics based on super‐resolution radial fluctuations
Saeed Bohlooli Darian, Jeongmin Oh, Bjorn Paulson, Minju Cho, Globinna Kim, Eunyoung Tak, Inki Kim, Chan-Gi Pack, Jung-Man Namgoong, In-Jeoung Baek, Jun Ki Kim
Opto-Electronic Advances
2025-07-17
Non-volatile tunable multispectral compatible infrared camouflage based on the infrared radiation characteristics of Rosaceae plants
Xin Li, Xinye Liao, Junxiang Zeng, Zao Yi, Xin He, Jiagui Wu, Huan Chen, Zhaojian Zhang, Yang Yu, Zhengfu Zhang, Sha Huang, Junbo Yang
Opto-Electronic Advances
2025-07-09
CW laser damage of ceramics induced by air filament
Chuan Guo, Kai Li, Zelin Liu, Yuyang Chen, Junyang Xu, Zhou Li, Wenda Cui, Changqing Song, Cong Wang, Xianshi Jia, Ji'an Duan, Kai Han
Opto-Electronic Advances
2025-06-27
Operando monitoring of state of health for lithium battery via fiber optic ultrasound imaging system
Chen Geng, Wang Anqi, Zhang Yi, Zhang Fujun, Xu Dongchen, Liu Yueqi, Zhang Zhi, Yan Zhijun, Li Zhen, Li Hao, Sun Qizhen
Opto-Electronic Science
2025-06-25
Observation of polaronic state assisted sub-bandgap saturable absorption
Li Zhou, Yiduo Wang, Jianlong Kang, Xin Li, Quan Long, Xianming Zhong, Zhihui Chen, Chuanjia Tong, Keqiang Chen, Zi-Lan Deng, Zhengwei Zhang, Chuan-Cun Shu, Yongbo Yuan, Xiang Ni, Si Xiao, Xiangping Li, Yingwei Wang, Jun He
Opto-Electronic Advances
2025-06-19