Add LDT-10M model card
#7
by Compactbot - opened
README.md
CHANGED
|
@@ -1,101 +1,96 @@
|
|
| 1 |
---
|
| 2 |
-
license:
|
| 3 |
pipeline_tag: text-generation
|
| 4 |
language: en
|
| 5 |
-
library_name: transformers
|
| 6 |
tags:
|
| 7 |
- tiny
|
|
|
|
| 8 |
- tiny-model
|
| 9 |
- slm
|
|
|
|
| 10 |
- small-language-model
|
| 11 |
-
- sub-10m
|
| 12 |
-
- llama
|
| 13 |
- from-scratch
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
metrics:
|
| 15 |
- perplexity
|
| 16 |
---
|
| 17 |
|
| 18 |
# LDT-10M
|
| 19 |
|
| 20 |
-
A
|
| 21 |
-
verified **first checkpoint** for the LDT-10M request (model-requests #12,
|
| 22 |
-
DedeProGames) — real weights, real training, but **undertrained** (see the honest
|
| 23 |
-
status below). It is not a quality release yet; the card states that plainly.
|
| 24 |
|
| 25 |
-
|
| 26 |
|
| 27 |
-
|
| 28 |
|
| 29 |
-
|
|
| 30 |
|---|---|
|
| 31 |
-
|
|
| 32 |
-
|
|
| 33 |
| d_model | 320 |
|
| 34 |
-
|
|
| 35 |
-
| FFN |
|
| 36 |
-
|
|
| 37 |
-
|
|
| 38 |
-
|
|
| 39 |
-
|
|
| 40 |
-
|
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
`head.weight` aliases. Tied, the true count is 10,284,480.
|
| 45 |
|
| 46 |
## Training
|
| 47 |
|
| 48 |
-
|
| 49 |
-
-
|
| 50 |
-
|
| 51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
-
|
| 54 |
|
| 55 |
-
|
| 56 |
-
floor, so it is **not** flatlined and **not** degenerate. But it has seen only
|
| 57 |
-
~50.5M tokens ≈ **4.9 tokens/param**, far below the ~10–20+ tok/param small
|
| 58 |
-
models typically need for coherent prose. The result is grammatical but
|
| 59 |
-
semantically thin: wordy, repetitive, and it drifts off-topic mid-sentence.
|
| 60 |
|
| 61 |
-
|
| 62 |
-
token-loops:
|
| 63 |
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
|
| 68 |
-
|
| 69 |
-
> idea. But it is something that does not have a moment of his own life…"
|
| 70 |
|
| 71 |
-
> "The
|
| 72 |
-
> and is not a good deal of tear. The new story of the MD's Ford…"
|
| 73 |
|
| 74 |
-
> "
|
| 75 |
-
> happened to me. I'll be able to do anything, but I think it's been just a lot
|
| 76 |
-
> to say…"
|
| 77 |
|
| 78 |
-
|
| 79 |
-
and surface fluency. **What it is not:** a coherent prose model. It is a first
|
| 80 |
-
milestone on the path to the requested 2.6B-token model, not the destination.
|
| 81 |
|
| 82 |
-
|
| 83 |
|
| 84 |
-
|
| 85 |
|
| 86 |
-
|
| 87 |
-
import torch
|
| 88 |
-
from model import LDT
|
| 89 |
|
| 90 |
-
|
| 91 |
-
ids = torch.tensor([[1, 2, 3]]) # token ids
|
| 92 |
-
out = m.generate(ids, max_new_tokens=64, temperature=0.8, top_k=40, seed=0)
|
| 93 |
-
```
|
| 94 |
|
| 95 |
-
|
| 96 |
|
| 97 |
-
##
|
| 98 |
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
|
|
|
| 1 |
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
pipeline_tag: text-generation
|
| 4 |
language: en
|
|
|
|
| 5 |
tags:
|
| 6 |
- tiny
|
| 7 |
+
- tiny-lm
|
| 8 |
- tiny-model
|
| 9 |
- slm
|
| 10 |
+
- SLM
|
| 11 |
- small-language-model
|
|
|
|
|
|
|
| 12 |
- from-scratch
|
| 13 |
+
- llama
|
| 14 |
+
datasets:
|
| 15 |
+
- HuggingFaceFW/fineweb-edu
|
| 16 |
+
- allenai/dclm-baseline
|
| 17 |
metrics:
|
| 18 |
- perplexity
|
| 19 |
---
|
| 20 |
|
| 21 |
# LDT-10M
|
| 22 |
|
| 23 |
+
A 10.28M-parameter LLaMA-style language model, trained from scratch on FineWeb-Edu + DCLM.
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
+
**Requested by [DedeProGames](https://huggingface.co/DedeProGames) on the [model-requests board](https://huggingface.co/spaces/Compactbot/model-requests) (#12).**
|
| 26 |
|
| 27 |
+
## Architecture
|
| 28 |
|
| 29 |
+
| Parameter | Value |
|
| 30 |
|---|---|
|
| 31 |
+
| Params | **10,284,480** |
|
| 32 |
+
| Layers | 5 |
|
| 33 |
| d_model | 320 |
|
| 34 |
+
| Heads | 5 (MHA, GQA not used at this scale) |
|
| 35 |
+
| FFN dim | 896 (SwiGLU) |
|
| 36 |
+
| Vocab | 12,288 (gollem BPE) |
|
| 37 |
+
| Context | 512 |
|
| 38 |
+
| Embeddings | Tied (lm_head → tok.weight) |
|
| 39 |
+
| Norm | RMSNorm (eps 1e-5) |
|
| 40 |
+
| Attention | RoPE + causal SDPA |
|
| 41 |
+
| Dtype | float32 |
|
| 42 |
+
|
| 43 |
+
Standard LLaMA block: RMSNorm → MHA (RoPE) → residual → RMSNorm → SwiGLU FFN → residual.
|
|
|
|
| 44 |
|
| 45 |
## Training
|
| 46 |
|
| 47 |
+
| | |
|
| 48 |
+
|---|---|
|
| 49 |
+
| Steps | 4,000 |
|
| 50 |
+
| Batch size | 64 |
|
| 51 |
+
| LR | 3e-4 → 3e-5 (cosine decay) |
|
| 52 |
+
| Data | FineWeb-Edu (30.1M tok) + DCLM baseline (21.4M tok) = **~50.5M tokens** |
|
| 53 |
+
| Tokens/param | **~4.9** |
|
| 54 |
+
| Hardware | RTX 5090 (32 GB), GPU |
|
| 55 |
+
| Final val loss | **4.6020** (ppl 99.68) |
|
| 56 |
+
|
| 57 |
+
### ⚠️ Honest caveat: undertrained
|
| 58 |
|
| 59 |
+
DedeProGames requested **2.6B tokens**. This checkpoint is at **50.5M tokens** — a ~50× shortfall. The GPU was occupied by other work for most of the training window, and the CPU was over-subscribed.
|
| 60 |
|
| 61 |
+
At 4.9 tok/param, the model has learned grammar and surface fluency but not deep coherence. The val loss (4.602) is well below the 7.38 unigram floor, so it genuinely uses context — but the prose is semantically thin: wordy, repetitive, and it drifts off-topic mid-sentence.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
|
| 63 |
+
This is a **first checkpoint**, not the final deliverable. Continued training toward the 2.6B budget is planned.
|
|
|
|
| 64 |
|
| 65 |
+
## Eval (40 samples, 8 prompts × 5 seeds, temp 0.8, top-k 40)
|
| 66 |
+
|
| 67 |
+
| Metric | Value |
|
| 68 |
+
|---|---|
|
| 69 |
+
| mean loop_frac | 0.042 |
|
| 70 |
+
| max loop_frac | 1.0 (one sample) |
|
| 71 |
+
| Degenerate? | **No** |
|
| 72 |
+
| Below unigram floor? | **Yes** (4.602 < 7.38) |
|
| 73 |
|
| 74 |
+
### Sample outputs
|
|
|
|
| 75 |
|
| 76 |
+
> "The sun is assembled by a new study because he is an associate of the study of the disease in the early years. I've been interested in having a very different study…"
|
|
|
|
| 77 |
|
| 78 |
+
> "Once upon a time, she is an attack. But he is not a good idea. But it is something that does not have a moment of his own life…"
|
|
|
|
|
|
|
| 79 |
|
| 80 |
+
> "The cat sat on the ground. The sunp is a piece of light and is not a good deal of tear. The new story of the MD's Ford…"
|
|
|
|
|
|
|
| 81 |
|
| 82 |
+
> "def hello(): I have a lot of the best. I'm not sure what happened to me. I'll be able to do anything, but I think it's been just a lot to say…"
|
| 83 |
|
| 84 |
+
Grammar is intact. No token loops, no broken tokens, no speaker tags. Semantically limited — expected at 4.9 tok/param.
|
| 85 |
|
| 86 |
+
## Usage
|
|
|
|
|
|
|
| 87 |
|
| 88 |
+
The model uses a custom `LDT` architecture (standard LLaMA block, no special tricks). The safetensors file contains 47 tensors with tied embeddings (lm_head is not stored separately; it shares `tok.weight`).
|
|
|
|
|
|
|
|
|
|
| 89 |
|
| 90 |
+
To load with a custom model class, you need a small LLaMA-style implementation matching the config above. The training script (`train_ldt10m_fixed.py`) contains the full architecture definition.
|
| 91 |
|
| 92 |
+
## What this is NOT
|
| 93 |
|
| 94 |
+
- Not a 2.6B-token model (that's the target; this is the 50.5M checkpoint)
|
| 95 |
+
- Not a general-purpose assistant (it's a raw LM, no instruction tuning)
|
| 96 |
+
- Not a replacement for anything larger — it's a research checkpoint in a from-scratch training run
|