jessevig/bertviz

BertViz: Visualize Attention in Transformer Models

65
/ 100
Established

Provides three complementary visualization modes—head view (individual attention heads), model view (all layers/heads overview), and neuron view (query/key vector decomposition)—enabling multi-level analysis of transformer attention mechanisms. Integrates directly with Huggingface transformers via a simple Python API that works in Jupyter and Colab notebooks by extracting attention tensors from model outputs. Supports both encoder-only models (BERT, GPT-2) and encoder-decoder architectures (BART, T5) with interactive HTML visualizations.

7,945 stars. Available on PyPI.

Maintenance 10 / 25
Adoption 10 / 25
Maturity 25 / 25
Community 20 / 25

How are scores calculated?

Stars

7,945

Forks

871

Language

Python

License

Apache-2.0

Last pushed

Jan 08, 2026

Commits (30d)

0

Dependencies

8

Get this data via API

curl "https://pt-edge.onrender.com/api/v1/quality/transformers/jessevig/bertviz"

Open to everyone — 100 requests/day, no key needed. Get a free key for 1,000/day.