Recent advances in large-scale code generation models have led to remarkable progress in producing high-quality code. These models are trained in a self-supervised manner on extensive unlabeled code corpora using a decoder-only architecture. However, despite their generative strength, decoder-only models often exhibit limited performance on code understanding tasks such as code search and clone detection, primarily due to their generation-oriented training objectives. While training large encoder-only models from scratch on massive code datasets can improve understanding ability but remains computationally expensive and time-consuming. In this paper, we explore a more efficient alternative by transferring knowledge from pre-trained decoder-only code generation models to code understanding tasks. We investigate how decoder-only architectures can be effectively adapted to learn discriminative and semantically meaningful code representations. To this end, we propose CL4D, a contrastive learning framework tailored to strengthen the representation capabilities of decoder-only models. Extensive experiments on multiple benchmark datasets demonstrate that CL4D achieves competitive or superior performance compared to existing methods on representative code understanding tasks, including code search and clone detection. Further analysis reveals that CL4D substantially improves the semantic alignment of code representations by reducing the distance between semantically similar code snippets. These findings highlight the feasibility of leveraging decoder-only models as a unified backbone for both code generation and understanding.
Multi-level Asymmetric Contrastive Learning for Volumetric Medical Image Segmentation Pre-training
Peking University(北京大学);Peking University Health Science Center(北京大学医学部);National Biomedical Imaging Center(国家生物医学成像中心);Peking University Shenzhen Graduate School(北京大学深圳研究生院);Georgia Institute of Technology(佐治亚理工学院);UT Southwestern Medical Center(西南大学达拉斯医学中心)
Towards Fine-grained Visual Representations by Combining Contrastive Learning with Image Reconstruction and Attention-weighted Pooling
Bayer AG(拜耳股份公司)
本文介绍了对比重建,ConRec -一种自监督学习算法,通过联合优化对比和自重建损失来获得图像表示。我们展示了最先进的对比学习方法(例如Simplified)在其表示中捕获细粒度视觉特征方面存在缺陷。ConRec通过添加(1)自我重建任务和(2)对比学习任务中的注意力机制扩展了Simplified框架。这是通过应用具有两个头的简单编码器-解码器架构来实现的。我们表明,这两个扩展有助于改善图像的矢量表示与细粒度的视觉特征。结合这些概念,ConRec在细粒度分类数据集上的性能优于Simplified和Simplified with Attention-Pooling。
From Dense to Sparse: Contrastive Pruning for Better Pre-trained Language Model Compression
Alibaba(阿里巴巴);Peking University(北京大学)
预训练语言模型(Pre-trained Language Models,PLM)在预训练和微调的范式下在各种自然语言处理(Natural Language Processing,NLP)任务中取得了巨大的成功。PLM具有大量的参数,计算密集型和资源消耗型。因此,模型修剪已被引入到压缩大规模PLM。然而,大多数已有的方法在剪枝时只考虑任务相关的知识,而忽略了任务无关的基本知识,这可能会导致灾难性遗忘问题,从而导致泛化能力差。为了在我们的修剪模型中保持任务不可知和任务特定的知识,我们提出了预训练和微调范式下的主动修剪(CAP)。它被设计为一个通用框架,兼容结构化和非结构化修剪。CAP与对比学习相结合,使修剪后的模型能够从预训练的模型中学习任务不可知的知识,并对任务特定的知识进行微调。此外,为了更好地保持修剪模型的性能,快照(即,在每次修剪迭代的中间模型)也用作修剪的有效监督。我们广泛的实验表明,采用CAP一贯产生显着的改善,特别是在极高的稀疏性的情况下。仅保留3%的模型参数(即,97%稀疏性),CAP成功地实现了99.2%和96.3%的原始BERT性能在QQP和MNLI任务。此外,我们的探测实验表明,CAP修剪的模型倾向于实现更好的泛化能力。
On the duality between contrastive and non-contrastive self-supervised learning
Meta AI - FAIR(Meta人工智能实验室(基础人工智能研究部));Univ Gustave Eiffel(古斯塔夫·埃菲尔大学);CNRS(法国国家科学研究中心);New York University(纽约大学);Inria(法国国家信息与自动化研究所);École normale supérieure(巴黎高等师范学院);PSL Research University(巴黎文理研究大学)
SimCLAD: A Simple Framework for Contrastive Learning of Acronym Disambiguation
College of Electrical and Information Engineering, Hunan University(湖南大学电气与信息工程学院);National Laboratory of Pattern Recognition, Institute of Automation, Chinese Academy Sciences(中国科学院自动化研究所模式识别国家重点实验室);School of Artificial Intelligence, University of Chinese Academy of Sciences(中国科学院大学人工智能学院)