Introduction To LLMs 1730172304
Introduction To LLMs 1730172304
October 2024
StatSoft.org 1
IntroLLM Attention Interpretability Text Classification
Recommended Texts
StatSoft.org 2
IntroLLM Attention Interpretability Text Classification
Outline
StatSoft.org 3
IntroLLM Attention Interpretability Text Classification
StatSoft.org 4
IntroLLM Attention Interpretability Text Classification
StatSoft.org 5
IntroLLM Attention Interpretability Text Classification
StatSoft.org 6
IntroLLM Attention Interpretability Text Classification
StatSoft.org 7
IntroLLM Attention Interpretability Text Classification
Outline
StatSoft.org 8
IntroLLM Attention Interpretability Text Classification
StatSoft.org 9
IntroLLM Attention Interpretability Text Classification
Transformer Architecture
• Multi-head self-attention
• Positional encoding
Docs>torch.nn>Transformer
StatSoft.org 10
IntroLLM Attention Interpretability Text Classification
Attention Mechanism
StatSoft.org 11
IntroLLM Attention Interpretability Text Classification
N
X
y(k) ← αki x(i)
i=1
exp(x(k) xT(i) )
αki = PN
T
j=1 exp(x(k) x(j) )
StatSoft.org 12
IntroLLM Attention Interpretability Text Classification
StatSoft.org 13
IntroLLM Attention Interpretability Text Classification
StatSoft.org 14
IntroLLM Attention Interpretability Text Classification
StatSoft.org 15
IntroLLM Attention Interpretability Text Classification
Outline
StatSoft.org 16
IntroLLM Attention Interpretability Text Classification
StatSoft.org 17
IntroLLM Attention Interpretability Text Classification
StatSoft.org 18
IntroLLM Attention Interpretability Text Classification
StatSoft.org 19
IntroLLM Attention Interpretability Text Classification
StatSoft.org 20
IntroLLM Attention Interpretability Text Classification
Clustering Techniques
StatSoft.org 21
IntroLLM Attention Interpretability Text Classification
StatSoft.org 22
IntroLLM Attention Interpretability Text Classification
https://github.com/MaartenGr/BERTopic
StatSoft.org 23
IntroLLM Attention Interpretability Text Classification
StatSoft.org 24
IntroLLM Attention Interpretability Text Classification
Outline
StatSoft.org 25
IntroLLM Attention Interpretability Text Classification
StatSoft.org 26
IntroLLM Attention Interpretability Text Classification
• Pros: Fine-tuning the entire model adapts fully to the task, yielding
higher accuracy and flexibility.
• Cons: Increased computational demands, potential risk of overfitting.
StatSoft.org 27
IntroLLM Attention Interpretability Text Classification
StatSoft.org 28
IntroLLM Attention Interpretability Text Classification
Thank you!
https://www.linkedin.com/in/ajzhang/
StatSoft.org 29