Update README.md
Browse files
README.md
CHANGED
|
@@ -1,42 +1,81 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
---
|
| 4 |
-
|
| 5 |
-
My smaller GPT-2 models utilize LayerNorm and FFN layers, whereas for larger models,
|
| 6 |
-
I have replaced these components with RMSNorm and SwiGLU. This adjustment allows a smoother transition to large model architectures,
|
| 7 |
-
including models with 8B, 33B, 70B, and 120B parameters.
|
| 8 |
|
| 9 |
-
|
| 10 |
|
| 11 |
-
|
| 12 |
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
CustomEmbedding
|
| 15 |
FrozenSignatureLayer
|
| 16 |
LearnedPositionalEmbedding
|
| 17 |
-
TransformerBlock
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
|
|
|
|
|
|
| 23 |
LayerNorm
|
| 24 |
Linear
|
|
|
|
|
|
|
|
|
|
| 25 |
|
|
|
|
| 26 |
|
| 27 |
-
|
| 28 |
CustomEmbedding
|
| 29 |
-
# Positional Embedding removed, RoPE
|
| 30 |
-
TransformerBlock
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
|
|
|
|
|
|
| 35 |
RMSNorm
|
| 36 |
Linear
|
| 37 |
FrozenSignatureLayer
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
|
|
|
|
| 41 |
|
| 42 |
-
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
---
|
| 4 |
+
# Model Architecture Overview
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
+
## Architectures Included
|
| 7 |
|
| 8 |
+
I have added my empty models based on the following architectures:
|
| 9 |
|
| 10 |
+
- **GPT-3 Standard**
|
| 11 |
+
- **Llama 3**
|
| 12 |
+
- **Mistral**
|
| 13 |
+
|
| 14 |
+
For smaller models modeled after **GPT-2**, I utilize `LayerNorm` and `FFN` layers. For larger models, these layers are replaced with `RMSNorm` and `SwiGLU`, enabling a smoother transition to architectures with larger parameter sizes (8B, 33B, 70B, and 120B).
|
| 15 |
+
|
| 16 |
+
---
|
| 17 |
+
|
| 18 |
+
## Tokenizer Choices
|
| 19 |
+
|
| 20 |
+
- For English models: **GPT-2 Hugging Face tokenizer**
|
| 21 |
+
- For multilingual models: **BERT tokenizer** from the Hugging Face library
|
| 22 |
+
|
| 23 |
+
---
|
| 24 |
+
|
| 25 |
+
## Training and Tuning
|
| 26 |
+
|
| 27 |
+
The **Transformer block is not frozen**, providing greater flexibility and power when tuning models from scratch.
|
| 28 |
+
|
| 29 |
+
---
|
| 30 |
+
|
| 31 |
+
## Model Architecture Details
|
| 32 |
+
|
| 33 |
+
### GPT-2 Architecture (Classic, Transformer-like)
|
| 34 |
+
|
| 35 |
+
```
|
| 36 |
CustomEmbedding
|
| 37 |
FrozenSignatureLayer
|
| 38 |
LearnedPositionalEmbedding
|
| 39 |
+
[TransformerBlock]
|
| 40 |
+
βββ MultiHeadAttention
|
| 41 |
+
βββ LayerNorm
|
| 42 |
+
βββ LayerNorm
|
| 43 |
+
βββ FFN
|
| 44 |
+
βββ Linear
|
| 45 |
+
βββ Activation: GELU
|
| 46 |
+
βββ Linear
|
| 47 |
LayerNorm
|
| 48 |
Linear
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
---
|
| 52 |
|
| 53 |
+
### GPT-3 Architecture (Similar to Llama 3 & Mistral)
|
| 54 |
|
| 55 |
+
```
|
| 56 |
CustomEmbedding
|
| 57 |
+
# Positional Embedding removed, RoPE integrated in Attention
|
| 58 |
+
[TransformerBlock]
|
| 59 |
+
βββ MultiHeadAttention
|
| 60 |
+
βββ SwiGLUFeedForward
|
| 61 |
+
βββ Linear (Gate Layer)
|
| 62 |
+
βββ Linear (Up Layer)
|
| 63 |
+
βββ Linear (Projection/Down Layer)
|
| 64 |
+
βββ RMSNorm
|
| 65 |
RMSNorm
|
| 66 |
Linear
|
| 67 |
FrozenSignatureLayer
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
+
---
|
| 71 |
|
| 72 |
+
**Note:** The large model architectures replace specific layers:
|
| 73 |
+
- `LayerNorm` β `RMSNorm`
|
| 74 |
+
- `FFN` β `SwiGLU`
|
| 75 |
+
|
| 76 |
+
---
|
| 77 |
|
| 78 |
+
## License
|
| 79 |
|
| 80 |
+
CMS Manhattan
|
| 81 |
+
Copyright Β© 2002β2026
|