Li commited on
Commit
608ecff
·
verified ·
1 Parent(s): 3f38b7b

Add detailed model card

Browse files
Files changed (1) hide show
  1. README.md +172 -0
README.md ADDED
@@ -0,0 +1,172 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ library_name: transformers
5
+ pipeline_tag: text-generation
6
+ tags:
7
+ - causal-lm
8
+ - llama
9
+ - pretraining
10
+ - from-scratch
11
+ - single-gpu
12
+ - nvidia-l20
13
+ ---
14
+
15
+ # L20-1B-20B-Base
16
+
17
+ L20-1B-20B-Base is a 1.10B-parameter English causal language model pretrained
18
+ from random initialization on 20.0B prediction tokens using one NVIDIA L20.
19
+ The tokenizer was also trained from scratch. This is a base completion model,
20
+ not an instruction/chat model, and no third-party pretrained checkpoint was
21
+ used to initialize it.
22
+
23
+ ## Quick start
24
+
25
+ ```python
26
+ import torch
27
+ from transformers import AutoModelForCausalLM, AutoTokenizer
28
+
29
+ model_id = "AliceYin/L20-1B-20B-Base"
30
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
31
+ model = AutoModelForCausalLM.from_pretrained(
32
+ model_id,
33
+ torch_dtype=torch.bfloat16,
34
+ device_map="auto",
35
+ )
36
+
37
+ prompt = "Machine learning is"
38
+ inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
39
+ with torch.no_grad():
40
+ output = model.generate(
41
+ **inputs,
42
+ max_new_tokens=80,
43
+ do_sample=True,
44
+ temperature=0.8,
45
+ top_p=0.95,
46
+ )
47
+ print(tokenizer.decode(output[0], skip_special_tokens=True))
48
+ ```
49
+
50
+ The uploaded safetensors preserve the final checkpoint exactly in FP32. Loading
51
+ with BF16, as above, substantially reduces inference memory use.
52
+
53
+ ## Architecture
54
+
55
+ | Field | Value |
56
+ |---|---:|
57
+ | Parameters | 1,100,048,384 |
58
+ | Architecture | LlamaForCausalLM |
59
+ | Layers | 22 |
60
+ | Hidden size | 2,048 |
61
+ | Attention heads / KV heads | 32 / 4 |
62
+ | MLP intermediate size | 5,632 |
63
+ | Context length | 2,048 |
64
+ | Vocabulary | 32,000 byte-level BPE |
65
+ | Positional encoding | RoPE, theta 10,000 |
66
+ | Weight tying | No |
67
+
68
+ ## Training
69
+
70
+ The run completed 19,148 optimizer steps and 19,999,703,040 prediction tokens.
71
+ It used BF16 mixed precision, compiled PyTorch SDPA, fused AdamW, sequence length
72
+ 2,048, micro-batch 6, gradient accumulation 85, and an effective global batch
73
+ of 510 sequences. The learning rate used 1,000 warmup steps followed by cosine
74
+ decay from 4e-4 to 4e-5.
75
+
76
+ The English training mixture was:
77
+
78
+ - 42.5% FineWeb-Edu-Dedup, score 4+
79
+ - 42.5% DCLM-Baseline
80
+ - 3% FineMath-4+
81
+ - 12% permissively licensed Stack-Edu code in Python, JavaScript, TypeScript,
82
+ C++, and Java at the release-validated educational thresholds
83
+
84
+ Accepted documents passed English/content filters, normalized-text SHA-256
85
+ exact deduplication, and a 13-word benchmark decontamination check. DCLM email
86
+ addresses and syntactically valid IPv4 addresses were deterministically
87
+ anonymized. The original decontamination list did not explicitly include BoolQ;
88
+ results therefore include a six-task sensitivity analysis excluding BoolQ.
89
+
90
+ ## Hardware, throughput, and MFU
91
+
92
+ Training used exactly one NVIDIA L20 with 46,068 MiB VRAM. The software snapshot
93
+ recorded NVIDIA driver 580.159.04, CUDA 13.0, PyTorch 2.12.1+cu130, Transformers
94
+ 4.56.2, and lm-eval 0.4.9.
95
+
96
+ A representative live snapshot at step 10,595 recorded:
97
+
98
+ | Metric | Value |
99
+ |---|---:|
100
+ | Throughput | 12,845 tokens/s |
101
+ | Model FLOP/s | 93.948 TFLOP/s |
102
+ | Standard MFU | 71.17% |
103
+ | GPU utilization | 100% |
104
+ | VRAM use | 45,265 / 46,068 MiB |
105
+ | Power | 348.3 W |
106
+
107
+ MFU is calculated as `model_FLOP/s / 132e12`, using exactly 132 TFLOP/s as the
108
+ BF16 peak denominator. This is point-in-time training telemetry, not a full-run
109
+ average. A separate 60-step preflight at the selected micro-batch measured
110
+ 12,586 tokens/s and 36.13 GiB peak allocated memory; micro-batch 8 was rejected
111
+ after an out-of-memory failure.
112
+
113
+ ## Evaluation
114
+
115
+ Final held-out validation loss was **2.4247** (perplexity **11.2990**). External
116
+ evaluation used lm-eval 0.4.9, BF16, maximum context 2,048, and fixed seeds.
117
+
118
+ | Task | Shots | Metric | Score |
119
+ |---|---:|---|---:|
120
+ | ARC-Challenge | 0 | acc_norm | 33.62% |
121
+ | ARC-Easy | 0 | acc_norm | 64.14% |
122
+ | HellaSwag | 0 | acc_norm | 45.13% |
123
+ | OpenBookQA | 0 | acc_norm | 35.00% |
124
+ | PIQA | 0 | acc_norm | 69.59% |
125
+ | WinoGrande | 0 | acc | 52.17% |
126
+ | BoolQ | 0 | acc | 59.17% |
127
+ | LAMBADA OpenAI | 0 | acc | 46.26% |
128
+ | TruthfulQA MC2 | 0 | acc | 36.91% |
129
+ | MMLU | 5 | acc | 25.31% |
130
+ | GSM8K | 5 | flexible exact match | 1.67% |
131
+
132
+ The primary seven-task macro over HellaSwag, PIQA, WinoGrande, OpenBookQA,
133
+ ARC-Easy, ARC-Challenge, and BoolQ is **51.2601%**. Excluding BoolQ gives
134
+ **49.9411%**.
135
+
136
+ Under the same frozen seven-task protocol, this checkpoint:
137
+
138
+ - beats TinyLlama 1T by **+1.0182 percentage points**, paired task-stratified
139
+ bootstrap 95% CI **[+0.1584, +1.8860]**;
140
+ - ties TinyLlama 1.5T: +0.0910 pp, 95% CI [-0.7771, +0.9745];
141
+ - ties TinyLlama 2T: -0.3019 pp, 95% CI [-1.1978, +0.5871];
142
+ - loses to TinyLlama 2.5T: -2.6317 pp, 95% CI [-3.4891, -1.8006].
143
+
144
+ The intervals cover benchmark-item sampling uncertainty only. They do not cover
145
+ training-seed variance and are not adjusted for multiple comparisons. The full
146
+ 36-checkpoint study contains both wins and losses; it is a frozen candidate set,
147
+ not a global census or a claim of universal token-efficiency leadership.
148
+
149
+ ![Compute-efficiency frontier](https://huggingface.co/AliceYin/L20-1B-20B-Base/resolve/main/assets/efficiency-frontier-clean.png)
150
+
151
+ ## Limitations
152
+
153
+ - This base model is not instruction tuned, preference tuned, or safety tuned.
154
+ - It may hallucinate, repeat text, produce biased or harmful content, and should
155
+ not be used as a factual authority or autonomous decision maker.
156
+ - It is English-focused, has a 2,048-token context window, and is weak on
157
+ multi-step mathematics in the reported evaluation.
158
+ - MMLU 5-shot required left truncation for some examples at the 2,048-token
159
+ context limit, so that score should be interpreted with care.
160
+ - Exact deduplication and benchmark matching cannot prove the absence of all
161
+ semantic near-duplicates, paraphrases, personal information, or contamination.
162
+ - Dataset quality filters improve the input distribution but do not guarantee
163
+ correctness of every training document or model output.
164
+
165
+ ## Reproducibility and release integrity
166
+
167
+ The release contains three sharded safetensors files. Conversion verified exact
168
+ equality for all 201 tensors against the final Transformers checkpoint. The
169
+ release manifest records file hashes, source checkpoint hash, parameter count,
170
+ and storage dtype. Training code, compact receipts, derived metrics, confidence
171
+ intervals, and plotting scripts are maintained in the accompanying private
172
+ GitHub evidence repository.