llm-transparency-tool  by facebookresearch

Interactive toolkit for analyzing Transformer-based language models

Created 1 year ago
843 stars

Top 42.3% on SourcePulse

GitHubView on GitHub
Project Summary

The LLM Transparency Tool (LLM-TT) provides an interactive, web-based interface for dissecting the internal mechanisms of Transformer-based language models. It is designed for researchers and practitioners seeking to understand model behavior, attention patterns, and neuron activations.

How It Works

LLM-TT leverages TransformerLens to create hooks into model layers, enabling detailed analysis of token contributions and representations. Users can visualize attention head contributions, explore neuron activations within Feed-Forward Networks (FFNs), and trace information flow through the model's layers. This approach allows for granular inspection of how specific tokens influence model outputs.

Quick Start & Requirements

  • Docker:
    docker build -t llm_transparency_tool .
    docker run --rm -p 7860:7860 llm_transparency_tool
    
  • Local Installation:
    git clone git@github.com:facebookresearch/llm-transparency-tool.git
    cd llm-transparency-tool
    conda env create --name llmtt -f env.yaml
    pip install -e .
    cd llm_transparency_tool/components/frontend
    yarn install
    yarn build
    
  • Launch:
    streamlit run llm_transparency_tool/server/app.py -- config/local.json
    
  • Prerequisites: Python 3.x, Conda, Yarn. Supports models already integrated with TransformerLens.
  • Demo: https://huggingface.co/spaces/facebook/llm-transparency-tool-demo

Highlighted Details

  • Interactive contribution graphs visualize token influence.
  • Detailed views of attention head and FFN neuron activity.
  • Supports models integrated with TransformerLens.
  • Includes citation for related research papers.

Maintenance & Community

Developed by facebookresearch. Links to relevant research papers are provided for citation.

Licensing & Compatibility

Licensed under CC BY-NC 4.0 (Creative Commons Attribution-NonCommercial 4.0 International). This license restricts commercial use and redistribution.

Limitations & Caveats

Adding support for models not already integrated with TransformerLens requires custom implementation of the TransparentLlm class and modifications to the Streamlit application. The CC BY-NC 4.0 license prohibits commercial use.

Health Check
Last Commit

11 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
5 stars in the last 30 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
7 more.

transformer-debugger by openai

0.0%
4k
Tool for language model behavior investigation
Created 1 year ago
Updated 1 year ago
Starred by Aravind Srinivas Aravind Srinivas(Cofounder of Perplexity), François Chollet François Chollet(Author of Keras; Cofounder of Ndea, ARC Prize), and
43 more.

spaCy by explosion

0.1%
33k
NLP library for production applications
Created 11 years ago
Updated 1 week ago
Feedback? Help us improve.