Cool Embeddings: Predicting Galaxy Cluster Cooling Times in IllustrisTNG and TNG-Cluster with AstroCLIP
Foundation models trained on optical astronomical data have not previously been applied to X-ray cluster thermodynamics. We show that embeddings from AstroCLIP, a contrastive vision-language model trained on optical galaxy images and spectra, retain physically meaningful structure when applied to mock Chandra X-ray images of simulated galaxy clusters - a significant shift in observational modality and physical scale. We target the central cooling time ($t_{\mathrm{cool},0}$) of the intracluster medium, a key diagnostic of cluster thermodynamics traditionally requiring X-ray spectroscopy. We present a machine learning framework that predicts $t_{\mathrm{cool},0}$ directly from X-ray images, applied to 711 projections from TNG300 and 993 from TNG-Cluster from the IllustrisTNG simulations. AstroCLIP embeddings form a structured latent space in which clusters with similar thermodynamic properties are naturally grouped, with no equivalent separation by halo mass. Building on this, we introduce a dot-product $k$-nearest neighbour attention model that retrieves similar clusters from the training set and adaptively reweights their cooling times. This model achieves root-mean-square errors of 0.24 (TNG300) and 0.23 (TNG-Cluster) in $\log(t_{\mathrm{cool},0})$, and demonstrates strong out-of-distribution generalisation, outperforming a fine-tuned convolutional neural network trained on raw images (RMSE 0.50 versus 0.73). These results demonstrate that pretrained foundation model embeddings transfer across astrophysical domains and encode thermodynamic information sufficient for inference of cluster cooling properties - offering a scalable path toward cool-core characterisation in all-sky surveys such as eROSITA.