GithubHelp home page GithubHelp logo

poppingtonic / transformer-visualization Goto Github PK

View Code? Open in Web Editor NEW
8.0 4.0 2.0 5.27 MB

Mechanistic Interpretability Tutorials, Results and research log as I learn from publicly available research, and experimentation.

Jupyter Notebook 99.84% Python 0.16%
interpretable-ai transformers gradio-interface visualization interpretability-jam

transformer-visualization's Introduction

Learning Mechanistic Interpretability on Transformers with EasyTransformer (now TransformerLens)

by Brian Muhia

Fahamu, Inc

This repository houses the beginnings of a tutorial on mechanistic interpretability for Transformer language models.

Pedagogy

So far, we have:

  1. Published a usable visualiser for tokens, fashioned from the Hacky Interactive Lexoscope by Neel Nanda.
  2. Written notes from rewriting EasyTransformer_Demo.ipynb by Neel, in order to learn the library and how to use it.

Output

  1. Applied some tools and ideas in the demo towards observing induction heads in SOLU-8l-old, also trained by Neel.
  2. Generated IOI-style datasets:
    • pkl_ioi_data.pkl is 100000 rows of IOI sentences from ABBA templates, most of which use multi-token terms.
    • https://huggingface.co/datasets/fahamu/ioi
      • mecha_ioi_26m.parquet is 26,010,000 rows of IOI sentences, mixing ABBA and BABA templates
      • mecha_ioi_200k.parquet is 200,000 rows of IOI sentences, mixing ABBA and BABA templates

All inspired by the paper Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 small, from Redwood Research. We are not affiliated with Redwood Research, and release this dataset to contribute to the collective research effort behind understanding how Transformer language models perform this task.

With thanks and Acknowledgements:
  • Esben Kran, Sabrina Zaki - for hosting the Interpretability Jam, which accelerated this work.
  • Neel Nanda - for publishing TransformerLens and making public his research process. Wonderful gifts!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.