Hypothese van Frame Representatie: Interpretabiliteit van Multi-Token Taalmodel en Door Concept Gestuurde Tekstgeneratie
Frame Representation Hypothesis: Multi-Token LLM Interpretability and Concept-Guided Text Generation
December 10, 2024
Auteurs: Pedro H. V. Valois, Lincon S. Souza, Erica K. Shimomoto, Kazuhiro Fukui
cs.AI
Samenvatting
Interpreteerbaarheid is een belangrijke uitdaging bij het opbouwen van vertrouwen in Grote Taalmodellen (LLM's), die voortkomt uit de complexiteit van het extraheren van redeneringen uit de parameters van het model. We presenteren de Hypothese van Frame Representatie, een theoretisch robuust kader gebaseerd op de Lineaire Representatie Hypothese (LRH) om LLM's te interpreteren en te controleren door het modelleren van meertekenwoorden. Eerdere onderzoeken verkenden LRH om LLM-representaties te verbinden met linguïstische concepten, maar waren beperkt tot de analyse van enkelvoudige tokens. Aangezien de meeste woorden uit meerdere tokens bestaan, breiden we LRH uit naar meertekenwoorden, waardoor het gebruik mogelijk is op alle tekstuele gegevens met duizenden concepten. Hiertoe stellen we voor dat woorden geïnterpreteerd kunnen worden als frames, geordende sequenties van vectoren die de token-woordrelaties beter vastleggen. Vervolgens kunnen concepten worden voorgesteld als het gemiddelde van woordframes die een gemeenschappelijk concept delen. We demonstreren deze tools via Top-k Concept-Gestuurde Decodering, waarmee tekstgeneratie intuïtief kan worden gestuurd met de gekozen concepten. We verifiëren deze ideeën op de Llama 3.1, Gemma 2 en Phi 3 families, waarbij gender- en taalvooroordelen worden aangetoond, schadelijke inhoud wordt blootgelegd, maar ook het potentieel om ze te remediëren, wat leidt tot veiligere en transparantere LLM's. De code is beschikbaar op https://github.com/phvv-me/frame-representation-hypothesis.git
English
Interpretability is a key challenge in fostering trust for Large Language
Models (LLMs), which stems from the complexity of extracting reasoning from
model's parameters. We present the Frame Representation Hypothesis, a
theoretically robust framework grounded in the Linear Representation Hypothesis
(LRH) to interpret and control LLMs by modeling multi-token words. Prior
research explored LRH to connect LLM representations with linguistic concepts,
but was limited to single token analysis. As most words are composed of several
tokens, we extend LRH to multi-token words, thereby enabling usage on any
textual data with thousands of concepts. To this end, we propose words can be
interpreted as frames, ordered sequences of vectors that better capture
token-word relationships. Then, concepts can be represented as the average of
word frames sharing a common concept. We showcase these tools through Top-k
Concept-Guided Decoding, which can intuitively steer text generation using
concepts of choice. We verify said ideas on Llama 3.1, Gemma 2, and Phi 3
families, demonstrating gender and language biases, exposing harmful content,
but also potential to remediate them, leading to safer and more transparent
LLMs. Code is available at
https://github.com/phvv-me/frame-representation-hypothesis.git