Entertainment Issue I Volume XXIV

Algorithmic Symphonies: How Spotify Strikes the Right Chord

About the Author: Jonathan Wong

Jonathan Wong is a junior at the University of Southern California, pursuing a bachelor's degree in Computer Science and Business. He has a passion for music and storytelling and is involved in various organizations such as HackSC, TASSEL, Taiwanese American Organization, and Delta Omicron Zeta. Jonathan is enthusiastic about exploring the intersection of technology and creative industries, and he hopes to use his skillset to make an impact in the world.


This article explores Spotify’s recommendation algorithm, including how it has revolutionized the music industry, and the machine learning techniques it uses, such as collaborative filtering, hybrid recommendation, and feedback loops. Through a discussion regarding the importance of data collection and the role it plays in the success of Spotify’s algorithm,  the implications of advanced recommendation algorithms on the broader field of AI and its relationship with human intelligence will be observed. 

Keywords: Artificial Intelligence, Spotify, Music, Audio, Machine Learning, Data, Streaming, Recommendation


The Rise of Streaming 

Have you ever found yourself endlessly scrolling through your Spotify library, looking for the perfect song for your mood? Maybe you’re tired of listening to the same songs on repeat and decide to explore. You shuffle through “Discover Weekly,” one of Spotify’s hundreds of personalized playlists, and find your new favorite song! With over 100 million songs and 500 million monthly active users [1], Spotify has completely revolutionized the music industry by providing a platform for easy streaming, discovering, and sharing new music. Whether through personalized playlists or the “Autoplay” feature that adds new songs to your queue in real-time, Spotify has a vast collection of songs to discover. But have you ever stopped and wondered how Spotify knows exactly what song to recommend next? How does Spotify know us better than we know ourselves? The answer lies in its robust recommendation algorithm, which utilizes machine learning techniques to analyze listening history, preferences, and user behavior to give personalized recommendations to each listener . 

Before Spotify’s creation and rise in 2006, accessing and sharing music was tedious and impractical. At the time, music could only be accessed by attaining physical copies, listening to the radio, and pirating online [2]. However, the rise of digital music streaming services like Soundcloud, Pandora, and Spotify completely changed how artists make music and how we listen to it. Through licensing agreements with record labels and artists [3], streaming services offer a seemingly infinite collection of songs that can be accessed anytime, anywhere, and on any device. What separates Spotify from the rest, however, is its innovative use of data. With complex machine-learning techniques, the platform provides users with personalized recommendations and playlists, making it easier to discover new music that aligns with their preferences. Beyond that, they have created new features such as “Spotify Wrapped,” which allows listeners to view their data and history in a captivatingly new way. According to a study done by Statista, such personalized recommendations were the most significant factor in user satisfaction with music streaming services [4]. In essence, Spotify’s rising growth and popularity have disrupted the traditional music industry with artificial intelligence and data at the core of its business model. 


Let’s Break it Down 

Machine learning models are only as powerful as the data they are trained on. Spotify’s data collection process is one of the biggest contributors to their powerful recommendation algorithms. For every song, Spotify collects two main types of data: artist-provided metadata and raw audio data. The metadata is tagged onto each song by the artist and contains information about the artist, song title, album, and genre. Raw audio signals, however, include detailed information about the track itself, such as beats per minute, loudness, and key [5]. With this information and complex knowledge of music theory, Spotify’s algorithm assigns values to

every song in three higher-level categories, which include “danceability,” “energy,” and “valence.” Using these broader values, the algorithm can begin categorizing and finding similarities between tracks. For instance, “When I Was Your Man” by Bruno Mars has 73 BPM and a time signature of 4 beats per bar. With this information, Spotify’s algorithm classifies the song as moody with low energy and high danceability [6]. 

Figure 1: Audio Analysis of “My Way” by Frank Sinatra using Spotify API

Alongside the data collected about the music, Spotify uses natural language processing (NLP) models to gather information about the music in a more text-related context. This can range from an analysis of the lyrics, listener sentiments online, and user-created playlist titles [7]. For instance, if a song contains an overwhelming amount of words with sad connotations or is in a lot of playlists titled “sad,” these NLP models can conclude that it is a sad song. On the other hand, a song like “Happy” by Pharrell Williams would be classified as upbeat and high energy. 


Music to Our Ears 

Now that we have the relevant information needed to analyze and categorize songs, Spotify’s recommendation algorithm is almost ready to make suggestions. But first, it must analyze and understand user behaviors and taste preferences using machine learning techniques such as collaborative, content-based, and item-based filtering. 

Collaborative filtering is a technique that is widely used in recommendation systems and involves analyzing user behavior to find commonalities between users. Using this information,  the system is able to suggest items that similar users have enjoyed [8]. To better understand this, imagine a matrix with each row representing a unique user and each column representing a song or artist. At each row and column pairing lies a score that describes how much the user (row value) likes a certain song/artist (column value). This score can be composed of many variables, such as repeated listens, skips, playlist saves, and listening duration. Using the example below, User A enjoys “Kill Bill” by Sza but has never listened to “Blank Space” by Taylor Swift. User C enjoys “Kill Bill” and “Blank Space”. Therefore, the recommendation algorithm may decide to recommend “Blank Space” to User A.

