Prior-Fitted and Frozen Scorers for Multimodal Contrastive Learning
Authors: Tillmann Rheude, Roland Eils, Benjamin Wild
Organizations: Berlin Institute of Health, Charité - Universitätsmedizin Berlin · Department of Mathematics and Computer Science, Freie Universität Berlin · Intelligent Medicine Institute, Fudan University
Multimodal contrastive learning typically relies on manually specified scoring functions, such as cosine similarity, to quantify the similarity between representations from different modalities. Several such functions have been recently proposed to extend contrastive learning beyond two modalities. In principle, however, any function that assigns high compatibility to matched samples and low compatibility to mismatched ones could serve as a scorer. Motivated by this broader view, we instantiate the scorer with a Transformer and find that even a randomly initialized model, when kept frozen, can outperform strong handcrafted multimodal contrastive baselines, whereas optimizing the scorer jointly with the encoders is less effective. Building on this observation, we introduce the Prior-Fitted Scorer (PFS): a Transformer scorer pre-trained on synthetic multimodal data generated from structural causal model (SCM) priors before transferring it to real-world data. The SCM exposes the scorer to diverse dependency structures, including shared, pairwise, and private information, providing a structured prior over higher-order cross-modal similarity. Across four real-world datasets, frozen Transformer scorers are competitive to contrastive baselines, and prior-fitting further improves the random initialization. More broadly, our results suggest that multimodal contrastive learning need not rely on manual similarity functions: Transformers can provide strong inductive biases, while causal pretraining can further shape these biases.
Figures & tables
Figure 1: Overview of the Prior-Fitted Scorer (PFS) , illustrated on the trimodal MIMIC-Symile setting ( Saporta et al., 2024 ) . (a) We sample latent causal structures and generate synthetic multimodal tuples from an SCM prior M . (b) A Transformer scoring function sθ is pretrained on these synthetic tuples to distinguish compatible from mismatched multimodal combinations with loss L , thereby shaping its inductive bias. (c) The PFS is transferred to the real dataset and kept frozen while the modality encoders Ei are optimized through the contrastive objective. (d) After extensive tuning, the PFS is evaluated on zero-shot predicting the future chest X-ray. Overall, a PFS replaces a manually specified similarity function with a Transformer whose structure is learned from a synthetic causal prior.
Figure 2: Overview of synthetic multimodal data generation and contrastive prior-fitting. A DAG G defines causal dependencies among latent variables, while the binary assignment matrix A selects the latent subsets contributing to each modality, inducing shared, subset-specific, and modality-private information. The selected latent variables are combined through linear and nonlinear readouts to produce modality vectors. During prior-fitting, matched tuples contain modalities from the same synthetic sample, whereas negatives are formed by replacing the target modality with a sampled mismatched candidate before scoring with sθ .
Dataset
# Samples
Modalities
MIMIC-IV ( Johnson et al., 2023b ; Johnson et al., 2023a )
52,802
Reports, Clinicals, Demographics
MIMIC-Symile ( Saporta et al., 2024 )
10,345
Chest X-rays, ECGs , laboratory
UKB ( Sudlow et al., 2015 )
486,400
Proteomics, Metabolomics, EHR
INSPECT ( Huang et al., 2023 )
22,449
CTs, Reports, EHR
Table 1: Trimodal benchmark datasets with retrieval modality as first listed modality.
Scorer
INSPECT ↑
UKB ↑
MIMIC-Symile ↑
MIMIC-IV ↑
Baselines
Clip
0.5548±0.005
0.4738±0.008
0.3109±0.006
0.6503±0.001
Triangle
0.5183±0.014
0.5259±0.009
0.4477±0.005
0.6476±0.003
Gram
0.4586±0.012
0.4623±0.009
0.3240±0.005
0.6454±0.002
Symile
0.6979±0.003
0.5554±0.005
0.4707±0.008
0.6562±0.003
Proposed
Table 2: Comparison of well-tuned models optimized with different multimodal contrastive objectives. Values represent top-1 accuracy of the retrieval task (mean ± SE ). Best non-overlapping value bold.
Figure 3: Validation performance of well-tuned baselines, the frozen Transformer and the PFS on the UKB . a) Scaling the prior-fitting with more sampled SCMs improves transfer to real-world data. b) Using the frozen PFS leads to faster convergence and higher retrieval accuracy than the baselines.
Table 6
Ablation
Top-1 Acc ↑
Only private information SCMs
0.3170±0.007
Transformer scorer (frozen, Xavier)
0.4462±0.005
Permute BC
0.4643±0.003
2k SCMs
0.4723±0.015
Remove DAG edges
0.5431±0.008
5k SCMs
0.5527±0.003
Table 5: Ablation study for the SCM design and prior-fitting the PFS on the UKB dataset.
Metric
MLP
Transformer
PFS
Clip
Triangle
Gram
Symile
Training step wall time (s) ↓
0.049
0.244
0.244
0.032
0.031
0.035
0.038
Table 6: Wall time for the frozen Transformer, PFS , and the baselines averaged over 10 epochs.
Multimodal contrastive learning aligns representations from different data types so models can connect related images, text, audio, signals, and other modalities.
Berlin Institute of Health, Charité - Universitätsmedizin Berlin · Department of Mathematics and Computer Science, Freie Universität Berlin · Intelligent Medicine Institute, Fudan University