Extracting Events Like Code: A Multi-Agent Programming Framework for Zero-Shot Event Extraction
Quanjiang Guo, Sijie Wang, Jinchuan Zhang, Ben Zhang, Zhao Kang, Ling Tian, Ke Yan
Abstract
Zero-shot event extraction (ZSEE) remains a significant challenge for large language models (LLMs) due to the need for complex reasoning and domain-specific understanding. Direct prompting often yields incomplete or structurally invalid outputs-such as misclassified triggers, missing arguments, and schema violations. To address these limitations, we present Agent-Event-Coder (AEC), a novel multi-agent framework that treats event extraction like software engineering: as a structured, iterative code-generation process. AEC decomposes ZSEE into specialized subtasks-retrieval, planning, coding, and verification-each handled by a dedicated LLM agent. Event schemas are represented as executable class definitions, enabling deterministic validation and precise feedback via a verification agent. This programminginspired approach allows for systematic disambiguation and schema enforcement through iterative refinement. By leveraging collaborative agent workflows, AEC enables LLMs to produce precise, complete, and schema-consistent extractions in zero-shot settings. Experiments across five diverse domains and six LLMs demonstrate that AEC consistently outperforms prior zero-shot baselines, showcasing the power of treating event extraction like code generation 1 .
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Builds on7
- Large Language Models as Analogical ReasonersMichihiro Yasunaga, Xinyun Chen, Yujia Li, Panupong Pasupat et al.ICLR 2024 · 155 citations
- Is a Large Language Model a Good Annotator for Event Extraction?Ruirui Chen, Chengwei Qin, Weifeng Jiang, Dongkyu ChoiAAAI 2024 · 65 citations
- Code4Struct: Code Generation for Few-Shot Event Structure PredictionXingyao Wang, Sha Li, Heng JiACL 2023 · 40 citations
- A Cooperative Multi-Agent Framework for Zero-Shot Named Entity RecognitionZihan Wang, Ziqi Zhao, Yougang Lyu, Zhumin Chen et al.WWW 2025 · 16 citations
- GLEN: General-Purpose Event Detection for Thousands of TypesSha Li, Qiusi Zhan, Kathryn Conger, Martha Palmer et al.EMNLP 2023 · 9 citations
Related papers
- Learning to Generate and Extract: A Multi-Agent Collaboration Framework for Zero-Shot Document-Level Event Arguments ExtractionGuangjun Zhang, Hu Zhang, Yazhou Han, Yue Fan et al.AAAI 2026
- KnowCoder: Coding Structured Knowledge into LLMs for Universal Information ExtractionZixuan Li, Yutao Zeng, Yuxin Zuo, Weicheng Ren et al.ACL 2024 · 19 citations
- Schema-Guided Event Reasoning: A Plug-and-Play Event Reasoning Framework Based on Large Language ModelsYuying Liu, Xuechen Zhao, Yanyi Huang, Ye Wang et al.AAAI 2026
- Multilingual Generative Language Models for Zero-Shot Cross-Lingual Event Argument ExtractionKuan-Hao Huang, I-Hung Hsu, Prem Natarajan, Kai-Wei Chang et al.ACL 2022
- Just Ask: Curious Code Agents Reveal System Prompts in Frontier LLMsXiang Zheng, YUTAO WU, Hanxun Huang, Yige Li et al.ICML 2026
