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
  • Scaling metasurface design: from reusable unit cells to full-metasurface inverse design
  • Eunbi Jang, Jiwan Hong, Ho-Jun Lee, Seokju Choi, Hyewon Suk, Chanik Kang, Sunae So, Haejun Chung
  • Opto-Electronic Science
  • 2026-10-20
  • Ultrafast all-optical biomimetic encoder for spiking neural networks
  • Qijun Bian, Fangchen Hu, Junlian Jia, Aolong Sun, Sizhe Xing, Boyu Dong, An Yan, Ziwei Li, Jianyang Shi, Nan Chi, Junwen Zhang
  • Opto-Electronic Science
  • 2026-10-20
  • Windmill-shaped multi-unit piezoelectric ceramic tuning fork for cooperatively enhanced photoacoustic methane sensing
  • Botao Liu, Guowei Han, Runqiu Wang, Xuan Yang, Haiyue Sun, Shunda Qiao, Ying He, Angelo Sampaolo, Vincenzo Spagnolo, Yufei Ma
  • Opto-Electronic Science
  • 2026-10-20
  • Ultrafast laser direct writing of highly conductive copper micropatterns
  • Songyan Xue, Chunsan Deng, Mingduo Zhang, Huace Hu, Fayu Chen, Leimin Deng, Jianguo Liu, Hui Gao, Wei Xiong
  • Opto-Electronic Manufacturing
  • 2026-09-30
  • Recent advances in fiber-tip integration based on femtosecond laser 3D printing
  • Yuye Xuan, Dezhi Zhu, Dejun Liu, Ying Wang, Yiping Wang, Changrui Liao
  • Opto-Electronic Manufacturing
  • 2026-09-30
  • Neural holography enabled multi-beam steering for multi-task classifier
  • Lin Wu, Mian Wu, Zhen Li, Ying Qiu, Zichen Liu, Yongquan Zeng, Guozhen Liang, Hanbing Li, Guoxing Zheng, Zhixue He, Xi Xiao, Qi Jie Wang, Jin Tao, Shaohua Yu
  • Opto-Electronic Technology
  • 2026-09-30
  • Laser direct writing of nonlinear metasurfaces on phase-change material Ge₂Sb₂Te₅ for enhanced third harmonic generation
  • Lanpeng Guo, Haochong Liu, Shixin Gao, Ming Tang, Minghui Hong, Tun Cao
  • Opto-Electronic Technology
  • 2026-09-30
  • Nearly vertically emitted nonlinear light sources with high efficiencies enabled by high-Q nearly-degenerate polygon modes
  • Chuntao Li, Yingnuo Qiu, Renhong Gao, Lingling Qiao, Jielei Ni, Min Wang, Jintian Lin, Ya Cheng
  • Opto-Electronic Technology
  • 2026-09-30
  • Multiple degrees-of-freedom optical encryption via pixel-resolved vectorial holography
  • Jianzhong Peng, Haoxian Zhou, Mengzhe Shen, Dapeng Wang, Yu Chen, Renlong Zhang, Fangrui Lin, Xiaoyu Weng, Junle Qu
  • Opto-Electronic Technology
  • 2026-09-30
  • Recent progress on mid-infrared and terahertz dual-comb spectroscopy
  • Zhuoren Wan, Min Li, Binbin Liu, Yu Xia, Yuan Chen, Xiuxiu Zhang, Dongxu Zhu, Yan Dai, Sinan Tao, Hua Li, Ming Yan, Heping Zeng
  • Opto-Electronic Technology
  • 2026-09-30
  • Optical packaging of photonic integrated circuits: bottlenecks and potential solutions
  • Rodrigo Rendeiro, Hugo Neto, Diogo Vaz, Carla Rodrigues, Heming Wei, Jan Nedoma, Antonio Teixeira, Francisco Rodrigues, Carlos Marques
  • Opto-Electronic Technology
  • 2026-09-30



  • 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