Inside the Black-Box: Towards the Interpretability of Conditioned Variational Autoencoder for
Hi to everyone, my name is Tommaso Carraro and I am the presenter of the paper “A Look
I am a Computer Science student at the University of Padova.
I’ve done this paper together with Mirko Polato, that is a postdoctoral researcher
I’m doing my master degree thesis.
Collaborative Filtering”.
at the University of Padova, and Fabio Aiolli, that is my thesis supervisor.
First of all, I want to begin this presentation with a little bit of background about recommendation
a desired platform, for example Netflix or Amazon.
systems.
They are widely used for commercial applications, for example music and video streaming or e-commerce
Recommenation systems are models used to predict the ratings a user would give to items of
sites, and they are used because usually items in these applications are really huge in number,
Collaborative Filtering (user-based) is the standard approach used in recommendation systems,
so users need a way to be helped in their decision process.
and how this works?
It simply recommend items based on a similarity computed between the users of the system.
In fact, the core idea of collaborative filtering is that similar users should have also similar
tastes.
In this paper, we worked on model designed for the top-N item recommendation task.
In this task, the goal is to produce a ranking for the user where the top-n positions of
this ranking are covered by items that are most appealing for the user.
At the beginning of recommendation systems, simple and intuitive approaches have been
proposed by researchers to tackle the recommendation problem.
Firstly, similarity based methods have been introduced and then latent factor models have
been proposed and also dominated the recommendation systems scene for many years.
Since these methods are really intuitive and simpler in the architecture than deep models,
they are also really easy in the interpretation.
However, in the last few years, with the deep learning rise, a constantly increasing number
of deep collaborative filtering models have appeared in the literature.
These models can be really accurate, thanks to their really high non-linearity, but also
they are black-box, and this means that they take the input, they produce the output, but
they don't produce any explanations about the process they use, so there is a lot of
skepticism in their usage.
the years.
In the majority of works, supplementary knowledge is injected to try to make deep models more
To try to solve this problem, many efforts have been devoted by researchers during in
explainable.
However, in the last few years, generative methods have shown promising results with
recommendation systems, so they are widely used instead of discriminative models.
Examples of generative models used in recommendation systems are Generative Adversarial Networks
and Variational Autoencoders.
However, these models are not explainable or interpretable by design, so an explanation
is welcomed.
And this is what we have tried to do with this work.
But, what are the differences between discriminative and generative models?
Discriminative models learn the boundary between classes, while generative models model the
distribution of individual classes in the data set.
Ok, so now there are some slides of backgroud about Autoencoders and Variational Autoencoders
Autoencoders are unsupervised machine learning models based on neural networks that learn
to help you understand the paper.
So, what are Autoencoders?
Thanks to these compression capabilities, they are widely used for dimensionality reduction.
an identity function that reconstruct the input while compressing the data (in the latent
space) in the process.
is usually the Mean Square Error between the input and the output.
The learning process of the Autoencoder aims at minimizing a reconstruction loss, that
Minimizing the Mean Square Error means minimize the differences between the input and the
Variational Autoencoders are still Autoencoders but their theoretical backbone is rooted in
output.
the Bayesian inference.
The core difference between Variational Autoencoders and Autoencoders is how the inputs are encoded
Autoencoder maps the input vector in a low dimensional vector, instead Variational Autoencoder
into the latent space.
maps the input x into a probability distribution, that is usually a Gaussian probability distribution.
The training of Variational Autoencoders is also different from the training of Autoencoders.
In fact, a sampling operation is required, since the encoder network of the model outputs
a probability distribution that has a mean and a variance.
And also the loss function is really different because there is a reconstruction loss, as
This loss works as a regulizer of the latent space by penalizing spaces that are far away
in Autoencoders, plus a Kullback-Leiber loss.
from a normal distribution with 0 mean and 1 variance.
You can see that it is very similar to a normal (vanilla) Autoencoder but the input vector
Here, you can see the architecture of the Variational Autoencoder.
is mapped by the encoder in a probability distribution that has a mean and a variance.
Then, a sampling operation has to be performed to sample a vector from which the decoder try
to reconstruct the initial vector.
This sampling operation can be performed using the so-called reparameterization trick.
This trick consists in sampling an epsilon vector from a normal distribution of 0 mean
and variance 1, multiply it for the standard deviation of the Gaussian distribution we
are trying to learn, and finally add it to the mean of this Gaussian distribution.
Thanks to this reparameterization trick we are able to learn this model with gradient
descent, because by design the sampling operation is not differentiable.
that is the state-of-the-art Variational Autoencoder used in the top-N item recommendation task.
The Conditioned Variational Autoencoder is a variant of the Multinomial Variational Autoencoder,
The most important contribution of Multinomial Variational Autoencoder is the reconstruction
loss, that is a multinomial loss.
Thanks to this particular loss the model is able to include in the gradient computation
In this way, the model is able to generate a ranking over the item that the user has
only those items that the user has clicked on.
The mean difference between Conditioned Variational Autoencoder and Multinomial Variational Autoencoder
not interacted with.
is that Conditioned Variational Autoencoder allows to specify a constraint in the recommendation,
for example a user can specify a movie genre that is willing to watch.
This is achieved by adding a one-hot condition vector at the input of the model.
The training of Conditioned Variational Autoencoder is also different from the training of Multinomial
Variational Autoencoder, in fact the reconstruction loss demotes the items that do not satisfy
the condition.
There is the user rating vector, then a dropout layer is applied to this vector, a one-hot
Here, you can see the architecture of the Conditioned Variational Autoencoder.
condition vector is added to the input, and then everything is fed to the encoder.
Then, the decoder outputs an unnormalized ranking over the item set.
How the training of this Conditioned Variational Autoencoder works?
First of all, we have selected the MovieLens 20M data set, that is one of the most popular
data sets used for movie recommendations.
Then, we have selected the genres of the movies as conditions for the training.
In particular, we have decided to use this specific data set because it contains auxiliary
information that can be used for making the conditions of our Conditioned Variational
Autoencoder.
However, this is not the only data set that contains auxiliary information, so this setting
can be obtained with all the other data sets that contain auxiliary information, for example
the movie genres.
plus without condition, that is a condition vector made of zeros.
In the training set each user appears conditioned with all the genres of the movies he has watched,
This means that if a user has seen movies that belong to three genres in total, it will
Here, there is an example of what happens when we try to train a Conditioned Variational
appear appear in the training set four times.
Autoencoder on the MovieLens 20M data set.
Here we can see the user in input has watched four movies in total, with drama, action,
drama and horror as genres, and that he has expressed a condition that is the drama genre,
so he wants to see a movie that is a drama movie.
Here, we can see that in the output the drama movies have the best scores, and
if we order this output we can see that in the top-n there are only drama movies, that
is what we wanted to obtain.
So, we can say that the reconstruction loss has done its job.
To try to explain the Conditioned Variational Autoencoder model we decided to explore its
learned latent representation.
In particular, we have analyzed what happens in the latent space when we change the condition
To perform the latent space exploration of the Conditioned Variational Autoencoder, after
for a group of users.
the training, we selected 2000 random users from the training set of the MovieLens 20M
data set, we conditioned all of them with all the possible genres, one genre per time,
and also without the condition, and finally we took the learned latent representation
of these conditioned users and performed Principal Component Analisys on them.
only the most interpretable pairs of principal components.
On our experiments we considered only the first 5 principal components and discussed
It is possible to observe that very different genres are placed in really far apart locations,
Here, there is the plot of the 2nd and 5th principal components.
while similar genre are placed in nearby clusters.
For example, the genre war is far away from children and animation, while it is near drama
and romance.
Then, popular genres, such as action, comedy, drama and romance are placed near the center
of the space, and not conditioned users are placed at the center of the space.
This is reasonable because when we try to recommend movies without cinditioning on a
Finally, it is possible to observe that the film-noir genre has been placed far away from
specific genre, the most popular genres become more likely.
In fact, it is difficult to place this specific genre near other genres.
all the other genres.
that is the package of genres that is nearest the film-noir genre.
However, the model has been able to place the genre near crime, drama, thirell and mystery
Watching the plot between the 3rd and 5th principal components, we think that the 3rd
principal component captures the emotional theme of the genres.
for example mystery and horror, that share anxiety, tension and sometimes fear.
In fact, the genres that share many emotional components are almost completely overlapped,
Similar observations can be done for other pairs such as children and fantasy or also
Finally, we have also observed that given the inner representation of the Conditioned
Variational Autoencoder we are able to construct user profiles.
war and western.
We have already said that the not conditioned users cluster is placed at the center of the
latent space, but it is possible to observe also that it spreads to any directions, and
For example, we can say that users who lie in the bottom of the cluster are more inclined
this suggests users particular tastes.
toward light entertainment, while users in the top part of the cluster are mainly interested
In this paper, we have discovered that the Conditioned Variational Autoencoder autonomously
in more serious movies, for example thriller, action and crime.
performs clustering of the inputs in the latent space.
It is not surprising that the model has learned which pairs of genres work well together,
however the relative positions in the space and the overall correlation between genres
is something that has been learned through the collaborative information provided by
the user profiles.
Finally, we can say that given the interpretation of the latent space it is possible to construct
Also, thanks to the Kullback-Leiber loss the model has been able to place compatible genres
in nearby clusters.
user a way to check how the system describes her tastes.
user profiles that can be leveraged to improve the recommendation and also to provide the
Ok so, we are arrived at acknowledgements!
thanks Fabio, my thesis supervisor, that gave me the opportunity to present this work to
First of all, I want to thanks you all for having watched this video, then I want to
you, and finally I want to thanks Mirko, that helped me during the preparation of this paper.