Biomedical entity recognition improves with code instruction tuning and voting

Enhancing Biomedical Named Entity Recognition via Multiple Programming Languages Instruction Tuning and Ensemble Method

Computation and Language

Summary

Biomedical named entity recognition means finding important words like diseases or drugs in medical text. The authors found that teaching AI models using examples written in computer code rather than plain text helps the AI understand the structure better. They used multiple programming languages like Python and Java to give different views on the same data, making the AI more reliable. When the model makes predictions, it combines results from all code styles to get better answers. This approach worked better than other methods on many tests with medical texts.

What this means in practice

  • For biomedical software developers: Create more accurate biomedical information extraction tools by training models with diverse code-format instructions and combining multiple outputs.
  • For healthcare data teams: Improve extraction of medical terms from clinical notes by using ensemble predictions from multi-language coded annotations to reduce errors.

Authors

Songtao Li, Yijia Zhang, Jianyuan Yuan, Shidi Zhang, Fengyu Zhang, Hongfei Lin

Abstract

Instruction tuning has become a common paradigm for applying large language models (LLMs) to biomedical named entity recognition (BioNER). However, existing instruction-tuning approaches still face two key challenges. First, conventional natural-language instructions typically serialize BioNER annotations as flat textual outputs, providing limited structural constraints for typed entity extraction. Second, high-quality biomedical annotations are limited, and learning from a single serialized output form may restrict structural diversity and reduce model robustness. Although external biomedical knowledge can be introduced to alleviate data scarcity, it often requires costly resource construction. To address these challenges, we propose MITE, a Multiple Programming Languages Instruction Tuning and Ensemble method for BioNER. MITE reformulates BioNER as a structure-to-structure generation task by representing both instructions and entity outputs in code-formatted representations. Specifically, each training instance is transformed into multiple programming-language formats, including Python, C++, and Java, while preserving the same underlying entity semantics. These language-specific representations provide structurally diverse supervision without requiring external biomedical knowledge or additional annotations. During inference, MITE aggregates predictions from different code formats through an entity-level voting strategy, reducing language-specific prediction variance and improving robustness. Experiments on six widely used BioNER datasets demonstrate that MITE consistently outperforms representative BERT-based and LLM-based baselines and exhibits strong cross-dataset generalization. Ablation and parameter analyses further verify the effectiveness and robustness of the proposed components.