Code4Struct: Code Generation for Few-Shot Event Structure Prediction
Not on the map. Why?
Abstract (arXiv)
Large Language Model (LLM) trained on a mixture of text and code has demonstrated impressive capability in translating natural language (NL) into structured code. We observe that semantic structures can be conveniently translated into code and propose Code4Struct to leverage such text-to-structure translation capability to tackle structured prediction tasks. As a case study, we formulate Event Argument Extraction (EAE) as converting text into event-argument structures that can be represented as a class object using code. This alignment between structures and code enables us to take advantage of Programming Language (PL) features such as inheritance and type annotation to introduce external knowledge or add constraints. We show that, with sufficient in-context examples, formulating EAE as a code generation problem is advantageous over using variants of text-based prompts. Despite only using 20 training event instances for each event type, Code4Struct is comparable to supervised models trained on 4,202 instances and outperforms current state-of-the-art (SOTA) trained on 20-shot data by 29.5% absolute F1. Code4Struct can use 10-shot training data from a sibling event type to predict arguments for zero-resource event types and outperforms the zero-shot baseline by 12% absolute F1.
Key facts. Cited by 70 papers in the map (data through 7 Oct 2026). Builds on 19 of its 41 references that are in the map. First posted on arXiv 23 Oct 2022.
Builds on
19 of 41 references.
References · 19
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2022Training language models to follow instructions with human feedbackcited by 15,712
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,304
- 2022Training Compute-Optimal Large Language Modelscited by 2,927
- 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,413
- 2021Calibrate Before Use: Improving Few-Shot Performance of Language Modelscited by 1,371
- 2021What Makes Good In-Context Examples for GPT-3?cited by 1,184
- 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,122
- 2022ProgPrompt: Generating Situated Robot Task Plans using Large Language Modelscited by 598
- 2019Entity, Relation, and Event Extraction with Contextualized Span Representationscited by 261
- 2021Structured Prediction as Translation between Augmented Natural Languagescited by 183
7 more
- 2020Event Extraction by Answering (Almost) Natural Questionscited by 177
- 2022Language Models of Code are Few-Shot Commonsense Learnerscited by 160
- 2021Document-Level Event Argument Extraction by Conditional Generationcited by 154
- 2021Text2Event: Controllable Sequence-to-Structure Generation for End-to-end Event Extractioncited by 129
- 2021DEGREE: A Data-Efficient Generation-Based Event Extraction Modelcited by 82
- 2016Joint Extraction of Events and Entities within a Document Contextcited by 48
- 2021Document-level Entity-based Extraction as Template Generationcited by 33
Built on by
Citing papers per year: 2022: 1; 2023: 14; 2024: 30; 2025: 20; 2026: 5.
70 papers.
Sort:
By area:
- 2024Executable Code Actions Elicit Better LLM Agentscited by 537
- 2023Large Language Models for Generative Information Extraction: A Surveycited by 183
- 2023Large Language Model Is Not a Good Few-shot Information Extractor, but a Good Reranker for Hard Samples!cited by 119
- 2023GoLLIE: Annotation Guidelines improve Zero-Shot Information-Extractioncited by 116
- 2024If LLM Is the Wizard, Then Code Is the Wand: A Survey on How Code Empowers Large Language Models to Serve as Intelligent Agentscited by 77
- 2024Aligning LLMs with Individual Preferences via Interactioncited by 63
- 2023LaMPilot: An Open Benchmark Dataset for Autonomous Driving with Language Model Programscited by 45
- 2023Retrieval-Augmented Code Generation for Universal Information Extractioncited by 40
- 2024LLM-Ensemble: Optimal Large Language Model Ensemble Method for E-commerce Product Attribute Value Extractioncited by 39
- 2024Unveiling the Impact of Coding Data Instruction Fine-Tuning on Large Language Models Reasoningcited by 31
- 2023TextEE: Benchmark, Reevaluation, Reflections, and Future Challenges in Event Extractioncited by 27
- 2023LeTI: Learning to Generate from Textual Interactionscited by 25
38 more
- 2024ADELIE: Aligning Large Language Models on Information Extractioncited by 24
- 2024Unlocking Reasoning Potential in Large Langauge Models by Scaling Code-form Planningcited by 24
- 2024C-ICL: Contrastive In-context Learning for Information Extractioncited by 22
- 2023The Magic of IF: Investigating Causal Reasoning Abilities in Large Language Models of Codecited by 21
- 2023ExtractGPT: Exploring the Potential of Large Language Models for Product Attribute Value Extractioncited by 20
- 2024Using LLMs for the Extraction and Normalization of Product Attribute Valuescited by 20
- 2025Instruction-Tuning LLMs for Event Extraction with Annotation Guidelinescited by 18
- 2023Why Can Large Language Models Generate Correct Chain-of-Thoughts?cited by 16
- 2024Towards Truly Zero-shot Compositional Visual Reasoning with LLMs as Programmerscited by 14
- 2023ViStruct: Visual Structural Knowledge Extraction via Curriculum Guided Code-Vision Representationcited by 13
- 2023Unit Test Generation using Generative AI : A Comparative Performance Analysis of Autogeneration Toolscited by 13
- 2025a1: Steep Test-time Scaling Law via Environment Augmented Generationcited by 13
- 2024Swarm Intelligence in Geo-Localization: A Multi-Agent Large Vision-Language Model Collaborative Frameworkcited by 11
- 2024CodeTaxo: Enhancing Taxonomy Expansion with Limited Examples via Code Language Promptscited by 10
- 2024On-the-fly Definition Augmentation of LLMs for Biomedical NERcited by 9
- 2024CHECKWHY: Causal Fact Verification via Argument Structurecited by 9
- 2024Explicit, Implicit, and Scattered: Revisiting Event Extraction to Capture Complex Argumentscited by 9
- 2024Improving Event Definition Following For Zero-Shot Event Detectioncited by 7
- 2024MAVEN-Fact: A Large-scale Event Factuality Detection Datasetcited by 6
- 2024CodeGraph: Enhancing Graph Reasoning of LLMs with Codecited by 6
- 2024Towards Better Multi-task Learning: A Framework for Optimizing Dataset Combinations in Large Language Modelscited by 6
- 2025Revisiting Prompt Optimization with Large Reasoning Models-A Case Study on Event Extractioncited by 6
- 2025Rank, Chunk and Expand: Lineage-Oriented Reasoning for Taxonomy Expansioncited by 5
- 2025Event Extraction in Large Language Modelcited by 5
- 2023Defining a New NLP Playgroundcited by 4
- 2024Promptly Predicting Structures: The Return of Inferencecited by 4
- 2024Transforming Scholarly Landscapes: Influence of Large Language Models on Academic Fields beyond Computer Sciencecited by 4
- 2024Explainable Behavior Cloning: Teaching Large Language Model Agents through Learning by Demonstrationcited by 4
- 2022A Survey on Natural Language Processing for Programmingcited by 3
- 2024Cascading Large Language Models for Salient Event Graph Generationcited by 3
- 2024RUIE: Retrieval-based Unified Information Extraction using Large Language Modelcited by 3
- 2024Exploring Large Language Models for Product Attribute Value Identificationcited by 3
- 2024KnowCoder-X: Boosting Multilingual Information Extraction via Codecited by 3
- 2026PaperX: A Unified Framework for Multimodal Academic Presentation Generation with Scholar DAGcited by 3
- 2024Formulation Comparison for Timeline Construction using LLMscited by 2
- 2025Self-Refinement Strategies for LLM-based Product Attribute Value Extractioncited by 2
- 2025Boost, Disentangle, and Customize: A Robust System2-to-System1 Pipeline for Code Generationcited by 2
- 2025SNaRe: Domain-aware Data Generation for Low-Resource Event Detectioncited by 2
50 most cited of 70 All 70 (JSON)
- 2026EAGER: Enhancing Generative Event Extraction via Reinforcement Learning with Verifiable Rewards24 Sep 2026
- 2026Beyond Clean Text: Evaluating Encoder and Decoder Robustness for Bangla Event Detection in Noisy Text29 Jun 2026
- 2026LC-ICL: Label-Guided Contrastive In-Context Learning for Robust Information Extraction28 Jun 2026
- 2026Which bird does not have wings: Negative-constrained KGQA with Schema-guided Semantic Matching and Self-directed Refinement16 Apr 2026
- 2026PaperX: A Unified Framework for Multimodal Academic Presentation Generation with Scholar DAG30 Jan 2026
- 2025Event Extraction in Large Language Model22 Dec 2025
- 2025Extracting Events Like Code: A Multi-Agent Programming Framework for Zero-Shot Event Extraction17 Nov 2025
- 2025Keyword-Centric Prompting for One-Shot Event Detection with Self-Generated Rationale Enhancements11 Aug 2025
- 2025CodeNER: Code Prompting for Named Entity Recognition27 Jul 2025
- 2025Large Language Model for Extracting Complex Contract Information in Industrial Scenes9 Jul 2025
- 2025KnowCoder-V2: Deep Knowledge Analysis7 Jun 2025
- 2025LEMONADE: A Large Multilingual Expert-Annotated Abstractive Event Dataset for the Real World1 Jun 2025
38 more
- 2025MPL: Multiple Programming Languages with Large Language Models for Information Extraction22 May 2025
- 2025Rank, Chunk and Expand: Lineage-Oriented Reasoning for Taxonomy Expansion19 May 2025
- 2025a1: Steep Test-time Scaling Law via Environment Augmented Generation20 Apr 2025
- 2025Revisiting Prompt Optimization with Large Reasoning Models-A Case Study on Event Extraction10 Apr 2025
- 2025Automated Archival Descriptions with Federated Intelligence of LLMs8 Apr 2025
- 2025Towards Event Extraction with Massive Types: LLM-based Collaborative Annotation and Partitioning Extraction4 Mar 2025
- 2025Predicting Through Generation: Why Generation Is Better for Prediction25 Feb 2025
- 2025SNaRe: Domain-aware Data Generation for Low-Resource Event Detection24 Feb 2025
- 2025Instruction-Tuning LLMs for Event Extraction with Annotation Guidelines22 Feb 2025
- 2025Boost, Disentangle, and Customize: A Robust System2-to-System1 Pipeline for Code Generation18 Feb 2025
- 2025Inferring from Logits: Exploring Best Practices for Decoding-Free Generative Candidate Selection28 Jan 2025
- 2025PoAct: Policy and Action Dual-Control Agent for Generalized Applications13 Jan 2025
- 2025Self-Refinement Strategies for LLM-based Product Attribute Value Extraction2 Jan 2025
- 2024Towards Better Multi-task Learning: A Framework for Optimizing Dataset Combinations in Large Language Models16 Dec 2024
- 2024Are Triggers Needed for Document-Level Event Extraction?13 Nov 2024
- 2024KnowCoder-X: Boosting Multilingual Information Extraction via Code7 Nov 2024
- 2024Explainable Behavior Cloning: Teaching Large Language Model Agents through Learning by Demonstration30 Oct 2024
- 2024Single Ground Truth Is Not Enough: Adding Flexibility to Aspect-Based Sentiment Analysis Evaluation13 Oct 2024
- 2024Aligning LLMs with Individual Preferences via Interaction4 Oct 2024
- 2024Explicit, Implicit, and Scattered: Revisiting Event Extraction to Capture Complex Arguments4 Oct 2024
- 2024Transforming Scholarly Landscapes: Influence of Large Language Models on Academic Fields beyond Computer Science29 Sep 2024
- 2024Exploring Large Language Models for Product Attribute Value Identification19 Sep 2024
- 2024Unlocking Reasoning Potential in Large Langauge Models by Scaling Code-form Planning19 Sep 2024
- 2024RUIE: Retrieval-based Unified Information Extraction using Large Language Model18 Sep 2024
- 2024CodeGraph: Enhancing Graph Reasoning of LLMs with Code25 Aug 2024
- 2024Swarm Intelligence in Geo-Localization: A Multi-Agent Large Vision-Language Model Collaborative Framework21 Aug 2024
- 2024CHECKWHY: Causal Fact Verification via Argument Structure20 Aug 2024
- 2024CodeTaxo: Enhancing Taxonomy Expansion with Limited Examples via Code Language Prompts17 Aug 2024
- 2024MAVEN-Fact: A Large-scale Event Factuality Detection Dataset22 Jul 2024
- 2024Cascading Large Language Models for Salient Event Graph Generation26 Jun 2024
- 2024Unveiling the Impact of Coding Data Instruction Fine-Tuning on Large Language Models Reasoning30 May 2024
- 2024ADELIE: Aligning Large Language Models on Information Extraction8 May 2024
- 2024On-the-fly Definition Augmentation of LLMs for Biomedical NER29 Mar 2024
- 2024Improving Event Definition Following For Zero-Shot Event Detection5 Mar 2024
- 2024Using LLMs for the Extraction and Normalization of Product Attribute Values4 Mar 2024
- 2024Formulation Comparison for Timeline Construction using LLMs1 Mar 2024
- 2024LLM-Ensemble: Optimal Large Language Model Ensemble Method for E-commerce Product Attribute Value Extraction29 Feb 2024
- 2024C-ICL: Contrastive In-context Learning for Information Extraction17 Feb 2024
50 newest of 70 All 70 (JSON)
- 2024Unveiling the Impact of Coding Data Instruction Fine-Tuning on Large Language Models Reasoningcited by 31
- 2024Unlocking Reasoning Potential in Large Langauge Models by Scaling Code-form Planningcited by 24
- 2023The Magic of IF: Investigating Causal Reasoning Abilities in Large Language Models of Codecited by 21
- 2023Why Can Large Language Models Generate Correct Chain-of-Thoughts?cited by 16
- 2024Towards Truly Zero-shot Compositional Visual Reasoning with LLMs as Programmerscited by 14
- 2025a1: Steep Test-time Scaling Law via Environment Augmented Generationcited by 13
- 2024Swarm Intelligence in Geo-Localization: A Multi-Agent Large Vision-Language Model Collaborative Frameworkcited by 11
- 2024CHECKWHY: Causal Fact Verification via Argument Structurecited by 9
- 2024CodeGraph: Enhancing Graph Reasoning of LLMs with Codecited by 6
- 2025Revisiting Prompt Optimization with Large Reasoning Models-A Case Study on Event Extractioncited by 6
- 2025Boost, Disentangle, and Customize: A Robust System2-to-System1 Pipeline for Code Generationcited by 2
- 2025PoAct: Policy and Action Dual-Control Agent for Generalized Applicationscited by 1
12 most cited of 14 All 14 (JSON)
- 2026Which bird does not have wings: Negative-constrained KGQA with Schema-guided Semantic Matching and Self-directed Refinement16 Apr 2026
- 2025KnowCoder-V2: Deep Knowledge Analysis7 Jun 2025
- 2025a1: Steep Test-time Scaling Law via Environment Augmented Generation20 Apr 2025
- 2025Revisiting Prompt Optimization with Large Reasoning Models-A Case Study on Event Extraction10 Apr 2025
- 2025Boost, Disentangle, and Customize: A Robust System2-to-System1 Pipeline for Code Generation18 Feb 2025
- 2025PoAct: Policy and Action Dual-Control Agent for Generalized Applications13 Jan 2025
- 2024Unlocking Reasoning Potential in Large Langauge Models by Scaling Code-form Planning19 Sep 2024
- 2024CodeGraph: Enhancing Graph Reasoning of LLMs with Code25 Aug 2024
- 2024Swarm Intelligence in Geo-Localization: A Multi-Agent Large Vision-Language Model Collaborative Framework21 Aug 2024
- 2024CHECKWHY: Causal Fact Verification via Argument Structure20 Aug 2024
- 2024Unveiling the Impact of Coding Data Instruction Fine-Tuning on Large Language Models Reasoning30 May 2024
- 2024Towards Truly Zero-shot Compositional Visual Reasoning with LLMs as Programmers3 Jan 2024
12 newest of 14 All 14 (JSON)
- 2024Executable Code Actions Elicit Better LLM Agentscited by 537
- 2024If LLM Is the Wizard, Then Code Is the Wand: A Survey on How Code Empowers Large Language Models to Serve as Intelligent Agentscited by 77
- 2024Explainable Behavior Cloning: Teaching Large Language Model Agents through Learning by Demonstrationcited by 4
- 2025Extracting Events Like Code: A Multi-Agent Programming Framework for Zero-Shot Event Extractioncited by 2
- 2025Extracting Events Like Code: A Multi-Agent Programming Framework for Zero-Shot Event Extraction17 Nov 2025
- 2024Explainable Behavior Cloning: Teaching Large Language Model Agents through Learning by Demonstration30 Oct 2024
- 2024Executable Code Actions Elicit Better LLM Agents1 Feb 2024
- 2024If LLM Is the Wizard, Then Code Is the Wand: A Survey on How Code Empowers Large Language Models to Serve as Intelligent Agents1 Jan 2024
- 2023Large Language Models for Generative Information Extraction: A Surveycited by 183
- 2023Large Language Model Is Not a Good Few-shot Information Extractor, but a Good Reranker for Hard Samples!cited by 119
- 2023GoLLIE: Annotation Guidelines improve Zero-Shot Information-Extractioncited by 116
- 2024LLM-Ensemble: Optimal Large Language Model Ensemble Method for E-commerce Product Attribute Value Extractioncited by 39
- 2023TextEE: Benchmark, Reevaluation, Reflections, and Future Challenges in Event Extractioncited by 27
- 2023LeTI: Learning to Generate from Textual Interactionscited by 25
- 2024C-ICL: Contrastive In-context Learning for Information Extractioncited by 22
- 2023ExtractGPT: Exploring the Potential of Large Language Models for Product Attribute Value Extractioncited by 20
- 2024Using LLMs for the Extraction and Normalization of Product Attribute Valuescited by 20
- 2025Instruction-Tuning LLMs for Event Extraction with Annotation Guidelinescited by 18
- 2023Unit Test Generation using Generative AI : A Comparative Performance Analysis of Autogeneration Toolscited by 13
- 2024CodeTaxo: Enhancing Taxonomy Expansion with Limited Examples via Code Language Promptscited by 10
12 most cited of 45 All 45 (JSON)
- 2026EAGER: Enhancing Generative Event Extraction via Reinforcement Learning with Verifiable Rewards24 Sep 2026
- 2026Beyond Clean Text: Evaluating Encoder and Decoder Robustness for Bangla Event Detection in Noisy Text29 Jun 2026
- 2026LC-ICL: Label-Guided Contrastive In-Context Learning for Robust Information Extraction28 Jun 2026
- 2026PaperX: A Unified Framework for Multimodal Academic Presentation Generation with Scholar DAG30 Jan 2026
- 2025CodeNER: Code Prompting for Named Entity Recognition27 Jul 2025
- 2025Large Language Model for Extracting Complex Contract Information in Industrial Scenes9 Jul 2025
- 2025LEMONADE: A Large Multilingual Expert-Annotated Abstractive Event Dataset for the Real World1 Jun 2025
- 2025MPL: Multiple Programming Languages with Large Language Models for Information Extraction22 May 2025
- 2025Rank, Chunk and Expand: Lineage-Oriented Reasoning for Taxonomy Expansion19 May 2025
- 2025Automated Archival Descriptions with Federated Intelligence of LLMs8 Apr 2025
- 2025Towards Event Extraction with Massive Types: LLM-based Collaborative Annotation and Partitioning Extraction4 Mar 2025
- 2025Predicting Through Generation: Why Generation Is Better for Prediction25 Feb 2025
12 newest of 45 All 45 (JSON)