Triplet Losses-based Matrix Factorization for Robust Recommendations

2025-05-06 0 0 656.2KB 6 页 10玖币
侵权投诉
Triplet Losses-based Matrix Factorization for Robust
Recommendations
Flavio Giobergia1
1Department of Control and Computer Engineering, Politecnico di Torino, Turin, Italy
Abstract
Much like other learning-based models, recommender systems can be aected by biases in the training data. While typical
evaluation metrics (e.g. hit rate) are not concerned with them, some categories of nal users are heavily aected by these
biases. In this work, we propose using multiple triplet losses terms to extract meaningful and robust representations of users
and items. We empirically evaluate the soundness of such representations through several “bias-aware” evaluation metrics, as
well as in terms of stability to changes in the training set and agreement of the predictions variance w.r.t. that of each user.
Keywords
recommender systems, matrix factorization, contrastive learning
1. Introduction
Recommender systems are a fundamental part of almost
any experience of online users. The possibility of rec-
ommending options tailored to each individual user is
one of the key contributors to the success of many com-
panies and services. The metrics that are commonly
used in literature to evaluate these models (e.g. hit rate)
are typically only concerned with the overall quality of
the model, regardless of the behaviors of such models
on particular partitions of data. This results in recom-
mender systems typically learning the preferences of the
“majority”. This in turn implies a poorer quality of recom-
mendations for users/items that belong to the long tail
of the distribution. In an eort to steer the research fo-
cus to addressing this problem, the EvalRS challenge [
1
].
This challenge, based on the RecList framework [
2
], pro-
poses a recommendation problem with a multi-faceted
evaluation, where the quality of any solution is not only
evaluated in terms of overall performance, but also based
on the results obtained on various partitions of users and
items. In this paper, we present a possible recommender
system that addresses the problem proposed by EvalRS.
The solution is based on matrix factorization by fram-
ing an objective function that aligns users and items in
the same embedding space. The matrices are learned by
minimizing a loss function that includes multiple triplet
losses terms. Dierently from what is typically done (i.e.
aligning an anchor user to a positive and a negative item),
in this work we propose additionally using triplet terms
for users and items separately.
The full extent of the challenge is described in detail in
[
1
]. In short, the goal of the challenge is to recommend
EvalRS at CIKM 2022
"avio.giobergia@polito.it (F. Giobergia)
0000-0001-8806-7979 (F. Giobergia)
©2022 Copyright for this paper by its authors. Use permitted under Creative Commons License
Attribution 4.0 International (CC BY 4.0).
CEUR
Workshop
Proceedings
http://ceur-ws.org
ISSN 1613-0073
CEUR Workshop Proceedings (CEUR-WS.org)
songs to a set of users, given their previous interactions
with other songs. The provided dataset is based on a
subset of the openly available LFM-1b dataset [
3
]. The
source code for the proposed solution has been made
available on GitHub 1.
2. Methodology
In this section we present the proposed methodology,
highlighting the main aspects of interest. No data prepro-
cessing has been applied to the original data, although
some approaches have been attempted (see Section 4).
The proposed methodology, as explained below, allows
ranking all items based on estimated compatibility with
any given user. We produce the nal list of
𝑘
recommen-
dations by stochastically selecting items from the ordered
list of songs, weighting each song with the inverse of its
position in the list.
2.1. Loss definition
Matrix factorization techniques have long been known
to achieve high performance in various recommendation
challenges [
4
]. This approach consists in aligning vec-
tor representations for two separate entities, users and
items (songs, in this case). This alignment task is a recur-
ring one: a commonly adopted approach to solving this
problem is through the optimization of a triplet loss [5].
A triplet loss is a loss that requires identifying an an-
chor point, as well as a positive and a negative point, i.e.
points that should either lie close to (positive) or far from
(negative) the anchor point.
Users and songs can thus be projected to a common
embedding space in a way that users are placed close to
songs they like and away from songs they do not like.
1https://github.com/fgiobergia/CIKM-evalRS-2022
arXiv:2210.12098v1 [cs.IR] 21 Oct 2022
This can be done by choosing a user as the anchor, and
two songs as the positive and negative points. A reason-
able choice for the positive song is one that has been
listened by the user. The choice for the negative song
is trickier. Random songs, or songs not listened by the
user are possible choices. However, more sophisticated
strategies can be adopted to choose negative points that
are dicult for the model to separate from the anchor.
These are called hard negatives and have been shown in
literature to be benecial to the training of models [6].
We decided to use a simple policy for the selection of
a negative song: a negative song for user
𝑢
is extracted
from the pool of songs that have been listened by one of
the nearest neighbors of
𝑢
and have not been listened by
𝑢
. By doing so, we aim to reduce the extent to which the
model relies on other users’ preferences to make a recom-
mendation. The concept of neighboring users is obtained
by comparing the similarity between embedding repre-
sentations of all users. Due to the computational cost of
this operation, it is only performed at the beginning of
each training epoch.
We can thus dene the triplets
(𝑢𝑎
𝑖, 𝑠𝑝
𝑖, 𝑠𝑛
𝑖)
to be used
for the denition of a triplet loss. Here,
𝑢𝑎
𝑖
is used to
represent the vector for the anchor user, whereas
𝑠𝑝
𝑖
and
𝑠𝑛
𝑖
represent the vectors for the positive and negative
songs respectively.
Similar approaches where users are aligned to songs
they did or did not like are Bayesian Personalized Rank-
ing (BPR) [
7
], where negative songs are sampled ran-
domly, and WARP [
8
], where negative items are sampled
so as to be “hard” (based on their proximity of the anchor
w.r.t. the positive item). To improve the robustness of the
representations built, we are additionally interested in
aligning similar songs and similar users. To this end, we
introduce two additional triplet terms to the loss function,
one that is based on
(𝑠𝑎
𝑖, 𝑠𝑝
𝑖, 𝑠𝑛
𝑖)
and one on
(𝑢𝑎
𝑖, 𝑢𝑝
𝑖, 𝑢𝑛
𝑖)
.
Based on the previously dened concepts, we choose
𝑠𝑎
𝑖
as a song listened by
𝑢𝑎
𝑖
, and
𝑢𝑝
𝑖
and
𝑢𝑛
𝑖
as users who
respectively listened to
𝑠𝑝
𝑖
and
𝑠𝑛
𝑖
. Other alternatives
have been considered, but were ultimately not selected
due to a higher computational cost.
We dene the nal loss as:
=
𝑖
𝑤𝑖(𝑚𝑎𝑥{𝑑(𝑢𝑎
𝑖, 𝑠𝑝
𝑖)𝑑(𝑢𝑎
𝑖, 𝑠𝑛
𝑖) + 𝑚0,0}+
𝜆1𝑚𝑎𝑥{𝑑(𝑢𝑎
𝑖, 𝑢𝑝
𝑖)𝑑(𝑢𝑎
𝑖, 𝑢𝑛
𝑖) + 𝑚1,0}+
𝜆2𝑚𝑎𝑥{𝑑(𝑠𝑎
𝑖, 𝑠𝑝
𝑖)𝑑(𝑠𝑎
𝑖, 𝑠𝑛
𝑖) + 𝑚2,0})
(1)
Where
𝑑(·)
is a distance function between any pair of
vectors. In this work, the cosine distance is used.
𝑚𝑗
is a
margin enforced between positive and negative pairs. In
this work, since all elements are projected to a common
embedding, we used
𝑚0=𝑚1=𝑚2
. Finally,
𝑤𝑖
is a
weight that is assigned to each entry, which is discussed
useranc
songanc
userneg
songneg
userpos
songpos
user-song loss
song-song loss
user-user loss
Figure 1:
Representation of the action of each part of the loss
on the vectors. Arrow directions represent whether elements
are pulled towards or pushed away from the anchors.
in Subsection 2.2.
Figure 1summarizes the eect of the various terms of
the loss on the embedding vectors learned.
2.2. Popularity weight
To make the minority entities more relevant, we adopted
a weighting scheme that modulates the previously de-
scribed loss so as to weigh rows more if they belong to
“rarer” entities and less for common ones. In accordance
with [
1
], we identied ve factors to be kept into account.
Based on these, a coecient has been dened for each
entry in the training set. The nal weight is given by
a weighted average of these coecients. The following
is a list of factors, along with the way the respective co-
ecients have been computed (logarithms are used for
factors that follow a power law distribution). All coe-
cients are normalized to sum to 1 across the respective
population.
Gender (
𝜃𝑔𝑒𝑛𝑑𝑒𝑟
): in accordance with the original
dataset, a relevance coecient is provided for the
categories male, female, and undisclosed
2
. The
coecient is proportional to the inverse of the
occurrences of each gender in the list of known
users.
2
This simplied perspective on gender does not reect that of the
author
摘要:

TripletLosses-basedMatrixFactorizationforRobustRecommendationsFlavioGiobergia11DepartmentofControlandComputerEngineering,PolitecnicodiTorino,Turin,ItalyAbstractMuchlikeotherlearning-basedmodels,recommendersystemscanbeaffectedbybiasesinthetrainingdata.Whiletypicalevaluationmetrics(e.g.hitrate)arenotc...

展开>> 收起<<
Triplet Losses-based Matrix Factorization for Robust Recommendations.pdf

共6页,预览2页

还剩页未读, 继续阅读

声明:本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。玖贝云文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知玖贝云文库,我们立即给予删除!
分类:图书资源 价格:10玖币 属性:6 页 大小:656.2KB 格式:PDF 时间:2025-05-06

开通VIP享超值会员特权

  • 多端同步记录
  • 高速下载文档
  • 免费文档工具
  • 分享文档赚钱
  • 每日登录抽奖
  • 优质衍生服务
/ 6
客服
关注