Song Vectorisation — Audio + Lyric Embeddings for Similarity & Song Maths

Represent each song as a vector so that similarity search ("find more like this") and vector arithmetic ("more Hornsby, less piano, more Springsteen lyrically") become possible. Two embedding sources — audio and lyrics — kept independently addressable rather than fused into one opaque blob, consistent with the concept-factorisation preference for debuggable retrieval over black-box RAG.

⚠ Review by 2026-09-30 — delete this note if John hasn't revisited/actioned it by then.

Motivation

Prompted by asking Claude for songs similar to Bruce Hornsby's "The Way It Is" (melancholy, piano-led, late-80s AOR/folk-rock, Don Henley-adjacent). A one-off LLM recommendation is fine but not reusable, not queryable, and not composable. A vector space would let this become a standing tool: nearest-neighbour search, playlist clustering, and arithmetic over a personal listening corpus.

Two Embedding Sources

Prior Art

"song2vec" is an established term, not a novel idea — confirmed by search (2026-07-17). Two established lines of prior art, roughly matching the audio/co-occurrence split above; the lyric+audio -vector-with-arithmetic angle here appears less common than either alone.

Playlist co-occurrence (word2vec/skip-gram over tracks) — closest to what a personal listening history could drive. Idea traces to a 2017 Spotify ML talk applying word2vec-style embeddings to track co-occurrence in playlists, so tracks that appear near each other across many playlists get similar vectors even without being adjacent in any single one. Open-source implementation exists (vrjkmr/song2vec on GitHub, skip-gram over Spotify playlist data). Also used in academic recommender work (IJCAI 2017) and in social-science research measuring cross-level similarity (song-user, song-city, etc.).

Deep audio embeddings — a Stanford CS229 project (2017) learned a metric embedding directly from spectrograms via Adversarially Learned Inference, benchmarked against non-deep baselines like PCA. This is the audio-side sibling to the co-occurrence approach and validates the OpenL3/MERT-style direction above.

Practical starting point — a Medium writeup (Weiqi Tong, 2018) trained a skip-gram song2vec (dim 100) on listening-history sequence data, used cosine similarity for nearest-neighbour recommendation, and averaged song vectors per artist into an "Artist2Vec". Good reference for a first working version of the co-occurrence half.

Where this idea differs — the surveyed prior art each picks one modality (audio co-occurrence/sequence data); none combine audio and lyric embeddings as separately-weightable concatenated vectors for arithmetic across both axes at once. That dual-vector-with-arithmetic framing, plus using concept-factorisation for interpretable lyric axes, is the more original part of this note.

Audio embeddings — captures sound: instrumentation, tempo, mood, production era.

Lyric embeddings — captures theme, sentiment, narrative.

A third option, metadata/co-occurrence embeddings (word2vec-style over playlist co-occurrence — how Spotify's own recommender embeddings work) — noted as an alternative if audio/lyric processing proves impractical; needs a large playlist corpus (public Spotify API playlists, or personal listening history).

Combining the Two

Normalise each embedding independently, then either:

Song Maths

The appealing part once vectors exist: analogies and blends, e.g. Hornsby_TheWayItIs - piano + guitar ≈ ? or averaging several songs' vectors to search for "a bit of X and a bit of Y". Works best when the embedding space has reasonably linear substructure — audio and co-occurrence embeddings tend to exhibit this better than raw lyric embeddings, which is another argument for concept-factorised lyric vectors over a plain sentence embedding (interpretable axes compose more predictably than an opaque high-dimensional space).

Open Questions / Next Steps

created 2026-07-17  ·  updated 2026-07-17  ·  version 1  ·  tags review-2026-09-30, delete-if-unreviewed