Year
Month
(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.
CLSEBERT: Contrastive Learning for Syntax Enhanced Code Pre-Trained Model_1
CLSEBERT: Contrastive Learning for Syntax Enhanced Code Pre-Trained Model_2
CLSEBERT: Contrastive Learning for Syntax Enhanced Code Pre-Trained Model_3
CLSEBERT: Contrastive Learning for Syntax Enhanced Code Pre-Trained Model_4
  • Cavity-assisted nonlocal metasurfaces for momentum-space broadband-operational optical vortice generation with maximum efficiency approaching 80%
  • Keren Wang, Kaili Sun, Jing Du, Peijuan Dai, Hao Zhou, Lujun Huang, Zhanghua Han, Wei Wang
  • Opto-Electronic Advances
  • 2026-07-10
  • Instantaneous UAV tracking using single-photon LiDAR via photon-event-driven suppression of temporal-averaging bias
  • Dongfang Guo, Jianfeng Sun, Xin Zhou, Chen Shen, Sheng Chen, Sining Li, Yanchen Qu
  • Opto-Electronic Technology
  • 2026-06-28
  • Biological testing with terahertz focal-plane imaging based on a slot metamaterial sensor
  • Chen Zhang, Xinke Wang, Zehao He, Shuanglin Yue, Baogang Quan, Huan Zhao, Yan Zhang
  • Opto-Electronic Technology
  • 2026-06-28
  • Scattering media as random micro-phase-pinhole arrays for incoherent information transmission
  • Xuyu Zhang, Haoran Li, Tianting Zhong, Dawei Zhang, Songlin Zhuang, Shensheng Han, Puxiang Lai, Honglin Liu
  • Opto-Electronic Technology
  • 2026-06-28
  • Entropy-loaded digital subcarrier multiplexing transmission adaptive to the loss-spectrum ripples of hollow-core fiber
  • Hailin Yang, Meng Xiang, Cong Zhang, Lipeng Feng, Peng Li, Lei Zhang, Jie Luo, Jianping Li, Songnian Fu, Yuwen Qin
  • Opto-Electronic Technology
  • 2026-06-28
  • Integrated optical transceivers: architectures, key technologies, and applications
  • Peng Yan, Yunhao Zhang, Yuansheng Tao, Lei Wang, Haowen Shu, Xingjun Wang
  • Opto-Electronic Technology
  • 2026-06-28
  • AI-enabled electromagnetic metasurfaces for wireless communication and invisibility cloak
  • Fan Zhang, Jiwei Zhao, Huan Lu, Guixi Mei, Ruikai Hu, Bin Zheng, Hongsheng Chen
  • Opto-Electronic Technology
  • 2026-06-28
  • Breaking the speed-resolution trade-off in 3.3-km non-line-of-sight imaging using scanning-free laser reflective tomography
  • Zewei Wang, Xiaoyin Li, Yinghui Guo, Hengshuo Guo, Peng Yang, Fei Zhang, Mingbo Pu, Mingfeng Xu, Xiangang Luo
  • Opto-Electronic Science
  • 2026-06-17
  • Highly sensitive DUV-SWIR photodetectors by natural flavonoid-derivative isomers through a multisite chelation strategy
  • Nan Ding, Donggang Li, Mingyu Yao, Yanqi Liu, Hailong Liu, Guoqiang Fang, Ge Zhu, Xiaodong Li, Wen Xu, Bin Dong
  • Opto-Electronic Science
  • 2026-06-17
  • Triplet exciton harvesting via TADF in hafnium chlorides array scintillator screen enables ultrahigh-resolution X-ray imaging
  • Jun'an Lai, Yi Ye, Xu Liu, Sijun Cao, Shiji Zhou, Wenxia Zhang, Kang An, Peng He, Tingming Jiang, Xiaosheng Tang, Rui Zhou, Dong Zhang
  • Opto-Electronic Advances
  • 2026-06-08
  • Vacancy oscillating mode in amorphous binary oxide film by terahertz time domain spectroscopy
  • Huan Liu, Haiyun Huang, Heng Yu, Zhi Gong, Fei Yu, Zheng Zhang, Zhiyong Tan, Juncheng Cao, Haiyun Liu, Kan-Hao Xue, Xiangshui Miao, Yan Liu, Yue Hao, Genquan Han, Qihua Xiong
  • Opto-Electronic Advances
  • 2026-06-08



  • Grassland: A Rapid Algebraic Modeling System for Million-variable Optimization                                China's Technology Cooperation with Russia: Geopolitics, Economics, and Regime Security
    About
    |
    Contact
    |
    Copyright © PubCard