Source-linked AI summary

AstroSpecLM: A Spectrum-Language Model for Evidence-Grounded Astronomical Spectral Analysis

Jinghang Shi, Yanxia Zhang, Ali Luo, Changhua Li, Xiao Kong

arXiv:2609.07102v1astro-ph.IMcs.AI

TL;DR

Natural-language frameworks that map 1D astronomical spectra to conclusions grounded in spectral evidence remain limited. AstroSpecLM connects DESI spectra to a language model and trains it with fact-mediated instruction data; it matches or surpasses specialist baselines on classification and redshift estimation, while temperature regression remains challenging.

  • Problem

    Natural-language frameworks that explicitly map spectral evidence to conclusions remain limited, despite the importance of grounding interpretations in wavelength-localized features.

    Source: §1 · p. 1
  • Method

    AstroSpecLM connects 1D DESI spectra to Qwen3-4B and uses catalog- and spectrum-derived facts to ground instruction conversations.

    Source: §1 · p. 1, §3 · p. 2, §4 · p. 4
  • Results

    AstroSpecLM matches or surpasses specialist supervised baselines on classification and redshift estimation, while effective-temperature regression remains a challenge.

    Source: §5.2 · p. 6, §6 · p. 8
  • Takeaways & Limitations

    The results suggest that 1D scientific measurements can be connected to language models through fact-mediated instruction tuning.

    Source: §6 · p. 8

    In an ambiguous galaxy spectrum, AstroSpecLM misclassifies the object as an A-type star, suggesting possible over-reliance on local absorption patterns.

    Source: §5.3 · p. 7

Abstract

from arXiv · show

Astronomical spectra encode rich physical information, but drawing scientific conclusions from spectral features typically requires expert interpretation. This paper presents AstroSpecLM, a spectrum-language model that connects one-dimensional DESI spectra with Qwen3-4B to answer questions and provide explanations grounded in spectral evidence. Instead of generating question-answer pairs directly from templates or raw catalog fields, we first distill each spectrum into a compact set of catalog- and spectrum-derived facts, then use these facts as references to generate instruction-following conversations. The resulting model is competitive with specialist supervised baselines on classification and redshift estimation, while additionally producing natural-language explanations that reference specific spectral features. Our results indicate that grounding a language model in one-dimensional scientific spectra is feasible, and that fact-mediated instruction data yields a model capable of both prediction and explanation.

1 Introduction

Astronomical spectra contain evidence for physical properties, but natural-language systems that map spectral evidence to conclusions remain limited. AstroSpecLM connects DESI spectra to a language model and answers questions with explanations tied to spectral features.

1 Introduction

  • Astronomical spectra support inference about object type, redshift, stellar temperature, and other physical properties through wavelength-resolved features.Interpretation links features such as emission and absorption lines, and their wavelength shifts, to the source’s properties.Source: §1 · p. 1
  • Natural-language frameworks that explicitly map spectral evidence to conclusions lag behind the scalable production of spectra and structured measurements.The desired framework would provide interpretable predictions with rationales grounded in spectral features.Source: §1 · p. 1
  • Most multimodal language models target images, videos, or documents, while 1D spectra require grounding in narrow, wavelength-localized features.Spectral meaning depends on wavelength and physical interpretation, creating a distinct grounding problem.Source: §1 · p. 1
  • AstroSpecLM connects real 1D DESI spectra with Qwen3-4B for spectrum-grounded question answering and explanations that cite specific spectral features.The model uses SpecMAE and a spectral projector; training data is built through an intermediate fact-extraction stage.Source: §1 · pp. 1–2

2 Related Work

Prior astronomical systems process spectra at scale, but often leave the evidence-to-conclusion chain implicit. AstroSpecLM places real 1D spectra at the center of a language-model framework for prediction and evidence-based explanation.

2 Related Work

  • Spectral pipelines and expert systems produce calibrated spectra, structured measurements, and quality assessments, while leaving evidence-to-conclusion links implicit.Recent models offer reusable spectral representations, but their outputs still depend on expert interpretation to connect them to evidence.Source: §2 · p. 2
  • General-purpose multimodal language models mainly target images, video, documents, or web data rather than 1D scientific measurements grounded in localized physical evidence.For spectra, relevant evidence includes emission-line profiles and continuum breaks tied to wavelength.Source: §2 · p. 2
  • Astronomy-oriented language and multimodal systems cover literature, images, and radio sources, while early spectroscopy systems focus on redshift prediction or tool-mediated visual inspection.The cited examples include Teaching LLMs to Speak Spectroscopy and Spec-o3.Source: §2 · p. 2
  • AstroSpecLM uses real observed 1D spectra as direct evidence for classification, regression, feature analysis, and evidence-based explanation in one generative framework.It is positioned between spectral expert systems and astronomy-oriented language models.Source: §2 · p. 2

3 Data Construction

The data pipeline turns DESI spectra into fact-grounded instruction conversations and a separate benchmark for evaluation. It combines catalog annotations with spectral measurements to anchor generated questions and answers in observable evidence.

