[Paper Review] AstroLLaMA: Towards Specialized Foundation Models in Astronomy
AstroLLaMA is a 7-billion-parameter language model fine-tuned on 300,000 astronomy abstracts from arXiv, achieving 30% lower perplexity than LLaMA-2 and generating more scientifically relevant, context-aware text completions. It outperforms state-of-the-art models in embedding quality and domain specificity despite fewer parameters.
Large language models excel in many human-language tasks but often falter in highly specialized domains like scholarly astronomy. To bridge this gap, we introduce AstroLLaMA, a 7-billion-parameter model fine-tuned from LLaMA-2 using over 300,000 astronomy abstracts from arXiv. Optimized for traditional causal language modeling, AstroLLaMA achieves a 30% lower perplexity than Llama-2, showing marked domain adaptation. Our model generates more insightful and scientifically relevant text completions and embedding extraction than state-of-the-arts foundation models despite having significantly fewer parameters. AstroLLaMA serves as a robust, domain-specific model with broad fine-tuning potential. Its public release aims to spur astronomy-focused research, including automatic paper summarization and conversational agent development.
Motivation & Objective
- Address the gap in specialized large language models for astronomy, where general LLMs often hallucinate or lack domain-specific accuracy.
- Overcome the limitations of existing models like astroBERT, which is non-generative and limited to discriminative tasks.
- Develop a high-performing, generative foundation model tailored for astronomy that supports downstream tasks like summarization, question-answering, and hypothesis generation.
- Improve semantic representation in embeddings to capture nuanced scientific distinctions in astronomical literature.
- Enable community-driven refinement of the model through public release of weights and training data to foster responsible, accurate, and creative scientific applications.
Proposed method
- Fine-tuned LLaMA-2 (6.7B parameters) on a curated dataset of 326,238 astronomy abstracts from arXiv’s astro-ph category, totaling ~95 million tokens.
- Used causal language modeling with AdamW optimization (β₁=0.9, β₂=0.999) and a sequence length of 512 tokens, with [BOS] and [EOS] tokens for sequence boundaries.
- Trained on 77 million tokens from the dataset, with 20% reserved for evaluation, using a learning rate of 1e-5 and 100 epochs.
- Evaluated performance using perplexity and cosine similarity between embedding vectors to assess semantic discriminability.
- Compared model outputs and embeddings against GPT-3 and LLaMA-2 using zero-shot and few-shot prompting on scientific reasoning and context-aware generation.
- Released model weights and training data on Hugging Face to support community adaptation and alignment improvements.
Experimental results
Research questions
- RQ1Can a fine-tuned, smaller-scale LLM outperform general-purpose LLMs in generating scientifically accurate and contextually relevant astronomy text?
- RQ2To what extent does domain-specific fine-tuning reduce perplexity and improve semantic representation in embeddings compared to general models?
- RQ3How does AstroLLaMA compare to GPT-4 and LLaMA-2 in generating coherent, factually plausible, and domain-specific scientific completions?
- RQ4Can fine-tuned embeddings from AstroLLaMA distinguish between semantically distinct astronomical contexts better than generic embeddings?
- RQ5What are the primary failure modes of AstroLLaMA in scientific reasoning, particularly regarding numerical accuracy and factual consistency?
Key findings
- AstroLLaMA achieves a 30% lower perplexity than LLaMA-2 on the astronomy abstracts dataset, indicating superior next-token prediction and domain adaptation.
- The model generates more insightful and scientifically relevant text completions than both LLaMA-2 and GPT-4, especially in context-aware and hypothesis-generative tasks.
- AstroLLaMA’s embeddings exhibit significantly higher variance in pairwise cosine similarity (0.7–0.9 range) compared to GPT-3, indicating better discriminative power across diverse astronomical topics.
- In contrast to GPT-3, which often confuses contexts based on keyword matching (e.g., 'magnetized' in different contexts), AstroLLaMA correctly distinguishes semantic differences.
- AstroLLaMA accurately identifies relevant scientific connections—such as linking Spitzer observations to star formation—where GPT-3 fails due to lack of keyword alignment.
- Despite its success, the model exhibits knowledge gaps (e.g., incorrect star candidate estimation from Gaia-ESO data) and generates hallucinated numerical data, highlighting the need for alignment and factual consistency improvements.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.