Skip to content

Commit 032506e

Browse files
aobo-yfacebook-github-bot
authored andcommitted
Add a tutorial for LLM Attribution (#1228)
Summary: as title The tutorial only demonstrate the perturbation-based algorithms. Will add the gradient-based demo later. rendered notebook: https://github.com/aobo-y/captum/blob/llm/tutorials/Llama2_LLM_Attribution.ipynb Pull Request resolved: #1228 Reviewed By: vivekmig Differential Revision: D52476602 Pulled By: aobo-y fbshipit-source-id: 5565fc41c163cff1ddbf32ac8def52aba38b7d1e
1 parent fefcb5b commit 032506e

File tree

3 files changed

+507
-0
lines changed

3 files changed

+507
-0
lines changed

tutorials/Llama2_LLM_Attribution.ipynb

Lines changed: 498 additions & 0 deletions
Large diffs are not rendered by default.

website/pages/tutorials/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ class TutorialHome extends React.Component {
8585
Using Captum and Integrated Gradients we interpret the output of several test questions and analyze the attribution scores
8686
of the text and visual parts of the model. Find the tutorial <a href="Multimodal_VQA_Interpret">here</a>.
8787

88+
<h4>Understanding Llama2 with Captum LLM Attribution:</h4>
89+
This tutorial demonstrates how to easily use the LLM attribution functionality to interpret the large langague models (LLM) in text generation.
90+
It takes Llama2 as the example and shows the step-by-step improvements from the basic attribution setting to more advanced techniques.
91+
Find the tutorial <a href="Llama2_LLM_Attribution">here</a>.
92+
8893
<h4>Interpreting question answering with BERT Part 1:</h4>
8994
This tutorial demonstrates how to use Captum to interpret a BERT model for question answering.
9095
We use a pre-trained model from Hugging Face fine-tuned on the SQUAD dataset and show how to use hooks to

website/tutorials.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@
4646
"id": "Image_and_Text_Classification_LIME",
4747
"title": "Interpreting vision and text models with LIME"
4848
},
49+
{
50+
"id": "Llama2_LLM_Attribution",
51+
"title": "Understanding Llama2 with Captum LLM Attribution"
52+
},
4953
{
5054
"title": "Interpreting BERT",
5155
"children": [

0 commit comments

Comments
 (0)