3 Data Construction

  • Fact-mediated instruction construction uses selected DESI spectra, grounded facts, and those facts as references for generating conversations.The pipeline is designed to reduce unsupported physical properties while enabling evidence-tied questions and explanations.Source: §3 · p. 2, Figure 1 · p. 3

3.1 Spectrum Selection

  • The spectral encoder corpus contains 2.85 million class-balanced spectra, while the instruction-data subset contains 58,558 higher-quality spectra with reliable annotations and clean measurements.The encoder corpus is used for masked reconstruction training; the smaller subset is selected for instruction-data construction.Source: §3.1 · pp. 2–3

3.2 Fact Extraction

  • For each instruction spectrum, grounded facts combine catalog labels with quantities measured directly from the spectrum and serve only as references during data generation.Examples include object class and redshift alongside emission-line equivalent widths and continuum slopes; the facts are not shown to the model.Source: §3.2 · p. 3

3.3 Instruction Data

  • 305,536 conversations remain after filtering; generation includes single- and multi-turn exchanges and forbids unsupported wavelengths, redshifts, or physical quantities.The dataset contains 208,614 single-turn and 96,922 multi-turn conversations.Source: §3.3 · p. 3

3.4 Held-out Benchmark

  • AstroSpecQA is a held-out benchmark of 11,698 questions across four spectrum-grounded tasks, built from spectra disjoint from DESI-SpecInstruct.It covers object classification, redshift regression, stellar subtype classification, and effective-temperature regression; it is used only for evaluation.Source: §3.4 · p. 3

4 Method

AstroSpecLM connects 1D spectra with Qwen3-4B through SpecMAE and a spectral projector, using spectrum masked autoencoding followed by spectral instruction tuning.

4.1 AstroSpecLM

  • A pretrained SpecMAE encodes the spectrum, and a projector compresses its representations into 130 tokens inserted between spectrum markers for autoregressive answer generation.The answer is conditioned on both the spectral signal and the textual instruction.Source: §4.1 · p. 4

4.2 Spectrum Masked Autoencoding

  • SpecMAE pretraining masks continuous spectral spans, then reconstructs masked flux values using valid pixels and inverse-variance weights clipped at 1000.Each spectrum has 10 masked chunks of 30 consecutive patch tokens; the pretrained encoder is frozen in later stages.Source: §4.2 · p. 4

4.3 Spectral Instruction Tuning

  • During instruction tuning, the encoder and Qwen3-4B base parameters stay frozen while the projector, special-token embeddings, and LoRA adapters train.The autoregressive objective applies loss only to answer tokens.Source: §4.3 · pp. 4–5, Figure 2 · p. 5

5 Experiments

AstroSpecLM is evaluated against specialist spectral baselines and a text-only reference on spectrum-grounded tasks, language benchmarks, and explanation faithfulness. It performs strongly on classification and redshift, struggles more with effective temperature, and exhibits trade-offs across qualitative cases and ablations.

5.1 Experimental Setup

  • Evaluation compares frozen-encoder task-specific MLP baselines and a text-only Qwen3-4B reference across four spectral tasks and three language benchmarks.SpecMAE is pretrained before instruction tuning; explanation support is judged against held-out spectral facts, with a 100-output human meta-evaluation.Source: §5.1 · pp. 5–6

5.2 Main Results

  • 98.56% vs. 98.12% object-type accuracy and 87.56% vs. 86.37% stellar-subtype accuracy exceed specialist baselines; redshift MAE is 0.015 vs. SpecMAE’s 0.029.Redshift R2 is comparable: 0.992 for AstroSpecLM vs. 0.993 for SpecMAE.Source: §5.2 · p. 6, Table 1 · p. 6
  • 335.2 K MAE and 0.668 R2 for effective temperature lag SpecMAE’s 162.3 K MAE and 0.955 R2; this task relies on distributed spectral cues.The paper notes that alignment pretraining can substantially improve this task.Source: §5.2 · pp. 6–7
  • After spectral tuning, MMLU-Redux falls from 75.82% to 74.00%, while explanations receive 4.2/5.0 faithfulness; human ratings generally align with the judge.IFEval falls from 69.30% to 65.53%, and MATH-500 from 83.60% to 80.20%.Source: §5.2 · p. 7

5.3 Qualitative Analysis

  • The QSO example estimates z = 4.36 from consistent Lyα and C IV shifts; the white-dwarf case uses its blue continuum and absent molecular bands despite uncertainty.Source: Figure 3 · p. 6, §5.3 · p. 7
  • A galaxy with prominent Balmer absorption and a blue continuum is misclassified as an A-type star, illustrating ambiguity between stellar and young-population galaxy spectra.The authors suggest the model can over-rely on local absorption patterns when they resemble another class.Source: Figure 3 · p. 6, §5.3 · p. 7

