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
  • Pixel-controlled programmable metasurface as phase-type spatial terahertz modulator
  • Guibin Li, Guanyi Li, Zehao He, Xinke Wang, Peter J. Klar, He Ma, Yan Zhang
  • Opto-Electronic Advances
  • 2026-09-15
  • Spatiotemporal beam stirring in a multicore fiber
  • Alena Y. Kolesnikova, Mikhail D. Gervaziev, Nikita V. Bochkarev, Denis S. Kharenko, Evgeniy V. Podivilov, Sergey A. Babin
  • Opto-Electronic Advances
  • 2026-09-15
  • Ultrafast all-optical modulation of wide-bandwidth pulses enabled by silicon-metasurfaces
  • Kaloyan Georgiev, Khosro Zangeneh Kamali, Anton A. Trifonov, Giulia Crotti, Lyuben Petrov, Stefan Georgiev, Hristo Iliev, Lei Xu, Unai Arregui Leon, Mohsen Rahmani, Giuseppe Della Valle, Ivan Buchvarov, Dragomir Neshev
  • Opto-Electronic Advances
  • 2026-09-15
  • Physics-informed neural fields enable blind aberration correction for partially coherent quantitative phase imaging
  • Shun Zhou, Xingyu Huang, Linpeng Lu, Habib Ullah, Kaiyu Du, Maciej Trusiak, Malgorzata Kujawinska, Yuzhen Zhang, Yao Fan, Qian Chen, Qinrong Zhang, Chao Zuo
  • Opto-Electronic Science
  • 2026-08-26
  • Programmable directional photonic spiking neuron based on a non-Hermitian silicon microresonator
  • Stefano Biasi, Bülent Aslan, Stefano Gretter, Davide Olivieri, Alessandro Foradori, Riccardo Franchi, Lorenzo Pavesi
  • Opto-Electronic Science
  • 2026-08-26
  • Mutual empowerment of artificial intelligence and metasurfaces: intelligent nanophotonics and optical intelligence
  • Yu Zhao, Zile Li, Yongquan Zeng, Shaohua Yu, Guoxing Zheng
  • Opto-Electronic Science
  • 2026-08-26
  • Heterogeneously integrated micro-ring with SnS₂ for dual-functional optical modulation and photodetection
  • Jinyi Du, Lidan Lu, Xu Zhang, Bofei Zhu, Wenbo Bo, Yingjie Xu, Guang Chen, Yanlin He, Guanghui Ren, Xiaoping Lou, Zheng You, Lianqing Zhu
  • Opto-Electronic Advances
  • 2026-08-25
  • Hardware-aware lightweight photonic spiking neural network for pattern classification
  • Shuiying Xiang, Yahui Zhang, Shangxuan Shi, Haowen Zhao, Dianzhuang Zheng, Xingxing Guo, Yanan Han, Ye Tian, Liyue Zhang, Yuechun Shi, Yue Hao
  • Opto-Electronic Advances
  • 2026-08-25
  • PhyspeNet: An empirical physics-aware network for adaptive speckle reconstructive spectrometry
  • Junrui Liang, Min Jiang, Jun Li, Zhongming Huang, Junhong He, Yanting Guo, Yanzhao Ke, Jun Ye, Jiangming Xu, Jinyong Leng, Pu Zhou
  • Opto-Electronic Advances
  • 2026-08-25
  • Video-rate wavefront capture and replay via single-shot reference-free measurement: toward holographic telepresence
  • Minwook Kim, Chansuk Park, Chulmin Oh, KyeoReh Lee, Herve Hugonnet, YongKeun Park
  • Opto-Electronic Advances
  • 2026-08-25
  • Luminescent YAG:Ce³⁺ 3D micro-structures via multi-photon laser lithography
  • Robertas Virkėtis, Greta Merkininkaitė, Artūr Harnik, Ugnė Ūsaitė, Dominykas Dapšys, Arturo Susarrey-Arce, Simas Šakirzanovas, Mangirdas Malinauskas
  • Opto-Electronic Advances
  • 2026-08-25
  • A 36 × 240 Gbps hybrid mode/wavelength division multiplexing transmitter using lithium niobate on insulator
  • Mingyu Zhu, Weihan Wang, Ruitao Ma, Aoyun Gao, Chun Gao, Zexu Wang, Fei Huang, Zhenyuan Bao, Dajian Liu, Jiaxuan Gan, Zejie Yu, Huan Li, Weike Zhao, Daoxin Dai
  • Opto-Electronic Advances
  • 2026-08-25



  • 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