{"about":{"non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","site":"https://codewithpapers.app","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page","syntology":{"site":"https://syntology.ai","developers":"https://syntology.ai/developers","mcp":{"server":"https://syntology.ai/mcp","transport":"streamable-http","server_card":"https://syntology.ai/.well-known/mcp/server-card.json","auth":{"type":"trial token, no account","trial_token":"https://syntology.ai/api/oauth/trial/token","method":"POST","docs":"https://syntology.ai/developers"}},"have":"https://syntology.ai/api/graph/have?x=<method, arXiv id or title> (free, answers coverage only)","paper_base":"https://syntology.ai/paper/","atlas_base":"https://app.syntology.ai/?focus="},"machine_readable":[{"url":"https://codewithpapers.app/llms.txt","what":"the machine catalog: every machine-readable file, counted"},{"url":"https://codewithpapers.app/index/manifest.json","what":"paper-to-code index by arXiv id, with Syntology's counts"},{"url":"https://codewithpapers.app/search/manifest.json","what":"site search index (titles, authors) and its files"},{"url":"https://codewithpapers.app/download","what":"bulk files: Syntology's layer, described there"},{"url":"https://codewithpapers.app/build_manifest.json","what":"the build record: inputs, counts, exclusions, probes"}]},"url":"/paper/knowcoder-coding-structured-knowledge-into","title":"KnowCoder: Coding Structured Knowledge into LLMs for Universal Information Extraction","arxiv_id":"2403.07969","date":"2024-03-12","proceeding":null,"authors":["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"],"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 $\\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.","url_abs":"https://arxiv.org/abs/2403.07969v2","url_pdf":"https://arxiv.org/pdf/2403.07969v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"knowcoder-coding-structured-knowledge-into","repo_url":"https://github.com/ICT-GoKnow/KnowCoder","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"NOASSERTION"}}],"tasks":[{"task_slug":"code-generation","task_name":"Code Generation"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"large-language-model","task_name":"Large Language Model"},{"task_slug":"uie","task_name":"UIE"}],"methods":[{"method_slug":null,"method_name":"Library"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/uie-on-ace-2004","task":"UIE","dataset":"ACE 2004","model":"KnowCoder-7b-IE","rank_in_archive_order":1,"of":1,"metrics":{"F1 score":"86.2"},"uses_additional_data":false},{"leaderboard":"/sota/uie-on-ace-2005-eae","task":"UIE","dataset":"ACE 2005-EAE","model":"KnowCoder-7b-IE","rank_in_archive_order":1,"of":1,"metrics":{"F1 score":"70.3"},"uses_additional_data":false},{"leaderboard":"/sota/uie-on-ace-2005-ed","task":"UIE","dataset":"ACE 2005-ED","model":"KnowCoder-7b-IE","rank_in_archive_order":1,"of":1,"metrics":{"F1 score":"74.2"},"uses_additional_data":false},{"leaderboard":"/sota/uie-on-ace-2005-ner","task":"UIE","dataset":"ACE 2005-NER","model":"KnowCoder-7b-IE","rank_in_archive_order":1,"of":1,"metrics":{"F1 score":"86.1"},"uses_additional_data":false},{"leaderboard":"/sota/uie-on-ace-2005-re","task":"UIE","dataset":"ACE 2005-RE","model":"KnowCoder-7b-IE","rank_in_archive_order":1,"of":1,"metrics":{"F1 score":"64.5"},"uses_additional_data":false},{"leaderboard":"/sota/uie-on-ade-corpus","task":"UIE","dataset":"ADE Corpus","model":"KnowCoder-7b-IE","rank_in_archive_order":1,"of":1,"metrics":{"F1 score":"84.3"},"uses_additional_data":false},{"leaderboard":"/sota/uie-on-anatem","task":"UIE","dataset":"AnatEM","model":"KnowCoder-7b-IE","rank_in_archive_order":1,"of":1,"metrics":{"F1 score":"86.4"},"uses_additional_data":false},{"leaderboard":"/sota/uie-on-bc2gm","task":"UIE","dataset":"BC2GM","model":"KnowCoder-7b-IE","rank_in_archive_order":1,"of":1,"metrics":{"F1 score":"82.0"},"uses_additional_data":false},{"leaderboard":"/sota/uie-on-bc5cdr","task":"UIE","dataset":"BC5CDR","model":"KnowCoder-7b-IE","rank_in_archive_order":1,"of":1,"metrics":{"F1 score":"89.3"},"uses_additional_data":false},{"leaderboard":"/sota/uie-on-broad-twitter","task":"UIE","dataset":"Broad Twitter","model":"KnowCoder-7b-IE","rank_in_archive_order":1,"of":1,"metrics":{"F1 score":"78.3"},"uses_additional_data":false},{"leaderboard":"/sota/uie-on-conll-2003","task":"UIE","dataset":"CoNLL 2003","model":"KnowCoder-7b-IE","rank_in_archive_order":1,"of":1,"metrics":{"F1 score":"95.1"},"uses_additional_data":false},{"leaderboard":"/sota/uie-on-conll-2004","task":"UIE","dataset":"CoNLL 2004","model":"KnowCoder-7b-IE","rank_in_archive_order":1,"of":1,"metrics":{"F1 score":"73.3"},"uses_additional_data":false},{"leaderboard":"/sota/uie-on-diann","task":"UIE","dataset":"DIANN","model":"KnowCoder-7b-IE","rank_in_archive_order":1,"of":1,"metrics":{"F1 score":"94.7"},"uses_additional_data":false},{"leaderboard":"/sota/uie-on-fabner","task":"UIE","dataset":"FabNER","model":"KnowCoder-7b-IE","rank_in_archive_order":1,"of":1,"metrics":{"F1 score":"82.9"},"uses_additional_data":false},{"leaderboard":"/sota/uie-on-findvehicle","task":"UIE","dataset":"FindVehicle","model":"KnowCoder-7b-IE","rank_in_archive_order":1,"of":1,"metrics":{"F1 score":"99.4"},"uses_additional_data":false},{"leaderboard":"/sota/uie-on-genia","task":"UIE","dataset":"GENIA","model":"KnowCoder-7b-IE","rank_in_archive_order":1,"of":1,"metrics":{"F1 score":"76.7"},"uses_additional_data":false},{"leaderboard":"/sota/uie-on-gids","task":"UIE","dataset":"GIDS","model":"KnowCoder-7b-IE","rank_in_archive_order":1,"of":1,"metrics":{"F1 score":"78.0"},"uses_additional_data":false},{"leaderboard":"/sota/uie-on-mit-movie","task":"UIE","dataset":"MIT Movie","model":"KnowCoder-7b-IE","rank_in_archive_order":1,"of":1,"metrics":{"F1 score":"90.6"},"uses_additional_data":false},{"leaderboard":"/sota/uie-on-mit-restaurant","task":"UIE","dataset":"MIT Restaurant","model":"KnowCoder-7b-IE","rank_in_archive_order":1,"of":1,"metrics":{"F1 score":"81.3"},"uses_additional_data":false},{"leaderboard":"/sota/uie-on-multinerd","task":"UIE","dataset":"MultiNERD","model":"KnowCoder-7b-IE","rank_in_archive_order":1,"of":1,"metrics":{"F1 score":"96.1"},"uses_additional_data":false},{"leaderboard":"/sota/uie-on-nyt","task":"UIE","dataset":"NYT","model":"KnowCoder-7b-IE","rank_in_archive_order":1,"of":1,"metrics":{"F1 score":"93.7"},"uses_additional_data":false},{"leaderboard":"/sota/uie-on-ontonotes-5-0","task":"UIE","dataset":"OntoNotes 5.0","model":"KnowCoder-7b-IE","rank_in_archive_order":1,"of":1,"metrics":{"F1 score":"88.2"},"uses_additional_data":false},{"leaderboard":"/sota/uie-on-scierc","task":"UIE","dataset":"SciERC","model":"KnowCoder-7b-IE","rank_in_archive_order":1,"of":1,"metrics":{"F1 score":"40.0"},"uses_additional_data":false},{"leaderboard":"/sota/uie-on-wnut-2017","task":"UIE","dataset":"WNUT 2017","model":"KnowCoder-7b-IE","rank_in_archive_order":1,"of":1,"metrics":{"F1 score":"66.4"},"uses_additional_data":false},{"leaderboard":"/sota/uie-on-wikiann","task":"UIE","dataset":"WikiANN","model":"KnowCoder-7b-IE","rank_in_archive_order":1,"of":1,"metrics":{"F1 score":"87.0"},"uses_additional_data":false},{"leaderboard":"/sota/uie-on-kbp37","task":"UIE","dataset":"kbp37","model":"KnowCoder-7b-IE","rank_in_archive_order":1,"of":1,"metrics":{"F1 score":"73.2"},"uses_additional_data":false},{"leaderboard":"/sota/uie-on-ncbi-disease","task":"UIE","dataset":"ncbi_disease","model":"KnowCoder-7b-IE","rank_in_archive_order":1,"of":1,"metrics":{"F1 score":"83.8"},"uses_additional_data":false},{"leaderboard":"/sota/uie-on-semeval-re","task":"UIE","dataset":"semeval RE","model":"KnowCoder-7b-IE","rank_in_archive_order":1,"of":1,"metrics":{"F1 score":"66.3"},"uses_additional_data":false}],"syntology":{"syntology_url":"https://syntology.ai/paper/2403.07969","atlas_url":"https://app.syntology.ai/?focus=2403.07969","mcp":null,"developers":"https://syntology.ai/developers","held":true,"reason":"arxiv_id_in_atlas","checked_against":{"atlas_ids":549449,"atlas_ids_sha256":"afd72399dafd9906e9062927f70655952385a3d75488558e1f0484e950ab09b7","read_at":"2026-10-05T01:46:21Z"},"agent_calls":[{"tool":"get_citation_path","arguments":{"paper_1":"2403.07969"},"arguments_in":{"paper_2":"another paper's arXiv id or title"},"call":"get_citation_path(paper_1=\"2403.07969\", paper_2=\"…\")"},{"tool":"get_concepts_for_paper","arguments":{"arxiv_id":"2403.07969"},"call":"get_concepts_for_paper(arxiv_id=\"2403.07969\")"}],"by_repo":[{"repo":"ICT-GoKnow/KnowCoder","kind":"listed","samples":0,"ran":0,"instrument":0,"unverified":0}],"by_repo_is":"one row per repository in the archive's code links, Syntology's graph links or the samples; samples 0 means no sample is linked to this paper, a statement about Syntology's coverage, not about the repository: with harvested_for_other_papers present, Syntology harvested the repository for that many other papers, and without it, Syntology harvested nothing from it; placed_by_identical_code counts samples whose link records no repository, placed here because identical code was harvested from this repository for another paper; ran counts executions on a synthesized input and instrument counts failures of Syntology's instrument, not of the code"},"code_links_note":null,"arxiv_metadata":null,"syntology_extracted_results":null,"record_sha256":"1342d35c0c215f4efdd3ec31aea32f93f063c9c76d279face875e22cffda6440","record_changed_at":"2026-09-28","record_changed_at_basis":"first_hashed"}