← All projects
AI models & research

BertViz

An interactive tool that shows which words an AI language model pays attention to.

New this week

What it does

Language models use a mechanism called attention to decide which words matter to each other. BertViz draws this as interactive pictures so you can see what is happening inside the model.

It offers several views: one layer at a time, a bird's-eye view of the whole model, and a close look at individual parts of the calculation. It works with most models from the Hugging Face library.

It runs inside Jupyter or Google Colab notebooks, and there is a ready-made Colab tutorial with all the views loaded.

Who it's for

Students, teachers and researchers who want to understand or explain how transformer models work.

Can I use it without coding?

Developers only. You run it from Python code in a notebook, though the Colab tutorial needs very little setup. New to this? Start here.

Can I run it?

Cost
FreeNothing to pay or sign up for.
Runs on
Web browser
Computer
An ordinary computer is fine
Privacy
Runs on your own device: your data stays with you
API key
Not needed

Try it

  1. Open the project's interactive Colab tutorial, which runs in your web browser with the views already loaded.

Using Claude Code, Cursor or another AI coding assistant? Paste the prompt and it will walk you through the setup.New to this?

Before you install

  • Only download from the official GitHub page. Copies with similar names exist for many popular projects.
  • License (Apache-2.0): Permissive: free to use, change and share, including for business.
  • More on staying safe