arXiv:2608.22614cs.LGAug 2026

Manuscript Offprint

arXiv:2608.22614

What AstroPT knows about galaxies, and what that can teach us about LLMs

UniverseTBD, :, Kshitij Duraphe, Aman Kumar, Michael J. Smith, Shashwat Sourav

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original. This text is shared under the same licence.

Abstract

Interpretability research increasingly asks when concepts emerge during training and whether linear probes recover real structure, but in language models these claims are hard to validate because language offers little ground-truth ordering of concepts or relationships among them. We propose the use of astronomical ground truth through AstroPT, a transformer trained on millions of galaxy images, as a calibration testbed. AstroPT is an LLM-like model trained within a domain where the difficulty ordering of concepts and the relations among them are known in advance. Probing frozen representations across checkpoints, layers, model sizes, and objective choices, we find that galaxy properties emerge in a fixed order that tracks their known difficulty—quantities written almost directly into the pixels (band magnitude) become decodable early in training and shallow in the network, while multiband/spectra based and inferred quantities (such as redshift and specific star formation rate) emerge later and deeper. This order is invariant to our tested training objectives, and scales in magnitude but not in sequence with capacity. Our linear probe directions further recover the known physical structure among galaxy properties. Our findings suggest that astronomy offers a controlled sandbox for calibrating mechanistic interpretability methods we otherwise apply to LLMs blind.

1 Astronomy for machine learning

Large language models are hard to interpret in part because their training data is broad, messy, and not grounded in known relations (Bell & de Jong, 2001; Bommasani et al., 2021). Scientific foundation models promise a cleaner setting. In astronomy, many relationships in the data are already known from theory, observation, and long-standing empirical work (e.g. Courteau et al., 2007; Conroy, 2013; UniverseTBD et al., 2025; Dolag et al., 2025). This perspective permits us to ask two questions: when such a model is trained, does its hidden space recover known scientific structure? And can we use that structure as a tool to probe the model's learning dynamics and internalized knowledge?

Modern sky surveys contain millions of galaxy images tied to physical quantities such as brightness, size, stellar mass, morphology, redshift, and star formation history (The Multimodal Universe Collaboration, 2024). These quantities form a natural ladder of difficulty. Some are close to the raw pixels: an apparent magnitude is essentially the galaxy's integrated flux. Other quantities require more physics knowledge and computation to recover—redshift depends on multiple photometric bands or galaxy spectra, and the specific star formation rate is more indirect still (Noeske et al., 2007; Speagle et al., 2014). Galaxy properties are also not independent: stellar mass scales with luminosity, star formation activity anti-correlates with stellar mass, and observed redshift correlates with mass due to survey selection effects. This gives us both a difficulty ordering and a set of known

*Alphabetical ordering, contributions at end of paper. Correspondence to: mike@mjjsmith.com.

relationships, so we can test whether a model merely internalizes only individual labels or also preserves the geometry that connects them.

We study these questions using AstroPT (Fig. 1; Smith et al., 2024; Euclid Collaboration et al., 2025), a model deliberately built to resemble a large language model (LLM). It treats an astronomical observation as a sequence of data chunks: a galaxy image is split into ordered patches, the patches are treated like tokens, and the model learns in a self-supervised way by reconstructing dropped chunks in either an autoregressive GPT-like or masked autoencoding BERT-like fashion (Radford et al., 2018; Devlin et al., 2019). This architectural choice follows Sutton (2019): a scalable general architecture should win out over a bespoke one, and the precise design matters little provided it scales, so the most developed and community-supported option is preferred. That option—the causal autoregressive transformer—is also technically convenient for the many modal domain of astronomy, as it facilitates efficient training and modality fusion by simple token-chaining.

Our goal is not to claim that AstroPT discovers new galaxy laws from scratch. Instead, we ask whether our interpretability tools recover this known structure inside an LLM-like model, whether the order in which that structure emerges tracks known difficulty, whether the latent space geometry preserves the known relationships, and whether these signals survive changes of training recipe. This turns astronomy into a controlled testbed for the developmental, probe-based interpretability methods we otherwise apply to LLMs blind.

A Data

DESI-LS DR8 galaxy

postage stamp

512×512512 \times 512, grz bands

Pretraining set: 8.6M galaxy images

B Spiral tokenization

Patchify (p×p)(p \times p) and order patches in outward spiral

C AstroPT pretraining

next-patch prediction, self-supervised

Figure

Patch

normalization

mean = 0,

std = 1

MLP

tokenizer

  • position

embedding

Causal Transformer Decoder

masked self-attention

Next patch

(shifted)

Spiralized patch sequence

Input (previous patches)

Targets (next patches)

Predict next patch

loss: Huber loss

use pretrained AstroPT embeddings

D Downstream scientific use

Penultimate-layer embeddings

Average penultimate-layer outputs over central 64 tokens

Linear probes

Stellar mass

mean sSFR

Galaxy Zoo morphology

Absolute magnitudes

Figure 1: Overview of AstroPT. Galaxy images are split into ordered patch sequences and used to train a GPT (pictured here) or BERT-style transformer via a patch reconstruction objective. The learned embeddings are then used for downstream probes of galaxy properties.

We find that: (1) The order in which galaxy properties become decodable during pre-training tracks their known separation from low-level pixel statistics, and the same order recurs along network depth. We find that directly recoverable quantities emerge early in training and shallow in the network, more complex quantities later and deeper. (2) This order is invariant to training objective, and scales in magnitude but not in sequence with model capacity, so it is a property of the learning problem rather than of the recipe. (3) Our physics probe directions recover the known sign structure among galaxy properties.

References (20)