CodeUpdateArena
收藏资源简介:
CodeUpdateArena数据集由德克萨斯大学奥斯汀分校开发,专注于评估大型语言模型在代码合成领域的知识编辑能力。该数据集包含670个程序合成任务,涉及54个函数从7个不同的Python包中的更新。数据集通过GPT-4生成,确保了合成API更新的原子性和可执行性。创建过程中,每个更新都配有一系列程序合成示例,这些示例的设计旨在促使模型使用更新后的API功能。CodeUpdateArena主要应用于评估和提升代码生成模型对API更新的适应性和准确性。
Developed by The University of Texas at Austin, the CodeUpdateArena dataset focuses on evaluating the knowledge editing capabilities of large language models (LLMs) in the domain of code synthesis. This dataset comprises 670 program synthesis tasks, involving updates to 54 functions across 7 distinct Python packages. It was constructed using GPT-4, which guarantees the atomicity and executability of the synthesized API updates. During the dataset creation process, each update is paired with a series of program synthesis examples tailored to prompt models to leverage the functionalities of the updated APIs. CodeUpdateArena is primarily utilized to evaluate and improve the adaptability and accuracy of code generation models in response to API updates.
CodeUpdateArena: Benchmarking Knowledge Editing on API Updates
数据集描述
目标
该数据集的目标是更新大型语言模型(LLM)关于代码API的更新,并能够在不提供更新文档的情况下解决相关的程序合成示例。
内容
- 数据集类型:包含54个来自7个不同Python包的虚构且可执行的函数更新。
- 数据实例:每个虚构的API函数更新与至少3个可执行的程序合成示例配对。
访问
数据集可通过HuggingFace的datasets库加载:
python
from datasets import load_dataset
ds = load_dataset("leo-liuzy/CodeUpdateArena")
实验设置
实验脚本
提供了多种实验脚本,用于运行不同的知识编辑基线:
-
Prepending:将
[Update]、[Task]和[Test]作为输入,不更新模型参数,仅在上下文中学习更新。 bash bash scripts/prepend.sh -
FT (U):在
[Update]上进行微调,测试输入为[Task]+[Test]。 bash bash scripts/ft_u.sh -
FT (PS):在
[Task]+[Test]上进行监督微调。 bash bash scripts/ft_ps.sh -
FT (U+PS):类似于FT(PS),但在上下文中预置了更新文档。 bash bash scripts/ft_ups.sh
特殊实验
-
Specificity:测试模型是否过度拟合于特定的
[Update],通过测量模型在固定样本上的性能差异。 bash bash scripts/specificity.sh -
Random-FT:在其他随机更新的程序合成示例上进行微调,以理解模型在微调过程中实际学到的内容。 bash bash scripts/rand_ft.sh
数据集生成
生成流程
提供了数据集生成的核心脚本,包括manager_update.py和manager_prog_syn.py,分别用于生成更新和程序合成示例。
去重
包含了自动去重重程序合成示例的核心代码auto-dedup.py。




