inseq  by inseq-team

Interpretability toolkit for sequence generation models

Created 4 years ago
438 stars

Top 68.2% 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

4 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
2
Star History
4 stars in the last 30 days

Explore Similar Projects

Starred by Shizhe Diao Shizhe Diao(Author of LMFlow; Research Scientist at NVIDIA), Tri Dao Tri Dao(Chief Scientist at Together AI), and
1 more.

hnet by goombalab

1.5%
722
Hierarchical sequence modeling with dynamic chunking
Created 2 months ago
Updated 1 month ago
Starred by Shizhe Diao Shizhe Diao(Author of LMFlow; Research Scientist at NVIDIA), Vincent Weisser Vincent Weisser(Cofounder of Prime Intellect), and
8 more.

galai by paperswithcode

0%
3k
Scientific language model API
Created 2 years ago
Updated 2 years ago
Feedback? Help us improve.