Jacob Wood

Hyper Personalized Music Recommendations with Gemini Flash

Kaggle & Google: Gemini Long Context Competition

The competition is about exploring a use case that can benefit from the unique features of Gemini Flash, including its one million token context window and context caching.

Use Case: Hyper Personalized Music Recommendations

I went deep on a specific user called SavageCore, including almost four years of their listening history (736,388 tokens) as the context used by Gemini Flash to make recommendations, form opinions, build a profile and match SavageCore to other users based on music taste.

I chose this approach because many Generative AI experiences are too generic to blow our minds. I beleive the promise of this technology to be hyper personalization at scale.

The long context window of Flash allows me to capture a significant period of listening history for SavageCore and caching enables me to introduce multiple listening histories.

Music is a deeply personal and unique experience, which is why this level of hyper personalization enabled by Gemini Flash's features is an interesting use case to explore.

SavageCore's Music Taste & Insights

Here are just some of things I learned about SavageCore's music taste:

  • Enjoy a wide range of electronic music, ambient, IDM, techno and breakbeat (Charlotte de Witte, Hardfloor, 1200 Micrograms, Aphex Twin, Burial).
  • Drawn to artists who push boundaries and explore unconventional sounds.
  • Enjoys tracks where there's great Synthwork.
  • Like artists that blend genres, for unique musical experiences.
  • Has an open mind when it comes to music and looking to discover new sounds.
  • Deep dives into certain artists, listening to entire albums and discography - showing a genuine interest in music, beyond a single hit.
  • Enjoys music with darker, heavier moods and introspective themes.
  • Listens to music more on Thursdays.
  • Peak listening times are in the afternoons 1-6pm UTC.

Introducing Multiple Users & Tastes

I generate three musical profiles using unique listening histories specific to those users:

  from IPython.display import Markdown, display

  display (Markdown(gw_profile))

  display (Markdown(bespont_profile))

  display (Markdown(savage_core_profile))

From the profiles, I look at musical compatibility between users:

from IPython.display import Markdown, display

prompt = f"""
Please review three user music profiles: 
- SavageCore: {savage_core_profile}
- gw666: {gw_profile}
- BeSpont: {bespont_profile}

Based on your review:
1. Which profile is most compatible with SavageCore's and why?
2. Provide a compatibility score (as a percentage) for both gw666 and BeSpont compared to SavageCore.
"""

response = model.generate_content([prompt])

# Lets save our report
compatibility_report = response.text

display (Markdown(response.text))

I'm able to see that BeSpont is more compatible with SavageCore at 85% compatibility because both have an eclectic taste, a shared love for the underground and like to explore darker and more complex music.

Concluding On What's Possible?

This is an entry into a competition and not a functional application with users.

I wanted to demonstrate an extra level of personalization possible using Gemini Flash, a one million token context window and context caching.

To me I can see different ways that this level of personalization could create astounding user experiences:

  • Facilitating real life shared experiences through concerts, dates, meetups by matching musically compatible people.
  • Serving more personalized ads, at the right time, based on a better understanding of a person's music taste.
  • Introducing new modalities: Audio, Image, Video, to create interactive and personalized music experiences.