Model save
Browse files- README.md +44 -177
- config.json +2 -2
- model.safetensors +2 -2
- training_args.bin +1 -1
README.md
CHANGED
|
@@ -1,197 +1,64 @@
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
-
license: apache-2.0
|
| 4 |
tags:
|
| 5 |
-
-
|
| 6 |
-
-
|
| 7 |
-
-
|
| 8 |
-
|
| 9 |
-
- normalization
|
| 10 |
-
- neollm
|
| 11 |
-
datasets:
|
| 12 |
-
- HuggingFaceFW/fineweb-edu
|
| 13 |
---
|
| 14 |
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
NeoLLM is a **135 M parameter** decoder-only language model trained from scratch on
|
| 18 |
-
[FineWeb-Edu](https://huggingface.co/datasets/HuggingFaceFW/fineweb-edu) in **FP8**
|
| 19 |
-
precision, completing training in approximately **6 hours** on a single NVIDIA RTX 5090.
|
| 20 |
-
It integrates a collection of recently published attention and normalization techniques
|
| 21 |
-
into a single architecture, with the goal of studying how they interact during
|
| 22 |
-
pretraining. The model is actively being developed and the current checkpoint represents
|
| 23 |
-
an intermediate training state.
|
| 24 |
-
|
| 25 |
-
> **Author / contact:** [@Kyokopom](https://x.com/Kyokopom) on X
|
| 26 |
-
> **Repository:** [KitsuVp/NeoLLM](https://huggingface.co/KitsuVp/NeoLLM)
|
| 27 |
-
|
| 28 |
-
---
|
| 29 |
-
|
| 30 |
-
## Architecture
|
| 31 |
-
|
| 32 |
-
NeoLLM is a decoder-only transformer with the following configuration:
|
| 33 |
-
|
| 34 |
-
| Parameter | Value |
|
| 35 |
-
|---|---|
|
| 36 |
-
| Hidden size | 512 |
|
| 37 |
-
| Layers | 12 |
|
| 38 |
-
| Attention heads | 8 |
|
| 39 |
-
| KV heads (GQA) | 2 |
|
| 40 |
-
| Head dim | 64 |
|
| 41 |
-
| Intermediate size | 1536 |
|
| 42 |
-
| Vocabulary | Qwen3 tokenizer (64,402 tokens) |
|
| 43 |
-
| Context length | 512 tokens |
|
| 44 |
-
|
| 45 |
-
### Parameter breakdown
|
| 46 |
-
|
| 47 |
-
| Parameter bucket | Count |
|
| 48 |
-
|---|---|
|
| 49 |
-
| **Total parameters** | 79.58M (79,582,952) |
|
| 50 |
-
| **Embedding parameters** (tied) | 32.97M (32,973,824) |
|
| 51 |
-
| **Non-embedding parameters** | 46.61M (46,609,128) |
|
| 52 |
-
| **Effective trainable parameters** | 79.58M (79,582,952) |
|
| 53 |
-
|
| 54 |
-
> Weight tying is **enabled**: the input embedding matrix and the language-model head
|
| 55 |
-
> share the same parameters, so the effective trainable budget is
|
| 56 |
-
> `total − embed = 46.61M`.
|
| 57 |
-
|
| 58 |
-
### Integrated techniques
|
| 59 |
-
|
| 60 |
-
Each layer combines the following mechanisms simultaneously.
|
| 61 |
-
|
| 62 |
-
**Normalization and residual stream**
|
| 63 |
-
|
| 64 |
-
- **SeeDNorm** ([arXiv:2510.22777](https://arxiv.org/abs/2510.22777)) — Applied to Q and K
|
| 65 |
-
projections. Dynamically rescales the normalization based on the input's own statistics,
|
| 66 |
-
making the attention geometry more stable across varying input distributions.
|
| 67 |
-
- **PolyNorm** ([arXiv:2602.04902](https://arxiv.org/abs/2602.04902)) — Replaces the standard
|
| 68 |
-
MLP activation with three branches: linear (x), quadratic (x²), and cubic (x³) — each
|
| 69 |
-
normalized and combined with learned weights. This allows the MLP to express both linear
|
| 70 |
-
and non-linear relationships simultaneously.
|
| 71 |
-
- **GPAS** ([arXiv:2506.22049](https://arxiv.org/abs/2506.22049)) — Gradient-Preserving
|
| 72 |
-
Activation Scaling. Applied to residual connections between sublayers; helps gradients
|
| 73 |
-
flow more cleanly during training without distorting the residual stream.
|
| 74 |
-
- **LayerNorm Scaling / LNS** ([arXiv:2502.05795](https://arxiv.org/abs/2502.05795)) — Each
|
| 75 |
-
layer's output is scaled by 1/√ℓ where ℓ is the layer index. Directly addresses the
|
| 76 |
-
"Curse of Depth" in Pre-LN transformers.
|
| 77 |
-
|
| 78 |
-
**Attention mechanisms**
|
| 79 |
-
|
| 80 |
-
- **FAN** ([arXiv:2502.21309](https://arxiv.org/abs/2502.21309)) — Fourier Analysis Networks.
|
| 81 |
-
A portion of the input projection channels are dedicated to representing periodic patterns
|
| 82 |
-
(cosine/sine pairs), while the remainder handle standard linear content.
|
| 83 |
-
- **MEA** ([arXiv:2601.19611](https://arxiv.org/abs/2601.19611)) — Explicit Multi-head
|
| 84 |
-
Attention. Adds small learnable interaction matrices between attention heads for K and V.
|
| 85 |
-
- **LUCID** ([arXiv:2602.10410](https://arxiv.org/abs/2602.10410)) — Applies a learned
|
| 86 |
-
lower-triangular preconditioner to V before attention, decorrelating value representations
|
| 87 |
-
across positions.
|
| 88 |
-
- **Affine-Scaled Attention** ([arXiv:2602.23057](https://arxiv.org/abs/2602.23057)) — Adds
|
| 89 |
-
two learnable per-head scalars (α and β) to the softmax weights:
|
| 90 |
-
`[α·softmax(QKᵀ) + β]·V`.
|
| 91 |
-
- **XSA** ([arXiv:2603.09078](https://arxiv.org/abs/2603.09078)) — Exclusive Self Attention.
|
| 92 |
-
After computing attention, removes the component of the output aligned with the token's
|
| 93 |
-
own value vector.
|
| 94 |
-
- **Directional Routing** ([arXiv:2603.14923](https://arxiv.org/abs/2603.14923)) — Each head
|
| 95 |
-
learns K=4 directions in the output space; a learned router suppresses the attention output
|
| 96 |
-
along each direction per input.
|
| 97 |
-
- **Gated Attention** ([arXiv:2505.06708](https://arxiv.org/abs/2505.06708)) — A sigmoid gate
|
| 98 |
-
is applied to the attention output before the output projection, introducing non-linearity
|
| 99 |
-
and preventing attention sinks.
|
| 100 |
-
- **Momentum Attention** ([arXiv:2411.03884](https://arxiv.org/abs/2411.03884)) — Modifies Q
|
| 101 |
-
and K by subtracting a fraction of the previous position's Q and K values (causal
|
| 102 |
-
first-difference).
|
| 103 |
-
|
| 104 |
-
**MLP**
|
| 105 |
-
|
| 106 |
-
- **Learnable Multipliers** ([arXiv:2601.04890](https://arxiv.org/abs/2601.04890)) — Adds
|
| 107 |
-
per-row and per-column learnable scalar parameters to each linear layer.
|
| 108 |
-
- **SimpleGPT** ([arXiv:2602.01212](https://arxiv.org/abs/2602.01212)) — A normalization
|
| 109 |
-
strategy derived from second-order geometry analysis, applied inside MLP projections to
|
| 110 |
-
improve optimization stability.
|
| 111 |
-
|
| 112 |
-
---
|
| 113 |
|
| 114 |
-
#
|
| 115 |
-
|
| 116 |
-
| Setting | Value |
|
| 117 |
-
|---|---|
|
| 118 |
-
| Dataset | FineWeb-Edu (sample-10BT) |
|
| 119 |
-
| Tokens seen | ~0.51B (15,625 steps × batch 64 × length 512) |
|
| 120 |
-
| Precision | FP8 native (E4M3 weights/activations, E5M2 gradients) + BF16 fallback |
|
| 121 |
-
| Optimizer | Conda (Column-Normalized Adam) + GPA |
|
| 122 |
-
| Learning rate | 6e-04 with linear warmup (10 % of steps) |
|
| 123 |
-
| Weight decay | 0.1 |
|
| 124 |
-
| Training time | ~1h 22m |
|
| 125 |
-
| Hardware | NVIDIA RTX 5090 (single GPU) |
|
| 126 |
-
|
| 127 |
-
### Training curve
|
| 128 |
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
| 10,000 | 4.028 | 3.970 |
|
| 133 |
-
| 15,000 | 3.863 | 3.797 |
|
| 134 |
-
| 15,625 | — | 3.787 |
|
| 135 |
|
| 136 |
-
|
| 137 |
|
| 138 |
-
|
| 139 |
|
| 140 |
-
|
| 141 |
-
will improve with more training.
|
| 142 |
-
- **Gradient spike at step 40k** — Reorganized the attention pattern in layer 9 that
|
| 143 |
-
previously captured long-range token correlations. A checkpoint from ~step 38k is expected
|
| 144 |
-
to have better aggregate benchmark scores.
|
| 145 |
-
- **PolyNorm exclusivity** — The quadratic branch has become partially redundant with the
|
| 146 |
-
linear branch. Will be corrected in the next training run.
|
| 147 |
-
- **Base model only** — Not instruction-tuned or aligned; purely a next-token-prediction
|
| 148 |
-
base model.
|
| 149 |
|
| 150 |
-
|
| 151 |
|
| 152 |
-
##
|
| 153 |
-
|
| 154 |
-
All papers whose techniques are integrated into NeoLLM's architecture:
|
| 155 |
-
|
| 156 |
-
| Technique | Paper title | arXiv |
|
| 157 |
-
|---|---|---|
|
| 158 |
-
| SeeDNorm | Self-Rescaled Dynamic Normalization | [2510.22777](https://arxiv.org/abs/2510.22777) |
|
| 159 |
-
| MEA | Explicit Multi-head Attention | [2601.19611](https://arxiv.org/abs/2601.19611) |
|
| 160 |
-
| Learnable Multipliers | Freeing the Scale of Language Model Matrix Layers | [2601.04890](https://arxiv.org/abs/2601.04890) |
|
| 161 |
-
| Directional Routing | Directional Routing in Transformers | [2603.14923](https://arxiv.org/abs/2603.14923) |
|
| 162 |
-
| XSA | Exclusive Self Attention | [2603.09078](https://arxiv.org/abs/2603.09078) |
|
| 163 |
-
| Gated Attention | Gated Attention for LLMs | [2505.06708](https://arxiv.org/abs/2505.06708) |
|
| 164 |
-
| Affine-Scaled Attention | Affine-Scaled Attention | [2602.23057](https://arxiv.org/abs/2602.23057) |
|
| 165 |
-
| LNS | The Curse of Depth in LLMs | [2502.05795](https://arxiv.org/abs/2502.05795) |
|
| 166 |
-
| LUCID | Attention with Preconditioned Representations | [2602.10410](https://arxiv.org/abs/2602.10410) |
|
| 167 |
-
| FAN | Fourier Analysis Networks | [2502.21309](https://arxiv.org/abs/2502.21309) |
|
| 168 |
-
| SimpleGPT | SimpleGPT | [2602.01212](https://arxiv.org/abs/2602.01212) |
|
| 169 |
-
| GPAS | Gradient-Preserving Activation Scaling | [2506.22049](https://arxiv.org/abs/2506.22049) |
|
| 170 |
-
| PolyNorm | PolyNorm / PolyCom | [2602.04902](https://arxiv.org/abs/2602.04902) |
|
| 171 |
-
| Momentum Attention | Momentum Attention | [2411.03884](https://arxiv.org/abs/2411.03884) |
|
| 172 |
-
| TWEO (analysis ref.) | Transformers Without Extreme Outliers | [2511.23225](https://arxiv.org/abs/2511.23225) |
|
| 173 |
|
| 174 |
-
|
| 175 |
|
| 176 |
-
##
|
| 177 |
|
| 178 |
-
|
| 179 |
-
@misc{neollm2026,
|
| 180 |
-
title = {NeoLLM: A Research Language Model Integrating Recent Attention and Normalization Techniques},
|
| 181 |
-
author = {KitsuVp},
|
| 182 |
-
year = {2026},
|
| 183 |
-
url = {https://huggingface.co/KitsuVp/NeoLLM}
|
| 184 |
-
}
|
| 185 |
-
```
|
| 186 |
|
| 187 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 188 |
|
| 189 |
-
##
|
| 190 |
|
| 191 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 192 |
|
| 193 |
-
---
|
| 194 |
|
| 195 |
-
##
|
| 196 |
|
| 197 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
library_name: transformers
|
|
|
|
| 3 |
tags:
|
| 4 |
+
- generated_from_trainer
|
| 5 |
+
model-index:
|
| 6 |
+
- name: NeoLLM
|
| 7 |
+
results: []
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
+
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
| 11 |
+
should probably proofread and complete it, then remove this comment. -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
+
# NeoLLM
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
+
This model is a fine-tuned version of [](https://huggingface.co/) on an unknown dataset.
|
| 16 |
+
It achieves the following results on the evaluation set:
|
| 17 |
+
- Loss: 3.6722
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
+
## Model description
|
| 20 |
|
| 21 |
+
More information needed
|
| 22 |
|
| 23 |
+
## Intended uses & limitations
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
+
More information needed
|
| 26 |
|
| 27 |
+
## Training and evaluation data
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
+
More information needed
|
| 30 |
|
| 31 |
+
## Training procedure
|
| 32 |
|
| 33 |
+
### Training hyperparameters
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
+
The following hyperparameters were used during training:
|
| 36 |
+
- learning_rate: 0.0006
|
| 37 |
+
- train_batch_size: 256
|
| 38 |
+
- eval_batch_size: 256
|
| 39 |
+
- seed: 42
|
| 40 |
+
- optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
|
| 41 |
+
- lr_scheduler_type: linear
|
| 42 |
+
- lr_scheduler_warmup_steps: 0.1
|
| 43 |
+
- num_epochs: 1
|
| 44 |
|
| 45 |
+
### Training results
|
| 46 |
|
| 47 |
+
| Training Loss | Epoch | Step | Validation Loss |
|
| 48 |
+
|:-------------:|:------:|:----:|:---------------:|
|
| 49 |
+
| 5.6666 | 0.1280 | 500 | 5.2505 |
|
| 50 |
+
| 4.5860 | 0.2560 | 1000 | 4.3573 |
|
| 51 |
+
| 4.1286 | 0.3839 | 1500 | 4.0324 |
|
| 52 |
+
| 3.9563 | 0.5119 | 2000 | 3.8867 |
|
| 53 |
+
| 3.8586 | 0.6399 | 2500 | 3.8002 |
|
| 54 |
+
| 3.8004 | 0.7679 | 3000 | 3.7422 |
|
| 55 |
+
| 3.7501 | 0.8958 | 3500 | 3.6938 |
|
| 56 |
+
| 3.7302 | 1.0 | 3907 | 3.6722 |
|
| 57 |
|
|
|
|
| 58 |
|
| 59 |
+
### Framework versions
|
| 60 |
|
| 61 |
+
- Transformers 5.5.3
|
| 62 |
+
- Pytorch 2.11.0+cu130
|
| 63 |
+
- Datasets 4.8.4
|
| 64 |
+
- Tokenizers 0.22.2
|
config.json
CHANGED
|
@@ -57,7 +57,7 @@
|
|
| 57 |
"rope_type": "default"
|
| 58 |
},
|
| 59 |
"rope_theta": 10000.0,
|
| 60 |
-
"tie_word_embeddings":
|
| 61 |
"transformers_version": "5.5.3",
|
| 62 |
"use_affine_scaled_attention": true,
|
| 63 |
"use_attn_res": false,
|
|
@@ -73,7 +73,7 @@
|
|
| 73 |
"use_momentum_attention": true,
|
| 74 |
"use_repo": true,
|
| 75 |
"use_spelling_bee_embeddings": false,
|
| 76 |
-
"use_token_generator":
|
| 77 |
"use_versatile_ffn": false,
|
| 78 |
"use_xsa": true,
|
| 79 |
"versatile_active_experts": 2,
|
|
|
|
| 57 |
"rope_type": "default"
|
| 58 |
},
|
| 59 |
"rope_theta": 10000.0,
|
| 60 |
+
"tie_word_embeddings": true,
|
| 61 |
"transformers_version": "5.5.3",
|
| 62 |
"use_affine_scaled_attention": true,
|
| 63 |
"use_attn_res": false,
|
|
|
|
| 73 |
"use_momentum_attention": true,
|
| 74 |
"use_repo": true,
|
| 75 |
"use_spelling_bee_embeddings": false,
|
| 76 |
+
"use_token_generator": false,
|
| 77 |
"use_versatile_ffn": false,
|
| 78 |
"use_xsa": true,
|
| 79 |
"versatile_active_experts": 2,
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bba35fb67502770b4aa98fac1b7b94365b0167cff1f9c0edc09d463351541ef0
|
| 3 |
+
size 156523688
|
training_args.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 5329
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:89f8c5c1c3f84a9dee4b4fe4f5d8116118372dae665fd9b4b9dd87255996b3d8
|
| 3 |
size 5329
|