mlsanityData to 14 Oct 2026

CodeNER: Code Prompting for Named Entity Recognition

arXiv 2507.20423 ↗First posted 27 Jul 2025cs.CL cs.AIcited by 0

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

  1. 2020Language Models are Few-Shot Learnerscited by 32,419
  2. 2022Training language models to follow instructions with human feedbackcited by 15,971
  3. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
  4. 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,326
  5. 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,780
  6. 2024Phi-3 Technical Report: A Highly Capable Language Model Locally on Your Phonecited by 1,917
  7. 2022LaMDA: Language Models for Dialog Applicationscited by 1,220
  8. 2016Neural Architectures for Named Entity Recognitioncited by 550
  9. 2016End-to-end Sequence Labeling via Bi-directional LSTM-CNNs-CRFcited by 341
  10. 2021Generated Knowledge Prompting for Commonsense Reasoningcited by 214
  11. 2015Named Entity Recognition with Bidirectional LSTM-CNNscited by 201
  12. 2019A Unified MRC Framework for Named Entity Recognitioncited by 199
27 more
  1. 2023Multilingual Machine Translation with Large Language Models: Empirical Results and Analysiscited by 160
  2. 2023GPT-NER: Named Entity Recognition via Large Language Modelscited by 160
  3. 2021Template-Based Named Entity Recognition Using BARTcited by 153
  4. 2021A Unified Generative Framework for Various NER Subtaskscited by 141
  5. 2023GoLLIE: Annotation Guidelines improve Zero-Shot Information-Extractioncited by 119
  6. 2023Guiding Large Language Models via Directional Stimulus Promptingcited by 95
  7. 2022Code4Struct: Code Generation for Few-Shot Event Structure Predictioncited by 70
  8. 2023CodeIE: Large Code Generation Models are Better Few-Shot Information Extractorscited by 68
  9. 2021Locate and Label: A Two-stage Identifier for Nested Named Entity Recognitioncited by 61
  10. 2023Empirical Study of Zero-Shot NER with ChatGPTcited by 60
  11. 2021SpanNER: Named Entity Re-/Recognition as Span Predictioncited by 55
  12. 2021MELM: Data Augmentation with Masked Entity Language Modeling for Low-Resource NERcited by 42
  13. 2021A Sequence-to-Set Network for Nested Named Entity Recognitioncited by 40
  14. 2020Local Additivity Based Data Augmentation for Semi-supervised NERcited by 31
  15. 2019Dependency-Guided LSTM-CRF for Named Entity Recognitioncited by 28
  16. 2020Instance-Based Learning of Span Representations: A Case Study through Named Entity Recognitioncited by 23
  17. 2021Better Feature Integration for Named Entity Recognitioncited by 22
  18. 2019Zero-Resource Cross-Lingual Named Entity Recognitioncited by 18
  19. 2023Self-Improving for Zero-Shot Named Entity Recognition with Large Language Modelscited by 15
  20. 2021Data Augmentation for Cross-Domain Named Entity Recognitioncited by 14
  21. 2019A Finnish News Corpus for Named Entity Recognitioncited by 11
  22. 2023Yes but.. Can ChatGPT Identify Entities in Historical Documents?cited by 10
  23. 2024CodeTaxo: Enhancing Taxonomy Expansion with Limited Examples via Code Language Promptscited by 10
  24. 2023SwissBERT: The Multilingual Language Model for Switzerlandcited by 9
  25. 2022FactMix: Using a Few Labeled In-domain Examples to Generalize to Cross-domain Named Entity Recognitioncited by 7
  26. 2024Show Less, Instruct More: Enriching Prompts with Definitions and Guidelines for Zero-Shot NERcited by 5
  27. 2016Entity Identification as Multitaskingcited by 2

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2024Recent Advances in Named Entity Recognition: A Comprehensive Survey and Comparative Study
  2. 2025Retrieval augmented generation based dynamic prompting for few-shot biomedical named entity recognition using large language models
  3. 2025FiNERweb: Datasets and Artifacts for Scalable Multilingual Named Entity Recognition
  4. 2023UniversalNER: Targeted Distillation from Large Language Models for Open Named Entity Recognition
  5. 2024Large Language Models Struggle in Token-Level Clinical Named Entity Recognition
  6. 2025LLMs as Data Annotators: How Close Are We to Human Performance
  7. 2025LLMs are Better Than You Think: Label-Guided In-Context Learning for Named Entity Recognition
  8. 2024SCANNER: Knowledge-Enhanced Approach for Robust Multi-modal Named Entity Recognition of Unseen Entities