Inferensys

Glossary

BIO Tagging

A token-level annotation scheme for sequence labeling where tokens are tagged as Beginning, Inside, or Outside of a named entity span.
Technical lab environment with sensor equipment and analytical workstations.
TOKEN-LEVEL ANNOTATION SCHEME

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.

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.

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.

TOKEN-LEVEL ANNOTATION SCHEME

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.

01

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-PER for the first name).
  • I-[TYPE]: Marks Inside tokens of a multi-word entity (e.g., I-PER for 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.

3
Core Tag Types
CoNLL-2003
Standard Benchmark
02

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-PER
  • John/B-PER, Smith/I-PER

This prevents the model from merging distinct entities into one incorrect span.

03

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-PER for 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.

04

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.

05

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.

06

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.

BIO TAGGING

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.

TOKEN-LEVEL ANNOTATION SCHEMES

BIO vs. Other Tagging Schemes

A comparison of sequence labeling schemes used to encode named entity spans for token classification models.

FeatureBIOBIOESIO

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

Prasad Kumkar

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.