Datasets:
|
Download README.md from b4ph/clap-retrieval-benchmark: direct link, hf CLI and curl.
- Browser
- Download file 9.11 kB
-
https://huggingface.co/datasets/b4ph/clap-retrieval-benchmark/resolve/main/README.md
- Command line
-
hf download hf://datasets/b4ph/clap-retrieval-benchmark/README.md
-
curl -L -o README.md https://huggingface.co/datasets/b4ph/clap-retrieval-benchmark/resolve/main/README.md
9.11 kB
| license: mit | |
| task_categories: | |
| - audio-classification | |
| language: | |
| - en | |
| tags: | |
| - audio-text-retrieval | |
| - clap | |
| - benchmark | |
| - reproducibility | |
| pretty_name: CLAP audio-text retrieval (pinned protocol) | |
| size_categories: | |
| - 1K<n<10K | |
| # CLAP audio-text retrieval, pinned protocol | |
| Retrieval measurements for LAION's fused and unfused CLAP checkpoints on AudioCaps and Clotho, with pinned inputs, per-query results and paired confidence intervals. Under the short-clip protocol, AudioCaps differences are inconclusive. On Clotho, unfused scores higher in both retrieval directions, with the reported 95% intervals excluding zero. Practical equivalence is not established on any endpoint. | |
| The repository also measures how the fused checkpoint's scores depend on processor branch selection and random seeding. It contains evaluation artifacts and code; no audio or model weights are redistributed. | |
| ## Results | |
| R@1 is the fraction of queries whose top-ranked result is relevant. T2A is text-to-audio; A2T is audio-to-text. Scores below are computed from the recorded per-query ranks. Differences are **unfused minus fused**, in percentage points (pp). | |
| | Endpoint | Fused R@1 | Unfused R@1 | Difference (pp) | 95% CI (pp) | | |
| |---|---:|---:|---:|---:| | |
| | AudioCaps T2A | 0.349 | 0.334 | -1.46 | [-4.49, +1.57] | | |
| | AudioCaps A2T | 0.338 | 0.347 | +0.94 | [-1.88, +3.97] | | |
| | Clotho T2A | 0.132 | 0.154 | +2.24 | [+0.86, +3.66] | | |
| | Clotho A2T | 0.154 | 0.199 | +4.50 | [+2.01, +7.08] | | |
| Source: [analysis summary](erratum_analysis.json) and [per-query runs](https://huggingface.co/datasets/b4ph/clap-retrieval-benchmark/tree/main/results_erratum), tags `a1_short` and `a2_short`. These are measured runs with explicit short-clip routing, not adjustments to earlier scores. | |
| Intervals use 2,000 paired bootstrap resamples clustered by audio clip, seed `20261028`. They describe sampling uncertainty within this run, not variation across training or inference seeds. The summary contains endpoint-wise intervals, not multiplicity-adjusted permutation p-values. None of the 90% intervals lies entirely within the specified equivalence margin of ±3 pp. An interval containing zero therefore does not establish a tie. | |
| ## Fixtures and protocol | |
| | Fixture | Split | Audio clips | Captions / T2A queries | A2T queries | | |
| |---|---|---:|---:|---:| | |
| | [`CLAPv2/audiocaps`](https://huggingface.co/datasets/CLAPv2/audiocaps) | test | 957 | 957 | 957 | | |
| | [`gijs/clotho`](https://huggingface.co/datasets/gijs/clotho) | test | 1,045 | 5,225 | 1,045 | | |
| Counts and fixture fingerprints are recorded in each [result file](https://huggingface.co/datasets/b4ph/clap-retrieval-benchmark/tree/main/results_erratum). Clotho uses five separate reference captions per clip. T2A has one relevant audio item per query; Clotho A2T has five relevant captions and counts a hit when any is ranked first. The loader strips surrounding whitespace, removes empty and duplicate captions within each clip, and groups rows by clip identity. See [fixture construction](common.py). | |
| Both checkpoints use the same fixtures and ranking procedure: | |
| - Audio: 48 kHz mono, soxr resampling, first 10 seconds of each clip. | |
| - Inference: fp32, audio batch 1, text batch 64, processor padding, `is_longer=False` for the trimmed clips. | |
| - Randomness: Python, NumPy, torch and CUDA seeded with `20261028`. | |
| - Ranking: cosine similarity over L2-normalized embeddings; stable sorting resolves ties by document order. | |
| The [run files](https://huggingface.co/datasets/b4ph/clap-retrieval-benchmark/tree/main/results_erratum) record NVIDIA A40, Python 3.12.3, torch 2.8.0+cu128 and CUDA 12.8. The [dependency lock](requirements_lock.txt) specifies transformers 5.21.0; the [full environment record](requirements_frozen.txt) includes inherited container packages. | |
| | Checkpoint or fixture | Pinned revision | | |
| |---|---| | |
| | `laion/clap-htsat-fused` | `365dea6ef167` | | |
| | `laion/clap-htsat-unfused` | `8fa0f1c6d043` | | |
| | `CLAPv2/audiocaps` | `4d18fe131daa` | | |
| | `gijs/clotho` | `93be4f14a2d6` | | |
| Full commit hashes are in [PINS.json](PINS.json). The evaluators require those pins rather than resolving the latest revision. | |
| ## Processor behavior and checks | |
| In the pinned Hugging Face feature extractor, fusion mode selects one clip with `np.random.randint` and sets `is_longer=True` when every clip in a batch fits within the 10-second window. At batch 1, this routes every clip through the long-audio branch. Larger batches also make the selected clip depend on the random state. The current short-clip protocol explicitly sets the flag to `False`; seeding controls repeatability separately. A fix that removes the assignment, so the flag follows clip length, is proposed in [PR #50101](https://github.com/huggingface/transformers/pull/50101). These results set the flag explicitly, so they describe the short-clip branch under either processor behaviour. | |
| On the AudioCaps fixture, the short-clip fused path scores **0.3490 T2A R@1**, compared with **0.3417** for the `laion_clap` control. The calculated difference is **0.73 pp**, within the specified **2 pp** validation tolerance. Sources: [validation summary](erratum_analysis.json) and [package control](results_control/laion__clap-htsat-fused__audiocaps__control.json). | |
| Two seeded processor-native batch-8 runs both score **0.321839** and have identical T2A per-query ranks: [run A](results_erratum/laion__clap-htsat-fused__audiocaps__e_seed_b8a.json), [run B](results_erratum/laion__clap-htsat-fused__audiocaps__e_seed_b8b.json). This supports repeatability for that tested configuration; the branch choice still affects the score. The processor behavior is documented in [transformers issue #50097](https://github.com/huggingface/transformers/issues/50097), with a fix proposed in [PR #50101](https://github.com/huggingface/transformers/pull/50101). | |
| An exploratory untrimmed Clotho run scores **0.1233 fused** and **0.1435 unfused** on T2A R@1. Both are below their trimmed scores. This is one seeded run per checkpoint without intervals: [fused](results_erratum/laion__clap-htsat-fused__clotho5__b1_full.json), [unfused](results_erratum/laion__clap-htsat-unfused__clotho5__b1_full.json). | |
| ## Use and reproduction | |
| Read the result summary without downloading audio or running inference: | |
| ```python | |
| import json | |
| from huggingface_hub import hf_hub_download | |
| path = hf_hub_download( | |
| repo_id="b4ph/clap-retrieval-benchmark", | |
| repo_type="dataset", | |
| filename="erratum_analysis.json", | |
| revision="83d9273e683eedfe02162a927e619ceac4f383cd", | |
| ) | |
| with open(path, encoding="utf-8") as f: | |
| summary = json.load(f) | |
| print(len(summary["results"])) # 4 endpoint records | |
| ``` | |
| Each summary record contains the fixture, direction, metric, query and cluster counts, both scores, paired difference, 95% and 90% intervals, and interval-based decision flags. Per-run JSON files contain model and dataset revisions, fixture fingerprints, protocol settings, environment metadata, recall metrics, and per-query `first_hit_rank`, `ap` and `cluster` arrays. Ranks are one-based; scores and intervals are fractions unless displayed as percentage points above. | |
| For inference, use the [environment setup](REPRODUCE.md) and run `bash run_erratum.sh` from the repository root. The [campaign script](run_erratum.sh) specifies the short-clip comparison, processor-native repeats and untrimmed arm. The separately recorded batch-8 checks and package control are linked above. [The experiment plan](PREREGISTRATION_ERRATUM.md) records the intended comparisons and decision rules. | |
| ## Scope and limitations | |
| These results compare two checkpoints on two pinned fixtures. Different audio encodings, reference-caption conventions, windows or preprocessing can change absolute scores, so they should not be compared directly with leaderboard or paper figures. The cause of the low absolute Clotho scores is not fully isolated, and training-data overlap has not been audited here. | |
| The short-clip comparison uses one inference seed. Earlier independent implementation, operator and cross-GPU checks apply to the processor-native campaign. They establish reproducibility under that configuration, but do not independently validate the current short-clip routing. Their evidence remains in [REPORT.md](REPORT.md), [PROVENANCE.json](PROVENANCE.json) and the [independent-operator artifacts](https://huggingface.co/datasets/b4ph/clap-retrieval-benchmark/tree/main/independent_operator). | |
| **Protocol version, 2026-10-28:** the results above use explicit short-clip routing and seeded inference. Earlier processor-native results, figures and statistical analyses remain available in [the original report](REPORT.md) and [analysis](analysis_v2.json). The [original plan](PREREGISTRATION.md) records the post-collection change to clip-level significance testing; the [follow-up plan](PREREGISTRATION_ERRATUM.md) records the routing update. [PUBLICATION.json](PUBLICATION.json) and [SHA256SUMS](SHA256SUMS) track the published files. | |
| Repository license: MIT. Upstream audio, captions and checkpoints remain subject to their respective source licenses. | |