Figure 2: Collaborative Filtering Matrix Representation 

The two main techniques used in collaborative filtering are user-based filtering and item-based filtering. User-based filtering relies on the similarities between users to make recommendations. In user-based filtering, the algorithm recommends songs that other users with similar interests have liked in the past [9]. Spotify’s user-based filtering algorithm analyzes a user’s listening history, search history, and playlists to find similar users and recommend songs accordingly. Meanwhile, item-based filtering is a collaborative filtering technique that relies on the  similarities between songs to make recommendations. In  item-based filtering, the algorithm recommends items similar to items that the same user likes [10].

Spotify’s item-based filtering algorithm analyzes a single user’s listening history, search history, and playlists to find similar songs and recommend them. In practice, Spotify uses a combination of these techniques called a hybrid recommender system that draws from the strengths of multiple filtering methods to provide more accurate and personalized recommendations. The system uses a combination of collaborative filtering and content-based filtering to identify songs or artists that are popular among users with similar listening habits and similar to the songs that a single user has previously listened to [11]. For example, suppose a user has listened to many songs in the indie rock genre: characterized by unconventional time signatures, tempo changes, and electric guitars. In that case, Spotify’s recommendation system might use user-based filtering to identify other users with similar listening histories and then use item-based filtering to recommend other indie rock songs similar to those the other user has listened to. 


Always Learning 

While Spotify’s recommendation algorithm is impressive, it is far from perfect. To ensure that its machine learning models are satisfactory and constantly improving, Spotify implements a feedback loop [12] an essential component of its recommendation algorithm. This allows the platform to continually improve its music recommendations based on user interactions/feedback with the recommended material. The feedback loop collects data on how users interact with the recommended songs, such as whether they save the songs to their playlists or skip them. This data is then used to adjust the recommendation algorithm to match the user’s preferences better. For example, if a user consistently skips recommendations in a particular genre, the algorithm will learn to stop recommending that genre to the user. The feedback loop also allows Spotify to track changes in user preferences over time, which helps to ensure that recommendations remain relevant and up-to-date. 

As Spotify’s recommendation algorithm continually evolves, the company is regularly adding innovative new features. For example, Spotify DJ is a new feature in beta testing that “knows you and your music taste so well that it can choose what to play for you” [13]. Not only will it scour through the latest trends and old favorites, but it even speaks to you in a (somewhat unsettling) realistic voice. 

Figure 3: Spotify’s Newest Feature: Artificial Intelligence DJ 


Potential Concerns 

Although Spotify’s recommendation algorithm has undoubtedly improved the music listening experience for many users, it is not without its ethical concerns and drawbacks. One of the main concerns is that the algorithm can create “filter bubbles,” where users are only

recommended music that aligns with their existing preferences, limiting exposure to new genres or styles [14]. This can lead to a lack of diversity in the music users are exposed to, which may perpetuate existing biases or stereotypes. More prominently, there are concerns about the ownership of user data and the transparency of how this data is being used. Many do not understand the extent to which their data is being tracked and some users may be uncomfortable with how their personal data is used behind the scenes [15]. Finally, there are growing concerns about the impact of recommendation algorithms on the music industry, with some arguing that they perpetuate inequality. Recommendation algorithms tend to be biased towards trending or popular artists, causing smaller artists to struggle to get noticed [16]. 


Wrapping it Up 

In conclusion, Spotify’s personalized content has played a huge factor in its success which has been made possible by machine learning algorithms and complex data analysis. In 2021, Spotify listeners accumulated 107.9 billion hours of listening, an impressive metric that can  confidently be attributed to  its complex recommendation systems[17]. As Spotify continues to provide tailored content, user engagement will only increase. Spotify’s recommendation algorithm is a prime example of how machine learning models are becoming more advanced as well as  the impact of artificial intelligence on countless industries. For example, other major companies like TikTok, Netflix, and Tinder all employ similar machine learning tactics. As the music streaming industry continues to grow and evolve, it is clear that recommendation algorithms will play an increasingly important role in shaping the way we discover and consume music.


Works Cited 

[1] D. Georgiev, “21+ spotify revenue and user statistics (2023),” Techjury. [Online]. Available: https://techjury.net/blog/spotify-statistics/#gref. [Accessed: 08-Mar-2023]. 

[2] D. EN, “A history of music streaming,” High-end loudspeakers for home systems, professionals and cars, 15-Sep-2022. [Online]. Available: 

https://dynaudio.com/magazine/2018/may/a-history-of-music-streaming#:~:text=Vinyl%20gave %20people%20the%20option,could%20listen%20to%20it%20anywhere. [Accessed: 08-Mar-2023]. 

