arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2403.07969cs.LGcs.AI
收藏

KnowCoder:将结构化知识编码进大语言模型以实现通用信息抽取

KnowCoder: Coding Structured Knowledge into LLMs for Universal Information Extraction

Institute of Computing Technology, Chinese Academy of Sciences(中国科学院计算技术研究所)
Zixuan Li, Yutao Zeng, Yuxin Zuo, Weicheng Ren, Wenxuan Liu, Miao Su, Yucan Guo, Yantao Liu, Xiang Li, Zhilei Hu, Long Bai, Wei Li, Yidan Liu, Pan Yang, Xiaolon… 展开作者

Zixuan Li, Yutao Zeng, Yuxin Zuo, Weicheng Ren, Wenxuan Liu, Miao Su, Yucan Guo, Yantao Liu, Xiang Li, Zhilei Hu, Long Bai, Wei Li, Yidan Liu, Pan Yang, Xiaolong Jin, Jiafeng Guo, Xueqi Cheng

AI总结:

KnowCoder通过代码生成实现通用信息抽取,利用代码风格模式表示和两阶段学习框架,在少样本、零样本及低资源场景下显著提升性能。

摘要:

在本文中,我们提出了KnowCoder,一种通过代码生成来执行通用信息抽取(UIE)的大语言模型(LLM)。KnowCoder旨在开发一种LLM易于理解的统一模式表示方法,以及一种有效的学习框架,鼓励LLM遵循模式并准确抽取结构化知识。为实现这些目标,KnowCoder引入了一种代码风格的模式表示方法,将不同的模式统一转换为Python类,通过这种方式,诸如UIE中任务间约束等复杂模式信息,可以以LLM友好的方式被捕获。我们进一步构建了一个包含超过30,000种知识类型的代码风格模式库,据我们所知,这是UIE领域最大的模式库。为了简化LLM的学习过程,KnowCoder包含一个两阶段学习框架,通过代码预训练增强其模式理解能力,并通过指令微调增强其模式遵循能力。在约15亿自动构建数据上进行代码预训练后,KnowCoder在少样本设置下已展现出显著的泛化能力,与LLaMA2相比,F1值相对提升了49.8%。经过指令微调后,KnowCoder在未见过的模式上进一步展现出强大的泛化能力,在零样本设置和低资源设置下,与最先进的基线相比,分别实现了高达12.5%和21.9%的提升。此外,基于我们统一的模式表示,各种人工标注的数据集可以同时用于优化KnowCoder,在监督设置下实现了高达7.5%的显著改进。

英文摘要:

In this paper, we propose KnowCoder, a Large Language Model (LLM) to conduct Universal Information Extraction (UIE) via code generation. KnowCoder aims to develop a kind of unified schema representation that LLMs can easily understand and an effective learning framework that encourages LLMs to follow schemas and extract structured knowledge accurately. To achieve these, KnowCoder introduces a code-style schema representation method to uniformly transform different schemas into Python classes, with which complex schema information, such as constraints among tasks in UIE, can be captured in an LLM-friendly manner. We further construct a code-style schema library covering over $\textbf{30,000}$ types of knowledge, which is the largest one for UIE, to the best of our knowledge. To ease the learning process of LLMs, KnowCoder contains a two-phase learning framework that enhances its schema understanding ability via code pretraining and its schema following ability via instruction tuning. After code pretraining on around $1.5$B automatically constructed data, KnowCoder already attains remarkable generalization ability and achieves relative improvements by $\textbf{49.8%}$ F1, compared to LLaMA2, under the few-shot setting. After instruction tuning, KnowCoder further exhibits strong generalization ability on unseen schemas and achieves up to $\textbf{12.5%}$ and $\textbf{21.9%}$, compared to sota baselines, under the zero-shot setting and the low resource setting, respectively. Additionally, based on our unified schema representations, various human-annotated datasets can simultaneously be utilized to refine KnowCoder, which achieves significant improvements up to $\textbf{7.5%}$ under the supervised setting.

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

↑