arXivDaily arXiv每日学术速递 周一至周五更新
​通知:联邦节假日调休:哥伦布日 / 原住民日(Columbus Day / Indigenous Peoples' Day),今日(13日)无更新。
arXiv 2305.07922cs.CLcs.LGcs.PL

CodeT5+:用于代码理解与生成的开放代码大语言模型

CodeT5+: Open Code Large Language Models for Code Understanding and Generation

Salesforce AI Research(Salesforce人工智能研究院)

Yue Wang, Hung Le, Akhilesh Deepak Gotmare, Nghi D. Q. Bui, Junnan Li, Steven C. H. Hoi

AI总结:

针对现有代码LLMs架构与预训练任务的局限性,提出CodeT5+模型,采用灵活组合的编码器-解码器模块与混合预训练目标,结合冻结LLM初始化与指令微调,在20多个基准上取得SOTA性能。

摘要:

在海量源代码上预训练的大语言模型(LLMs)在代码智能领域取得了显著进展。然而,现有的代码LLMs在架构和预训练任务方面存在两个主要局限性。首先,它们通常采用特定架构(仅编码器或仅解码器),或依赖统一的编码器-解码器网络来处理不同的下游任务。前一种范式在应用中缺乏灵活性,而后一种将模型视为处理所有任务的单一系统,导致在部分任务上性能欠佳。其次,它们通常采用有限的预训练目标集,这些目标可能与某些下游任务不相关,从而导致性能大幅下降。为了解决这些局限性,我们提出了“CodeT5+”,一个用于代码的编码器-解码器LLMs家族,其中组件模块可以灵活组合以适应广泛的下游代码任务。这种灵活性是通过我们提出的混合预训练目标来实现的,以缓解预训练与微调之间的差异。这些目标涵盖单模态和双模态多语言代码语料库上的跨度去噪、对比学习、文本-代码匹配和因果LM预训练任务。此外,我们提出使用冻结的现成LLMs初始化CodeT5+,无需从零开始训练以高效扩展模型,并探索指令微调以与自然语言指令对齐。我们在不同设置下的20多个代码相关基准上广泛评估了CodeT5+,包括零样本、微调和指令微调。我们观察到在各种代码相关任务上取得了最先进的模型性能,如代码生成与补全、数学编程和文本到代码检索任务。特别是,我们经过指令微调的CodeT5+ 16B在HumanEval代码生成任务上取得了优于其他开放代码LLMs的新SoTA结果。

英文摘要:

Large language models (LLMs) pretrained on vast source code have achieved prominent progress in code intelligence. However, existing code LLMs have two main limitations in terms of architecture and pretraining tasks. First, they often adopt a specific architecture (encoder-only or decoder-only) or rely on a unified encoder-decoder network for different downstream tasks. The former paradigm is limited by inflexibility in applications while in the latter, the model is treated as a single system for all tasks, leading to suboptimal performance on a subset of tasks. Secondly, they often employ a limited set of pretraining objectives which might not be relevant to some downstream tasks and hence result in substantial performance degrade. To address these limitations, we propose ``CodeT5+'', a family of encoder-decoder LLMs for code in which component modules can be flexibly combined to suit a wide range of downstream code tasks. Such flexibility is enabled by our proposed mixture of pretraining objectives to mitigate the pretrain-finetune discrepancy. These objectives cover span denoising, contrastive learning, text-code matching, and causal LM pretraining tasks, on both unimodal and bimodal multilingual code corpora. Furthermore, we propose to initialize CodeT5+ with frozen off-the-shelf LLMs without training from scratch to efficiently scale up our models, and explore instruction-tuning to align with natural language instructions. We extensively evaluate CodeT5+ on over 20 code-related benchmarks in different settings, including zero-shot, finetuning, and instruction-tuning. We observe state-of-the-art (SoTA) model performance on various code-related tasks, such as code generation and completion, math programming, and text-to-code retrieval tasks. Particularly, our instruction-tuned CodeT5+ 16B achieves new SoTA results on HumanEval code generation task against other open code LLMs.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