OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Evaluation & Observability

Inseq

Inseq is an open-source Python toolkit for post-hoc feature-attribution analysis of sequence-generation models. It calculates and visualizes token-level attribution scores and supports attribution methods, aggregation and custom target functions.

Independent OpenViST project profile, based on linked sources.

Inseq — OpenViST project profile in AI Evaluation & Observability.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use Inseq when you need post-hoc, token-level attribution analysis for sequence-generation outputs and want to work with the results in Python, notebooks, a browser or the command line.

Who it is for

  • Researchers analyzing how inputs contribute to generated text or translations.
  • Developers incorporating attribution analysis into sequence-to-sequence or language-generation research workflows.
  • Practitioners working with supported Hugging Face encoder-decoder and decoder-only models.

Documented uses

  • Attribute input tokens in a generated sequence using a feature-attribution method.
  • Inspect attribution scores through notebook, browser or command-line visualizations.
  • Process an individual example or a Hugging Face dataset through the CLI.
  • Post-process, filter or merge attribution maps with aggregator classes.
Before you choose

Requirements & limits

The repository identifies Inseq as open source under the Apache-2.0 license. Installation instructions specify Python 3.10 through 3.13.

  • The documented model scope covers most Hugging Face Transformers ForConditionalGeneration and ForCausalLM models.
  • The project supports multiple attribution methods, including methods extending those available in Captum.
  • Visualization options include notebooks, browser and command line; dataset attribution is available through the CLI.
  • Notebook visualization and Hugging Face datasets attribution are documented as optional installation extras.
  • The installation FAQ notes extra system dependencies for some packages: Rust for tokenizers and build packages for sentencepiece.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Attribute a translation with Integrated Gradients

Produce and display token-level attribution scores for a translation input using the documented Python example.

Before you start

  • Python 3.10 through 3.13
  • Inseq installed with pip
  • A supported Hugging Face sequence-generation model

Steps

  1. Install Inseq with the command below.

    Documented command
    pip install inseq
  2. Import inseq and load Helsinki-NLP/opus-mt-en-fr with the integrated_gradients method.

  3. Call model.attribute() with the example sentence and n_steps=100.

  4. Call .show() on the returned attribution output.

Expected outcome

Displays attribution scores for tokens in the input sentence; the example describes automatic token-level aggregation.

Guide limitations

  • The guide follows the repository's translation example and does not establish suitability for every model or task.
  • Some dependencies may require additional tooling, including Rust for tokenizers and system build packages for sentencepiece.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
14 October 2026
Original website title
inseq-team/inseq · Official homepage title · retained in its source language