On the de-duplication of the Lakh MIDI dataset

Eunjin Choi, Hyerin Kim, Jiwoo Ryu, Juhan Nam, Dasaem Jeong

Introduction

The Lakh MIDI Dataset (LMD) is a foundational resource for symbolic music AI research. However, because it was compiled by scraping the web, it contains numerous duplicate and near-duplicate files. This redundancy causes "data leakage," where models are evaluated on data they have effectively seen during training, leading to inflated performance metrics. This paper introduces CAugBERT, a contrastive learning-based model designed to identify these duplicates, revealing that over 21% of the LMD-full dataset is redundant.

The Problem: Data Leakage in MIR

In Music Information Retrieval (MIR), data leakage occurs when a training set contains one version of a song and the test set contains a slightly edited version of the same arrangement. For example, if a specific arrangement of "Dancing Queen" is in the training set, and a version with a slightly different tempo or one missing track ends up in the test set, the model isn't learning to compose—it is merely reciting memorized content.

This phenomenon skews evaluation metrics like cross-entropy loss and perplexity, making models appear significantly more capable than they are in practice. Despite the critical nature of this issue, the MIR community has historically lacked robust tools for large-scale MIDI de-duplication, often relying on simple file hashing that fails to catch even minor variations.

Methodology

The authors evaluated three primary avenues to identify duplicates:

  1. Rule-based Baselines: Simple methods like MD5 hashing (which only finds exact bit-for-bit copies), Beat Position Entropy (checking the distribution of notes in a bar), and Chroma-DTW (comparing pitch content over time).
  2. Existing Neural Models: Pre-trained symbolic music models, including MusicBERT and the CLaMP series, were tested to see if their embeddings could naturally cluster similar songs in a high-dimensional space.
  3. CAugBERT: A BERT-based model developed specifically for this task using contrastive learning. The model is trained to minimize the mathematical distance between a song and its augmented versions ("positive pairs") while maximizing the distance between entirely different songs ("negative pairs").

To make CAugBERT robust, the authors employed novel music-specific augmentations that simulate common user edits. These included shifting onsets, changing instrument orders, dropping bars, and transposing keys.

Key Results and Performance

The study confirms that simple hashing is insufficient for de-duplication. It misses files where a user might have simply deleted an instrument track or changed the tempo, even though the core musical arrangement remains identical.

Performance comparison of various de-duplication methods.

As shown in the performance table above, CLaMP3 achieved the highest retrieval performance (nDCG@all of 0.697), indicating it is excellent at ranking duplicates at the top of a search list. However, CAugBERT achieved the best classification performance with an F1-score of 0.493. This makes CAugBERT the most reliable tool for the binary decision of whether a specific file should be filtered out of a dataset.

Redundancy in the Lakh MIDI Dataset

Using their most conservative settings, the authors identified that 38,134 files (21.4%) in LMD-full are duplicates. Under more aggressive configurations, this number exceeds 68,000 files.

Distribution of duplicates found by the proposed configuration versus simple hashing.

The figure above demonstrates that the proposed configuration identifies a significantly higher number of duplicate groups compared to standard MIDI encoding hashes. Interestingly, even the "LMD-clean" benchmark, which is organized by artist and song name, was found to contain errors where identical MIDI content was linked to different song titles due to tagging errors or international release variations.

Discussion: Hard vs. Soft Duplicates

The authors distinguish between "Hard Duplicates" (identical arrangements with minor edits) and "Soft Duplicates" (the same song but in a completely different style, such as a jazz version versus a rock version). While hard duplicates clearly constitute data leakage, soft duplicates represent a subjective gray area that current AI still struggles to categorize perfectly. Human validation via listening tests confirmed that 72.9% of the items flagged by the system were indeed duplicates (soft or hard).

Conclusion

By providing a filtered version of the LMD, this work enables more rigorous and reliable evaluation for future music generation models. Future research will focus on investigating how this de-duplication changes the current state-of-the-art leaderboards and whether AI-generated MIDI variations can be used to train even more precise de-duplication models.

Summary updated

BibTeX
@inproceedings{choi2025de,
  author = {Eunjin Choi and Hyerin Kim and Jiwoo Ryu and Juhan Nam and Dasaem Jeong},
  title = {{On the de-duplication of the Lakh MIDI dataset}},
  booktitle = {Ismir},
  year = {2025},
}
Figure