Attentive neural architecture incorporating song features for music recommendation

Noveen Sachdeva, Kartik Gupta, Vikram Pudi

TL;DR

This paper proposes STABR (Song and Tag Attention Based Recommendation), a novel neural architecture that predicts the "next song" a user will want to hear by analyzing both the sequence of songs played and their descriptive tags (like genre or mood). By using a dual-attention mechanism, the model learns to prioritize specific past interactions that best represent a user's current "vibe," significantly outperforming standard RNNs and collaborative filtering methods.

What Problem Does This Paper Address?

Most music recommendation systems fall into two camps: those that suggest what you might like eventually (long-term preference) and those that suggest what you want to hear right now (short-term interest). The latter is much harder because user moods shift rapidly.

While Recurrent Neural Networks (RNNs) are great at modeling sequences, they often struggle to capture the nuance of why a user is listening to a specific set of songs. Furthermore, standard sequence models often assume the most recent item is the most important. However, in music, a song played four tracks ago might be a better indicator of a user's current mood than the very last track played (which might have been a "skip"). The authors aim to bridge this gap by incorporating song features (tags) and an attention mechanism that can "pick and choose" which past songs are currently relevant.

Methods

The authors introduce an Attentive Neural Architecture consisting of two parallel components that merge before making a prediction:

  1. The Song Component: This takes the sequence of song IDs, converts them into embeddings, and passes them through a Bidirectional Gated Recurrent Unit (Bi-GRU). An attention layer then assigns weights to these hidden states, allowing the model to focus on specific songs in the history regardless of their position.
  2. The Tag Component: Instead of just song IDs, this path looks at the metadata. For every song in the history, it takes the average embedding of all its Last.fm tags (e.g., "rock," "mellow," "80s"). These are also processed via a Bi-GRU and an attention layer.
  3. Fusion: The "context vectors" from both paths are concatenated and passed through a bottleneck dense layer (to reduce dimensionality) and finally a softmax layer to calculate the probability of every song in the catalog being the "next" one.

What’s new? While attention is common in NLP, applying it specifically to a dual-input stream (IDs + averaged tag features) for music sessions allows the model to learn a "similarity function" that is much more flexible than previous heuristic-based approaches.

Datasets

The study uses a subset of the Last.fm dataset.

  • Scale: 3,553,321 logs across 759 users and 110,410 sessions.
  • Content: 386,046 unique songs and 487,844 unique tags.
  • Preprocessing: User histories were divided into sessions. The first 70% of sessions were used for training, and the remaining 30% for testing. Sessions with fewer than 5 songs were discarded to ensure enough context for the attention mechanism.

Key Insights and Ideas

  • Attention > Recency: The authors argue that the "exact sequence" matters less than the "group of items" occurring together. The attention mechanism proves this by giving higher weights to influential songs even if they weren't the most recent ones played.
  • Tags as a Latent Bridge: Song IDs are sparse; tags provide a dense semantic layer. By averaging tag embeddings, the model can recommend a song it has never seen in a specific sequence before, simply because its "tag profile" matches the user's current attentive context.
  • The Power of "SABR" vs "STABR": The authors tested a song-only attention model (SABR) and a combined song+tag model (STABR). While SABR was already strong, adding tags provided a massive performance boost, proving that metadata is essential for capturing short-term "vibe" shifts.

Key Results

The models were evaluated using HitRatio@k (the probability that the actual next song is in the top k recommendations).

  • STABR (Proposed): Achieved a HitRatio@10 of 28.95%.
  • RNN Baseline: Achieved only 14.42%.
  • Standard Collaborative Filtering (BPR-MF): Managed only 7.34%.
  • Popularity (POP): A meager 0.85%.

The proposed model effectively doubled the performance of standard RNNs, highlighting that attention and content-awareness are game-changers for session-based music recommendation.

Limitations and Future Work

  • Computational Complexity: The final layer performs a softmax over 386,046 songs. While the authors used a bottleneck layer to mitigate this, scaling to millions of songs (like Spotify's catalog) would likely require more efficient sampling methods (e.g., negative sampling or hierarchical softmax).
  • Tag Quality: The model relies heavily on Last.fm tags. In environments where metadata is noisy, sparse, or user-generated (and thus inconsistent), the performance might degrade.
  • Cold Start: The paper does not explicitly detail how the model handles entirely new songs that have no play history but do have tags (though the architecture suggests it could handle this better than ID-only models).

Summary updated

Abstract

Recommender Systems are an integral part of music sharing platforms. Often the aim of these systems is to increase the time, the user spends on the platform and hence having a high commercial value. The systems which aim at increasing the average time a user spends on the platform often need to recommend songs which the user might want to listen to next at each point in time. This is different from recommendation systems which try to predict the item which might be of interest to the user at some point in the user lifetime but not necessarily in the very near future. Prediction of next song the user might like requires some kind of modeling of the user interests at the given point of time. Attentive neural networks have been exploiting the sequence in which the items were selected by the user to model the implicit short-term interests of the user for the task of next item prediction, however we feel that features of the songs occurring in the sequence could also convey some important information about the short-term user interest which only the items cannot. In this direction we propose a novel attentive neural architecture which in addition to the sequence of items selected by the user, uses the features of these items to better learn the user short-term preferences and recommend next song to the user.
BibTeX
@inproceedings{sachdeva2018attentive,
  author = {Noveen Sachdeva and Kartik Gupta and Vikram Pudi},
  title = {{Attentive neural architecture incorporating song features for music recommendation}},
  booktitle = {RecSys},
  year = {2018},
  url = {https://openreview.net/forum?id=tGqu4yDBVw},
}

Loading related content...

Figure