Spotify Always Knows Our Music Taste

Ashley <3
The Startup
Published in
4 min readNov 20, 2020

Do you ever check Spotify on your phone, open your playlist, and scroll to the bottom to see recommended music? Then you click on a song from the selection and find that it’s immediately up your preference ally?

OR

When you check Spotify on your phone, look at recommended playlists, click on one, just to find that the playlist consists of your favourite music artists and new songs that are similar to the music you usually listen to?

This situation of Spotify recommending music that you are likely to enjoy is NOT a fluke. Rather this situation is a possibility as a result of BaRT, Spotify’s little monster, that hides in our screen to spy on the music we listen to.

Okay well, BaRT isn’t an actual monster, but rather a machine learning algorithm that stands for Bandits for Recommendations as Treatments. In fact, BaRT is the real reason why most Spotify users do not go and search for playlists, but rather listen to the recommended ones. Essentially BaRT is responsible of keeping users engaged and listening, by recommending artists the user likes and new music that the user will likely enjoy, to keep them entertained, and not bored.

It’s All About the Statistics 📈

BaRT, is driven by statistics, in fact the algorithm is constantly spying on millions of users engaging with different types of music, and is able to collect this data to strengthen the results.

Some of the stats BaRT analyzes:

  • A history of your listening style (Example: hip hop, pop, indie, rock)
  • The rate you skip songs at (Less skips, more recommendations for that style)
  • Time listened to a song (30 seconds into a song is a good thing)
  • Features the song you listen to have (beat drops, speed, keys)

How BaRT’s Model Works

Barts model consists of 3 main components: collaborative filtering, natural language processing, and raw audio analyzation using convolutional neural networks.

Collaborative Filtering 👨‍👩‍👧‍👧

The BaRT model takes advantage of a popular technique called collaborative filtering, which allows the model to make automated predictions regarding the song preferences of a user, all based on the preferences of similar users.

Natural Language Processing 🗣

BaRT does not just rely on collaborative filtering, but also natural language processing. Essentially NLP allows computers to understand, interpret, and manipulate the human language. Spotify scrapes the internet and finds information from blogs, articles, or any other text about music, to come up with a general profile for each song. With the data collected, the NLP can group songs based on the language used to describe them, and songs that have similar descriptions will be put together. Artists are also assigned their own profiles, and artists that have similar profiles will have their songs classified in similar categories.

BaRT uses web-scraping to gather data in order to use NLP and gather labels for songs.

Raw Audio Analyzation using Convolutional Neural Networks 🎵

The BaRT algorithm is able to use convolutional neural networks (CNN) to convert raw audio into a waveform. Then the waveforms are processed by the model, and are assigned parameters such as beats per minute, song keys, speed of words, loudness, and so on. Using these parameters, Spotify will try and match similar songs that have similar parameters to the user’s preference.

The 30 Seconds Rule ⏰

BaRT has a strict 30 second rule which determines the overall success of the model. The model will analyze if the user is listening to the recommended songs provided by the algorithm, and then BaRT will check the duration of the time spent listening to the song. If the song has been listened to for more than 30 seconds, the model recognizes this as a positive correlation as a result of their recommendations. The longer amount of time that someone spends on a song or playlist, the more accurate their suggestions will be. In contrast if the user does not like the first 28 seconds of a song, the model will not recommend music similar to that song again.

BaRT’s Brilliance Is What Keeps People Entertained

As a result of BaRT, Spotify 286 million users (2020), have been entertained due to the amazing recommendations that BaRT’s algorithm suggests. User’s on Spotify never get bored of the music that that they listen to because BaRT is able to track analytics and use it’s model to find music that is similar, new, and fresh. I’d say BaRT is doing a pretty great job so far, as a result of Spotify being one of the top streaming platforms for music.

Contact me for any inquiries 🚀

If you enjoyed reading my article and have any questions, would like to learn more about me, or want resources for anything A.I. related, you can contact me by:

💫Email: ashleycinquires@gmail.com

--

--

Ashley <3
The Startup

computer scientist, dog lover, peanut butter enthusiast, and probably a little too ambitious