TECHNOLOGY

CLAP long-audio embeddings: feature fusion and random crops affect reproducibility

In this article
THE QUICK TAKE

An audio embedding depends on the effective crops and fusion path as well as the file and checkpoint; a deterministic model forward does not imply deterministic preprocessing.

Begin with the selected fusion model

The CLAP research paper combines audio-text contrastive learning with feature fusion for audio representation. Fused and non-fused configurations should be treated as concrete artifact choices, not a harmless runtime enhancement automatically available for every checkpoint. Match the feature extractor and audio encoder configuration before evaluating retrieval. Otherwise a change attributed to a new embedding model may actually originate in a mismatched preparation or fusion path.

Inspect long-recording preparation

The CLAP feature reference documents a fusion truncation policy that combines local random crops with a downsampled representation of the full mel spectrogram. It also distinguishes random truncation without that fusion path. Therefore, a long recording is not necessarily represented by every original frame at equal detail. An event’s inclusion and local visibility can depend on preparation, which matters when comparing cached embeddings from repeated runs.

Keep short-input padding explicit

The same reference distinguishes repeating, repeat-and-pad, and padding-only behaviors for short recordings. These operations create different effective inputs even when the source file is unchanged. The official repository exposes fusion selection in its loading examples. Preserve that selection alongside the extractor settings rather than standardizing every short clip to a generic silence-padding routine inherited from a speech-recognition service with a different training contract.

Diagnose unstable retrieval results

Consider indexing a long ambient recording containing a brief bell. If its similarity to a bell description changes between runs, inspect crop selection and fusion metadata before blaming approximate nearest-neighbor search. Compare stored embeddings from identical effective features, then compare independently prepared features. This separates model execution from stochastic preparation. It does not guarantee localization of the bell or imply that a single pooled embedding can precisely identify the event’s time boundary.

Give the embedding cache a complete identity

Record checkpoint, fusion configuration, source segment, resampling, padding policy, crop procedure, and relevant random state. Guides on contrastive representations and inference evaluation explain adjacent concepts. Evaluate retrieval with representative long and short clips, and retain the preparation route in the index version. A stable file hash alone cannot identify the actual model input when the preprocessing path can select different local evidence from the same recording.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles