Source-linked AI summary
Enhancing Biomedical Named Entity Recognition via Multiple Programming Languages Instruction Tuning and Ensemble Method
Songtao Li, Yijia Zhang, Jianyuan Yuan, Shidi Zhang, Fengyu Zhang, Hongfei Lin
TL;DR
Flat natural-language outputs provide limited structural constraints for typed BioNER, and single-format supervision can restrict structural diversity. MITE uses code-formatted instructions and outputs in multiple programming languages, then aggregates predictions by entity-level voting. Across six BioNER benchmarks, it consistently outperforms representative baselines and exhibits cross-dataset generalization.
Problem
Conventional instruction tuning serializes entity annotations as flat text with limited structural constraints, while single output forms restrict structural diversity and may reduce robustness.
Source: §I · p. 2Method
MITE represents instructions and entity outputs as code structures in multiple programming languages and aggregates predictions through entity-level voting.
Source: §I · p. 2Results
MITE consistently outperforms representative baselines and exhibits strong cross-dataset generalization on six BioNER benchmarks.
Source: §I · p. 2Takeaways & Limitations
Entity-level voting across code representations is intended to improve the stability and reliability of BioNER outputs.
Source: §I · p. 2
Abstract
from arXiv · showhide
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.
I. INTRODUCTION
MITE addresses limitations of flat natural-language BioNER outputs and single-format supervision by using structured code representations in multiple languages and combining predictions through entity-level voting. The paper reports consistent gains over representative baselines across six BioNER benchmarks.
I. INTRODUCTION
- Flat textual outputs provide limited structural constraints for typed entity extraction, while learning from a single serialized form may restrict structural diversity and robustness.External biomedical resources may alleviate data scarcity, but can be costly to construct, limited in coverage, and difficult to maintain.Source: §I · p. 2
- MITE represents BioNER instructions and entity outputs as code-formatted structures, then combines predictions across language formats through entity-level voting.The approach uses Python, C++, and Java representations without additional biomedical knowledge or annotations.Source: §I · p. 2
- Code-style entity objects make span-type predictions explicit and align them with structured patterns learned by LLMs during pretraining.Source: §I · p. 2
- Multiple programming-language representations provide structurally diverse training signals without external biomedical knowledge or additional annotations.Source: §I · p. 2
- Entity-level voting across code representations is intended to improve the stability and reliability of BioNER outputs.Source: §I · p. 2
- MITE consistently outperforms representative baselines and shows strong cross-dataset generalization on six BioNER benchmarks.Source: §I · p. 2
II. RELATED WORK
BioNER research has moved from feature-based and neural methods to domain-pretrained models and instruction-following LLMs. Transfer across corpora and explicit control of structured outputs remain challenges; MITE explores multiple code-language representations and ensemble inference.
A. Biomedical Named Entity Recognition
- BioNER methods progressed from expert-designed rules and features to CNNs, BiLSTMs, and domain-pretrained models such as BioBERT and PubMedBERT.Source: A. Biomedical Named Entity Recognition · p. 2
- Cross-dataset generalization remains challenging because corpora differ in entity types, annotation guidelines, and label granularities, and combined datasets may assign inconsistent labels.Source: A. Biomedical Named Entity Recognition · p. 2
B. LLM-Based Information Extraction
- LLM-based BioNER includes zero-shot and few-shot prompting, supervised instruction tuning, and approaches such as BioNER-LLaMA, NERLlama3.1, and VANER.Source: B. LLM-Based Information Extraction · p. 2
- Natural-language instructions and free-form decoding offer limited explicit control over entity boundaries, semantic types, and output formats.Source: B. LLM-Based Information Extraction · p. 2
- Unlike code-oriented methods that typically use one formulation, MITE uses Python, C++, and Java representations and ensembles predictions across code formats.The representations provide structurally diverse supervision without additional biomedical knowledge.Source: B. LLM-Based Information Extraction · p. 3
III. METHODS
MITE treats BioNER as structured generation: it represents instructions and entity outputs in code, fine-tunes on multiple language formats, and ensembles predictions at inference. Its outputs are entity objects that specify mentions and semantic types.
III. METHODS
- MITE constructs code representations in Python, C++, and Java, fine-tunes an LLM on the resulting corpus, and ensembles predictions from the formats during inference.The framework includes task formulation, multi-language code instruction modeling, multi-language supervised fine-tuning, and multi-language ensemble inference.Source: §III · p. 3
A. Task Formulation
- MITE formulates BioNER as generative structured prediction, directly producing entity objects that specify mention spans and semantic types rather than token-level tags.Source: A. Task Formulation · p. 3
B. Multi-Language Code Instruction Modeling
- Code-formatted instructions and outputs express the extraction schema through function signatures, task descriptions, and entity construction statements.Source: B. Multi-Language Code Instruction… · p. 3
1) Code-Based Instruction:
- A function-based instruction names the BioNER task, carries the biomedical sentence as input, and specifies target entity types in its docstring.Expected entities are construction statements added to an EntityList, such as Gene("...").Source: 1) Code-Based Instruction · pp. 3–4
2) Multi-Language Structural Transformation:
Each original BioNER instance is transformed into multiple language-specific code representations, creating structural diversity while preserving its span-type annotations.
2) Multi-Language Structural Transformation:
- Each dataset sample pairs an input biomedical sentence with its corresponding set of annotated entities.The dataset contains N_d samples.Source: 2) Multi-Language Structural… · p. 4
- Each BioNER instance is transformed into Python, C++, and Java representations that preserve the same underlying span-type annotations.The corpus expands instances into structurally diverse code forms without changing label semantics.Source: 2) Multi-Language Structural… · p. 4
C. Multi-Language Supervised Fine-Tuning
MITE fine-tunes an LLM on language-specific code instructions paired with structured outputs in the same language. Training jointly across languages conditions generation on instructions while computing loss only over target outputs.
C. Multi-Language Supervised Fine-Tuning
- The model is fine-tuned on language-specific code instructions paired with gold structured outputs expressed in the same programming language.Instruction tokens provide conditioning context; loss is computed only over target output tokens.Source: C. Multi-Language Supervised Fine-Tuning · p. 4
- Jointly optimizing samples across programming languages is intended to teach the model unified BioNER behavior across heterogeneous code structures.The objective factorizes the likelihood over target output tokens.Source: C. Multi-Language Supervised Fine-Tuning · p. 4
D. Multi-Language Ensemble Inference
At inference, MITE generates predictions from multiple language-specific code instructions and combines them through entity-level majority voting.
D. Multi-Language Ensemble Inference
- Each language-specific prediction is parsed into span-type pairs, and an entity matches across predictions only when both its span and type agree.The final entity set is determined by majority voting; with three languages, at least two must predict an entity for it to be retained.Source: D. Multi-Language Ensemble Inference · p. 4
IV. EXPERIMENTS
Experiments use three combined source-training datasets and three external transfer datasets to assess BioNER across gene, chemical, and disease categories, comparing MITE with BERT- and LLM-based baselines.
A. BioNER Datasets
- Three source datasets—BC2GM, BC5CDR-Chemical, and NCBI Disease Corpus—are combined to instruction-tune one MITE model for gene, chemical, and disease recognition.Dataset statistics and splits are summarized in Table I.Source: A. BioNER Datasets · p. 4, Table I · p. 5
- NLM-Gene, NLM-Chem-BC7, and BC5CDR-Disease serve as external transfer benchmarks, with the trained model used directly for inference.Disease annotations are excluded from source training for BC5CDR-Disease to avoid target-label leakage.Source: A. BioNER Datasets · p. 4, Table I · p. 5
B. Baselines
- MITE is compared with two baseline categories: BERT-based methods and LLM-based methods.The BERT-based examples include BioBERT, PubMedBERT, and AIONER.Source: B. Baselines · p. 5, 1) BERT-based Methods: • · p. 5
2) LLM-based Methods:
LLM-based BioNER methods use instruction tuning and text-to-text generation, with some approaches adding biomedical knowledge or multi-dataset training.
- InstructUIE [18] unifies information-extraction tasks with Flan-T5, while UniversalNER distills ChatGPT into LLaMA-2 for cross-domain NER.Source: 2) LLM-based Methods: • · p. 5
- PMC-LLaMA adds biomedical pretraining before fine-tuning and BioNER specialization; BioNER-LLaMA instruction-tunes LLaMA-2 for biomedical entity generation.Source: 2) LLM-based Methods: • · p. 5
- VANER incorporates UMLS knowledge and multi-task training, whereas NERLlama3.1 uses QLoRA for parameter-efficient multi-dataset instruction tuning.Source: 2) LLM-based Methods: • · p. 5
C. Evaluation Metrics
This section specifies the evaluation and training setup, then reports MITE’s benchmark performance on familiar and held-out datasets.
C. Evaluation Metrics
- Performance is primarily measured by Micro-F1, with a prediction correct only when both entity boundaries and labels exactly match annotations.Source: C. Evaluation Metrics · p. 5
D. Experiment Settings
- Experiments fine-tune four 7B LLMs for 15 epochs using QLoRA, AdamW, and a single NVIDIA RTX 5090 GPU.Source: D. Experiment Settings · p. 5
A. Main Results
- MITE achieves the best performance across the three evaluated BioNER benchmarks, surpassing representative BERT-based and LLM-based approaches.Source: A. Main Results · p. 5, Table II · p. 6
B. Cross-dataset Generalization Performance
- MITE achieves the best performance on all three unseen transfer datasets, including an F1 score of 85.30 on NLM-Gene.Source: B. Cross-dataset Generalization… · p. 6, Table III · p. 6
C. Ablation Study
Ablations indicate that multiple programming-language representations contribute complementary structure, while increasing one language’s data volume alone yields limited gains.
- Removing Python, C++, or Java lowers average Micro-F1 by 0.60, 0.46, or 0.53 points, respectively.Source: C. Ablation Study · p. 6
- At the same data scale as single-language 1× settings, MITEsampled-train reaches 89.62 and outperforms all single-language variants.Source: C. Ablation Study · p. 6, Table V · p. 7
- Expanding single-language corpora 3× by changing output order and docstrings yields gains of only 0.08, 0.09, and 0.03 points for Python, C++, and Java.Source: C. Ablation Study · p. 6
D. The Effect of LLM Backbone
MITE’s conclusion reports strong benchmark and transfer performance; analyses find base LLMs lead code-oriented backbones and voting improves single-language inference.
D. The Effect of LLM Backbone
- Base LLMs outperform code-oriented models across all three datasets, suggesting code-oriented pretraining does not necessarily benefit BioNER in this setting.Source: D. The Effect of LLM Backbone · p. 7
E. The Effect of Ensemble Strategies
- Entity-level voting raises the best single-language score from 89.05 to 90.14 for LLaMA2 and from 88.78 to 89.16 for CodeLLaMA.Source: E. The Effect of Ensemble Strategies · p. 7, Table VI · p. 7
VI. CONCLUSION
- Across six BioNER datasets, MITE outperforms representative baselines and shows cross-dataset generalization, with ablation and parameter analyses supporting its components.Source: §VI · p. 8