[3] S. Rosen, “What makes Spotify Tick? an overview of how Spotify Licenses Music,” Richmond Journal of Law and Technology, 27-Oct-2022. [Online]. Available: https://jolt.richmond.edu/2022/11/08/what-makes-spotify-tick-an-overview-of-how-spotify-licen ses-music/#:~:text=Spotify%20gains%20access%20to%20catalogs,recording%20of%20the%20s ong%20itself. [Accessed: 08-Mar-2023]. 

[4] M. C. Götting, “Most important features of music streaming services among adults in the U.S. 2020,” Statista, 24-Mar-2022. [Online]. Available: 

https://www.statista.com/statistics/819865/important-features-music-streaming-services/#:~:text =For%20U.S.%20consumers%2C%20the%20most,when%20listening%20to%20music%20onlin e. [Accessed: 08-Mar-2023]. 

[5] D. Pastukhov, “How Spotify’s algorithm works? A Complete Guide to spotify recommendation system [2022]: Music tomorrow blog,” How Spotify’s Algorithm Works? A Complete Guide to Spotify Recommendation System [2022] | Music Tomorrow Blog. [Online]. Available: 

https://www.music-tomorrow.com/blog/how-spotify-recommendation-system-works-a-complete guide-2022. [Accessed: 08-Mar-2023]. 

[6] “BPM and key for when I was your man by Bruno Mars: Tempo for when I was your man: Songbpm,” SongBPM. [Online]. Available: 

https://songbpm.com/@bruno-mars/when-i-was-your-man. [Accessed: 01-May-2023]. [7] Mage, “How does Spotify Use Machine Learning?,” DEV Community, 11-Feb-2022. [Online]. Available: 

https://dev.to/mage_ai/how-does-spotify-use-machine-learning-4pdg#:~:text=Natural%20langua ge%20processing%20(NLP)%20is,language%20used%20to%20describe%20them. [Accessed: 08-Mar-2023]. 

[8] “Collaborative filtering  |  machine learning  |  google developers,” Google. [Online]. Available:

https://developers.google.com/machine-learning/recommendation/collaborative/basics. [Accessed: 08-Mar-2023]. 

[9] A. @GrabNGoInfo, “Recommendation system: User-based collaborative filtering,” Medium, 23-Jan-2023. [Online]. Available: 

https://medium.com/grabngoinfo/recommendation-system-user-based-collaborative-filtering-a2e 76e3e15c4#:~:text=User%2Dbased%20collaborative%20filtering%20is,similarity%20to%20ma ke%20product%20recommendations. [Accessed: 08-Mar-2023]. 

[10] M. Qutbuddin, “Comprehensive guide on Item Based Recommendation Systems,” Medium, 02-Oct-2020. [Online]. Available: 

https://towardsdatascience.com/comprehensive-guide-on-item-based-recommendation-systems-d 67e40e2b75d. [Accessed: 08-Mar-2023]. 

[11] “Towards recommender system optimization: Our data tool for algorithmic optimization on Spotify [part 1],” Towards Recommender System Optimization: Our Data Tool for Algorithmic Optimization on Spotify [Part 1]. [Online]. Available: 

https://www.music-tomorrow.com/blog/towards-recommender-system-optimization-data-tool-for -algorithmic-optimization-on-streaming-platforms. [Accessed: 08-Mar-2023]. 

[12] S. Ciocca, “How does Spotify know you so well?,” Medium, 08-Apr-2020. [Online]. Available: 

https://medium.com/s/story/spotifys-discover-weekly-how-machine-learning-finds-your-new-mu sic-19a41ab76efe. [Accessed: 08-Mar-2023]. 

[13] Naomi, “Spotify debuts a new AI DJ, right in your pocket,” Spotify, 22-Feb-2023. [Online]. Available: 

https://newsroom.spotify.com/2023-02-22/spotify-debuts-a-new-ai-dj-right-in-your-pocket/. [Accessed: 08-Mar-2023]. 

[14] Jasmine Ryu Won Kang and Adam Lam and T. Kumar, “How you may be trapped in a filter bubble of music due to ai,” The Strand, 14-Aug-2022. [Online]. Available: https://thestrand.ca/how-you-may-be-trapped-in-a-filter-bubble-of-music-due-to-ai/. [Accessed: 08-Mar-2023]. 

[15] J. Morse, “How to stop Spotify from sharing your data, and why you should,” Mashable, 05-Apr-2022. [Online]. Available: https://mashable.com/article/spotify-user-privacy-settings. [Accessed: 08-Mar-2023].

[16] S. Ovide, “Streaming saved music. artists hate it.,” The New York Times, 22-Mar-2021. [Online]. Available: 

https://www.nytimes.com/2021/03/22/technology/streaming-music-economics.html. [Accessed: 08-Mar-2023]. 

[17] “Spotify notched up 107.9bn hours of music listening in 2021 – music ally,” Spotify notched up 107.9bn hours of music listening in 2021 – Music Ally. [Online]. Available: https://musically.com/2021/12/14/spotify-107-9bn-hours-music-listening-2021/. [Accessed: 08-Mar-2023].

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *