Skip to main content

Scripts to test the Platonic Representation Hypothesis on astronomical data

Project description

The Platonic Universe: Testing The Platonic Representation Hypothesis With Astronomical Data 🔮 💫

This repository contains the code for testing the Platonic Representation Hypothesis (PRH) on astronomical data, as described in our paper "The Platonic Universe: Do Foundation Models See the Same Sky?"

Background & Motivation

The Platonic Representation Hypothesis suggests that neural networks trained with different objectives on different data modalities converge toward a shared statistical model of reality in their representation spaces. As models become larger and are trained on more diverse tasks, they should converge toward a "Platonic ideal" representation of underlying reality.

Why Astronomy?

Astronomical observations provide an ideal testbed for the PRH because:

  • Shared Physical Origin: Different astronomical observations (images, spectra, photometry) all emerge from the same underlying physics
  • Multiple Modalities: We can compare representations across fundamentally different data types (like optical images, infrared images, and spectroscopy)
  • Scale: Modern astronomical surveys provide the data volume necessary to test convergence across multiple model architectures

Our results (below) show that larger models exhibit more similar representations, even when trained across different data modalities. This suggests that astronomical foundation models may be able to leverage pre-trained general-purpose architectures.

Installation

  1. Clone the repository:

    git clone [https://github.com/UniverseTBD/platonic-universe.git](https://github.com/UniverseTBD/platonic-universe.git)
    cd platonic-universe    
    
  2. Install dependencies using uv:

    pip install uv
    uv sync
    
  3. Install the package

    uv pip install .
    

Quick Start: Running Experiments

There are two methods to run experiments:

  1. Using platonic_universe CLI:

    platonic_universe run --model vit --mode jwst 
    
  2. Using python pakage directly:

    import pu 
    
    pu.run_experiment("vit", "sdss", batch_size=64, num_workers=1, knn_k=10)
    

Supported Models & Datasets

Models Tested:

  • Vision Transformers (ViT): Base, Large, Huge
  • DINOv2: Small, Base, Large, Giant
  • ConvNeXtv2: Nano, Tiny, Base, Large
  • IJEPA: Huge, Giant
  • AstroPT: Astronomy-specific transformer (Small, Base, Large)
  • Specformer: Spectroscopy-specific model (Enable by uncommenting relevant lines in 'experiments.py')

Astronomical Datasets:

  • HSC (Hyper Suprime-Cam): Ground-based optical imaging (reference baseline)
  • JWST: Space-based infrared imaging
  • Legacy Survey: Ground-based optical imaging
  • DESI: Spectroscopy

Understanding the Results

The code measures representational alignment using the Mutual k-Nearest Neighbour (MKNN) metric:

from pu.metrics import mknn

# Calculate MKNN score between two embedding sets
score = mknn(embeddings_1, embeddings_2, k=10)
print(f"MKNN alignment score: {score:.4f}")

Higher MKNN scores indicate more similar representations between models or modalities.

Contributing

This project is open source under the AGPLv3.

We welcome contributions! Please feel free to open a pull request to:

  • Add support for new model architectures
  • Include additional astronomical datasets
  • Implement alternative similarity metrics
  • Improve preprocessing pipelines

We also hang out on the UTBD Discord, so feel free to reach out there!

Citation

If you use this code in your research, please cite:

@article{utbd2025,
	author = {{UniverseTBD} and Duraphe, K. and Smith, M. J. and Sourav, S. and Wu, J. F.},
	title = {{The Platonic Universe: Do Foundation Models See the Same Sky?}},
	journal = {ArXiv e-prints},
	year = {2025},
	eprint = {2509.19453},
	doi = {10.48550/arXiv.2509.19453}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

platonic_universe-0.1.0.tar.gz (813.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

platonic_universe-0.1.0-py3-none-any.whl (31.4 kB view details)

Uploaded Python 3

File details

Details for the file platonic_universe-0.1.0.tar.gz.

File metadata

  • Download URL: platonic_universe-0.1.0.tar.gz
  • Upload date:
  • Size: 813.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.3

File hashes

Hashes for platonic_universe-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7acaa24d4848d784a48e534b043b4abe48335582bf5e5f171d472a7e8ded96f6
MD5 6961dfc9c602dd81fd9ca10e76b4c0b4
BLAKE2b-256 af98a5146c18cca657c342d7a2a9d1f995fee9e7d24d1a9efb988c629bb3f1e0

See more details on using hashes here.

File details

Details for the file platonic_universe-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for platonic_universe-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eb1fa2ddc632e0a485f09cd243279451be68c297f622eb314bc90d25ac94f5fd
MD5 f192d7490028aa554d2935b44f4115cd
BLAKE2b-256 6db73e3191d7dcff7eb6670901f05f10eb681b5b95ceed151907dd31b365dc29

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page