Skip to content

IgT5

T5 encoder-based antibody language model with paired and unpaired variants that produces sequence-level and per-residue embeddings for immunoglobulin sequences.

License: MIT · Molecules: antibody · Tasks: embedding

Actions: encode · Variants: 2

At a glance

Use it when

  • You specifically want T5-architecture embeddings for antibody sequences, either for architectural comparison against BERT-based models or because T5 relative position biases better suit your downstream task
  • You need paired or unpaired antibody embeddings from a well-benchmarked model and your downstream task requires only embedding features, not generation or scoring
  • You are comparing T5 vs BERT representation architectures for antibody property prediction and want models trained on the same dataset (IgT5 vs IgBERT from Kenlay et al. 2024)
  • You need embeddings as input features for training custom downstream ML models for antibody properties (binding affinity, expression, stability) and want a strong antibody-specific baseline
  • You are building a multi-model ensemble combining IgT5, IgBERT, and AbLang2 embeddings for improved downstream prediction through representation diversity
Strengths
  • T5 architecture with relative position biases (rather than absolute positional embeddings), which may better capture long-range dependencies between distant framework residues and CDR loops in variable-length antibody sequences
  • Both paired and unpaired variants in a single model family, enabling analysis of matched heavy-light chain pairs and individual chains depending on data availability
  • From the same large-scale paired antibody training dataset as IgBERT (Exscientia/Kenlay et al. 2024), providing a direct architecture comparison (T5 encoder vs BERT) on identical training data
  • Published benchmarks show IgT5 Paired achieves 91.63% VH accuracy on paired sequence recovery, establishing it as a competitive baseline for antibody language models
  • HuggingFace Transformers-compatible model weights, making integration with standard ML ecosystems and transfer learning pipelines straightforward
  • Permissively licensed (MIT per the HuggingFace model card; permits commercial use), suitable for therapeutic antibody development
  • Mean-pooled or per-residue embeddings capture both sequence-level and position-level representations for flexible downstream use
Limitations
  • Embedding-only model (encode action only): no sequence generation, masked prediction, or log-probability scoring -- limiting utility compared to IgBERT's three actions or AbLang2's four actions
  • Requires T4 GPU with 16 GB RAM for inference, making it more expensive than CPU-only models like AbLang2, and more expensive than IgBERT (6 GB RAM)
  • No germline debiasing in the training objective, so embeddings may conflate germline gene identity with functional properties, a known bias that AbLang2 explicitly addresses
  • Not specialized for nanobody (VHH) sequences; the unpaired variant can process them but lacks nanobody-specific training
  • Published CDR-aware benchmarks show compact fine-tuned models can surpass the 3B-parameter IgT5 by 16-25% on binding affinity prediction using 5x fewer parameters, suggesting the model may be overparameterized for some tasks
  • Two separate deployments required (paired and unpaired) to cover all use cases, adding infrastructure complexity
  • Embedding-only output means users cannot directly assess sequence plausibility or score mutations without training separate downstream models
Reach for something else when
  • You need sequence generation, masked residue prediction, or log-probability scoring -- use IgBERT (generate + log_prob actions) or AbLang2 (four actions including predict and generate)
  • You need germline-debiased antibody representations -- use AbLang2 with focal-loss training that explicitly reduces germline bias in embeddings
  • You are working with nanobody (VHH) sequences and need VHH-specific representations -- IgT5's unpaired variant can process VHH but is not nanobody-specialized; use AntiFold or ImmuneFold for nanobody-specific structural analysis
  • You need the most cost-effective antibody embeddings and GPU resources are limited -- use AbLang2 (CPU-only, 4 GB RAM)
  • You need 3D structure prediction -- use AbodyBuilder3, ImmuneBuilder, or ImmuneFold for structure prediction from sequence
  • You need developability property predictions -- use DeepViscosity for antibody viscosity or TemBERTure for thermostability (Tm)
  • You need antibody annotation (numbering, CDR boundaries, germline assignment) -- use SADIE as a preprocessing step

Alternatives