5.4 Ablation Study

  • Alignment raises Teff R2 from 0.668 to 0.942 but lowers MMLU-Redux from 74.00 to 70.40; two-epoch tuning slightly improves classification but degrades both regressions.The SFT-only configuration is retained as a simpler, more balanced trade-off.Source: §5.4 · pp. 7–8
  • A 1.7B model lowers Teff R2 from 0.668 to 0.437; 260 tokens raise it to 0.912 but worsen redshift MAE from 0.015 to 0.084, while rank 16 provides sufficient adaptation.The proposed explanation for the token trade-off is a hypothesis, not directly verified by attribution analysis.Source: §5.4 · p. 8

6 Conclusion

AstroSpecLM connects 1D DESI spectra with Qwen3-4B for spectrum-grounded question answering. It matches or surpasses specialist supervised baselines on classification and redshift estimation, while its explanations are largely supported by spectral facts.

6 Conclusion

  • The model connects 1D DESI spectra with Qwen3-4B for spectrum-grounded question answering.Instruction data is constructed through an intermediate fact-extraction stage.Source: §6 · p. 8
  • AstroSpecLM matches or surpasses specialist supervised baselines on classification and redshift estimation, while effective-temperature regression remains challenging for token-by-token decoding.The explanation-faithfulness evaluation also finds that generated explanations are largely supported by corresponding spectral facts.Source: §6 · p. 8
  • Generated explanations are largely supported by the corresponding spectral facts.Source: §6 · p. 8
  • Future work may improve numerical grounding through stronger spectral-language alignment, finer wavelength-aware representations, and broader instruction data.The proposed broader data coverage includes more physical parameters and scientific analysis scenarios.Source: §6 · p. 8

Supplementary Material

The supplementary material describes the DESI corpus and preprocessing, the construction and measurement of grounded facts, and the instruction-generation prompt. The corpus combines calibrated spectra and catalog annotations, while extracted facts include catalog labels and measurements from spectral features.

A.1 Spectrum Corpus and Preprocessing

  • DESI DR1 provides calibrated 1D spectra and catalog annotations; encoder pretraining uses 2,853,354 balanced STAR, GALAXY, and QSO spectra, while instruction construction uses a quality-filtered subset of 58,558.Flux is normalized to zero mean and unit variance; inverse variance is used for masked reconstruction weighting and quality filtering, not as encoder input. DESI DR1 is used under its CC BY 4.0 license and data-access terms.Source: §A.1 · p. 12

A.2 Grounded Fact Extraction

  • Grounded facts combine catalog annotations with direct spectral measurements, including locally continuum-subtracted emission or absorption line measurements with validity checks.The supplementary tables summarize fact types and representative class-specific spectral lines and bands; K and M stars additionally use molecular-band indices.Source: §A.2 · p. 12, Table 3 · p. 12, Table 4 · p. 12

A.3 Instruction Generation

  • The appendix includes the full prompt used to generate instruction data.Source: Figure 4 · p. 13

A.4 AstroSpecQA Benchmark Details

The benchmark split has approximately balanced major object classes, whereas its stellar-subtype distribution is naturally imbalanced. Common stellar types dominate the evaluation set, and rare categories have very few examples.

A.4 AstroSpecQA Benchmark Details

  • The object-classification split is approximately balanced across its three major classes, reducing the risk that object-level accuracy is dominated by one class.Table 5 reports the object-class distribution.Source: §A.4 · p. 14, Table 5 · p. 14
  • The stellar-subtype split is naturally imbalanced: common K, G, M, and F types dominate, while B stars and cataclysmic variables have very few examples.Table 6 reports the stellar-subtype distribution.Source: §A.4 · p. 14

A.5 Alignment Data

The alignment pretraining experiment constructs spectrum–caption pairs from grounded facts, with captions constrained to information in those facts. The appendix also identifies a stellar-subtype distribution table and provides the full prompt used for caption generation.

A.5 Alignment Data

  • The appendix identifies Table 6 as reporting the stellar-subtype distribution.Source: Table 6 · p. 14
  • 474,051 spectrum–caption pairs are constructed from the grounded facts used for instruction data generation.DeepSeek-V3.2 generates concise natural-language captions constrained to information in the fact structure.Source: §A.5 · p. 14
  • The appendix includes the full prompt used to generate spectrum–caption pairs for alignment pretraining.Source: Figure 5 · p. 14

B.1 Training Hyperparameters

Table 7 summarizes the optimization hyperparameters used for SpecMAE pretraining and AstroSpecLM spectral instruction tuning.

B.1 Training Hyperparameters

  • Table 7 summarizes optimization hyperparameters for SpecMAE pretraining and AstroSpecLM spectral instruction tuning.Source: §B.1 · p. 15, Table 7 · p. 15

B.2 Explanation Faithfulness Evaluation

Figure 6 presents the full prompt used for the LLM-as-a-judge faithfulness evaluation.

B.2 Explanation Faithfulness Evaluation

  • Figure 6 provides the full prompt used in the LLM-as-a-judge faithfulness evaluation.Source: Figure 6 · p. 15
Loading 2609.07102v1…