Pre-trained models for programming languages have recently demonstrated great success on code intelligence. To support both code-related understanding and generation tasks, recent works attempt to pre-train unified encoder-decoder models. However, such encoder-decoder framework is sub-optimal for auto-regressive tasks, especially code completion that requires a decoder-only manner for efficient inference. In this paper, we present UniXcoder, a unified cross-modal pre-trained model for programming language. The model utilizes mask attention matrices with prefix adapters to control the behavior of the model and leverages cross-modal contents like AST and code comment to enhance code representation. To encode AST that is represented as a tree in parallel, we propose a one-to-one mapping method to transform AST in a sequence structure that retains all structural information from the tree. Furthermore, we propose to utilize multi-modal contents to learn representation of code fragment with contrastive learning, and then align representations among programming languages using a cross-modal generation task. We evaluate UniXcoder on five code-related tasks over nine datasets. To further evaluate the performance of code fragment representation, we also construct a dataset for a new task, called zero-shot code-to-code search. Results show that our model achieves state-of-the-art performance on most tasks and analysis reveals that comment and AST can both enhance UniXcoder.
Better Language Models of Code through Self-Improvement
FPT Software AI Center(FPT软件人工智能中心);Fulbright University(富布赖特大学);McGill University(麦吉尔大学);Mila - Quebec AI Institute(米拉-魁北克人工智能研究所);The University of Texas at Dallas(德克萨斯大学达拉斯分校)
Enhance-then-Balance Modality Collaboration for Robust Multimodal Sentiment Analysis
Key Laboratory of Aerospace Information Security and Trusted Computing, Ministry of Education, School of Cyber Science and Engineering, Wuhan University(航天信息安全部门与可信计算教育部重点实验室,网络安全科学与工程学院,武汉大学)
Multi-modal Semantic Understanding with Contrastive Cross-modal Feature Alignment
Peking University(北京大学);School of Software and Microelectronics, Peking University(北京大学软件与微电子学院);School of Computer Science, Peking University(北京大学计算机学院)
Unleashing the Power of Imbalanced Modality Information for Multi-modal Knowledge Graph Completion
Zhejiang University(浙江大学);Ant Group(蚂蚁集团);Alibaba-Zhejiang University Joint Institute of Frontier Technology(阿里巴巴-浙江大学前沿技术联合研究中心);Zhejiang University-Ant Group Joint Laboratory of Knowledge Graph(浙江大学-蚂蚁集团知识图谱联合实验室)