Augmenting X-ray Astronomical Representations with Scientific Knowledge through Contrastive Learning

Juan Rafael Martínez-Galarza, Nicolò Oreste Pinciroli Vago, Shivam Raval, Carolina Cuesta-Lazaro, Melanie Weber, David Alvarez-Melis, Alberto Accomazzi, Cecilia Garraffo, Joshua Knutson, Ryan Thill, Christopher B. Green, Imantha AhangamaRe-Align @ ICLR 2025

TL;DR

This paper introduces a novel method to combine X-ray astronomical data with scientific knowledge from text using contrastive learning. By aligning representations of photon event data with text summaries generated by Large Language Models, the system achieves improved performance on downstream tasks like predicting astrophysical properties and identifying unusual celestial objects.

What Problem Does This Paper Address?

The field of astronomy is rapidly generating massive, multimodal datasets from new telescopes. Effectively extracting scientific insights from this data requires sophisticated machine learning models. While self-supervised learning has shown promise in learning representations from astronomical data, a significant gap exists in integrating the vast, structured scientific knowledge embedded in astronomical literature with these data representations. Existing multimodal approaches often focus on image-text pairings or limited modalities. This paper tackles the challenge of bridging the gap between raw observational data (specifically X-ray photon event streams) and the rich, descriptive knowledge found in scientific papers, aiming to create more physically informed and interpretable representations.

Methods

The core of this work is a physics-informed representation alignment framework that uses contrastive learning. Here's a breakdown of the key techniques:

  • Data Representation: X-ray photon event data from the Chandra X-ray Observatory is processed using a Poisson Process Auto Decoder (PPAD). This neural network learns latent embeddings that capture spectral and time-domain information from the photon arrival times and energies.
  • Text Representation: Text summaries describing astrophysical sources are generated using Large Language Models (LLMs), specifically OpenAI's gpt-4o-mini and ada-002. The LLM is prompted to extract relevant physical properties and scientific context from astronomical papers.
  • Contrastive Learning: The paper employs a contrastive learning architecture to align the latent embeddings from the PPAD (data) and the LLM (text). This involves:
  • Using fully connected neural networks (FCNNs) to project both data and text embeddings into a common, lower-dimensional space (64 dimensions).
  • Concatenating these projected embeddings.
  • Passing the concatenated embeddings through a final FCNN to generate a shared, aligned representation.
  • Training this network using an InfoNCE loss to encourage similar representations for corresponding data-text pairs and dissimilar representations for non-corresponding pairs.
  • A regularizer based on Mean Squared Error (MSE) is added to preserve the original pairwise distances within each modality's embedding space, aiming to retain modality-specific information.

Datasets

  • Training and Evaluation Data: X-ray observations from the Chandra X-ray Observatory were used.
  • Text Corpus: A collection of astronomical papers from NASA's Astrophysical Data Systems (ADS), specifically those referencing Chandra observations, was utilized.
  • Benchmark: The paper constructs a unique dataset by pairing individual Chandra observations of astrophysical sources with text summaries derived from relevant scientific literature. This allows for cross-modal alignment between raw photon data and scientific descriptions.

Key Insights and Ideas

  • Bridging the Knowledge Gap: The most significant insight is that scientific knowledge embedded in text can meaningfully augment raw observational data representations. This goes beyond simple image-text matching and integrates complex physical descriptions.
  • Physics-Informed Representations: By aligning data with text that describes physical properties, the learned representations become more semantically meaningful and physically interpretable, moving towards "physics-informed" AI.
  • Complementarity of Modalities: The results strongly suggest that text summaries provide complementary information to raw X-ray data, particularly for describing spectral shapes and variability, leading to improved predictions.
  • Efficient Representation: The aligned multimodal representations are highly efficient, capturing significant information in a much smaller latent space (64 dimensions) compared to the initial combined unimodal spaces.

Key Results

  • Improved Regression Performance: Combining both text and data embeddings in the shared space significantly improved the accuracy of predicting astrophysical properties (e.g., hardness ratios) compared to using either modality alone. For instance, the HardHS variable saw a 24% improvement in Mean Absolute Error (MAE) compared to using only data.
  • High Alignment Accuracy: The contrastive learning achieved a high level of alignment, evidenced by a validation loss of approximately 0.2.
  • Effective Nearest Neighbor Search: The aligned representations demonstrated strong performance in nearest neighbor retrieval, achieving 93.3% accuracy for k=1 and 98.1% for k=10. This indicates that semantically similar sources are clustered together in the shared space.
  • Anomaly Detection: The aligned embeddings were successfully used with an Unsupervised Random Forest (URF) anomaly detector to identify rare and unique celestial objects, such as a fluctuating, transient Ultra-Luminous X-ray source (ULX), highlighting the potential for scientific discovery.

Limitations and Future Work

  • LLM Prompting Sensitivity: The effectiveness of the text summaries is dependent on the LLM prompting strategies. While they demonstrated success, further refinement could yield even better results.
  • Cross-Modal Retrieval Limitations: The current architecture, while effective for alignment, limits direct cross-modal retrieval (e.g., finding text descriptions for a given data embedding). The authors plan to release a version that improves this aspect.
  • Generalizability to Other Domains: While successful for X-ray astronomy, the framework's applicability to other scientific domains with similar multimodal data and textual knowledge remains to be explored.
  • Data Generation: The authors envision future work on generating data from text and creating physics-informed descriptions for unlabeled observations, extending the current alignment capabilities.

Summary updated

BibTeX
@inproceedings{martinezgalarza2025augmenting,
  author = {Juan Rafael Martínez-Galarza and Nicolò Oreste Pinciroli Vago and Shivam Raval and Carolina Cuesta-Lazaro and Melanie Weber and David Alvarez-Melis and Alberto Accomazzi and Cecilia Garraffo and Joshua Knutson and Ryan Thill and Christopher B. Green and Imantha Ahangama},
  title = {{Augmenting X-ray Astronomical Representations with Scientific Knowledge through Contrastive Learning}},
  booktitle = {Re-Align @ ICLR},
  year = {2025},
  url = {https://openreview.net/forum?id=jae1ZHJ3yl},
}
Figure