Blog

Comparing mood-search models

We compared three openly available models for finding music from a typed description: LAION’s 2023 CLAP music checkpoint, LAION’s new CLAP2-S and the TinyMU music captioner. Each ran with and without a small mood model, on 2,986 tracks that people had labelled, through the same search code. The 2023 CLAP with the mood model found the most matching tracks and was the quickest to analyse music.

Each search is ranked the same way for every model. The model’s text encoder turns the words into a vector, the 50 nearest tracks by sound and the 200 nearest by mood are combined, and a weight set by the mood confidence blends the two.
How every search in the test was ranked. With no mood word in the query, the mood leg uses the nearest mood words in the model’s own text space, or stays off. Ranking details.

Text-to-music search turns a phrase such as “sad piano” into a ranked list of tracks. Kalinka’s Smart Search uses the 2023 CLAP model with a mood model for this, and we wanted to know whether a newer model would do better. Detailed methodology · Reproduce the results

The models

  • LAION-CLAP music (2023) is LAION’s HTSAT-base checkpoint trained for music, music_audioset_epoch_15_esc_90.14. It has 196 million parameters, and we ran it through ONNX. Project
  • CLAP2-S (October 2026) is LAION’s new small model, with 104 million parameters, trained on 366 million clips of speech, music and other sound. On the music tasks of the MAEB benchmark, LAION reports 74.2 for it against 70.3 for its earlier Larger CLAP. None of those tasks involves finding music by description. Model · Paper
  • TinyMU (2026) is a 229-million-parameter music-language model that writes a description of each 10 seconds of music. We searched those descriptions with the small all-MiniLM-L6-v2 text model. Paper · Code
  • The mood model is a 66,000-parameter network we trained on the DEAM listener ratings. From a track’s vector it predicts how pleasant and how energetic the track sounds. Mood words in a query, such as sad or calm, then pull in the tracks nearest that point. Each model got its own mood model, trained the same way. More about the mood model

How we tested

We used two public collections whose tracks carry human labels. MTG-Jamendo gave us 600 short clips and 584 full-length tracks, tagged with genres, instruments and moods. DEAM gave us 1,802 songs that listeners rated from sad to happy and from calm to energetic.

We ran 75 searches on each MTG-Jamendo set. Of these, 55 were tag-style searches such as jazz music, music with piano and sad music, and 20 were everyday phrases such as something melancholic for tonight. DEAM got 15 mood searches such as calm relaxing music. A result counts as a match when it carries a fitting tag. On DEAM, it counts when the song is in the top quarter for that mood.

Every model analysed the same three 10-second excerpts of each track, taken at 25%, 50% and 75% of its length. Every search was ranked by the same code, shown in the diagram above. DEAM results use only mood predictions for songs that the mood model had not seen in training. Queries and relevance · Audio each model sees

Results

Average matching tracks in the first ten results by kind of search. LAION-CLAP with its mood model leads on genre, mood tags, everyday phrases and rated moods. TinyMU leads on instrument searches. All three are well above a random pick.
Each model is shown with its mood model. The grey line marks the average for ten tracks drawn at random from the same collection. Genre, instrument, mood-tag and everyday-phrase searches are averaged over both MTG-Jamendo sets. Plotted values (CSV)

Across all 165 searches, LAION-CLAP with its mood model averaged 3.3 matching tracks in the first ten. CLAP2-S and TinyMU, each with a mood model, averaged 2.7 and 2.8. CLAP2-S ranked lower in 88 searches and higher in 59. TinyMU ranked lower in 92 and higher in 55. Both gaps held up in a paired significance test (p < 0.01). Paired comparisons (CSV)

Average matching tracks in the first ten results · number of searches in brackets
Model All (165) MTG-Jamendo (150) DEAM moods (15)
LAION-CLAP3.12.86.0
LAION-CLAP + mood3.32.87.6
CLAP2-S2.62.44.7
CLAP2-S + mood2.72.46.5
CLAP2-S, 30-second excerpts2.52.34.8
TinyMU2.72.36.1
TinyMU + mood2.82.37.3
LAION-CLAP and TinyMU blended + mood3.32.88.1
Random pick1.00.82.6

With mood models, CLAP2-S was close to LAION-CLAP on the short clips, 2.7 matches against 2.9, but fell behind on full-length tracks, 2.0 against 2.7, and on DEAM. Giving it 30-second excerpts, the length it was trained on, did not help. TinyMU did best on instrument searches, 2.4 against 2.1, and worst on everyday phrases. Blending TinyMU with LAION-CLAP scored highest overall, but its lead over LAION-CLAP with a mood model was too small to tell apart from chance. Scores by collection and kind of search (CSV)

The mood model

We built the mood model ourselves, because none of the three models handles words such as sad or calm well on its own. It is a small network with one hidden layer of 128 units and 66,000 parameters. From a track’s vector it predicts valence, how pleasant the music sounds, and arousal, how energetic it is, on DEAM’s 1–9 scale. We trained it on 1,261 DEAM songs, used 270 more to decide when to stop, and kept 271 aside for testing. As ONNX it is 264 KB and takes well under a millisecond per track. Training recipe