Model Better when Worse when
igbert IgBERT provides generate and log_prob actions in addition to encode, enabling sequence completion and scoring not available in IgT5; also uses less GPU memory (6 GB vs 16 GB) IgBERT uses BERT architecture while IgT5 uses T5 with relative position biases; for tasks sensitive to long-range dependencies in variable-length sequences, T5 may be advantageous
ablang2 AbLang2 provides four actions (encode, predict, generate, log_prob) with germline debiasing on CPU-only -- more functionality at lower compute cost AbLang2 requires paired input only and uses a custom library; IgT5 offers both paired and unpaired variants with HuggingFace compatibility for fine-tuning
esm2 ESM-2 covers all proteins with 5 size variants and the broadest downstream ecosystem; better for cross-protein-family analyses and when antibody-specific training is not critical ESM-2 is not antibody-specialized and cannot model paired heavy-light chains; IgT5's antibody-specific training produces more informative representations for antibody tasks

API & schema

Variants

Variant Endpoint slug GPU CPU Memory
paired igt5-paired t4 4.0 16 GB
unpaired igt5-unpaired t4 4.0 16 GB

Call an action with POST /api/v1/{slug}/{action} — the request envelope is {"items": [...], "params": {...}} and a success returns {"results": [...]}. See the HTTP API page for the base URL, error shape, and full contract.

encode

Call it

curl -X POST http://127.0.0.1:8000/api/v1/igt5-paired/encode \
  -H "Content-Type: application/json" \
  -d '{
  "items": [
    {}
  ]
}'

RequestIgT5EncodeRequest

Field Type Required Constraints Description
params IgT5EncodeRequestParams no Optional parameters controlling this action (defaults are used when omitted).
items list[IgT5EncodeRequestItem] yes items 1–8 Batch of inputs to process in a single request. Up to 8 sequences per request.
Nested types

IgT5EncodeIncludeOptions

Allowed values: mean, per_residue, per_residue

IgT5EncodeRequestItem

Field Type Required Constraints Description
heavy_chain string | null no Antibody heavy-chain amino-acid sequence.
light_chain string | null no Antibody light-chain amino-acid sequence.
sequence string | null no Single antibody-chain sequence in single-letter amino-acid codes (unpaired mode).

IgT5EncodeRequestParams

