# jessevig/bertviz

BertViz: Visualize Attention in Transformer Models

Repository: https://github.com/jessevig/bertviz
Canonical: https://ross.abutalabs.com/products/bertviz
Language: Python
License: Apache-2.0
License Family: permissive
Topics: natural-language-processing, machine-learning, visualization, neural-network, pytorch, nlp, bert, transformer, gpt2, roberta, transformers
Last push: 2026-01-08T22:38:46+00:00

## Health v2 (maintenance only)
Score: 50/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 61, release rhythm 8, longevity 100
- inputs: {"age_days": 2817, "days_push": 237, "days_rel": 458, "gap_med": null, "n_releases_24m": 1}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 8160, forks 885 (observed 2026-08-28T04:10:13.958063+00:00)

## What it is
BertViz is an interactive Python library for visualizing attention mechanisms in Transformer language models such as BERT, GPT-2, and RoBERTa. It runs inside Jupyter or Colab notebooks via a simple API supporting most Huggingface models, offering head, model, and neuron views.

## Use cases
- visualize attention heads in a BERT model
- understand how transformer layers attend to tokens
- debug why a Huggingface model attends to certain words
- create interactive attention visualizations in a Jupyter notebook
- teach students how self-attention works
- explore query and key neuron interactions in attention computation

## When to choose
- you need interactive attention visualizations for Huggingface transformer models
- you work in Jupyter or Colab notebooks
- you want multiple views (head, model, neuron) of attention
- you are teaching or researching transformer interpretability

## When to avoid
- you need production model serving or inference
- you use models outside the Huggingface ecosystem
- you need visualizations outside notebook environments
- you want general-purpose neural network visualization beyond attention

## Facets
- artifact type: library
- maturity: stable
- function: data-visualization, nlp, machine-learning
- domain: machine-learning, data-visualization, deep-learning
- platform: python, jvm-scripting
- tags: transformer-attention, bert, gpt-2, huggingface, jupyter-notebook, colab, interpretability, pytorch, natural-language-processing

## Member repositories
- jessevig/bertviz (main) score 50

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:10:13.958063+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:29:44.992438+00:00, confidence not recorded.
  - readme: https://github.com/jessevig/bertviz (fetched 2026-08-28T04:10:13.958063+00:00, sha f34e37673812)
  - registry_pypi: https://pypi.org/pypi/bertviz/json (fetched 2026-08-29T08:28:23.876159+00:00, sha ed8f1ac8cf9c)
- Data as of 2026-08-30T08:39:29.467469+00:00.
