L EARNING L ESS -O VERLAPPING R EPRESENTATIONS
Anonymous authors
Paper under double-blind review
A BSTRACT
In representation learning (RL), how to make the learned representations easy to interpret and less overﬁtted to training data are two important but challenging issues.
To address these problems, we study a new type of regularization approach that encourages the supports of weight vectors in RL models to have small overlap, by simultaneously promoting near-orthogonality among vectors and sparsity of each vector.
We apply the proposed regularizer to two models: neural networks (NNs) and sparse coding (SC), and develop an efﬁcient ADMM-based algorithm for regularized SC.
Experiments on various datasets demonstrate that weight vectors learned under our regularizer are more interpretable and have better generalization performance.
I NTRODUCTION
In representation learning (RL), two critical issues need to be considered.
First, how to make the learned representations more interpretable?
Interpretability is a must in many applications.
For instance, in a clinical setting, when applying deep learning (DL) and machine learning (ML) models to learn representations for patients and use the representations to assist clinical decision-making, we need to explain the representations to physicians such that the decision-making process is transparent, rather than being black-box.
Second, how to avoid overﬁtting?
It is often the case that the learned representations yield good performance on the training data, but perform less well on the testing data.
How to improve the generalization performance on previously unseen data is important.
In this paper, we make an attempt towards addressing these two issues, via a uniﬁed approach.
DL/ML models designed for representation learning are typically parameterized with a collection of weight vectors, each aiming at capturing a certain latent feature.
For example, neural networks are equipped with multiple layers of hidden units where each unit is parameterized by a weight vector.
In another representation learning model – sparse coding (Olshausen & Field, 1997), a dictionary of basis vectors are utilized to reconstruct the data.
In the interpretation of RL models, a major part is to interpret the learned weight vectors.
Typically, elements of a weight vector have one-to-one correspondence with observed features and a weight vector is oftentimes interpreted by examining the top observed-features that correspond to the largest weights in this vector.
For instance, when applying SC to reconstruct documents that are represented with bag-of-words feature vectors, each dimension of a basis vector corresponds to one word in the vocabulary.
To visualize/interpret a basis vector, one can inspect the words corresponding to the large values in this vector.
To achieve better interpretability, various constraints have been imposed on the weight vectors.
Some notable ones are: (1) Sparsity (Tibshirani, 1996) – which encourages most weights to be zero.
Observed features that have zeros weights are considered to be irrelevant and one can focus on interpreting a few non-zero weights.
(2) Diversity (Wang et al., 2015) – which encourages different weight vectors to be mutually “different” (e.g., having larger angles (Xie et al., 2015)).
By doing this, the redundancy among weight vectors is reduced and cognitively one can map each weight vector to a physical concept in a more unambiguous way.
(3) Non-negativeness (Lee & Seung, 1999) – which encourages the weights to be nonnegative since in certain scenarios (e.g., bag of words representation of documents), it is difﬁcult to make sense of negative weights.
In this paper, we propose a new perspective of interpretability: less-overlapness , which encourages the weight vectors to have small overlap in supports 1 .
By doing this, each weight vector is anchored on a unique subset of observed features without being redundant with other vectors, which greatly facilitates interpretation.
For example, if topic models (Blei et al., 2003) are learned in such a way, each topic will be characterized by a few representative words and the representative words of different topics are different.
Such topics are more amenable for interpretation.
Besides improving interpretability, less-overlapness helps alleviate overﬁtting.
It imposes a structural constraint over the weight vectors, thus can effectively shrink the complexity of the function class induced by the RL models and improve the generalization performance on unseen data.
To encourage less-overlapness, we propose a regularizer that simultaneously encourages different weight vectors to be close to being orthogonal and each vector to be sparse, which jointly encourage vectors’ supports to have small overlap.
The major contributions of this work include:
• We propose a new type of regularization approach which encourages less-overlapness, for the sake of improving interpretability and reducing overﬁtting.
• We apply the proposed regularizer to two models: neural networks and sparse coding (SC), and derive an efﬁcient ADMM-based algorithm for the regularized SC problem.
• In experiments, we demonstrate the empirical effectiveness of this regularizer.
M ETHODS
In this section, we propose a nonoverlapness-promoting regularizer and apply it to two models.
2. N ONOVERLAPNESS -P ROMOTING R EGULARIZATION
We assume the model is parameterized by m vectors W = { w i } mi =1 .
For a vector w , its support s ( w ) is deﬁned as { i | w i (cid:54) = 0 } – the indices of nonzero entries in w .
We ﬁrst deﬁne a score ˜ o
( w i , w j ) to measure the overlap between two vectors:
[Equation]
which is the Jaccard index of their supports.
The smaller ˜ o
( w i , w j ) is, the less overlapped the two vectors are.
For m vector, the overlap score is deﬁned as the sum of pairwise scores
[Equation]
This score function is not smooth, which will result in great difﬁculty for optimization if used as a regularizer.
Instead, we propose a smooth function that is motivated from ˜ o
( w i , w j ) and can achieve a similar effect as o ( W ) .
The basic idea is: to encourage small overlap, we can encourage (1) each vector has a small number of non-zero entries and (2) the intersection of supports among vectors is small.
To realize (1), we use an L1 regularizer to encourage the vectors to be sparse.
To realize (2), we encourage the vectors to be close to being orthogonal.
For two sparse vectors, if they are close to orthogonal, then their supports are landed on different positions.
As a result, the intersection of supports is small.
We follow the method proposed by Xie et al.
(2017b) to promote orthogonality.
To encourage two vectors w i and w j to be close to being orthogonal, one can make their (cid:96) 2 norm (cid:107) w i (cid:107) 2 , (cid:107) w j (cid:107) 2 close to one and their inner product w (cid:62) i w j close to zero.
Based on this, one can promote orthogonality among a set of vectors by encouraging the Gram matrix G ( G ij = w (cid:62) i w j ) of these vectors to be close to an identity matrix I .
Since w (cid:62) i w j and zero are off the diagonal of G and I respectively, and (cid:107) w i (cid:107) 22 and one are on the diagonal of G and I respectively, encouraging G close to I essentially makes w (cid:62) i w j close to zero and (cid:107) w i (cid:107) 2 close to one.
As a result, w i and w j are encouraged to be close to being orthogonal.
In (Xie et al., 2017b), one way proposed to measure the “closeness” between two matrices is to use the log-determinant divergence (LDD) (Kulis et al., 2009).
The LDD between two m × m positive deﬁnite matrices X and Y is deﬁned as D ( X , Y ) =
tr ( XY − 1 ) − log det( XY − 1 ) − m where tr ( · ) denotes matrix trace.
The closeness between G and I can be achieved by encouraging their LDD D ( G , I ) =
tr ( G ) − log det( G ) − m to be small.
Combining the orthogonality-promoting LDD regularizer with the sparsity-promoting L1 regularizer together, we obtain the following LDD-L1 regularizer
[Equation]
where γ is a tradeoff parameter between these two regularizers.
As veriﬁed in experiments, this regularizer can effectively promote non-overlapness.
The formal analysis of the relationship between
Eq.(3) and Eq.(2) will be left for future study.
It is worth noting that either L1 or LDD alone is not sufﬁcient to reduce overlap.
As illustrated in Figure 1(a) where only L1 is applied, though the two vectors are sparse, their supports are completely overlapped.
In Figure 1(b) where the LDD regularizer is applied, though the two vectors are very close to orthogonal, their supports are completely overlapped since they are dense.
In Figure 1(c) where the LDD-L1 regularizer is used, the two vectors are sparse and are close to being orthogonal.
As a result, their supports are not overlapped.
2. C ASE S TUDIES
In this section, we apply the LDD-L1 regularizer to two models.
Neural Networks
In a neural network (NN) with L hidden layers, each hidden layer l is equipped with m ( l ) units and each unit i is connected with all units in layer l − 1 .
Hidden unit i at layer l is parameterized by a weight vector w ( l ) i .
These hidden units aim at capturing latent features underlying data.
For m ( l ) weight vectors W ( l ) = { w ( l ) i } m ( l ) i
=1 in each layer l , we apply the LDD-L regularizer to encourage them to have small overlap.
An LDD-L1 regularized NN problem (LDDL1-NN) can be deﬁned in the following way:
[Equation]
where L ( {W ( l ) } Ll =1 ) is the objective function of this NN.
Sparse Coding Given n data samples X ∈ R d × n where d is the feature dimension, we aim to use a dictionary of basis vectors W ∈ R d × m to reconstruct X , where m is the number of basis vectors.
Each data sample x is reconstructed by taking a sparse linear combination of the basis vectors x ≈ (cid:80) mj
=
α j w j , where { α j } mj =1 are the linear coefﬁcients and most of them are zero.
The reconstruction error is measured using the squared L2 norm (cid:107) x − (cid:80) mj
=
α j w j (cid:107) 22 .
To achieve sparsity among the codes, L1 regularization is utilized: (cid:80) mj
=1 | α j | 1 .
To avoid the degenerated case where most coefﬁcients are zero and the basis vectors are of large magnitude, L2 regularization is applied to the basis vectors: (cid:107) w j (cid:107) 2 2 .
We apply the LDD-L1 regularizer to encourage the supports of basis vectors to have small overlap.
Putting these pieces together, we obtain the LDD-L1 regularized SC (LDD-L1-SC) problem min W
[Equation]
(4) where A ∈ R m × n denotes all the linear coefﬁcients.
[Equation]
A LGORITHM
For LDD-L1-NNs, a simple subgradient descent algorithm is applied to learn the weight parameters.
For LDD-L1-SC, we solve it by alternating between A and W : (1) updating A with W ﬁxed; (2) updating W with A ﬁxed.
These two steps alternate until convergence.
With W ﬁxed, the subproblem deﬁned over A is
[Equation]
which can be decomposed into n Lasso problems: for i
= 1 , · · · , n min a i
[Equation]
where a i is the coefﬁcient vector of the i -th sample.
Lasso can be solved by many algorithms, such as proximal gradient descent (PGD) (Parikh & Boyd, 2014).
Fixing A , the sub-problem deﬁned over W is:
[Equation]
We solve this problem using an ADMM-based algorithm.
First, we write the problem into an equivalent form
[Equation]
Then we write down the augmented Lagrangian function
[Equation]
We minimize this Lagrangian function by alternating among (cid:102) W , U and W .
Update (cid:102) W
The subproblem deﬁned on (cid:102) W is
[Equation] [Equation]
which is a Lasso problem and can be solved using PGD (Parikh & Boyd, 2014).
Update
U
The update equation of U is simple.
[Equation]
The subproblem deﬁned on W is
[Equation] [Equation]
which can be solved using a coordinate descent algorithm.
The derivation is given in the next subsection.
3. C OORDINATE D ESCENT A LGORITHM FOR L EARNING W
In each iteration of the CD algorithm, one basis vector is chosen for update while the others are ﬁxed.
Without loss of generality, we assume it is w 1 .
The sub-problem deﬁned over w 1 is
[Equation]
To obtain the optimal solution, we take the derivative of the objective function and set it to zero.
First, we discuss how to compute the derivative of logdet ( W (cid:62) W ) w.r.t w 1 .
According to the chain rule, we have
[Equation]
[Equation]
where ( W (cid:62) W ) − 1 : , 1 denotes the ﬁrst column of ( W (cid:62) W ) − 1 .
Let W ¬ 1 =
[ w 2 , · · · , w m ] , then
[Equation]
According to the inverse of block matrix
[Equation]
16) where (cid:101)
A =
( A − BD
[Equation]
BD − 1 , we have ( W (cid:62) W ) − 1 : , 1 equals [ a b (cid:62) ] (cid:62) where
[Equation]
Then
[Equation]
where
[Equation]
To this end
[Equation]
we obtain the full gradient of the objective function in Eq.(13):
[Equation]
[Equation]
Setting the gradient to zero
[Equation]
we get
[Equation]
Let γ = w (cid:62)
Mw 1 , c
= (cid:80) ni
=1 a 2 i 1 + λ 2 + λ 3 + ρ , b = (cid:80) ni
=
a i 1 ( x i
[Equation]
(cid:80) ml
=2 a il w l ) − u
+ ρ (cid:101) w j , then ( c I − λ 3 γ M )
w 1 = b and w 1 =
( c I − λ 3 γ M ) − 1 b .
Let UΣU (cid:62) be the eigen decomposition of
M , we have
[Equation] [Equation]
Then
[Equation]
The matrix A = W ¬ 1 ( W (cid:62)¬ 1 W ¬ 1 ) − 1 W (cid:62)¬ 1 is idempotent, i.e., AA = A , and its rank is m − 1 .
According to the property of idempotent matrix, the ﬁrst m − 1 eigenvalues of A equal to one and the rest equal to zero.
Thereafter, the ﬁrst m − 1 eigenvalues of M =
I − A equal to zero and the rest equal to one.
Based on this property, Eq.(24) can be simpliﬁed as
[Equation]
After simpliﬁcation, it is a quadratic function where γ has a closed form solution.
Then we plug the solution of γ into Eq.(23) to get the solution of w 1 .
E XPERIMENTS
In these section, we present experimental results.
The studies were performed on three models: sparse coding (SC) for document modeling, long short-term memory (LSTM) (Hochreiter & Schmidhuber, 1997) network for language modeling and convolutional neural network (CNN) (Krizhevsky et al., 2012) for image classiﬁcation.
4. D ATASETS
We used four datasets.
The SC experiments were conducted on two text datasets: 20-Newsgroups(20-News) and Reuters Corpus 3 Volume 1 (RCV1).
The 20-News dataset contains newsgroup documents belonging to 20 categories, where 11314, 3766 and 3766 documents were used for training, validation and testing respectively.
The original RCV1 dataset contains documents belonging to 103 categories.
Following (Cai & He, 2012), we chose the largest 4 categories which containdocuments, to carry out the study.
The number of training, validation and testing documents are 5775, 1925, 1925 respectively.
For both datasets, stopwords were removed and all words were changed into lower-case.
Top 1000 words with the highest document frequency were selected to form the vocabulary.
We used tf-idf to represent documents and the feature vector of each document is normalized to have unit L2 norm.
The LSTM experiments were conducted on the Penn Treebank (PTB) dataset (Marcus et al., 1993), which consists of 923K training, 73K validation, and 82K test words.
Following (Mikolov et al.), top 10K words with highest frequency were selected to form the vocabulary.
All other words are replaced with a special token UNK.
The CNN experiments were performed on the CIFAR-10 dataset 4 .
It consists of 32x32 color images belonging to 10 categories, where 50,000 images were used for training and 10,000 for testing.
5000 training images were used as the validation set for hyperparameter tuning.
We augmented the dataset by ﬁrst zero-padding the images with 4 pixels on each side, then randomly cropping the padded images to reproduce 32x32 images.
4. LDD-L1 AND N ON - OVERLAPNESS
First of all, we verify whether the LDD-L1 regularizer is able to promote non-overlapness.
The study is performed on the SC model and the 20-News dataset.
The number of basis vectors was set to 50.
For 5 choices of the regularization parameter of LDD-L1: { 10 − 4 , 10 − 3 , · · · , 1 } , we ran the LDD-L1-SC model until convergence and measured the overlap score (deﬁned in Eq.2) of the basis vectors.
The tradeoff parameter γ inside LDD-L1 is set to 1.
Figure 2 shows that the overlap score consistently decreases as the regularization parameter of LDD-L1 increases, which implies that LDD-L1 can effectively encourage non-overlapness.
As a comparison, we replaced LDD-L with LDD-only and L1-only, and measured the overlap scores.
As can be seen, for LDD-only, the overlap score remains to be 1 when the regularization parameter increases, which indicates that
LDD alone is not able to reduce overlap.
This is because under LDD-only, the vectors remain dense, which renders their supports to be completely overlapped.
Under the same regularization parameter,
LDD-L1 achieves lower overlap score than L1, which suggests that LDD-L1 is more effective in promoting non-overlapness.
Given that γ – the tradeoff parameter associated with the L1 norm in
[Figure]
LDD-L1 – is set to 1, the same regularization parameter λ imposes the same level of sparsity for both LDD-L1 and L1-only.
Since LDD-L1 encourages the vectors to be mutually orthogonal, the intersection between vectors’ supports is small, which consequently results in small overlap.
This is not the case for L1-only, which hence is less effective in reducing overlap.
4. I NTERPRETABILITY
In this section, we examine whether the weight vectors learned under LDD-L1 regularization are more interpretable, using SC as a study case.
For each basis vector w learned by LDD-L1-SC on the 20-News dataset, we use the words (referred to as representative words ) that correspond to the supports of w to interpret w .
Table 1 shows the representative words of 9 exemplar vectors.
By analyzing the representative words, we can see vector 1-9 represent the following semantics respectively: crime, faith, job, war, university, research, service, religion and Jews.
The representative words of these vectors have no overlap.
As a result, it is easy to associate each vector with a unique concept, in other words, easy to interpret.
Figure 3 visualizes the learned vectors where the black dots denote vectors’ supports.
As can be seen, the supports of different basis vectors are landed over different words and their overlap is very small.
4. R EDUCING O VERFITTING
In this section, we verify whether LDD-L1 is able to reduce overﬁtting.
The studies were performed on SC, LSTM and CNN.
In each experiment, the hyperparameters were tuned on the validation set.
Sparse Coding For 20-News, the number of basis vectors in LDD-L1-SC is set to
[Table]
To evaluate the model performance quantitatively, we applied the dictionary learned on the training data to infer the linear coefﬁcients ( A in Eq.4) of test documents, then performed k -nearest neighbors (KNN) classiﬁcation on A .
Table 2 shows the classiﬁcation accuracy on test sets of 20-News and RCV1 and the gap 5 between the accuracy on training and test sets.
Without regularization,
SC achieves a test accuracy of 0.592 on 20-News, which is lower than the training accuracy by 0.119.
This suggests that an overﬁtting to training data occurs.
With LDD-L1 regularization, the test accuracy is improved to 0.612 and the gap between training and test accuracy is reduced to 0.099, demonstrating the ability of LDD-L1 in alleviating overﬁtting.
Though LDD alone and L alone improve test accuracy and reduce train/test gap, they perform less well than LDD-L1, which indicates that for overﬁtting reduction, encouraging non-overlapness is more effective than solely promoting orthogonality or solely promoting sparsity.
Similar observations are made on the RCV dataset.
Interestingly, the test accuracy achieved by LDD-L1-SC on RCV1 is even better than the training accuracy.
LSTM for Language Modeling
The LSTM network architecture follows the word language model (PytorchTM) provided in Pytorch 6 .
The number of hidden layers is set to 2.
The embedding size is 1500.
The size of hidden state is 1500.
The word embedding and softmax weights are tied.
The number of training epochs is 40.
Dropout with 0.65 is used.
The initial learning rate is 20.
Gradient clipping threshold is 0.25.
The size of mini-batch is 20.
In LSTM training, the network is unrolled for 35 iterations.
Perplexity is used for evaluating language modeling performance (lower is better).
The weight parameters are initialized uniformly between [-0.1, 0.1].
The bias parameters are initialized as 0.
We compare with the following regularizers: (1) L1 regularizer; (2) orthogonality-promoting regularizers based on cosine similarity (CS) (Yu et al., 2011), incoherence (IC) (Bao et al., 2013), mutual angle (MA) (Xie et al., 2015), decorrelation (DC)
(Cogswell et al., 2015), angular constraint (AC)
(Xie et al., 2017a) and LDD (Xie et al., 2017b).
Table 3 shows the perplexity on the PTB test set.
Without regularization, PytorchLM achieves a perplexity of 72.3.
With LDD-L1 regularization, the perplexity is signiﬁcantly reduced to 71.1.
This shows that LDD-L1 can effectively improve generalization performance.
Compared with the sparsity-promoting L1 regularizer and orthogonality-promoting regularizers, LDD-L1 – which promotes non-overlapness by simultaneously promoting sparsity and orthogonality – achieves lower perplexity.
For the convenience of readers, we also list the perplexity achieved by other state of the art deep learning models.
The LDD-L1 regularizer can be applied to these models as well to potentially boost their performance.
[Table]
CNN for Image Classiﬁcation The CNN architecture follows that of the wide residual network (WideResNet) (Zagoruyko & Komodakis, 2016).
The depth and width are set to 28 and 10 respectively.
The networks are trained using SGD, where the epoch number is 200, the learning rate is set to 0.1 initially and is dropped by 0.2 at 60, 120 and 160 epochs, the minibatch size is 128 and the Nesterov momentum is 0.9.
The dropout probability is 0.3 and the L2 weight decay is 0.0005.
Model performance is measured using error rate, which is the median of 5 runs.
We compared with (1) L1 regularizer; (2) orthogonality-promoting regularizers including CS, IC, MA, DC, AC, LDD and one based on locally constrained decorrelation (LCD) (Rodr ´ ıguez et al., 2016).
Table 4 shows classiﬁcation errors on CIFAR-10 test set.
Compared with the unregularized
WideResNet which achieves an error rate of 3.89%, the proposed LDD-L1 regularizer greatly reduces the error to 3.60%.
LDD-L1 outperforms the L1 regularizer and orthogonality-promoting regularizers, demonstrating that encouraging non-overlapness is more effective than encouraging sparsity alone or orthogonality alone in reducing overﬁtting.
The error rates achieved by other state of the art methods are also listed.
R ELATED W ORKS
The interpretation of representation learning models has been widely studied.
Choi et al.
(2016) develop a two-level neural attention model that detects inﬂuential variables in a reverse time order and use these variables to interpret predictions.
Lipton (2016) discuss a taxonomy of both the desiderata and methods in interpretability research.
Koh & Liang (2017) propose to use inﬂuence functions to trace a model’s prediction back to its training data and identify training examples that are most relevant to a prediction.
Dong et al.
(2017) integrate topics extracted from human descriptions into neural networks via an interpretive loss and then use a prediction-difference maximization algo-
[Table]
rithm to interpret the learned features of each neuron.
Our method is orthogonal to these existing approaches and can be potentially used with them together to further improve interpretability
[Table]
C ONCLUSIONS
In this paper
[Table]
we propose a new type of regularization approach that encourages the weight vectors to have less-overlapped supports.
The proposed LDD-L1 regularizer simultaneously encourages the weight vectors to be sparse and close to being orthogonal, which jointly produces the effects of less overlap.
We apply this regularizer to two models: neural networks and sparse coding (SC) and derive an efﬁcient ADMM-based algorithm for solving the regularized SC problem.
Experiments on various datasets demonstrate the effectiveness of this regularizer in alleviating overﬁtting and improving interpretability.