Skip to main content
QUICK REVIEW

[论文解读] CrossCodeBench: Benchmarking Cross-Task Generalization of Source Code Models

Changan Niu, Chuanyi Li|arXiv (Cornell University)|Feb 8, 2023
Software Engineering ResearchComputer Science被引用 3
一句话总结

本文提出了 CrossCodeBench,一个大规模基准测试,涵盖 28 个类别和 18 种编程语言的 216 项多样化代码相关任务,附带丰富的元信息,包括任务描述、指令以及正/负样本示例。该基准支持对代码模型的跨任务泛化能力进行系统性评估,表明在少量示例和任务指令的上下文学习中,零样本性能在未见过的任务上显著提升,尤其当结合更大规模的模型和多样化的训练任务时效果更佳。

ABSTRACT

Despite the recent advances showing that a model pre-trained on large-scale source code data is able to gain appreciable generalization capability, it still requires a sizeable amount of data on the target task for fine-tuning. And the effectiveness of the model generalization is largely affected by the size and quality of the fine-tuning data, which is detrimental for target tasks with limited or unavailable resources. Therefore, cross-task generalization, with the goal of improving the generalization of the model to unseen tasks that have not been seen before, is of strong research and application value. In this paper, we propose a large-scale benchmark that includes 216 existing code-related tasks. Then, we annotate each task with the corresponding meta information such as task description and instruction, which contains detailed information about the task and a solution guide. This also helps us to easily create a wide variety of ``training/evaluation'' task splits to evaluate the various cross-task generalization capabilities of the model. Then we perform some preliminary experiments to demonstrate that the cross-task generalization of models can be largely improved by in-context learning methods such as few-shot learning and learning from task instructions, which shows the promising prospects of conducting cross-task learning research on our benchmark. We hope that the collection of the datasets and our benchmark will facilitate future work that is not limited to cross-task generalization.

研究动机与目标

  • 通过实现预训练代码模型的跨任务泛化,解决软件工程(SE)任务中标签数据有限的挑战。
  • 通过实现零样本或少样本迁移至未见过的任务,减少对特定任务微调的依赖。
  • 提供一个标准化、多样化且标注完善的基准测试,用于评估和推进代码智能中的跨任务学习。
  • 探究模型规模、数据量和任务多样性对跨任务泛化性能的影响。

提出的方法

  • 作者收集了涵盖 28 个类别、7 种类型和 18 种编程语言的 216 项代码相关任务。
  • 每项任务均经过人工标注,包含详细的元信息,包括任务描述、定义、指令以及正/负样本示例。
  • 该基准支持多种跨任务学习设置,包括少样本学习和从任务指令中学习。
  • 创建了十种不同的训练/评估划分,以评估不同任务类型和数据配置下的各种泛化能力。
  • 采用统一的文本到文本序列到序列框架对所有任务进行形式化,以支持自回归模型的兼容性。
  • 利用基准划分,在零样本和少样本设置下对多种预训练代码模型进行了评估。

实验结果

研究问题

  • RQ1在不进行微调的情况下,预训练代码模型在未见过的代码相关任务上泛化能力如何?
  • RQ2少样本演示和任务指令对多样化代码任务中零样本性能的影响是什么?
  • RQ3哪些源任务的组合能在数据有限的目标任务上实现最佳泛化性能?
  • RQ4模型规模、训练数据量和任务多样性如何影响跨任务泛化?
  • RQ5在跨任务设置下,分类任务的输出约束存在哪些关键限制?

主要发现

  • 所有模型在跨任务设置下的分类任务中表现均较差,即使提供了标签指令,也常因生成无效或未登录词汇的标签而失败。
  • 少样本学习和任务指令提示显著提升了在未见过任务上的性能,表明其在零样本迁移方面具有强大潜力。
  • 跨任务泛化性能因训练期间使用的源任务组合不同而异,表明任务选择对最优迁移至关重要。
  • 更大的模型、更多的训练数据以及更高的任务多样性均有助于提升跨任务泛化性能,提示资源分配中存在权衡。
  • 该基准揭示,检索任务(如代码到代码搜索)无法在文本到文本框架中形式化,限制了其包含。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。