Field Type Required Constraints Description
include list[IgT5EncodeIncludeOptions] no default ['mean'] Optional outputs to compute and include in the response.
Raw JSON Schema
{
  "$defs": {
    "IgT5EncodeIncludeOptions": {
      "enum": [
        "mean",
        "per_residue",
        "per_residue"
      ],
      "title": "IgT5EncodeIncludeOptions",
      "type": "string"
    },
    "IgT5EncodeRequestItem": {
      "additionalProperties": false,
      "properties": {
        "heavy_chain": {
          "anyOf": [
            {
              "maxLength": 256,
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Antibody heavy-chain amino-acid sequence.",
          "title": "Heavy Chain"
        },
        "light_chain": {
          "anyOf": [
            {
              "maxLength": 256,
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Antibody light-chain amino-acid sequence.",
          "title": "Light Chain"
        },
        "sequence": {
          "anyOf": [
            {
              "maxLength": 512,
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Single antibody-chain sequence in single-letter amino-acid codes (unpaired mode).",
          "title": "Sequence"
        }
      },
      "title": "IgT5EncodeRequestItem",
      "type": "object"
    },
    "IgT5EncodeRequestParams": {
      "additionalProperties": false,
      "properties": {
        "include": {
          "description": "Optional outputs to compute and include in the response.",
          "items": {
            "$ref": "#/$defs/IgT5EncodeIncludeOptions"
          },
          "title": "Include",
          "type": "array",
          "default": [
            "mean"
          ]
        }
      },
      "title": "IgT5EncodeRequestParams",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "params": {
      "$ref": "#/$defs/IgT5EncodeRequestParams",
      "description": "Optional parameters controlling this action (defaults are used when omitted)."
    },
    "items": {
      "description": "Batch of inputs to process in a single request. Up to 8 sequences per request.",
      "items": {
        "$ref": "#/$defs/IgT5EncodeRequestItem"
      },
      "maxItems": 8,
      "minItems": 1,
      "title": "Items",
      "type": "array"
    }
  },
  "required": [
    "items"
  ],
  "title": "IgT5EncodeRequest",
  "type": "object"
}

ResponseIgT5EncodeResponse

Field Type Required Constraints Description
results list[IgT5EncodeResponseResult] yes Per-input results, returned in the same order as the request items.
Nested types

IgT5EncodeResponseResult

Field Type Required Constraints Description
embeddings list[number] | null no Mean-pooled embedding vector for the antibody sequence (included when 'mean' is in params.include).
residue_embeddings list[list[number]] | null no Per-residue embedding vectors.
Raw JSON Schema
{
  "$defs": {
    "IgT5EncodeResponseResult": {
      "additionalProperties": false,
      "properties": {
        "embeddings": {
          "anyOf": [
            {
              "items": {
                "type": "number"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Mean-pooled embedding vector for the antibody sequence (included when 'mean' is in params.include).",
          "title": "Embeddings"
        },
        "residue_embeddings": {
          "anyOf": [
            {
              "items": {
                "items": {
                  "type": "number"
                },
                "type": "array"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Per-residue embedding vectors.",
          "title": "Residue Embeddings"
        }
      },
      "title": "IgT5EncodeResponseResult",
      "type": "object"
    }
  },
  "properties": {
    "results": {
      "description": "Per-input results, returned in the same order as the request items.",
      "items": {
        "$ref": "#/$defs/IgT5EncodeResponseResult"
      },
      "title": "Results",
      "type": "array"
    }
  },
  "required": [
    "results"
  ],
  "title": "IgT5EncodeResponse",
  "type": "object"
}

Usage

One-line summary: T5 encoder-based antibody language model with paired and unpaired variants that produces sequence-level and per-residue embeddings for immunoglobulin sequences.

Overview

IgT5 (Immunoglobulin T5) is an antibody language model developed by Kenlay, Dreyer, Sherborne, and Deane. It uses the encoder component of the T5 architecture, fine-tuned on large-scale antibody sequence data. IgT5 is available in two variants: a paired variant that processes concatenated heavy-light chain sequences and an unpaired variant for individual chain analysis.

IgT5 is published alongside IgBERT in "Large scale paired antibody language models" (Kenlay et al., 2024). While both models target antibody representation learning, IgT5 uses the T5 encoder (with relative position biases) and IgBERT uses BERT (with absolute positional embeddings). IgT5 is an embedding-only model -- for sequence generation or log-probability scoring, use IgBERT instead.

Architecture

Property Value
Architecture T5 encoder (T5EncoderModel)
Training objective Span corruption
Training data Large-scale antibody sequences (Exscientia)
Tokenizer T5Tokenizer (SentencePiece)
Positional encoding Relative position biases
License MIT (HuggingFace model card)

License note: The HuggingFace model card (Exscientia/IgT5) declares license: mit, which we adopt as the more permissive option. A separate Zenodo deposit of the same weights (DOI 10.5281/zenodo.10876909) lists CC-BY-4.0; since Exscientia is the rights-holder for both releases, we assert MIT and provide attribution to satisfy either license.

Capabilities & Limitations

CAN be used for: - Generating mean-pooled sequence embeddings for antibody sequences - Generating per-residue embeddings for position-level analysis - Both paired (heavy+light) and unpaired (single chain) analysis

CANNOT be used for: - Masked residue prediction / sequence generation (use IgBERT instead) - Log-probability sequence scoring (use IgBERT instead) - Non-antibody proteins (use ESM-2 or similar) - 3D structure prediction - Antibody numbering and annotation (use SADIE) - Mixing paired and unpaired items in a single request

Other considerations: - Both variants require GPU (T4) - Batch size capped at 8 sequences per request - All items in a request must match the deployed variant (all paired or all unpaired)

Usage Examples

# Encode -- paired antibody embeddings
from models.igt5.schema import (
    IgT5EncodeRequest,
    IgT5EncodeRequestItem,
    IgT5EncodeRequestParams,
)

encode_request = IgT5EncodeRequest(
    params=IgT5EncodeRequestParams(include=["mean"]),
    items=[
        IgT5EncodeRequestItem(
            heavy_chain="QVQLVQSGAEVKKPGASVKVSCKVSGYTSPTTIHWVRQAPGKGLEWMG",
            light_chain="DIQMTQSPSSVSASVGDRVTITCRASQSIGSFLAWYQQKPGKAPKLLIY",
        ),
    ],
)

# Encode -- unpaired single chain with residue embeddings
encode_unpaired = IgT5EncodeRequest(
    params=IgT5EncodeRequestParams(include=["mean", "residue"]),
    items=[
        IgT5EncodeRequestItem(
            sequence="QVQLVQSGAEVKKPGASVKVSCKVSGYTSPTTIHWVRQAPGKGLEWMG",
        ),
    ],
)

Architecture & training

Architecture

Model Type & Innovation

IgT5 is an antibody language model based on the T5 (Text-to-Text Transfer Transformer) encoder architecture. It is part of the same research effort as IgBERT, providing an alternative architectural approach to antibody representation learning. While IgBERT uses a BERT encoder, IgT5 uses the encoder component of T5 (T5EncoderModel), which employs relative position biases instead of absolute positional embeddings.

The key innovation of IgT5, shared with IgBERT, is the availability of both paired and unpaired variants trained at scale on antibody sequences. The paired variant processes concatenated heavy-light chain sequences with a </s> separator, while the unpaired variant processes individual chains.

IgT5 uses the T5 architecture from HuggingFace Transformers with a SentencePiece tokenizer, making it compatible with the broader Transformers ecosystem.

Parameters & Layers

Variant Model ID Input Type Max Seq Length
igt5-paired IgT5 Heavy + </s> + Light 256 per chain
igt5-unpaired IgT5_unpaired Single chain 512
Property Value
Architecture T5 encoder (T5EncoderModel)
Training objective Span corruption (T5 pre-training)
Tokenizer T5Tokenizer (SentencePiece-based)
Positional encoding Relative position biases

Training Data

Property Details
Dataset Large-scale antibody sequences (Exscientia)
Composition Antibody heavy and light chains
Pre-training base T5 model fine-tuned on antibody data

Loss Function & Objective

T5-style span corruption objective adapted for antibody sequences. During pre-training, contiguous spans of tokens are replaced with sentinel tokens, and the model learns to reconstruct the original spans.

Tokenization / Input Processing

Property Details
Tokenizer T5Tokenizer (SentencePiece, case-sensitive)
Paired input H E A V Y </s> L I G H T (space-separated residues)
Unpaired input S E Q U E N C E (space-separated residues)
Special tokens </s> (separator/end), <pad>
Max paired length 256 residues per chain
Max unpaired length 512 residues
Batch size 8 sequences

Performance & Benchmarks

Published Benchmarks

IgT5 is evaluated alongside IgBERT in the same paper, comparing BERT and T5 architectures for antibody representation learning.

Key findings from the paper (Kenlay et al. 2024, arXiv: 2403.17889): - T5 encoder produces competitive or superior embeddings compared to BERT for some downstream tasks - Relative position biases may better capture long-range dependencies in antibody sequences - Both paired and unpaired variants benefit from large-scale training

BioLM Verification Results

The BioLM implementation loads official pre-trained weights from HuggingFace via T5EncoderModel.from_pretrained(). Numerical verification is performed against golden reference outputs:

Metric Threshold Status
Relative tolerance 1e-4 PASS

Tests cover the encode action for both paired and unpaired variants.

Comparison to Alternatives

Model Type Key Advantage Key Disadvantage
IgT5 (this) Antibody LM (T5) Relative position biases, paired+unpaired Encode only
IgBERT Antibody LM (BERT) Generate and log_prob actions Absolute positions
AbLang2 Antibody LM Germline debiasing, multiple modes Paired only
ESM-2 General protein LM Broad protein coverage Not antibody-specialized

Error Bars & Confidence

IgT5 is deterministic when seeds are set. The same input produces the same output on the same hardware.

Strengths & Limitations

Pros

  • T5 architecture with relative position biases
  • Both paired and unpaired variants
  • HuggingFace Transformers compatible
  • GPU-accelerated inference on T4
  • Mean-pooled and per-residue embedding outputs

Cons

  • Encode-only (no generate or log_prob actions)
  • MIT per the HuggingFace model card; Zenodo lists CC-BY-4.0
  • Smaller batch size (8 vs 32 for IgBERT) due to larger model footprint
  • Higher memory requirements than IgBERT (16 GB vs 6 GB)

Known Failure Modes

  • Mixed paired/unpaired requests: All items in a batch must be the same type; mixed requests will raise an error
  • Very short sequences: Sequences shorter than ~10 residues may produce low-quality embeddings
  • Non-antibody input: The model expects immunoglobulin sequences

Implementation Details

Inference Pipeline

Request
  |-- 1. Validate sequences (alphabet, length, paired vs unpaired)
  |-- 2. Infer request type (_kind: paired or unpaired)
  |-- 3. Verify request type matches deployed model variant
  |-- 4. Format input:
  |     |-- Paired: "H E A V Y </s> L I G H T"
  |     |-- Unpaired: "S E Q U E N C E"
  |-- 5. Tokenize with T5Tokenizer (batch_encode_plus)
  |-- 6. Forward pass on GPU (torch.no_grad)
  |     |-- T5EncoderModel -> last_hidden_state
  |     |-- Mask special tokens
  |     |-- Mean pool or return per-residue
  |-- 7. Return IgT5EncodeResponse

Memory & Compute Profile

Variant GPU Memory CPU
igt5-paired T4 16 GB 4 cores
igt5-unpaired T4 16 GB 4 cores

Determinism & Reproducibility

Setting Value
torch.manual_seed 42
torch.cuda.manual_seed_all 42
torch.no_grad Yes (inference)
model.eval() Yes
GPU memory snapshot Enabled

Caching Behavior

Response caching is handled outside the model container by the serving layer.

Versions & Changelog

Version Date Changes
v1 2025-01-30 Initial implementation with encode action

Biology

Molecule Coverage

Primary Molecule Type(s)

IgT5 is trained on immunoglobulin (antibody) sequences, supporting both paired heavy-light chain analysis and individual chain analysis depending on the deployed variant. The model operates at the amino acid level and produces dense vector embeddings suitable for downstream computational tasks.

IgT5 handles different antibody regions and contexts:

  • Variable domains (VH/VL): Primary target. Both framework and CDR regions are well-represented.
  • Paired sequences: The paired variant learns cross-chain representations, capturing how VH and VL domains interact.
  • Unpaired sequences: The unpaired variant processes individual chains independently, useful when pairing information is unavailable.

Cross-Applicability

Molecule Type Applicability Evidence Caveats
IgG antibodies (paired) High Primary training target for paired variant Use igt5-paired variant
IgG antibodies (single chain) High Primary training target for unpaired variant Use igt5-unpaired variant
Nanobodies (VHH) Low--Moderate Single-domain; could use unpaired variant Not specifically trained on nanobodies
TCRs Low Some structural homology Not trained on TCR data
General proteins Not applicable Antibody-specialized model Use ESM-2 or similar

Biological Problems Addressed

Antibody Sequence Embedding

Problem: Computational analysis of antibody sequences requires numerical representations that capture relevant biophysical and functional properties. The choice of embedding model can significantly impact the quality of downstream analyses such as clustering, similarity search, and property prediction.

How IgT5 helps: The encode action produces mean-pooled or per-residue embeddings from the T5 encoder's last hidden state. These embeddings are specialized for antibody sequences and capture both intra-chain and (for the paired variant) inter-chain sequence features.

Biological meaning: IgT5 embeddings represent antibody sequences in a high-dimensional space where proximity correlates with functional and structural similarity. The T5 architecture's relative position biases may provide advantages for capturing long-range dependencies, such as between distant framework residues that form the VH-VL interface or between CDR loops that are distant in sequence but proximal in 3D space.

Paired Chain Representation

Problem: Antibody binding specificity is determined by the combined paratope formed by VH and VL CDR loops. Analyzing chains independently loses information about how the two chains work together.

How IgT5 helps: The paired variant processes both chains in a single forward pass with a </s> separator, producing embeddings that encode cross-chain information. This is particularly valuable for tasks that depend on the combined properties of both chains.

Biological meaning: Paired embeddings encode the joint VH-VL sequence context. Two antibodies with identical heavy chains but different light chains will produce different paired embeddings, reflecting the biological reality that light chain identity influences antigen specificity, affinity, and developability properties.

Applied Use Cases

IgT5 is primarily an embedding model suitable for:

  • Antibody repertoire clustering: Group antibody sequences by functional similarity using embedding distance (published)
  • Paired chain analysis: Study heavy-light chain compatibility and pairing preferences (published)
  • Feature extraction for property prediction: Use IgT5 embeddings as input features for downstream ML models predicting binding affinity, expression level, or stability (anticipated)
  • Antibody similarity search: Find functionally similar antibodies across different germline families (anticipated)

Companion Models

  • IgBERT: BERT-based companion model from the same paper. Offers generate and log_prob actions not available in IgT5. Use IgBERT when you need masked prediction or sequence scoring.

Complementary Models

  • SADIE: Use for antibody numbering and annotation before IgT5 embedding
  • AbLang2: Alternative antibody LM with germline debiasing and additional capabilities (restore, likelihood)

Typical multi-model workflows: 1. Use SADIE to annotate sequences and extract variable domains 2. Use IgT5 encode to generate embeddings for clustering or property prediction 3. Use IgBERT log_prob to score top candidates from the analysis

Alternative Models

Alternative Advantage Over IgT5 Disadvantage vs IgT5
IgBERT Generate + log_prob actions, smaller memory footprint BERT vs T5 architecture
AbLang2 Germline debiasing, restore mode, likelihood Paired only, custom library
ESM-2 Broad protein coverage, multiple size variants Not antibody-specialized
ProtT5 General protein T5, generation capable Not antibody-specialized

When to choose IgT5: Use IgT5 when you specifically want T5-architecture embeddings for antibody sequences, or when comparing T5 vs BERT representations for your downstream task.

When to choose alternatives: Consider IgBERT for sequence generation and scoring; consider AbLang2 for germline-debiased representations; consider ESM-2 for general protein analysis.

Biological Background

Antibodies are modular proteins with a conserved architecture: each arm of the Y-shaped molecule contains a variable domain (Fab) responsible for antigen binding and a constant domain (Fc) responsible for effector functions. The variable domain is composed of the VH (heavy chain variable) and VL (light chain variable) regions, each contributing three CDR loops to the antigen-binding surface.

Sequence-function relationship: The amino acid sequence of the variable domain encodes information about binding specificity, affinity, stability, and developability. Language models trained on large antibody sequence datasets learn statistical patterns that correlate with these functional properties, enabling computational prediction and design.

T5 architecture for antibodies: The T5 model's use of relative position biases (rather than absolute positional embeddings) means the model attends to the distance between positions rather than their absolute location. This may be advantageous for antibody sequences where the relative positions of CDR loops and framework regions carry more biological information than their absolute positions, especially given that antibody sequences vary in length (particularly CDR-H3).

Key terminology: - T5 (Text-to-Text Transfer Transformer): A transformer model originally developed for NLP that uses an encoder-decoder architecture. IgT5 uses only the encoder. - Relative position bias: Attention weights that depend on the distance between query and key positions, rather than their absolute positions. - Mean pooling: Averaging per-residue embeddings (excluding special tokens) to produce a single fixed-length vector per sequence. - Embedding: A dense numerical vector representing a sequence in a high-dimensional space.


Sources & license

License: MIT (text) — HuggingFace model card (Exscientia/IgT5) declares "license: mit", which we adopt as the more permissive option (owner-set metadata, authoritative). A separate Zenodo deposit of the same weights (DOI 10.5281/zenodo.10876909) lists CC-BY-4.0. Since Exscientia is the rights-holder for both releases, we assert MIT and provide attribution to satisfy either license. No Exscientia GitHub repo exists to cross-check.

Papers

  • Large scale paired antibody language models — arXiv preprint, 2024 · arXiv

Source repositories

Cite

@article{kenlay2024large,
  title={Large scale paired antibody language models},
  author={Kenlay, Henry and Dreyer, Fr{\'e}d{\'e}ric A and Sherborne, Berton and Deane, Charlotte M},
  journal={arXiv preprint arXiv:2403.17889},
  year={2024}
}