Towards Reinterpreting Neural Topic Models via Composite Activations (2022)

Abstract: Most Neural Topic Models (NTM) use a variational auto-encoder framework producing K topics limited to the size of the encoder’s output. These topics are interpreted through the selection of the top activated words via the weights or reconstructed vector of the decoder that are directly connected to each neuron. In this paper, we present a model-free two-stage process to reinterpret NTM and derive further insights on the state of the trained model. Firstly, building on the original information from a trained NTM, we generate a pool of potential candidate “composite topics” by exploiting possible co-occurrences within the original set of topics, which decouples the strict interpretation of topics from the original NTM. This is followed by a combinatorial formulation to select a final set of composite topics, which we evaluate for coherence and diversity on a large external corpus. Lastly, we employ a user study to derive further insights on the reinterpretation process.

## introduction to help us understand the latent structures within a text corpus, topic models associate each document with "topics" @xcite . in turn, each topic is associated with a set of words that frequently co-occur together in various documents, forming a semantically coherent grouping that fosters interpretability. aside from the common applications in text analysis and classifications, topic models are also used in advanced downstream tasks such as in summarization @xcite ), text generation @xcite , and language modelling @xcite . while earlier topic models are based on graphical models, more recent topic models are neural, with several based on the variational autoencoder framework @xcite . traditionally, what constitutes a topic is a neuron at the encoder's output. its association with words is typically derived from a selection of the top activated words via the weights or reconstructed vector of the decoder connected to that neuron, forming what we now interpret as a topic-word distribution. motivation. while such autoencoder-based topic models are adept at learning lowerdimensional representations of documents, we question the notion of one-to-one correspondence between a topic and a neuron. we postulate that this traditional view belies the natural working order of a neural model, whereby it is the joint activation of several neurons, rather than the singular activation of an independent neuron, that may be responsible for the generation or reconstruction of document semantics. moreover, the traditional interpretation of only the top activations in the resultant topic-word distribution ignores the potential information that might be gleaned from the rest of the distribution. we therefore hypothesize that individual neurons are but components of a "topic" that is inherently compositional in nature. and, to properly interpret an autoencoder-based topic model, we need to fully utilise the topic-word distribution space to uncover such compositions of neurons that frequently coactivate to collectively represent a semantic topic. approach. given a generic class of trained neural topic model (ntm) (to be defined in section 3) with k component (original) topics, we seek to reinterpret the ntm by finding a new set of k compositional topics that are more attuned to wellaccepted measures of topic interpretability (also to be specified in section 3). each compositional topic is a linear combination of the original component topics. inherently, the number of potential compositional topics are combinatorially explosive. thus, we propose a two-stage process of candidate generation via mining the neural activations of various documents in the original corpus for frequently co-activated neurons, followed by candidate selection via solving optimization problems that map to classical algorithmic formulations with well-established computational properties. contributions. to our best knowledge, this is the first work to seek a reinterpretation of an ntm via compositional topics. we reiterate that our objective is not to replace, but to derive further quantitative insights on the state of the trained model. this reinterpretation process is model-free, as validated on a number of base ntms (see section 7.1). secondly, we propose an approach that aligns the mining of compositional topics to the objective of optimizing for well-accepted notions of topic interpretability. this approach is realized through principled formulations of frequent itemset mining for candidate generation (section 5), as well as maximum independent sets and multi-dimensional knapsack for candidate selection (section 6). thirdly, through quantitative measurements of interpretability on external large corpora, we show that the compositional topics tend to perform better than the original output of ntm's (section 7). finally, as our core thrust is topic interpretability, we employ a user study to derive additional insights from the reinterpretation process (section 8). ## related work there are many neural topic models (ntms), a comprehensive review can be found at @xcite . primarily, the focus has been on creating better models, with numerous ntms benchmarked in @xcite . more detailed descriptions of our baseline ntms used in the experiments can be found in section 7.1. there are also notable research efforts to derive better interpretability of ntms, such as through works focusing on topic sparsity @xcite , and through weakly supervised training @xcite . another popular approach to topic modelling involves using graph-based ntms such as in @xcite , @xcite , and zhang and lauw (2020) which utilizes graph neural networks, and/or, leveraging on graph representations of document/word/document-word relations and also through graph representations of higher-level entity metadata. the key distinction between our work and previous stand-alone graph-based ntms is that our model-free approach is rooted in (nonneural network) classical selection problems with 1 www.gurobi.com 2 www.cvxpy.org the choices (component topics) represented in a graphical manner. finally, there are other non-neural networkbased topic modelling approaches such as online mean-field variational inference @xcite and non-negative matrix factorization @xcite . ## preliminaries neural topic model (ntm). let d denote a text corpus, k the desired number of topics, and n the vocabulary. an autoencoder-based ntm τ trained on d would produce a latent layer at the output of the encoder that we denote θ. the i th neuron θ i is referred to as an original or component topic. to associate θ i with its topic words, we examine the topic-word decoder's weights or outputs due to the sole activation of θ i . considering the general case where a topic-word decoder has one of more hidden layers, we set θ @xmath0. passing this input through the decoder, ∀θ @xmath1, creates a k × |n | topicword relation matrix β. taking the l top-activated words from each row in β produces a topic set @xmath2,...,k consisting of k number of lsized word sets t i , using the top activated words in each row of β. ## stage i: topic candidate generation based on neural activation profiles we make the critical observation that which neurons tend to co-activate with one another can be mined from the pattern of neural activations of the documents within a corpus. from figure 3 , the activation distribution of τ on d in layer θ is similar to a pareto distribution, with a only a few neurons being responsible for most of the activation strength. for practical purposes, we limit the size of compositions of up to five different component topics. leveraging on d and τ , producing document-topic relations θ ∈ r |d|×k , we can find frequently occurring compositions in d. we can transform our current search problem to the frequent itemset mining problem (fim) @xcite . the input to fim is a set of transactions, where each transaction is a basket of items. the objective is to output all frequent itemsets, i.e., subsets of items that occur in at least s (minimum support) of the transactions. in our context, each transaction is a document, and each item is an activated neuron. we set the minimum activation threshold κ to the fifth-largest mean activation value for θ. for each document d, we set its θ d,@xmath3,@xmath4, creating boolean "itemsets" (essentially baskets of co-activated neurons). hyper-parameter minimum support s controls the size of v (setting larger values of s resulting in fewer candidates). while there are many solution approaches to fim @xcite , we leverage the apriori algorithm foot_1 @xcite . the resulting frequent itemsets ĉ (each itemset specifying a few co-activated neurons) generate candidate pool @xmath5, i.e., each @xmath6 ## stage ii: diversity-constrained coherence-optimizing topic selection we now seek to reduce v to find the final k composite topics that represent c, by optimizing for npmi, as evaluated on d foot_2 . however, due to the way that diversity-oriented constraint ϵ could be formulated, this gives rise to a couple of formulation variants as outlined below. ## experiments the primary objective of the following experiments is to investigate the efficacy of the terpretation pro- name #docs #words #labels 20newsgroup 16,309 1,612 20 bbc-news 2,225 2,949 5 dblp 54,595 1,513 4 m10 8,355 1,696 10 ## user study we have 29 valid responses to our user study, consisting of 30 questions (14 normal and 1 verification each for two tasks below). we excluded responses that failed verification questions foot_6 , ensuring responses of higher quality. before starting, participants were given a short primer on coherence and reminded that there are no right or wrong answers. questions. procedure of random question generation, with topics sorted alphabetically, and example questions can be found in appendix a. for task i, participants are shown a pair of composite-component topics and asked to identify which of the two is more coherent. we split the 14 questions into two groups where half of the questions contains a component topic with npmi strictly larger than its paired composite topic, with the other half having equal or less. for task ii, participants are shown a group of topics consisting of one composite topic and its components and asked to check which topics they think are coherent. they may select multiple options or none at all. following which, they are asked if the composite topic is related to its components. out of the 14 questions in task ii, 7 groups of topics will serve as control, with one of its component topic randomly swapped out with another. insights. in task i, we establish that npmi indeed has a positive correlation (pearson's @xmath7.500 * * * ) foot_7 to participants' selection of their preferred topic, with greater participant's agreement in instances where npmi difference is large. additionally, despite the 50/50 split, in 60% of question instances, participants choose the composite topic over its component topic. in task ii, we plot each topic shown as a point in figure 5 . on average, composite topics have a higher consistent agreement (%), amongst participants marking it as coherent, with a mean of 78%, compared to component topics, at 61%. additionally, in terms of composite-component relevance, 5 out of 7 treatment groups have more than 75% of participants agreeing that the composite topic is relevant to the component topics, compared to 0 out of 7 control groups for the same criteria. this reveals that while majority of the composite topics are built out of related component topics, there are also instances when non-related component topics contribute to form composite topics. ## conclusion our proposed two-stage reinterpretation process strongly demonstrates the possibility of obtaining better topic sets. its accompanying improvements, in both computational metrics and human evaluation, highlight the necessity to view the original topic model in a composite manner to reveal a deeper interpretation. since auto-encoder frameworks are widely used on other tasks, future investigation is required to explore and determine if this methodology can be applied to other tasks as well.