VersiCode

评测集介绍

Introduction

VersiCode 是一个专门用于评估大模型在特定版本库中生成可验证代码能力的评测数据集。该数据集涵盖了超过 300 个不同的依赖库,涉及 2000 多种版本。VersiCode 设计了两种代码生成任务:版本限定的代码补全和版本感知的代码迁移,任务跨越三种不同的粒度,包括 token 级、line 级和block级。本次评测采用 block-level 的代码补全任务,评测指标为 ISM@1。

ISM@1 表示在生成1个独立样本的情况下,模型生成的代码序列与真实代码序列在标识符(如变量名、函数名等)上的匹配程度。

任务定义:根据自然语言描述和限定的版本号,生成符合目标版本的代码块。

Meta Data

dependency:目标依赖

version:依赖版本

time:发布时间

description:针对代码功能的描述

code:目标代码

masked_code:带有<masked_code>的代码块

masked_line:被<masked_code>替换的部分

answer: 该版本发生演化的API

type:该API发生演化的类型

granularity:代码粒度

  {
        “dependency”: “accelerate”,
        “version”: “==0.20.0”,
        “time”: “2023-06-07”,
        “description”: “This code splits a list of elements between two processes and prints the inputs assigned to each process. The second split includes padding the inputs to make the assignment equal.”,
        “code”: “# Assume there are two processes\nfrom accelerate import PartialState\n\nstate = PartialState()\nwith state.split_between_processes([\”A\”, \”B\”, \”C\”]) as inputs:\n print(inputs)\n# Process 0\n[\”A\”, \”B\”]\n# Process 1\n[\”C\”]\n\nwith state.split_between_processes([\”A\”, \”B\”, \”C\”], apply_padding=True) as inputs:\n print(inputs)\n# Process 0\n[\”A\”, \”B\”]\n# Process 1\n[\”C\”, \”C\”]\n”,
        “masked_code”: “# Assume there are two processes\nfrom accelerate import PartialState\n\nstate = PartialState()\nwith state.split_between_processes([\”A\”, \”B\”, \”C\”]) as inputs:\n print(inputs)\n# Process 0\n[\”A\”, \”B\”]\n# Process 1\n[\”C\”]\n\n<mask>\n print(inputs)\n# Process 0\n[\”A\”, \”B\”]\n# Process 1\n[\”C\”, \”C\”]\n”,
        “masked_line”: “with state.split_between_processes([\”A\”, \”B\”, \”C\”], apply_padding=True) as inputs:”,
        “answer”: “split_between_processes”,
        “type”: “add”,
        “granularity”: “block”,
        “language”: “python”,
        “task”: “code_completion”,
        “source”: “docstring”,
        “id”: “docstring_19”,
  },