Disentangling Transformer Language Models as Superposed Topic Models

Jia Peng Lim, Hady Lauw


Abstract
Topic Modelling is an established research area where the quality of a given topic is measured using coherence metrics. Often, we infer topics from Neural Topic Models (NTM) by interpreting their decoder weights, consisting of top-activated words projected from individual neurons. Transformer-based Language Models (TLM) similarly consist of decoder weights. However, due to its hypothesised superposition properties, the final logits originating from the residual path are considered uninterpretable. Therefore, we posit that we can interpret TLM as superposed NTM by proposing a novel weight-based, model-agnostic and corpus-agnostic approach to search and disentangle decoder-only TLM, potentially mapping individual neurons to multiple coherent topics. Our results show that it is empirically feasible to disentangle coherent topics from GPT-2 models using the Wikipedia corpus. We validate this approach for GPT-2 models using Zero-Shot Topic Modelling. Finally, we extend the proposed approach to disentangle and analyse LLaMA models.
Anthology ID:
2023.emnlp-main.534
Volume:
Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing
Month:
December
Year:
2023
Address:
Singapore
Editors:
Houda Bouamor, Juan Pino, Kalika Bali
Venue:
EMNLP
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
8646–8666
Language:
URL:
https://aclanthology.org/2023.emnlp-main.534
DOI:
10.18653/v1/2023.emnlp-main.534
Bibkey:
Cite (ACL):
Jia Peng Lim and Hady Lauw. 2023. Disentangling Transformer Language Models as Superposed Topic Models. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pages 8646–8666, Singapore. Association for Computational Linguistics.
Cite (Informal):
Disentangling Transformer Language Models as Superposed Topic Models (Lim & Lauw, EMNLP 2023)
Copy Citation:
PDF:
https://aclanthology.org/2023.emnlp-main.534.pdf
Video:
 https://aclanthology.org/2023.emnlp-main.534.mp4