Update README.md
Browse files
README.md
CHANGED
|
@@ -1,53 +1,73 @@
|
|
| 1 |
-
|
| 2 |
-
library_name: transformers
|
| 3 |
-
model_name: sft_conv
|
| 4 |
-
tags:
|
| 5 |
-
- generated_from_trainer
|
| 6 |
-
- trl
|
| 7 |
-
- sft
|
| 8 |
-
licence: license
|
| 9 |
-
---
|
| 10 |
|
|
|
|
| 11 |
|
| 12 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
```python
|
| 15 |
-
from transformers import
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
print(output["generated_text"])
|
| 21 |
-
```
|
| 22 |
|
| 23 |
-
|
| 24 |
|
| 25 |
-
|
| 26 |
|
|
|
|
| 27 |
|
|
|
|
| 28 |
|
| 29 |
-
|
| 30 |
|
| 31 |
-
|
| 32 |
|
| 33 |
-
|
| 34 |
-
- Transformers: 5.6.1
|
| 35 |
-
- Pytorch: 2.4.1+cu124
|
| 36 |
-
- Datasets: 4.8.4
|
| 37 |
-
- Tokenizers: 0.22.2
|
| 38 |
|
| 39 |
-
|
| 40 |
|
|
|
|
| 41 |
|
|
|
|
| 42 |
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
}
|
| 53 |
-
|
|
|
|
| 1 |
+
# Quark (50M)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
+
Quark is a lightweight decoder-only language model with approximately 50 million parameters. It is designed for efficient inference on consumer hardware while maintaining reasonable language understanding and generation capabilities.
|
| 4 |
|
| 5 |
+
## Model Description
|
| 6 |
+
|
| 7 |
+
- **Architecture:** SmolLM-style (Grouped-Query Attention, SwiGLU, RMSNorm, RoPE, deep-thin)
|
| 8 |
+
- **Parameters:** ~50M
|
| 9 |
+
- **Context length:** 2048 tokens
|
| 10 |
+
- **Vocabulary size:** 49,152 (HuggingFaceTB/cosmo2-tokenizer)
|
| 11 |
+
- **Training data:** HuggingFaceTB/smollm-corpus (5B tokens total)
|
| 12 |
+
- 60% cosmopedia-v2
|
| 13 |
+
- 30% python-edu
|
| 14 |
+
- 10% fineweb-edu
|
| 15 |
+
- **Hardware:** RTX 3070 (8 GB VRAM)
|
| 16 |
+
- **License:** MIT
|
| 17 |
+
|
| 18 |
+
## Intended Uses
|
| 19 |
+
|
| 20 |
+
- Lightweight on-device chat
|
| 21 |
+
- Educational experiments with small LMs
|
| 22 |
+
- Fine-tuning for specific tasks (instruction following, code generation, etc.)
|
| 23 |
+
|
| 24 |
+
## How to Use
|
| 25 |
|
| 26 |
```python
|
| 27 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 28 |
+
|
| 29 |
+
model_name = "OvercastLab/Quark-50m-Instruct"
|
| 30 |
+
model = AutoModelForCausalLM.from_pretrained(model_name, trust_remote_code=True)
|
| 31 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
| 32 |
|
| 33 |
+
inputs = tokenizer("Hello, how are you?", return_tensors="pt")
|
| 34 |
+
outputs = model.generate(**inputs, max_new_tokens=50)
|
| 35 |
+
print(tokenizer.decode(outputs[0]))
|
|
|
|
|
|
|
| 36 |
|
| 37 |
+
Training Details
|
| 38 |
|
| 39 |
+
Effective batch size: 64 sequences per step (4 micro-batches × 16 gradient accumulation)
|
| 40 |
|
| 41 |
+
Learning rate: 3e-4 (cosine decay to 3e-5)
|
| 42 |
|
| 43 |
+
Optimizer: AdamW (β1=0.9, β2=0.95, weight decay=0.1)
|
| 44 |
|
| 45 |
+
Precision: bfloat16
|
| 46 |
|
| 47 |
+
Total tokens: 5 billion
|
| 48 |
|
| 49 |
+
Training steps: ~1.2 million
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
|
| 51 |
+
Checkpoint frequency: every 2,000 steps
|
| 52 |
|
| 53 |
+
Limitations
|
| 54 |
|
| 55 |
+
Small parameter count limits factual knowledge and reasoning depth.
|
| 56 |
|
| 57 |
+
May produce repetitive or nonsensical outputs when prompted outside its training distribution.
|
| 58 |
+
|
| 59 |
+
The base model is not instruction-tuned; use the -Instruct variant for conversational tasks.
|
| 60 |
+
|
| 61 |
+
Citation
|
| 62 |
+
|
| 63 |
+
If you use Quark in your work, please cite:
|
| 64 |
+
bibtex
|
| 65 |
+
|
| 66 |
+
@misc{quark2025,
|
| 67 |
+
author = {OvercastLab},
|
| 68 |
+
title = {Quark: A 50M Parameter Lightweight Language Model},
|
| 69 |
+
year = {2025},
|
| 70 |
+
publisher = {Hugging Face},
|
| 71 |
+
howpublished = {\url{https://huggingface.co/OvercastLab/Quark-50m-Instruct}}
|
| 72 |
}
|
| 73 |
+
|