arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2303.09128cs.CLcs.LGcs.SE
收藏

探索代码分析大型语言模型中的分布偏移

Exploring Distributional Shifts in Large Language Models for Code Analysis

University of Southern California(南加州大学);IIT, Delhi(德里印度理工学院);MBZUAI(穆罕默德·本·扎耶德人工智能大学);Microsoft Azure AI(微软Azure人工智能)

Shushan Arakelyan, Rocktim Jyoti Das, Yi Mao, Xiang Ren

AI总结:

本文研究CodeT5、Codex和ChatGPT在代码摘要与生成中的跨领域分布偏移,提出多任务学习结合检索示例少样本微调,并扩展至多领域联合适应。

摘要:

我们系统研究了三个具备代码能力的大型语言模型——CodeT5、Codex和ChatGPT——如何泛化到域外数据。我们考虑两个基础应用:代码摘要和代码生成。我们按照数据的自然边界将其划分为不同领域,即按组织、按项目以及按软件项目内的模块划分。我们证实,来自每个新领域的样本都会给所有模型带来显著的分布偏移挑战。我们研究了既有方法如何调整模型,使其更好地泛化到新领域。实验表明,虽然单独使用多任务学习是一个合理的基线,但将其与基于从训练数据中检索的示例进行少样本微调相结合,可以取得非常强的性能。此外,在极低数据场景下,该解决方案可以优于直接微调。最后,我们考虑该方法的变体,以创建一种可更广泛适用、能够同时适应多个领域的方法。我们发现,对于代码生成,同时适应多个领域的模型表现与适应单一领域的模型相当。

英文摘要:

We systematically study how three large language models with code capabilities - CodeT5, Codex, and ChatGPT - generalize to out-of-domain data. We consider two fundamental applications - code summarization, and code generation. We split data into domains following its natural boundaries - by an organization, by a project, and by a module within the software project. We establish that samples from each new domain present all the models with a significant challenge of distribution shift. We study how established methods adapt models to better generalize to new domains. Our experiments show that while multitask learning alone is a reasonable baseline, combining it with few-shot finetuning on examples retrieved from training data can achieve very strong performance. Moreover, this solution can outperform direct finetuning for very low-data scenarios. Finally, we consider variations of this approach to create a more broadly applicable method to adapt to multiple domains at once. We find that for code generation, a model adapted to multiple domains simultaneously performs on par with those adapted to a single domain

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

↑