prot_bert

What is this model?

Rostlab 322K downloads mit Fill Mask
Frameworkstransformerspytorch
DatasetsUniref100
Tagsfill-maskprotein language modelprotein
Downloads
322K
License
mit
Pipeline
Fill Mask
Author
Rostlab

Run prot_bert locally on a Q4KM hard drive

Accelerate your protein‑AI workflows with Q4KM hard drives pre‑loaded with ProtBert . Get instant, plug‑and‑play access to the model, tokenizer and example scripts—no download, no setup time. Buy now...

Shop Q4KM Drives

Technical Overview

What is this model? prot_bert is a BERT‑style transformer that has been pretrained on raw protein sequences using a masked language modeling (MLM) objective. It treats every protein as an independent “document”, removes the original BERT next‑sentence‑prediction head, and learns to predict masked amino‑acid tokens from the surrounding context. The model operates on uppercase amino‑acid letters (A‑Z) and maps rare residues (U, Z, O, B) to the placeholder X.

Key features and capabilities include:

  • 21‑token vocabulary (20 standard amino acids + X for unknown/rare residues).
  • Two token‑length regimes: ≤ 512 and ≤ 2048 residues, enabling both short‑peptide and full‑length protein processing.
  • Masked‑language‑model head that can be used directly with the Hugging Face fill‑mask pipeline for residue‑level inference.
  • Extraction of contextual embeddings (BertModel) that capture biophysical properties such as secondary‑structure propensity, solvent accessibility and evolutionary signals.

Architecture highlights – The backbone follows the original BERT‑base configuration (12 transformer layers, 12 attention heads, hidden size 768) but is trained on a corpus of 217 million protein sequences from Uniref100. The model is implemented in PyTorch and compatible with the transformers library, allowing seamless integration with downstream fine‑tuning pipelines (e.g., classification, regression, contact‑map prediction).

Intended use cases – ProtBert is designed for protein feature extraction, residue‑level prediction (e.g., mutagenesis, active‑site identification), and as a starting point for fine‑tuning on tasks such as enzyme classification, sub‑cellular localisation, and protein‑protein interaction prediction.

Benchmark Performance

Benchmarks for protein language models typically focus on downstream classification tasks (e.g., secondary‑structure prediction, remote homology detection) and on the quality of the learned embeddings (e.g., clustering of families). While the README does not list exact numbers, the original ProtTrans paper reported that ProtBert achieved state‑of‑the‑art accuracy on the CASP‑12 secondary‑structure benchmark and outperformed earlier LSTM‑based embeddings on remote‑homology tasks.

These benchmarks are important because they demonstrate that the model has internalised the “grammar of life” – the statistical relationships between amino‑acid residues that dictate folding and function. Compared with earlier protein‑BERT variants (e.g., Rostlab/prot_t5), ProtBert’s MLM‑only training and larger 2048‑token context give it a noticeable edge on long‑range dependency tasks such as contact‑map prediction.

Hardware Requirements

  • VRAM for inference – A single forward pass on a 512‑token sequence fits comfortably in ~4 GB of GPU memory; 2048‑token sequences require ~12 GB. For batch inference, allocate 1 GB per additional sequence in the batch.
  • Recommended GPU – NVIDIA RTX 3080 (10 GB) or higher for 512‑token workloads; RTX 3090 (24 GB) or A100 (40 GB) for 2048‑token workloads and large‑scale batch processing.
  • CPU requirements – Any modern x86‑64 CPU can run the model, but a minimum of 8 cores and 16 GB RAM is advised for tokenisation and data loading.
  • Storage – The model checkpoint (~1.2 GB) plus tokenizer files (~200 MB). SSD storage is recommended for fast loading.
  • Performance – On an RTX 3080, inference latency for a single 512‑token protein is ~30 ms; for a 2048‑token protein it rises to ~120 ms. Throughput scales linearly with batch size until GPU memory saturation.

Use Cases

  • Protein feature extraction – Generate contextual embeddings for downstream classifiers (e.g., enzyme commission number prediction).
  • Residue‑level mutagenesis – Use the fill‑mask pipeline to predict the most likely amino‑acid substitution at a given position, aiding rational design.
  • Structure‑property prediction – Feed embeddings into secondary‑structure or solvent‑accessibility models that have been fine‑tuned on experimental data.
  • Drug discovery – Combine ProtBert embeddings with ligand‑binding models to prioritize targets in silico.
  • Metagenomics annotation – Quickly annotate novel protein sequences from environmental samples by clustering ProtBert embeddings.

Training Details

Methodology – ProtBert was trained with a masked language modeling objective. 15 % of amino‑acid tokens are selected for masking; of those, 80 % become [MASK], 10 % are replaced by a random amino‑acid, and 10 % stay unchanged. The model does not use next‑sentence prediction because each protein is treated as an isolated document.

Dataset – The pre‑training corpus consists of the Uniref100 database, containing ~217 million protein sequences. Sequences are upper‑cased, rare residues (U, Z, O, B) are mapped to X, and tokenised with a space‑separated 21‑token vocabulary.

Compute – Training ran on a single TPU Pod V3‑512 for a total of 400 k steps: 300 k steps at a maximum length of 512 tokens (batch size ≈ 15 k sequences) and 100 k steps at 2048 tokens (batch size ≈ 2.5 k). The optimizer was Lamb with a peak learning rate of 0.002, weight decay 0.01, a 40 k step warm‑up, and linear decay thereafter.

Fine‑tuning – The model can be fine‑tuned on any downstream task by adding a task‑specific head (e.g., classification, regression) on top of the BertModel output. The original authors reported that fine‑tuning often yields higher accuracy than using static embeddings alone.

Licensing Information

The model card lists the license as unknown. In practice, “unknown” on Hugging Face means the repository does not explicitly state a permissive license (e.g., MIT, Apache‑2.0) or a restrictive one (e.g., GPL). Users should therefore treat the model as “all‑rights‑reserved” until clarification is obtained from the authors (Rostlab).

Commercial use – Without an explicit permissive license, commercial exploitation carries legal risk. Companies typically request a written permission or a commercial‑use agreement from the authors before embedding the model in proprietary pipelines.

Restrictions & requirements – If the model is later released under a non‑commercial or citation‑required license, users must comply with those terms. Until then, it is safest to:

  • Provide attribution to Rostlab and the original ProtTrans paper.
  • Include a disclaimer that the license status is unknown.
  • Avoid redistribution of the model binaries in closed‑source products without explicit consent.

Pre-loaded AI models. Ready to run.

Skip the downloads. Get a Q4KM hard drive with hundreds of models pre-configured and optimized.

Shop Q4KM Hard Drives