ecco  by jalammar

Python library for interactive NLP model visualization in Jupyter notebooks

created 4 years ago
2,044 stars

Top 22.2% on sourcepulse

GitHubView on GitHub
Project Summary

Ecco is a Python library designed for exploring and explaining the behavior of Transformer-based NLP models within Jupyter notebooks. It targets researchers and practitioners who need to understand how models like GPT2, BERT, and T5 arrive at their predictions, offering interactive visualizations to demystify complex internal workings.

How It Works

Ecco leverages PyTorch and Hugging Face's transformers library to provide a suite of tools for analyzing pre-trained models. Its core approach involves capturing and visualizing intermediate states, neuron activations, and feature attributions. Techniques like Integrated Gradients, DeepLift, and various Canonical Correlation Analysis (CCA) methods are employed to identify influential input tokens and uncover activation patterns within the model's feed-forward networks.

Quick Start & Requirements

  • Install via pip: pip install ecco or conda: conda install -c conda-forge ecco.
  • Requires Python and PyTorch. Compatible with Hugging Face transformers models.
  • Official documentation: ecco.readthedocs.io.
  • Examples and Colab notebooks are available.

Highlighted Details

  • Supports a wide range of Hugging Face models (GPT2, BERT, RoBERTa, T5, T0) and allows adding custom local models.
  • Integrates multiple feature attribution methods via Captum for detailed input-output analysis.
  • Visualizes neuron activation patterns using Non-negative Matrix Factorization (NMF) and compares activation spaces with SVCCA, PWCCA, and CKA.
  • Offers interactive "logit lens" visualizations to track token processing through model layers.

Maintenance & Community

  • Presented at ACL System Demonstrations 2021.
  • Discussion board and issue tracker available for help and bug reporting.

Licensing & Compatibility

  • The README does not explicitly state a license. Compatibility for commercial use or closed-source linking is not specified.

Limitations & Caveats

  • The library is currently in alpha release as a research project.
  • Focuses solely on exploring and understanding existing pre-trained models, not on training or fine-tuning.
Health Check
Last commit

11 months ago

Responsiveness

1 week

Pull Requests (30d)
0
Issues (30d)
0
Star History
15 stars in the last 90 days

Explore Similar Projects

Starred by Anastasios Angelopoulos Anastasios Angelopoulos(Cofounder of LMArena), Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), and
3 more.

transformer-debugger by openai

0.1%
4k
Tool for language model behavior investigation
created 1 year ago
updated 1 year ago
Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), Elie Bursztein Elie Bursztein(Cybersecurity Lead at Google DeepMind), and
1 more.

alibi by SeldonIO

0.1%
3k
Python library for ML model inspection and interpretation
created 6 years ago
updated 1 month ago
Feedback? Help us improve.