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
  • Ppt-level volatile organic compounds detection via microsecond-pulse-enhanced mid-infrared photoacoustic
  • Senyu Wang, Liang Zhao, Hongyu Luo, Xiangyu Zhao, Jianfeng Li, Wei Wang, Hao Lei, Mingrui Jiang, Jinlong Wan, Binxing Zhao, Bincheng Li, Yong Liu
  • Opto-Electronic Science
  • 2026-04-23
  • Polarization-guided diffusion prior for eyeglass reflection removal
  • Yating Chen, Liangcai Cao
  • Opto-Electronic Advances
  • 2026-04-17
  • AI-assisted metaphotonics
  • Minsung Kang, Seokju Choi, Kaixi Fu, Xiaoyuan Liu, Zhun Wei, Lei Jin, Hao Wang, Olivier J. F. Martin, Joel K. W. Yang, Sunae So, Trevon Badloe
  • Opto-Electronic Advances
  • 2026-04-17
  • Terahertz imaging technology: progress and applications
  • Yuyuan Tian, Xiaoyin Chen, Zhuocheng Zhang, Qianze Yan, Yiming Liu, Chengliang Deng, Min Wan, Jiang Li, Xiaoqiuyan Zhang, Lu Rong, Elizaveta Tsiplakova, Nikolay Petrov, Xinke Wang, Liguo Zhu, Min Hu, Yan Zhang
  • Opto-Electronic Technology
  • 2026-03-30
  • Interpretable low-dose CT enhancement via multi-Gaussian cluster variance reduction
  • Xiaofeng Zhang, Yilan Zhu, Yongsheng Huang, Jielong Yang, Zhili Wang, Kai Zhang, Si Chen, Linbo Liu, Xin Ge
  • Opto-Electronic Science
  • 2026-03-25
  • Polygonal generalized perfect spatiotemporal optical vortices
  • Shuoshuo Zhang, Zhangyu Zhou, Qianyi Wei, Zhongsheng Man, Changjun Min, Wending Zhang, Yuquan Zhang, Ting Mei, Xiaocong Yuan
  • Opto-Electronic Science
  • 2026-03-25
  • Perovskite nanocrystals in glass for high efficiency and ultra-high resolution dynamic holographic multicolor display
  • Chao Ruan, Xinkuo Li, Ke Sun, Jianrong Qiu, Dezhi Tan
  • Opto-Electronic Advances
  • 2026-03-25
  • Pixelated BIC metasurfaces for terahertz integrated sensing and imaging
  • Zhanqiang Xue, Guizhen Xu, Junliang Chen, Junxing Fan, Hongyang Xing, Ye Zhou, Longqing Cong
  • Opto-Electronic Advances
  • 2026-03-25
  • Overcoming challenges in InP-based quantum dots: from nucleation mechanisms to high-performance quantum dot light-emitting diodes
  • Yangyang Bian, Qian Li, Fei Chen, Chunhe Yang, Huaibin Shen, Aiwei Tang
  • Opto-Electronic Advances
  • 2026-03-25
  • Emerging landscape of photonic bound states in the continuum for next-generation metadevices
  • Thi Thu Ha Do, Ronghui Lin, Daniil A. Shilkin, Zhiyi Yuan, Cuong Dang, Arseniy I. Kuznetsov, Jinghua Teng, Son Tung Ha
  • Opto-Electronic Advances
  • 2026-03-25
  • A 4096-element 3D-integrated Si-SiN optical phased array for high-power coherent LiDAR
  • Han Wang, Weimin Xie, Xin Yan, Jiaqi Li, Youxi Lu, Ping Jiang, Feng Li, Kai Jin, Xu Yang, Jiali Jiang, Keran Deng, Weishuai Chen, Jing Luo, Li Jin, Junbo Feng, Kai Wei
  • Opto-Electronic Technology
  • 2026-03-20



  • 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