Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
datasets:
|
| 3 |
+
- HuggingFaceFW/fineweb-edu
|
| 4 |
+
license: apache-2.0
|
| 5 |
+
library_name: transformers
|
| 6 |
+
pipeline_tag: text-generation
|
| 7 |
+
---
|
| 8 |
+
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
# DMaS-LLaMa-Lite-step-100
|
| 12 |
+
|
| 13 |
+
This repository provides access to **DMaS-LLaMa-Lite-step-100**, a 1.7-billion-parameter language model based on the LLaMa architecture. The model has been trained from scratch as part of the DMaS-LLaMa-Lite project using approximately 20 billion tokens of high-quality educational content.
|
| 14 |
+
|
| 15 |
+
## Model Overview
|
| 16 |
+
|
| 17 |
+
- **Architecture**: LLaMa-based
|
| 18 |
+
- **Parameters**: 1.7B (36 layers, 32 attention heads, RMSNorm)
|
| 19 |
+
- **Tokenizer**: GPT-2 tokenizer
|
| 20 |
+
- **Training Data**: FineWeb-Edu subset (educational text)
|
| 21 |
+
- **Training Steps**: 100
|
| 22 |
+
- **Optimizer**: AdamW with linear warmup and decay
|
| 23 |
+
- **Hardware**: Trained on 1-2 RTX A6000 GPUs with PyTorch DDP
|
| 24 |
+
- **Dataset Source**: [FineWeb-Edu Dataset](https://huggingface.co/datasets/HuggingFaceFW/fineweb-edu)
|
| 25 |
+
|
| 26 |
+
The training process emphasizes qualitative improvements in coherence, fluency, and factual grounding, demonstrating competitive results even with fewer tokens compared to larger-scale models.
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
This checkpoint represents the model's state at **100 training steps**. Validation loss and downstream performance benchmarks demonstrate notable early improvements in text fluency and alignment with prompts.
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
## Training Code
|
| 33 |
+
|
| 34 |
+
The training script, including configurations and instructions, is open-sourced and available here:
|
| 35 |
+
📄 **[DMaS-LLaMa-Lite Training Code](https://github.com/McGill-DMaS/DMaS-LLaMa-Lite-Training-Code)**
|
| 36 |
+
|
| 37 |
+
## Usage
|
| 38 |
+
|
| 39 |
+
You can load the model with Hugging Face Transformers library:
|
| 40 |
+
|
| 41 |
+
```python
|
| 42 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 43 |
+
|
| 44 |
+
model_name = "McGill-DMaS/DMaS-LLaMa-Lite-step-100"
|
| 45 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 46 |
+
model = AutoModelForCausalLM.from_pretrained(model_name)
|
| 47 |
+
|
| 48 |
+
inputs = tokenizer("The Pyramids of Giza in Egypt are some of the oldest man-made structures in the world.", return_tensors="pt")
|
| 49 |
+
outputs = model.generate(**inputs, max_length=50)
|
| 50 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
## Citation
|
| 54 |
+
|
| 55 |
+
If you use this model or its training insights in your work, please cite the following [paper](https://arxiv.org/abs/2412.13335):
|
| 56 |
+
|
| 57 |
+
```bibtex
|
| 58 |
+
@inproceedings{LFH25ijcnn,
|
| 59 |
+
author = "M. Q. Li and B. C. M. Fung and S.-C. Huang",
|
| 60 |
+
title = "Training dynamics of a 1.7B {LLaMa} model: a data-efficient approach",
|
| 61 |
+
booktitle = "Proc. of the IEEE International Joint Conference on Neural Networks (IJCNN),
|
| 62 |
+
pages = "",
|
| 63 |
+
address = "Rome, Italy",
|
| 64 |
+
month = "July",
|
| 65 |
+
year = "2025",
|
| 66 |
+
publisher = "IEEE Press",
|
| 67 |
+
}
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
+
## License
|
| 71 |
+
|
| 72 |
+
This model and code are released under the **Apache License 2.0**. Please check the respective repositories for detailed terms.
|