  A central role in shaping the experience of users online is played by
recommendation algorithms. On the one hand they help retrieving content that
best suits users taste, but on the other hand they may give rise to the so
called "filter bubble" effect, favoring the rise of polarization. In the
present paper we study how a user-user collaborative-filtering algorithm
affects the behavior of a group of agents repeatedly exposed to it. By means of
analytical and numerical techniques we show how the system stationary state
depends on the strength of the similarity and popularity biases, quantifying
respectively the weight given to the most similar users and to the best rated
items. In particular, we derive a phase diagram of the model, where we observe
three distinct phases: disorder, consensus and polarization. In the latter
users spontaneously split into different groups, each focused on a single item.
We identify, at the boundary between the disorder and polarization phases, a
region where recommendations are nontrivially personalized without leading to
filter bubbles. Finally, we show that our model can reproduce the behavior of
users in the online music platform last.fm. This analysis paves the way to a
systematic analysis of recommendation algorithms by means of statistical
physics methods and opens to the possibility of devising less polarizing
recommendation algorithms.
