CodeNER: Code Prompting for Named Entity Recognition
Not on the map. Why?
Abstract (arXiv)
Recent studies have explored various approaches for treating candidate named entity spans as both source and target sequences in named entity recognition (NER) by leveraging large language models (LLMs). Although previous approaches have successfully generated candidate named entity spans with suitable labels, they rely solely on input context information when using LLMs, particularly, ChatGPT. However, NER inherently requires capturing detailed labeling requirements with input context information. To address this issue, we propose a novel method that leverages code-based prompting to improve the capabilities of LLMs in understanding and performing NER. By embedding code within prompts, we provide detailed BIO schema instructions for labeling, thereby exploiting the ability of LLMs to comprehend long-range scopes in programming languages. Experimental results demonstrate that the proposed code-based prompting method outperforms conventional text-based prompting on ten benchmarks across English, Arabic, Finnish, Danish, and German datasets, indicating the effectiveness of explicitly structuring NER instructions. We also verify that combining the proposed code-based prompting method with the chain-of-thought prompting further improves performance.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 39 of its 69 references that are in the map. First posted on arXiv 27 Jul 2025.
Builds on
39 of 69 references.
References · 39
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2022Training language models to follow instructions with human feedbackcited by 15,971
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
- 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,326
- 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,780
- 2024Phi-3 Technical Report: A Highly Capable Language Model Locally on Your Phonecited by 1,917
- 2022LaMDA: Language Models for Dialog Applicationscited by 1,220
- 2016Neural Architectures for Named Entity Recognitioncited by 550
- 2016End-to-end Sequence Labeling via Bi-directional LSTM-CNNs-CRFcited by 341
- 2021Generated Knowledge Prompting for Commonsense Reasoningcited by 214
- 2015Named Entity Recognition with Bidirectional LSTM-CNNscited by 201
- 2019A Unified MRC Framework for Named Entity Recognitioncited by 199
27 more
- 2023Multilingual Machine Translation with Large Language Models: Empirical Results and Analysiscited by 160
- 2023GPT-NER: Named Entity Recognition via Large Language Modelscited by 160
- 2021Template-Based Named Entity Recognition Using BARTcited by 153
- 2021A Unified Generative Framework for Various NER Subtaskscited by 141
- 2023GoLLIE: Annotation Guidelines improve Zero-Shot Information-Extractioncited by 119
- 2023Guiding Large Language Models via Directional Stimulus Promptingcited by 95
- 2022Code4Struct: Code Generation for Few-Shot Event Structure Predictioncited by 70
- 2023CodeIE: Large Code Generation Models are Better Few-Shot Information Extractorscited by 68
- 2021Locate and Label: A Two-stage Identifier for Nested Named Entity Recognitioncited by 61
- 2023Empirical Study of Zero-Shot NER with ChatGPTcited by 60
- 2021SpanNER: Named Entity Re-/Recognition as Span Predictioncited by 55
- 2021MELM: Data Augmentation with Masked Entity Language Modeling for Low-Resource NERcited by 42
- 2021A Sequence-to-Set Network for Nested Named Entity Recognitioncited by 40
- 2020Local Additivity Based Data Augmentation for Semi-supervised NERcited by 31
- 2019Dependency-Guided LSTM-CRF for Named Entity Recognitioncited by 28
- 2020Instance-Based Learning of Span Representations: A Case Study through Named Entity Recognitioncited by 23
- 2021Better Feature Integration for Named Entity Recognitioncited by 22
- 2019Zero-Resource Cross-Lingual Named Entity Recognitioncited by 18
- 2023Self-Improving for Zero-Shot Named Entity Recognition with Large Language Modelscited by 15
- 2021Data Augmentation for Cross-Domain Named Entity Recognitioncited by 14
- 2019A Finnish News Corpus for Named Entity Recognitioncited by 11
- 2023Yes but.. Can ChatGPT Identify Entities in Historical Documents?cited by 10
- 2024CodeTaxo: Enhancing Taxonomy Expansion with Limited Examples via Code Language Promptscited by 10
- 2023SwissBERT: The Multilingual Language Model for Switzerlandcited by 9
- 2022FactMix: Using a Few Labeled In-domain Examples to Generalize to Cross-domain Named Entity Recognitioncited by 7
- 2024Show Less, Instruct More: Enriching Prompts with Definitions and Guidelines for Zero-Shot NERcited by 5
- 2016Entity Identification as Multitaskingcited by 2
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2024Recent Advances in Named Entity Recognition: A Comprehensive Survey and Comparative Study
- 2025Retrieval augmented generation based dynamic prompting for few-shot biomedical named entity recognition using large language models
- 2025FiNERweb: Datasets and Artifacts for Scalable Multilingual Named Entity Recognition
- 2023UniversalNER: Targeted Distillation from Large Language Models for Open Named Entity Recognition
- 2024Large Language Models Struggle in Token-Level Clinical Named Entity Recognition
- 2025LLMs as Data Annotators: How Close Are We to Human Performance
- 2025LLMs are Better Than You Think: Label-Guided In-Context Learning for Named Entity Recognition
- 2024SCANNER: Knowledge-Enhanced Approach for Robust Multi-modal Named Entity Recognition of Unseen Entities