arXiv:2609.35672cs.SDSep 2026

Manuscript Offprint

arXiv:2609.35672

Retrieving Individual Stems from Music Mixtures with Slot Embeddings

David Braun, Junyi Fan, Pranay Manocha, Donald S. Williamson, Adam Finkelstein

ABSTRACT

Music producers search libraries of isolated instrument recordings, called stems, for sounds resembling parts of an existing song. Neural retrieval systems address this by mapping audio to embeddings and ranking library stems by their similarity to the query. The leading method, Contrastive Instrument Retrieval (CIR), encodes the mixture as a single embedding, but it works best when a user specifies the target's instrument family. We introduce Stembed, which encodes a mixture as several slot embeddings representing candidate stems. During training, we construct mixtures from stems of the same song and match their slot embeddings to those of the isolated stems. The slot embeddings from mixtures inherit the stem identities of their assigned solo embedding, enabling a contrastive loss. On mixtures from held out MoisesDB artists, Stembed outperforms a CIR-style baseline when both search the full stem library. Even when predicting the stem count itself without family labels, Stembed exceeds the baseline's family-filtered R@1. Our website demonstrates how users can select a slot by inspecting the tags of its retrieved stems.

Index Terms— Music information retrieval, representation learning, contrastive learning, timbre, query by example

1. INTRODUCTION

Musicians often use existing recordings to communicate the sounds they want in a production. A reference recording may contain a desirable guitar, drum kit, or synthesizer, each of which could guide a search through a stem library. Audio retrieval models encode the recording as a single embedding [1] or a set of embeddings [2], then compare these with embeddings of library stems. A single mixture embedding aggregates information from all its underlying stems. We study how to encode the mixture as a set of embeddings, each providing a potential query to a library.

One approach is to apply source separation [3] and encode the resulting stems for retrieval [1]. However, separation artifacts can affect the embeddings, and predefined output categories can group several instruments together. Methods that retrieve directly from mixtures offer another approach. Show Me the Instruments (SMTI) [2] first trains an instrument encoder through classification, then trains a mixture encoder to predict a set of embeddings from the frozen instrument encoder. The second stage uses permutation-invariant training with minimum-cost matching [4, 5].

More recently, Contrastive Instrument Retrieval (CIR) [1] fine-tunes an Audio Spectrogram Transformer (AST) [6] trained on AudioSet [7] to encode both mixtures and isolated instruments. Its contrastive objective brings a mixture's embedding close to those of its stems. Since multiple instruments compete for representation in the same coordinate space, CIR benefits from searching within a specified instrument family. However, specifying a family requires skilled human intervention and limits automation.

Slot-based models [8, 9] provide another way to produce a set of latent embeddings. A slot is a learned representation intended to describe an individual component of the input. AudioSlots [10] maps two-speaker mixtures to source slots, which guide the reconstruction of spectrograms of the individual speakers. MusicSlots [11] learns slots for individual notes in synthesized chords through unsupervised spectrogram reconstruction. Compositional Audio Representation Learning (CARL) [12] learns source-centric slots from frozen audio features using classification supervision or feature reconstruction.

We introduce Stembed, which learns stem-specific slot embeddings from multitrack recordings. Unlike SMTI, whose second training stage predicts frozen solo embeddings, Stembed fine-tunes a joint representation of stems and mixtures. During training, we match a mixture's slots to solo embeddings. The matched slots inherit the corresponding stem identities, enabling a contrastive loss. The matching procedure leaves some slots assigned and some unassigned. A slot predicts its own binary assignment with a "presence" score. At inference, this score enables selecting which slot embeddings become queries. In principle, users could inspect each slot's retrieved tags or filenames and choose which results to audition without naming an instrument family. This could turn the production task of specifying a family into a recognition task.

Our main contributions are as follows. First, we introduce a framework for contrastive training of stem-level slots. Second, we evaluate the approach on real multitrack music, comparing against CIR- and SMTI-style objectives with a consistent audio backbone. We also compare against pipelines that first source separate and then encode. On MoisesDB, without instrument-family guidance, Stembed achieves higher R@1 than family-guided CIR–MuQ. Code, model weights, and a retrieval demo are available. 1^{1} The demo suggests that slots specialize in instrument types within mixtures, with slot 1 tending to represent vocals when they’re present.

References (26)