LH-Tech-AI commited on
Commit
a5840a2
·
verified ·
1 Parent(s): a5e1c43

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +165 -0
README.md CHANGED
@@ -1,3 +1,168 @@
1
  ---
2
  license: apache-2.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: apache-2.0
3
+ datasets:
4
+ - HuggingFaceFW/fineweb-edu
5
+ language:
6
+ - en
7
+ pipeline_tag: text-generation
8
+ library_name: transformers
9
+ tags:
10
+ - supra
11
+ - chimera
12
+ - 50m
13
+ - llama
14
+ - small
15
+ - open
16
+ - open-source
17
+ - cpu
18
+ - tiny
19
+ - slm
20
  ---
21
+
22
+ # 🦅 Supra-50M
23
+
24
+ **Supra-50M** is a compact 50M-parameter causal language model built by SupraLabs, trained from scratch using a Llama-style architecture on 20 billion tokens of high-quality educational web text. Despite being significantly smaller than comparable open models, it achieves competitive or superior results on several key benchmarks.
25
+
26
+ ---
27
+
28
+ ## 🏆 Benchmarks
29
+
30
+ ![Benchmarks Table](https://huggingface.co/SupraLabs/Supra-50M_BASE/resolve/main/benchmarks.png)
31
+
32
+ Supra-50M outperforms much larger models — GPT-2 Small (124M), SmolLM-135M, and OpenELM-270M — on BLiMP and SciQ, while remaining closely competitive on PIQA, HellaSwag, and ARC-Easy. All of this at a fraction of the parameter count.
33
+
34
+ ### Benchmark Table
35
+
36
+ | Benchmark | Supra-50M *(ours)* | GPT-2 (124M) | SmolLM-135M | OpenELM-270M |
37
+ |---|---|---|---|---|
38
+ | **Parameters** | **50M** | 124M *(2.5× larger)* | 135M *(2.7× larger)* | 270M *(5.4× larger)* |
39
+ | BLiMP (linguistics) | **76.3%** | ~63.0% | ~75.2% | ~68.0% |
40
+ | SciQ (science) | **77.2%** | ~52.0% | ~74.5% | ~61.0% |
41
+ | ARC-Easy (knowledge) | 52.2% | ~42.0% | **~55.0%** | ~46.0% |
42
+ | PIQA (logic) | 62.2% | ~61.0% | **~63.3%** | ~60.5% |
43
+ | HellaSwag (context) | 31.8% | ~31.0% | **~34.0%** | ~28.0% |
44
+
45
+ ---
46
+
47
+ ## 🧠 Model Architecture & Hyperparameters
48
+
49
+ Supra-50M is based on the `LlamaForCausalLM` architecture with the following configuration:
50
+
51
+ | Hyperparameter | Value |
52
+ |---|---|
53
+ | Architecture | Llama (decoder-only transformer) |
54
+ | Parameters | ~50M |
55
+ | `vocab_size` | 32,000 |
56
+ | `hidden_size` | 512 |
57
+ | `intermediate_size` | 1,408 |
58
+ | `num_hidden_layers` | 12 |
59
+ | `num_attention_heads` | 8 |
60
+ | `num_key_value_heads` | 4 (GQA) |
61
+ | `max_position_embeddings` | 1,024 |
62
+ | `rope_theta` | 10,000 |
63
+ | `tie_word_embeddings` | True |
64
+
65
+ ---
66
+
67
+ ## 📚 Training Data
68
+
69
+ | Property | Value |
70
+ |---|---|
71
+ | Dataset | [HuggingFaceFW/fineweb-edu](https://huggingface.co/datasets/HuggingFaceFW/fineweb-edu) (`sample-100BT` split) |
72
+ | Total tokens | 20,000,000,000 (20B) |
73
+ | Sequence length | 1,024 tokens |
74
+ | Storage format | Memory-mapped binary (`uint16`, ~40 GB) |
75
+
76
+ ---
77
+
78
+ ## 🔤 Tokenizer
79
+
80
+ A custom **Byte-Level BPE** tokenizer was trained from scratch on 500,000 documents sampled from `fineweb-edu (sample-10BT)`.
81
+
82
+ | Property | Value |
83
+ |---|---|
84
+ | Type | ByteLevelBPETokenizer |
85
+ | Vocabulary size | 32,000 |
86
+ | Min frequency | 2 |
87
+ | Special tokens | `<s>`, `<pad>`, `</s>`, `<unk>`, `<mask>` |
88
+
89
+ ---
90
+
91
+ ## ⚙️ Training Configuration
92
+
93
+ | Parameter | Value |
94
+ |---|---|
95
+ | Epochs | 1 |
96
+ | Per-device batch size | 32 |
97
+ | Gradient accumulation steps | 4 |
98
+ | Effective batch size | 128 × 1,024 tokens |
99
+ | Learning rate | 6e-4 |
100
+ | LR scheduler | Cosine |
101
+ | Warmup ratio | 2% |
102
+ | Optimizer | AdamW Fused (`adam_beta1=0.9`, `adam_beta2=0.95`) |
103
+ | Weight decay | 0.1 |
104
+ | Max grad norm | 1.0 |
105
+ | Precision | bfloat16 |
106
+ | `torch.compile` | Enabled |
107
+ | Hardware | Single GPU |
108
+ | Final loss | *3.259* |
109
+
110
+ ---
111
+
112
+ ## 🚀 Inference
113
+
114
+ ```python
115
+ from transformers import pipeline
116
+ import torch
117
+
118
+ print("[*] Loading Supra-50M model from Hugging Face Hub...")
119
+ pipe = pipeline(
120
+ "text-generation",
121
+ model="SupraLabs/Supra-50M_BASE",
122
+ device_map="auto",
123
+ torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32
124
+ )
125
+
126
+ def generate_text(prompt, max_new_tokens=150):
127
+ result = pipe(
128
+ prompt,
129
+ max_new_tokens=max_new_tokens,
130
+ do_sample=True,
131
+ temperature=0.5,
132
+ top_k=25,
133
+ top_p=0.9,
134
+ repetition_penalty=1.2,
135
+ pad_token_id=pipe.tokenizer.pad_token_id,
136
+ eos_token_id=pipe.tokenizer.eos_token_id
137
+ )
138
+ return result[0]['generated_text']
139
+
140
+ # Example
141
+ prompt = "The importance of education is"
142
+ print(f"\nPrompt: {prompt}")
143
+ print("-" * 40)
144
+ print("\nOutput:\n" + generate_text(prompt))
145
+ ```
146
+
147
+ ---
148
+
149
+ ## 💬 Sample Outputs
150
+
151
+ **Prompt:** `"The main concept of physics is "`
152
+ > The main concept of physics is iffy, and the idea that we can make things behave in a certain way. The most important part of physics is called quantum mechanics which states that all particles are made up of energy (energy) and matter (matter). In physics, there are two types of particles: elementary particles and exotic ones. These particles have properties like mass, speed or momentum but they don’t interact with each other to form new objects. This is because these particles do not exist independently from one another. In this case, an exotic particle might be created by adding more energy into its structure than it would take for a normal particle. However, when you add additional energy to an exotic particle, the new object will become smaller and larger until it becomes too large to fit within the existing structure. If you think about how light travels through space, it takes around 20 billion years before the light reaches our eyes. Light waves travel faster than light at high speeds so if we could create some kind of light wave, then we wouldn’t need any special equipment. It just needs a few hundred millionths of a second to produce light rays. So even though the light is moving along the same path as the current, the speed of light is different depending on where the light hits the
153
+
154
+ **Prompt:** `"Artificial intelligence is "`
155
+ > Artificial intelligence is iffy, it can be used to make intelligent machines that could take over the world. What does Artificial Intelligence mean? AI refers to artificial intelligence and machine learning technology which is a type of computer science (also known as artificial intelligence) in which computers are programmed with knowledge about their environment or other objects. The term AI comes from the Greek word "art" meaning "to create." The most common uses for AI include: - Machine Learning This means using algorithms like natural language processing systems to learn how words work together to form sentences such as “I am going to go to the store.” These programs will then use these rules to decide whether they should buy something or not so that you know what’s being sold on the internet. For example, if you purchase an ebook at Amazon, you may want to check its price first before purchasing it. If this happens, your shopping cart might look different than it did when purchased by someone else who bought it earlier. You can also think of AI as a way to help people understand themselves better through training and reasoning rather than simply seeing them doing things differently. In fact, we often see AI models working very well because of the way humans interact with our minds. This ability makes us more effective
156
+
157
+ **Prompt:** `"Once upon a time, "`
158
+ > Once upon a time, ...... I was so excited about the new school year and wanted to make some changes in my life. I had been looking for ways to help me become more self-aware. As an adult, I have always felt that there is no one way of doing things without thinking first. This has led me to start making small changes at home or at work. One such change was to create a space where I could be more mindful and aware of myself as well as other people around me. It’s important to remember that we all need our own personal growth and development. We can do this by taking responsibility for ourselves; being responsible for what happens outside us and keeping it within our control. By creating these smaller steps towards becoming more conscious of yourself, you will see how much better your future looks!The word "treaty" means something like "a treaty made with a king." The French word for "covenant," célèbre (French: cœle), comes from the Latin cecus ("to give up"). A covenant is not a binding agreement but rather an act of mutual understanding between two parties. In general terms, a contract is anything agreed on which someone agrees to agree to receive certain benefits. For example, if a person
159
+
160
+ ---
161
+
162
+ ## 📄 License
163
+
164
+ This model is released under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0).
165
+
166
+ ---
167
+
168
+ *© SupraLabs 2026 — Project Chimera*