初始化项目,由ModelHub XC社区提供模型
Model: AstroMLab/AstroSage-8B Source: Original Platform
This commit is contained in:
35
.gitattributes
vendored
Normal file
35
.gitattributes
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.arrow filter=lfs diff=lfs merge=lfs -text
|
||||
*.bin filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
||||
*.ftz filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.h5 filter=lfs diff=lfs merge=lfs -text
|
||||
*.joblib filter=lfs diff=lfs merge=lfs -text
|
||||
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
||||
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
||||
*.model filter=lfs diff=lfs merge=lfs -text
|
||||
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
||||
*.npy filter=lfs diff=lfs merge=lfs -text
|
||||
*.npz filter=lfs diff=lfs merge=lfs -text
|
||||
*.onnx filter=lfs diff=lfs merge=lfs -text
|
||||
*.ot filter=lfs diff=lfs merge=lfs -text
|
||||
*.parquet filter=lfs diff=lfs merge=lfs -text
|
||||
*.pb filter=lfs diff=lfs merge=lfs -text
|
||||
*.pickle filter=lfs diff=lfs merge=lfs -text
|
||||
*.pkl filter=lfs diff=lfs merge=lfs -text
|
||||
*.pt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pth filter=lfs diff=lfs merge=lfs -text
|
||||
*.rar filter=lfs diff=lfs merge=lfs -text
|
||||
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
||||
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
||||
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
||||
*.tar filter=lfs diff=lfs merge=lfs -text
|
||||
*.tflite filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.wasm filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
||||
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
||||
149
README.md
Normal file
149
README.md
Normal file
@@ -0,0 +1,149 @@
|
||||
---
|
||||
language:
|
||||
- en
|
||||
pipeline_tag: text-generation
|
||||
tags:
|
||||
- llama-3.1
|
||||
- astronomy
|
||||
- astrophysics
|
||||
- cosmology
|
||||
- arxiv
|
||||
inference: false
|
||||
base_model:
|
||||
- meta-llama/Meta-Llama-3.1-8B
|
||||
---
|
||||
|
||||
# AstroSage-Llama-3.1-8B
|
||||
|
||||
https://arxiv.org/abs/2411.09012
|
||||
|
||||
AstroSage-Llama-3.1-8B is a domain-specialized natural-language AI assistant tailored for research in astronomy, astrophysics, and cosmology. Trained on the complete collection of astronomy-related arXiv papers from 2007-2024 along with millions of synthetically-generated question-answer pairs and other astronomical literature, AstroSage-Llama-3.1-8B demonstrates excellent proficiency on a wide range of questions. This achievement demonstrates the potential of domain specialization in AI, suggesting that focused training can yield capabilities exceeding those of much larger, general-purpose models.
|
||||
|
||||
## Model Details
|
||||
|
||||
- **Base Architecture**: Meta-Llama-3.1-8B
|
||||
- **Base Model**: Meta-Llama-3.1-8B
|
||||
- **Parameters**: 8 billion
|
||||
- **Training Focus**: Astronomy, Astrophysics, Cosmology, and Astronomical Instrumentation
|
||||
- **License**: Llama 3.1 Community License
|
||||
- **Development Process**:
|
||||
1. Continued Pre-training (CPT) on astronomical literature
|
||||
2. Supervised Fine-tuning (SFT) on QA pairs and instruction sets
|
||||
3. Model merging with Meta-Llama-3.1-8B-Instruct (75% CPT+SFT / 25% Meta-Instruct)
|
||||
|
||||
## Using the model
|
||||
|
||||
```python
|
||||
import torch
|
||||
from transformers import AutoModelForCausalLM, AutoTokenizer
|
||||
|
||||
# Load the model and tokenizer
|
||||
model = AutoModelForCausalLM.from_pretrained("AstroMLab/AstroSage-8b", device_map="auto")
|
||||
tokenizer = AutoTokenizer.from_pretrained("AstroMLab/AstroSage-8b")
|
||||
|
||||
# Function to generate a response
|
||||
def generate_response(prompt):
|
||||
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
||||
|
||||
outputs = model.generate(
|
||||
**inputs,
|
||||
max_new_tokens=128,
|
||||
do_sample=True,
|
||||
pad_token_id=tokenizer.eos_token_id,
|
||||
)
|
||||
response = outputs[0][inputs['input_ids'].shape[-1]:]
|
||||
decoded = tokenizer.decode(response, skip_special_tokens=True)
|
||||
|
||||
return decoded
|
||||
|
||||
# Example usage
|
||||
prompt = """
|
||||
You are an expert in general astrophysics. Your task is to answer the following question:
|
||||
What are the main components of a galaxy?
|
||||
"""
|
||||
response = generate_response(prompt)
|
||||
print(response)
|
||||
```
|
||||
|
||||
|
||||
## Model Improvements and Performance
|
||||
|
||||
AstroSage-Llama-3.1-8B shows remarkable performance improvements:
|
||||
|
||||
| Model | Score (%) |
|
||||
|-------|-----------|
|
||||
| **<span style="color:green">AstroSage-Llama-3.1-8B</span>** | **<span style="color:green">80.9</span>** |
|
||||
| GPT-4o | 80.4 |
|
||||
| LLaMA-3.1-8B | 73.7 |
|
||||
| Gemma-2-9B | 71.5 |
|
||||
| Qwen-2.5-7B | 70.4 |
|
||||
| Yi-1.5-9B | 68.4 |
|
||||
| InternLM-2.5-7B | 64.5 |
|
||||
| Mistral-7B-v0.3 | 63.9 |
|
||||
| ChatGLM3-6B | 50.4 |
|
||||
|
||||
The model demonstrates:
|
||||
- Outperformance of all 8B parameter models
|
||||
- Comparable performance to GPT-4o (80.4%)
|
||||
- ~1000x more cost-effective than proprietary models
|
||||
- 7 percentage-point improvement over base Llama-3.1-8b model
|
||||
|
||||
|
||||
## Training Data
|
||||
|
||||
- **Continued Pre-training**:
|
||||
- ~250,000 arXiv preprints (2007-2024) from astro-ph and gr-qc
|
||||
- Astronomy-related Wikipedia articles
|
||||
- Selected astronomy textbooks
|
||||
- Total: 3.3 billion tokens, 19.9 GB plaintext
|
||||
|
||||
- **Supervised Fine-tuning**:
|
||||
- 8.8 million curated QA pairs
|
||||
- Filtered Infinity-Instruct-7M dataset
|
||||
- Paper summaries and metadata
|
||||
- Total: 2.0 billion tokens, 9.8 GB plaintext
|
||||
|
||||
## Intended Use
|
||||
- Curiosity-driven question answering
|
||||
- Brainstorming new ideas
|
||||
- Astronomical research assistance
|
||||
- Educational support in astronomy
|
||||
- Literature review and summarization
|
||||
- Scientific explanation of concepts
|
||||
|
||||
## Limitations
|
||||
- Training data cutoff: January 2024
|
||||
- As with all LLMs, hallucinations are possible
|
||||
- Limited by 8B parameter size for complex reasoning
|
||||
- Paper metadata not perfectly memorized
|
||||
- Performance primarily validated on multiple-choice questions
|
||||
- Primarily trained for use in English
|
||||
|
||||
## Technical Specifications
|
||||
- Architecture: Based on Meta-Llama 3.1
|
||||
- Training Infrastructure: ORNL OLCF Frontier
|
||||
- Hosting: Hugging Face Hub (AstroMLab/AstroSage-8B)
|
||||
|
||||
## Ethical Considerations
|
||||
|
||||
While this model is designed for scientific use:
|
||||
- Should not be used as sole source for critical research decisions
|
||||
- Output should be verified against primary sources
|
||||
- May reflect biases present in astronomical literature
|
||||
|
||||
## Citation and Contact
|
||||
|
||||
- Corresponding author: Tijmen de Haan (tijmen dot dehaan at gmail dot com)
|
||||
- AstroMLab: astromachinelearninglab at gmail dot com
|
||||
- Please cite the AstroMLab 3 paper when referencing this model:
|
||||
```
|
||||
@preprint{dehaan2024astromlab3,
|
||||
title={AstroMLab 3: Achieving GPT-4o Level Performance in Astronomy with a Specialized 8B-Parameter Large Language Model},
|
||||
author={Tijmen de Haan and Yuan-Sen Ting and Tirthankar Ghosal and Tuan Dung Nguyen and Alberto Accomazzi and Azton Wells and Nesar Ramachandra and Rui Pan and Zechang Sun},
|
||||
year={2024},
|
||||
eprint={2411.09012},
|
||||
archivePrefix={arXiv},
|
||||
primaryClass={astro-ph.IM},
|
||||
url={https://arxiv.org/abs/2411.09012},
|
||||
}
|
||||
```
|
||||
39
config.json
Normal file
39
config.json
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"_name_or_path": "AstroMLab/AstroSage-8B",
|
||||
"architectures": [
|
||||
"LlamaForCausalLM"
|
||||
],
|
||||
"attention_bias": false,
|
||||
"attention_dropout": 0.0,
|
||||
"bos_token_id": 128000,
|
||||
"eos_token_id": [
|
||||
128001,
|
||||
128008,
|
||||
128009
|
||||
],
|
||||
"hidden_act": "silu",
|
||||
"hidden_size": 4096,
|
||||
"initializer_range": 0.02,
|
||||
"intermediate_size": 14336,
|
||||
"max_position_embeddings": 131072,
|
||||
"mlp_bias": false,
|
||||
"model_type": "llama",
|
||||
"num_attention_heads": 32,
|
||||
"num_hidden_layers": 32,
|
||||
"num_key_value_heads": 8,
|
||||
"pretraining_tp": 1,
|
||||
"rms_norm_eps": 1e-05,
|
||||
"rope_scaling": {
|
||||
"factor": 8.0,
|
||||
"high_freq_factor": 4.0,
|
||||
"low_freq_factor": 1.0,
|
||||
"original_max_position_embeddings": 8192,
|
||||
"rope_type": "llama3"
|
||||
},
|
||||
"rope_theta": 500000.0,
|
||||
"tie_word_embeddings": false,
|
||||
"torch_dtype": "bfloat16",
|
||||
"transformers_version": "4.44.2",
|
||||
"use_cache": true,
|
||||
"vocab_size": 128256
|
||||
}
|
||||
13
generation_config.json
Normal file
13
generation_config.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"_from_model_config": true,
|
||||
"bos_token_id": 128000,
|
||||
"do_sample": true,
|
||||
"eos_token_id": [
|
||||
128001,
|
||||
128008,
|
||||
128009
|
||||
],
|
||||
"temperature": 0.6,
|
||||
"min_p": 0.1,
|
||||
"transformers_version": "4.44.0"
|
||||
}
|
||||
3
model-00001-of-00004.safetensors
Normal file
3
model-00001-of-00004.safetensors
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:54548fb1c859ad845bfd464db84645c851c4bcc2c0c03486d76d1b831ea46c51
|
||||
size 4953586384
|
||||
3
model-00002-of-00004.safetensors
Normal file
3
model-00002-of-00004.safetensors
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:dd47aecf9ffdd0c1022a1233ae89a8f5340f496e176bf3527828457aa4dbfbe8
|
||||
size 4999819336
|
||||
3
model-00003-of-00004.safetensors
Normal file
3
model-00003-of-00004.safetensors
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e8e695747844d1bde662f7fd06ecb9133b55abc86fe8ff9f57d9541a677140aa
|
||||
size 4915916144
|
||||
3
model-00004-of-00004.safetensors
Normal file
3
model-00004-of-00004.safetensors
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4259cdb8b14b308aee2025c666576959cabf8b48d8504812f5f81c0068c74c4d
|
||||
size 1191234472
|
||||
1
model.safetensors.index.json
Normal file
1
model.safetensors.index.json
Normal file
File diff suppressed because one or more lines are too long
16
special_tokens_map.json
Normal file
16
special_tokens_map.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"bos_token": {
|
||||
"content": "<|begin_of_text|>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false
|
||||
},
|
||||
"eos_token": {
|
||||
"content": "<|end_of_text|>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false
|
||||
}
|
||||
}
|
||||
410563
tokenizer.json
Normal file
410563
tokenizer.json
Normal file
File diff suppressed because it is too large
Load Diff
2061
tokenizer_config.json
Normal file
2061
tokenizer_config.json
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user