Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 610789991
  • Loading branch information
iftenney authored and LIT team committed Feb 27, 2024
1 parent 62f18b2 commit f0417c9
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
5 changes: 3 additions & 2 deletions website/sphinx_src/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ You don't have to call the field "label", and it's okay if this field isn't
present in the *dataset* - as long as it's something that the model will
recognize and use as the target to derive gradients.

## Sequence salience
## Sequence Salience

Sequence salience generalizes token-based salience to text-to-text models,
allowing you to explain the impact of the prompt tokens on parts of the model
Expand Down Expand Up @@ -468,7 +468,8 @@ https://ai.google.dev/responsible/model_behavior.

**Code:**

* Demo:
* LIT-for-Gemma Colab: [`lit_gemma.ipynb`](https://colab.research.google.com/github/google/generative-ai-docs/blob/main/site/en/gemma/docs/lit_gemma.ipynb)
* Demo binary:
[`lm_salience_demo.py`](https://github.com/PAIR-code/lit/blob/main/lit_nlp/examples/lm_salience_demo.py)
* KerasNLP model wrappers:
[`instrumented_keras_lms.py`](https://github.com/PAIR-code/lit/blob/main/lit_nlp/examples/models/instrumented_keras_lms.py)
Expand Down
14 changes: 14 additions & 0 deletions website/sphinx_src/demos.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,20 @@ https://pair-code.github.io/lit/tutorials/sentiment

## Sequence-to-Sequence <!-- DO NOT REMOVE {#seq2seq .demo-section-header} -->

### Gemma <!-- DO NOT REMOVE {#gemma .demo-header} -->

**Code:** [examples/lm_salience_demo.py](https://github.com/PAIR-code/lit/blob/main/lit_nlp/examples/lm_salience_demo.py)

* Supports Gemma 2B and 7B models using KerasNLP and TensorFlow.
* Interactively debug LLM prompts using
[sequence salience](./components.md#sequence-salience).
* Multiple salience methods (grad-l2 and grad-dot-input), at multiple
granularities: token-, word-, sentence-, and paragraph-level.

Tip: check out the in-depth walkthrough at
https://ai.google.dev/responsible/model_behavior, part of the Responsible
Generative AI Toolkit.

### T5 <!-- DO NOT REMOVE {#t5 .demo-header} -->

**Hosted instance:** https://pair-code.github.io/lit/demos/t5.html \
Expand Down
18 changes: 18 additions & 0 deletions website/sphinx_src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,24 @@ Welcome to 🔥LIT, the Learning Interpretability Tool!

If you want to jump in and start playing with the LIT UI, check out the hosted demos at https://pair-code.github.io/lit/demos/.

## Research

Found LIT useful in your research? Please cite our
[system demonstration paper](https://aclanthology.org/2020.emnlp-demos.15/)!

```
@misc{tenney2020language,
title={The Language Interpretability Tool: Extensible, Interactive Visualizations and Analysis for {NLP} Models},
author={Ian Tenney and James Wexler and Jasmijn Bastings and Tolga Bolukbasi and Andy Coenen and Sebastian Gehrmann and Ellen Jiang and Mahima Pushkarna and Carey Radebaugh and Emily Reif and Ann Yuan},
booktitle = "Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations",
year = "2020",
publisher = "Association for Computational Linguistics",
pages = "107--118",
url = "https://www.aclweb.org/anthology/2020.emnlp-demos.15",
}
```


```{toctree}
:maxdepth: 2
Expand Down

0 comments on commit f0417c9

Please sign in to comment.