BIO tagging (also known as IOB tagging) is a token-level annotation scheme for sequence labeling where every token in a text sequence is assigned a tag indicating its position relative to a named entity. The scheme uses three core labels: B- marks the Beginning token of an entity, I- marks tokens Inside the entity, and O marks tokens Outside any entity. A suffix specifies the entity type, such as B-PER for the start of a person name or I-ORG for an inside token of an organization.
Glossary
BIO Tagging

What is BIO Tagging?
BIO tagging is the foundational sequence labeling scheme for Named Entity Recognition, encoding entity boundaries by classifying each token as the Beginning, Inside, or Outside of a named entity span.
This encoding transforms the Named Entity Recognition task into a token classification problem solvable by models like Conditional Random Fields (CRF) or fine-tuned transformers. The scheme enables unambiguous representation of multi-token entities and adjacent entities of the same type, where B- distinguishes the boundary. Variants include BILOU (adding Last and Unit tags) and IOB2, but the standard BIO format remains the dominant annotation standard, notably used in the CoNLL-2003 benchmark dataset.
Core Characteristics of BIO Tagging
BIO tagging is the foundational sequence labeling scheme for Named Entity Recognition, where each token is classified as the Beginning, Inside, or Outside of an entity span, enabling unambiguous boundary detection.
The B-I-O Tag Convention
The scheme assigns one of three tags to every token in a sentence:
- B-
[TYPE]: Marks the Beginning token of an entity (e.g.,B-PERfor the first name). - I-
[TYPE]: Marks Inside tokens of a multi-word entity (e.g.,I-PERfor a surname). - O: Marks tokens Outside any named entity.
This explicitly encodes entity boundaries, distinguishing "New York" (B-LOC, I-LOC) from two separate locations.
Disambiguation of Adjacent Entities
The primary advantage of BIO over simpler IO tagging is the resolution of adjacent entities of the same type. Without the B- prefix, the sequence I-PER I-PER could represent one entity or two.
BIO enforces that every new entity starts with a B- tag. Therefore, "President Jane Doe met John Smith" is correctly tagged as:
Jane/B-PER,Doe/I-PERJohn/B-PER,Smith/I-PER
This prevents the model from merging distinct entities into one incorrect span.
BILOU Variant for Boundary Precision
An extended scheme called BILOU (or BIOES) adds two more tags for finer-grained span representation:
- L-
[TYPE]: Last token of an entity (e.g.,L-PERfor a single-word entity or the final token). - U-
[TYPE]: Unit or singleton entity, a single token that is both beginning and end.
This provides explicit end-boundary signals, which can improve performance on span-level tasks but increases the total number of output classes the classifier must learn.
Tokenization Alignment Challenges
BIO tagging assumes a 1:1 mapping between tokens and labels, but modern subword tokenizers like Byte-Pair Encoding (BPE) or WordPiece fragment words. The word "Johansson" might become ["Johan", "##sson"].
Standard mitigation strategies include:
- Assigning the original entity label only to the first subword token and giving subsequent subwords a special ignore label during loss calculation.
- Using span-level masking to compute loss only on whole-entity reconstructions.
Misalignment here is a common source of silent evaluation errors.
Encoding for Sequence Models
BIO tags are treated as categorical labels in a many-to-many sequence prediction task. A linear-chain Conditional Random Field (CRF) is often stacked on top of neural encoders like BERT to model the transition constraints between adjacent tags.
The CRF learns valid transitions (e.g., I-PER cannot follow O without a B-PER) and prevents illegal sequences during Viterbi decoding, enforcing the structural integrity of the BIO scheme at inference time.
Evaluation via Span-Level Matching
Performance is not evaluated on token-level accuracy due to the heavy class imbalance toward the O tag. Instead, the BIO tag sequence is decoded back into entity spans, and Mention-Level F1 is computed.
A predicted entity is considered a true positive only if both its span boundaries (start and end tokens) and its entity type match the gold standard annotation exactly. A single token shift (e.g., missing a determiner) results in a false positive and a false negative.
Frequently Asked Questions
Clear, technical answers to the most common questions about the BIO tagging scheme for token-level sequence labeling in Named Entity Recognition.
BIO tagging is a token-level annotation scheme for sequence labeling where each token in a text is assigned a tag indicating whether it is at the Beginning, Inside, or Outside of a named entity span. The scheme encodes entity boundaries by marking the first token of an entity with a B- prefix (e.g., B-PER) and all subsequent tokens within the same entity with an I- prefix (e.g., I-PER). Tokens that do not belong to any entity are tagged as O. For example, the sentence 'John Smith visited Paris' would be tagged as: John (B-PER), Smith (I-PER), visited (O), Paris (B-LOC). This unambiguous boundary encoding allows sequence models like Conditional Random Fields to learn and predict structured entity spans without ambiguity about where one entity ends and another begins.
BIO vs. Other Tagging Schemes
A comparison of sequence labeling schemes used to encode named entity spans for token classification models.
| Feature | BIO | BIOES | IO |
|---|---|---|---|
Tag granularity | 3 tags per type | 5 tags per type | 1 tag per type |
Encodes entity boundaries | |||
Distinguishes entity types | |||
Handles adjacent entities | |||
Encodes single-token entities | B-tag only | S-tag | I-tag only |
Encodes entity end position | |||
Typical F1 improvement over IO | 2-4% | 2.5-4.5% | Baseline |
Annotation complexity | Moderate | Higher | Lowest |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Mastering BIO tagging requires understanding the sequence models, evaluation metrics, and alternative labeling schemes that form the backbone of modern Named Entity Recognition.
Conditional Random Fields (CRF)
A discriminative probabilistic model that serves as the decoding layer on top of neural networks for sequence labeling. CRFs model the conditional probability of an entire label sequence given the input tokens, enforcing valid transitions between BIO tags.
- Prevents impossible sequences like an I-ORG tag following an O tag
- Uses Viterbi decoding to find the globally optimal tag path
- Captures dependencies between adjacent labels that independent classifiers miss
Span Categorization
A modern NER paradigm that bypasses BIO tagging entirely by directly enumerating and classifying arbitrary text spans as entities. Instead of labeling every token, the model scores all possible start-end token pairs.
- Eliminates the sequence labeling constraint and invalid tag transition problem
- Naturally handles nested entities that BIO schemes struggle with
- Architectures like Global Pointer use multiplicative attention to score span boundaries
Mention-Level F1 Score
The standard evaluation metric for sequence labeling tasks that computes the harmonic mean of precision and recall based on exact span matching. A prediction is correct only if both the entity boundaries and the type classification match the gold standard.
- True Positive: Exact match of span and type
- False Positive: Predicted entity that does not match any gold entity
- False Negative: Gold entity missed entirely by the model
BIOES Variant
An extended tagging scheme that adds End and Single tags to the standard BIO format, providing explicit boundary information. This richer encoding helps models learn entity boundaries more effectively.
- B-PER: Beginning of a person entity
- I-PER: Inside a person entity
- E-PER: End of a person entity
- S-PER: Single-token person entity
- O: Outside any entity
The explicit end markers reduce ambiguity for multi-token entities.
Viterbi Decoding
A dynamic programming algorithm that efficiently finds the most probable sequence of hidden states in a linear-chain CRF. During inference, Viterbi computes the maximum over all possible BIO tag paths rather than greedily selecting the highest-scoring tag at each position.
- Guarantees globally optimal tag sequence under the model
- Enforces valid transitions like B-ORG → I-ORG → E-ORG
- Time complexity is O(n * s²) where n is sequence length and s is number of states
CoNLL-2003 Shared Task
The benchmark dataset that established the standard evaluation methodology for NER using BIO tagging. It defines four entity types across English and German newswire text.
- PER: Person names
- ORG: Organizations
- LOC: Locations
- MISC: Miscellaneous entities
The dataset's IOB2 tagging format became the de facto standard for training and evaluating sequence labeling models.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us