spitfire4794 commited on
Commit
95aab7a
·
verified ·
1 Parent(s): ee20602

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +71 -0
README.md ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ ---
3
+ language:
4
+ - en
5
+ tags:
6
+ - text-generation
7
+ - causal-lm
8
+ - custom-architecture
9
+ - slm
10
+ - small-language-model
11
+ license: mit
12
+ ---
13
+
14
+ # Ember (2.87M Parameters)
15
+
16
+ Ember is a highly efficient, ultra-small language model developed by SurjoLabs. It ranks **#2 on the Open SLM Leaderboard** for sub-3M parameter models, demonstrating that this custom XSA recurrent architecture is viable and can yield exceptional reasoning capabilities in tiny architectures.
17
+
18
+ ## Methodology
19
+
20
+ Ember is built to prove that unique recurrent architectures can match or beat standard transformers even at the smallest scales.
21
+
22
+ * **Custom Architecture:** Built on a Llama-variant framework but features **XSA Attention** (value-subtraction projection) and **Recurrent Layers**. By reusing weights across recurrent passes, the model achieves the depth of an 11-layer model while only carrying 8 layers of unique weights.
23
+ * **Optimized Tokenizer:** Uses a custom 4,096-vocabulary English tokenizer. This intentionally small vocabulary prevents the embedding table from dominating the parameter count, ensuring nearly 80% of the model's 2.87M parameters are dedicated to actual transformer compute logic.
24
+ * **Extreme Overtraining:** Trained on **20 Billion tokens**, resulting in a ~1:7,000 parameter-to-token ratio. This forces the small architecture to memorize syntax and knowledge far beyond Chinchilla-optimal limits.
25
+ * **Data Mixture:**
26
+ * 60% Finephrase (Synthetic FineWeb-Edu)
27
+ * 20% DCLM (Web text)
28
+ * 10% FineMath (Mathematics)
29
+ * 10% CornStack (Code)
30
+ * **Optimizer:** Utilizes a hybrid Muon (for 2D weight matrices) and AdamW (for embeddings/norms) optimizer setup for stable, rapid convergence.
31
+
32
+ ## Benchmark Results (Open SLM Leaderboard)
33
+
34
+ | Benchmark | Score (acc_norm) |
35
+ | :--- | :--- |
36
+ | HellaSwag | 27.35% |
37
+ | ARC-Easy | 33.25% |
38
+ | ARC-Challenge | 21.08% |
39
+ | PIQA | 54.41% |
40
+ | ArithMark-3 | 32.90% |
41
+ | **Intelligence Index** | **5.94** |
42
+
43
+ We used the Language Model Evaluation Harness for Hellaswag, ARC-Easy, ARC-Challange, PIQA.
44
+ We used the provided script for ArithMark-3
45
+
46
+ ## Usage
47
+
48
+ ```python
49
+ from transformers import AutoModelForCausalLM, AutoTokenizer
50
+ import torch
51
+
52
+ model_id = "SurjoLabs/Ember"
53
+ tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
54
+ model = AutoModelForCausalLM.from_pretrained(
55
+ model_id,
56
+ trust_remote_code=True,
57
+ torch_dtype=torch.bfloat16
58
+ ).cuda()
59
+
60
+ prompt = "The capital of France is"
61
+ inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
62
+ outputs = model.generate(**inputs, max_new_tokens=20)
63
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
64
+
65
+ ```
66
+
67
+ ## Acknowledgement
68
+ We would like to thank [AxiomicLabs](https://huggingface.co/AxiomicLabs) for proving that XSA architecture is excellent for token efficiency.
69
+
70
+ ## Limitations
71
+ This is an early test of the larger Surjo Project. The code is not very stable and we do not recommend using the modeling file without doing edits for training your own model.