inseq  by inseq-team

Interpretability toolkit for sequence generation models

created 3 years ago
432 stars

Top 69.9% on sourcepulse

GitHubView on GitHub
Project Summary

Inseq is a Python toolkit for post-hoc interpretability analysis of sequence generation models, targeting researchers and practitioners in NLP. It democratizes access to various attribution methods, enabling deeper understanding of model behavior and facilitating reproducible research.

How It Works

Inseq integrates with Hugging Face Transformers, supporting both encoder-decoder and decoder-only architectures. It implements a wide range of attribution methods, including gradient-based (e.g., Integrated Gradients, DeepLIFT), attention-based, and perturbation-based techniques. The library allows for flexible post-processing of attribution maps via Aggregator classes and supports custom attribution targets using "step functions" to extract scores like logits, probabilities, or entropy at each generation step.

Quick Start & Requirements

Highlighted Details

  • Supports a broad spectrum of attribution methods, extending Captum's capabilities.
  • Offers visualization in notebooks, browsers, and the command line.
  • Includes a CLI for batch attribution on datasets and context dependence analysis.
  • Enables custom attribution targets and extraction of intermediate generation scores.

Maintenance & Community

Licensing & Compatibility

  • MIT License. Permissive for commercial use and integration with closed-source projects.

Limitations & Caveats

  • Python version compatibility is restricted to 3.10-3.12.
  • Installation of certain dependencies (tokenizers, sentencepiece) may require additional system-level setup.
Health Check
Last commit

3 months ago

Responsiveness

1 day

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

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems) and Carol Willing Carol Willing(Core Contributor to CPython, Jupyter).

genai by rgbkrk

0%
352
IPython extension for generative AI assistance in Jupyter notebooks
created 3 years ago
updated 1 year ago
Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), Andre Zayarni Andre Zayarni(Cofounder of Qdrant), and
1 more.

refinery by code-kern-ai

0.1%
1k
Open-source tool for NLP data scaling, assessment, and maintenance
created 3 years ago
updated 7 months ago
Feedback? Help us improve.