KnowCoder: Coding Structured Knowledge into LLMs for Universal Information Extraction
Zixuan Li, Yutao Zeng, Yuxin Zuo, Weicheng Ren, Wenxuan Liu, Miao Su, Yucan Guo, Yantao Liu, Xiang Li, Zhilei Hu, Long Bai, Wei Li
Abstract
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 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 twophase 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.5B automatically constructed data, Know-Coder already attains remarkable generalization ability and achieves relative improvements by 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 12.5% and 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 7.5% under the supervised setting.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
11 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- GoLLIE: Annotation Guidelines improve Zero-Shot Information-Extraction cites LoRA: Low-Rank Adaptation of Large Language Models
- GoLLIE: Annotation Guidelines improve Zero-Shot Information-Extraction cites CrossNER: Evaluating Cross-Domain Named Entity Recognition
- GoLLIE: Annotation Guidelines improve Zero-Shot Information-Extraction cites A Joint Neural Model for Information Extraction with Global Features
- Zero-Shot Learning for Materials Science Texts: Leveraging Duck Typing Principles cites GoLLIE: Annotation Guidelines improve Zero-Shot Information-Extraction
- NOTAM-Evolve: A Knowledge-Guided Self-Evolving Optimization Framework with LLMs for NOTAM Interpretation cites GoLLIE: Annotation Guidelines improve Zero-Shot Information-Extraction
- DiCoRe: Enhancing Zero-shot Event Detection via Divergent-Convergent LLM Reasoning cites GoLLIE: Annotation Guidelines improve Zero-Shot Information-Extraction
- DiCoRe: Enhancing Zero-shot Event Detection via Divergent-Convergent LLM Reasoning cites Training language models to follow instructions with human feedback
- Multi-level Association Refinement Network for Dialogue Aspect-based Sentiment Quadruple Analysis cites GoLLIE: Annotation Guidelines improve Zero-Shot Information-Extraction
- Multi-level Association Refinement Network for Dialogue Aspect-based Sentiment Quadruple Analysis cites LoRA: Low-Rank Adaptation of Large Language Models
Cited by top-tier papers11
- Unlocking the Power of Large Language Models for Entity AlignmentXuhui Jiang, Yinghan Shen, Zhichao Shi, Chengjin Xu et al.ACL 2024 · 17 citations
- Multi-level Association Refinement Network for Dialogue Aspect-based Sentiment Quadruple AnalysisZeliang Tong, Wei Wei, Xiaoye Qu, Rikui Huang et al.ACL 2025 · 2 citations
- Zero-Shot Learning for Materials Science Texts: Leveraging Duck Typing PrinciplesXin Zhang, Peiliang Zhang, Jingling Yuan, Lin LiAAAI 2025 · 1 citation
- NOTAM-Evolve: A Knowledge-Guided Self-Evolving Optimization Framework with LLMs for NOTAM InterpretationMaoqi Liu, Quan Fang, Yuhao Wu, Can Zhao et al.AAAI 2026 · 1 citation
- DiCoRe: Enhancing Zero-shot Event Detection via Divergent-Convergent LLM ReasoningTanmay Parekh, Kartik Mehta, Ninareh Mehrabi, Kai-Wei Chang et al.EMNLP 2025 · 1 citation
Builds on11
- Training language models to follow instructions with human feedbackLong Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida et al.NeurIPS 2022 · 24,707 citations
- LoRA: Low-Rank Adaptation of Large Language ModelsEdward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu et al.ICLR 2022 · 18,833 citations
- A Joint Neural Model for Information Extraction with Global FeaturesYing Lin, Heng Ji, Fei Huang, Lingfei WuACL 2020 · 376 citations
- CrossNER: Evaluating Cross-Domain Named Entity RecognitionZihan Liu, Yan Xu, Tiezheng Yu, Wenliang Dai et al.AAAI 2021 · 201 citations
- GoLLIE: Annotation Guidelines improve Zero-Shot Information-ExtractionOscar Sainz, Iker García-Ferrero, Rodrigo Agerri, Oier Lopez de Lacalle et al.ICLR 2024 · 168 citations
Related papers
- KnowCoder-X: Boosting Multilingual Information Extraction via CodeYuxin Zuo, Wenxuan Jiang, Wenxuan Liu, Zixuan Li et al.ACL Findings 2025 · 5 citations
- WaveCoder: Widespread And Versatile Enhancement For Code Large Language Models By Instruction TuningZhaojian Yu, Xin Zhang, Ning Shang, Yangyu Huang et al.ACL 2024
- CodeIE: Large Code Generation Models are Better Few-Shot Information ExtractorsPeng Li, Tianxiang Sun, Qiong Tang, Hang Yan et al.ACL 2023 · 41 citations
- Unified Structure Generation for Universal Information ExtractionYaojie Lu, Qing Liu, Dai Dai, Xinyan Xiao et al.ACL 2022
- Capability Decomposition for Unified Information Extraction via Hierarchical Mixture-of-ExpertsJing Zhou, Peng Wang, Wenjun Ke, Jiajun Liu et al.ACL 2026
