Retrieval-Augmented Code Generation for Universal Information Extraction

Published: 01 Jan 2024, Last Modified: 17 Sept 2025NLPCC (2) 2024EveryoneRevisionsBibTeXCC BY-SA 4.0
Abstract: Information Extraction (IE) aims to extract structural knowledge (e.g., entities, relations, events) from natural language texts. Recently, Large Language Models (LLMs) with code-style prompts have demonstrated powerful capabilities in IE tasks. However, adopting code LLMs to conduct IE tasks still has two challenges: (1) It still lacks a unified code-style prompt for different IE tasks since existing methods use task-specific prompts for separate IE tasks. (2) It still lacks an effective in-context learning (ICL) method to encourage LLMs to conduct IE tasks precisely, considering some powerful LLMs are close-sourced and not trainable. Therefore, this paper proposes a code generation framework for Universal IE (UIE) tasks called Code4UIE. Specifically, for the first challenge, Code4UIE designs a unified code-style schema for various IE tasks via Python classes. By so doing, different IE tasks can be associated, and LLMs can learn from various IE tasks effectively. For the second challenge, Code4UIE adopts a retrieval-augmented mechanism to comprehensively utilize the ICL ability of LLMs. Extensive experiments on five representative IE tasks across nine datasets demonstrate the effectiveness of the Code4UIE framework.
Loading