Code search aims to retrieve the code snippet that highly matches the given query described in natural language. Recently, many code pre-training approaches have demonstrated impressive performance on code search. However, existing code search methods still suffer from two performance constraints: inadequate semantic representation and the semantic gap between natural language (NL) and programming language (PL). In this paper, we propose CPLCS, a contrastive prompt learning-based code search method based on the cross-modal interaction mechanism. CPLCS comprises:(1) PL-NL contrastive learning, which learns the semantic matching relationship between PL and NL representations; (2) a prompt learning design for a dual-encoder structure that can alleviate the problem of inadequate semantic representation; (3) a cross-modal interaction mechanism to enhance the fine-grained mapping between NL and PL. We conduct extensive experiments to evaluate the effectiveness of our approach on a real-world dataset across six programming languages. The experiment results demonstrate the efficacy of our approach in improving semantic representation quality and mapping ability between PL and NL.
ConsPrompt: Exploiting Contrastive Samples for Fewshot Prompt Learning
Institute of Information Engineering, Chinese Academy of Sciences(中国科学院信息工程研究所);School of Cyber Security, University of Chinese Academy of Sciences(中国科学院大学网络空间安全学院);Beijing Institute of Technology(北京理工大学);Southeast Academy of Information Technology(东南信息技术研究院)
Human-Centric Topic Modeling with Goal-Prompted Contrastive Learning and Optimal Transport
School of Computer Science, Nanjing University of Posts and Telecommunications(南京邮电大学计算机科学学院);School of Computer Science and Information Engineering, Hefei University of Technology(合肥工业大学计算机科学与信息工程学院);School of Electronic Engineering and Computer Science, Queen Mary University of London(伦敦玛丽女王大学电子工程与计算机科学学院);Department of Engineering Science, University of Oxford(牛津大学工程科学系)
CoCoSoDa: Effective Contrastive Learning for Code Search
Xi’an Jiaotong University(西安交通大学);School of Software Engineering, Sun Yat-sen University(中山大学软件工程学院);The Chinese University of Hong Kong(香港中文大学);Microsoft Research(微软研究院);Chongqing University(重庆大学)
HCVP: Leveraging Hierarchical Contrastive Visual Prompt for Domain Generalization
Mohamed bin Zayed University of Artificial Intelligence(莫扎德·本·扎耶德人工智能大学);University of New South Wales(新南威尔士大学);Carnegie Mellon University(卡内基梅隆大学);University of California, San Diego(加州大学圣地亚哥分校);CSIRO’s Data61(CSIRO数据61);University of Sydney(悉尼大学);Macquarie University(麦考瑞大学)
RAG-based Crowdsourcing Task Decomposition via Masked Contrastive Learning with Prompts
Institute of Automation, Chinese Academy of Sciences(中国科学院自动化研究所);University of Chinese Academy of Sciences(中国科学院大学);Anhui University(安徽大学);Qingdao Academy of Intelligent Industries(青岛智能产业技术研究院);National University of Defense Technology(国防科技大学);Macau University of Science and Technology(澳门科技大学);Chinese Academy of Sciences(中国科学院)
PGCLODA: Prompt-Guided Graph Contrastive Learning for Oligopeptide-Infectious Disease Association Prediction
Institute of Physical Science and Information Technology(物理科学与信息技术研究所);Key Laboratory of Intelligent Computing and Signal Processing of Ministry of Education(教育部智能计算与信号处理重点实验室);School of Artificial Intelligence(人工智能学院)
Contrastive Learning Guided Latent Diffusion Model for Image-to-Image Translation
School of Computer Science and Information Engineering, Hefei University of Technology(合肥工业大学计算机与信息工程学院);Yunnan Key Laboratory of Software Engineering(云南省软件工程重点实验室);School of Computer Science and Engineering, Donghua University(东华大学计算机科学与技术学院);ByteDance(字节跳动);School of Computer and Artificial Intelligence, Zhengzhou University(郑州大学计算机与人工智能学院)
Frequency-Masked Embedding Inference: A Non-Contrastive Approach for Time Series Representation Learning
School of Intelligence Science and Technology, University of Science and Technology Beijing(北京科技大学智能科学与技术学院);Institute of Artificial Intelligence, University of Science and Technology Beijing(北京科技大学人工智能研究院)
Evolutionary Neural Architecture Search with Dual Contrastive Learning
School of Computer Science and Engineering, South China University of Technology, Guangzhou, China.(计算机科学与工程学院,华南理工大学,广州,中国);College of Artificial Intelligence, Nankai University, Tianjin, China.(人工智能学院,南开大学,天津,中国);Hanyang University, 15588 Ansan, South Korea.(翰阳大学,韩国,安山15588)