A search reaches the same scale through 45 mood words placed on it by hand: sad sits at valence 2.5 and arousal 3.0, energetic at 7.0 and 8.0. The 200 tracks nearest that point join the results. The mood score can count for up to 60% of a track’s ranking, scaled by the share of the query’s words that are mood words. When a query has no listed word, the nearest words in the model’s own text space stand in, if they are similar enough.

How closely the mood model predicts listener ratings · R² on 271 held-out DEAM songs, where 1 is perfect
Vectors from Valence Arousal
LAION-CLAP0.590.71
CLAP2-S0.620.72
TinyMU descriptions0.470.59
Average matching tracks in the first ten results, without → with the mood model · number of searches in brackets
Search LAION-CLAP CLAP2-S TinyMU
Genre (50)3.4 → 3.43.2 → 3.02.9 → 3.0
Instrument (30)2.2 → 2.11.9 → 1.92.4 → 2.4
Mood or theme tag (30)1.1 → 1.41.1 → 1.21.0 → 0.9
Everyday phrase (40)3.6 → 3.83.0 → 2.82.6 → 2.5
DEAM, valence (5)5.2 → 8.03.8 → 7.05.4 → 7.6
DEAM, arousal (6)6.5 → 7.04.8 → 5.56.3 → 6.8
DEAM, both (4)6.2 → 8.05.8 → 7.56.5 → 7.5

On DEAM’s mood searches the mood model helped all three models clearly: results improved in 10 to 13 of the 15 searches, with p < 0.01 for each model. The gain is largest for valence, the sad-to-happy axis that text-to-audio models handle worst. On genre, instrument and tag searches it made no measurable difference.

Almost all of the gain comes from literal mood words. With the nearest-word fallback switched off, LAION-CLAP’s results did not measurably change. The fallback also needs tuning for each model. Its similarity threshold suits LAION-CLAP’s text space, where genre searches gave mood 0.28 of the weight on average. With CLAP2-S they gave it 0.47, which cost CLAP2-S a little on genre and everyday phrases. Mood prediction accuracy (CSV) · Paired comparisons (CSV)

The trained model for LAION-CLAP’s music checkpoint is published with Kalinka’s model release, together with the mood word list. It expects L2-normalised vectors from that release’s ONNX audio encoder and returns valence and arousal on the 1–9 scale. va_head_v1.onnx · mood_index_v1.npz · Release

Speed and size

We timed each model in its own process on a laptop with an Intel Core Ultra 9 185H, using 4 threads. Analysing a track means decoding it and processing its three 10-second excerpts.

4 threads on an Intel Core Ultra 9 185H · medians
Model Analyse one track 1,000 tracks One search Peak memory Model files
LAION-CLAP · ONNX0.42 s7 min40 ms1.1 GB786 MB
CLAP2-S · PyTorch0.51 s9 min67 ms1.3 GB416 MB
TinyMU and MiniLM · PyTorch3.7 s62 min5 ms3.2 GB2.4 GB

CLAP2-S has half of LAION-CLAP’s parameters and half its file size, but it ran in PyTorch, which brings its own memory overhead. Neither CLAP2-S nor TinyMU has an ONNX export, so their runtimes are not a like-for-like comparison with LAION-CLAP. TinyMU writes up to 200 tokens for each excerpt, which makes it about nine times slower than LAION-CLAP to analyse a track. The mood model adds 264 KB and well under a millisecond per track. Timings and memory (CSV) · How we timed it

Which to choose

  • For search on modest hardware, LAION-CLAP’s 2023 music checkpoint with a mood model gave the best results here and was the quickest to analyse a collection.
  • CLAP2-S comes close on short clips and has a smaller download. It trailed on full-length songs and on mood searches. If you store its vectors as int8, use a range of ±0.75; the ±0.25 that suits CLAP clips some of its values.
  • TinyMU is worth it when you want a readable description of each track. As a search model it trailed, and it needs about 3 GB of memory and nine times the analysis time.
  • Add a mood model to whichever you pick. It is tiny, it helped every model on mood searches, and it did not hurt tag searches. A keyword list does most of the work; tune or drop the nearest-word fallback if you change the text encoder.

Limits

CLAP2’s training data includes music from Jamendo and the Free Music Archive. DEAM’s songs come from the Free Music Archive, Jamendo and MedleyDB, and TinyMU was also trained on Free Music Archive audio. Any overlap would favour the newer models. MTG-Jamendo tags are incomplete, so some results counted as misses do fit the search. Compare the models with each other rather than reading the counts as absolute. There were only 15 DEAM searches, we tested only CLAP2’s small size, and the timings come from a single laptop.

Reproduce the results

The scripts, queries and measured data are in the KalinkaPlayer repository. With the public datasets and models in place, these commands rebuild the vectors and captions, the scores, the figure and the timings. The run instructions list every download, the environments and the checks the scripts print.

cd benchmarks/smart-search/model-comparison
python embed_clap.py && python embed_clap2.py
python caption_tinymu.py      # in its own Python 3.11 environment
python evaluate.py --out results
python figures.py --results results --out figures
python benchmark_speed.py --model clap --threads 4

Benchmark scripts and data · Run instructions and detailed methodology