Toward Exploring the Code Understanding Capabilities of Pre-trained Code Generation Models
Recently, large code generation models trained in a self-supervised manner on extensive unlabeled programming language data have achieved remarkable success. While these models acquire vast amounts of code knowledge, they perform poorly on code understanding tasks, such as code search and clone detection, as they are specifically trained for generation. Pre-training a larger encoder-only architecture model from scratch on massive code data can improve understanding performance. However, this approach is costly and time-consuming, making it suboptimal. In this paper, we pioneer the transfer of knowledge from pre-trained code generation models to code understanding tasks, significantly reducing training costs. We examine effective strategies for enabling decoder-only models to acquire robust code representations. Furthermore, we introduce CL4D, a contrastive learning method designed to enhance the representation capabilities of decoder-only models. Comprehensive experiments demonstrate that our approach achieves state-of-the-art performance in understanding tasks such as code search and clone detection. Our analysis shows that our method effectively reduces the distance between semantically identical samples in the representation space. These findings suggest the potential for unifying code understanding and generation tasks using a decoder-only structured model.
Code (0)
등록된 구현이 없습니다.
Tasks
Clone DetectionCode GenerationCode SearchContrastive LearningDecoderMethods 이 논문이 사용한 방법론
Similar Papers 제목 키워드 기반
Is BERT Blind? Exploring the Effect of Vision-and-Language Pretraining on Visual Language Understanding
Most humans use visual imagination to understand and reason about language, but models such as BERT reason about language using knowledge acquired during text-only pretraining. In this work, we investigate whether vision…
Knowledge ProbingLanguage ModellingNatural Language UnderstandingVisual ReasoningOmni-View: Unlocking How Generation Facilitates Understanding in Unified 3D Model based on Multiview images
This paper presents Omni-View, which extends the unified multimodal understanding and generation to 3D scenes based on multiview images, exploring the principle that "generation facilitates understanding". Consisting of …
Novel View SynthesisScene UnderstandingScene GenerationIs Functional Correctness Enough to Evaluate Code Language Models? Exploring Diversity of Generated Codes
Language models (LMs) have exhibited impressive abilities in generating codes from natural language requirements. In this work, we highlight the diversity of code generated by LMs as a critical criterion for evaluating t…
Code GenerationDiversityExploring Pretraining via Active Forgetting for Improving Cross Lingual Transfer for Decoder Language Models
Large Language Models (LLMs) demonstrate exceptional capabilities in a multitude of NLP tasks. However, the efficacy of such models to languages other than English is often limited. Prior works have shown that encoder-on…
Cross-Lingual TransferDecoderStackEval: Benchmarking LLMs in Coding Assistance
We present two comprehensive benchmarks to evaluate the performance of language models in coding assistance tasks, covering code writing, debugging, code review, and conceptual understanding. Our main contribution includ…
Benchmarking