Icold commited on
Commit
b52b8b3
·
verified ·
1 Parent(s): 68bb1cd

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +77 -77
README.md CHANGED
@@ -1,77 +1,77 @@
1
- ---
2
- language:
3
- - en
4
- - ru
5
- license: mit
6
- library_name: pytorch
7
- pipeline_tag: text-generation
8
- tags:
9
- - language-model
10
- - kronecker
11
- - small-language-model
12
- - bilingual
13
- - parameter-efficiency
14
- ---
15
-
16
- # KronLLM
17
-
18
- A compact bilingual (English/Russian) language model whose matrix layers are
19
- built entirely from **Kronecker sums of rank-1 factors**. Every attention and
20
- FFN projection is a composition of `L` factors instead of a dense `d × d`
21
- weight: a layer that would need 102,400 numbers needs 15,753.
22
-
23
- This repository hosts the model card, the code and the shipped int8
24
- checkpoints. The training corpus is separate: see
25
- [Icold21/kron-corpus](https://huggingface.co/datasets/Icold21/kron-corpus) and
26
- the research log at [github.com/Icold21/kron-llm](https://github.com/Icold21/kron-llm).
27
-
28
- ## Shipped checkpoints
29
-
30
- | file | parameters | size | quality |
31
- |---|---:|---:|---|
32
- | `q8g_int8.pt` | 2,851,280 | 3.14 MB | **0.7542 bits/byte** (TinyStories val, 61.4M tokens seen) |
33
- | `q2_int8.pt` | 2,079,992 | 2.34 MB | previous model, same corpus |
34
-
35
- Int8 quantisation costs +0.0003 bpb on Q8g. The fp32 checkpoint is 11.4 MB and
36
- is not shipped.
37
-
38
- ## Usage
39
-
40
- ```python
41
- import torch
42
- from kronllm.model import KronTransformer
43
- from kronllm.quantization import load_int8
44
-
45
- ckpt = torch.load("q8g_int8.pt", map_location="cpu")
46
- model = KronTransformer(ckpt["cfg"]).eval()
47
- load_int8(model, ckpt["model"])
48
- ```
49
-
50
- The model is a research artifact: it writes short English and Russian text and
51
- is not an instruct-tuned assistant.
52
-
53
- ## Architecture at a glance
54
-
55
- | | |
56
- |---|---|
57
- | layers / width | 24 / 320, 8 heads, seq 192 |
58
- | composition | product over L=4 factors, K=6 terms, depth carry `K_win=2` |
59
- | FFN | gated (SwiGLU-style) |
60
- | tokenizer | BPE-4096, tied factorised embedding (rank 128) |
61
-
62
- Measured, not assumed: the depth carry is worth 1.1 % bpb, freezing its scalar
63
- 0.8 %, and widening the window to four layers *costs* 1.4 %. Details in the
64
- [research log](https://github.com/Icold21/kron-llm/blob/main/docs/results.md).
65
-
66
- ## Next
67
-
68
- The 10M model (Q10: d=512, 25 layers, K=10, 9,938,886 parameters) trains on
69
- [KronCorpus](https://huggingface.co/datasets/Icold/kron-corpus) — 2B tokens of
70
- bilingual English/Russian text with a science accent — on two Kaggle T4s. The
71
- checkpoint will appear here when the first epoch finishes; the corpus card
72
- documents every source and licence.
73
-
74
- ## Licence
75
-
76
- Code and weights: MIT. The corpus keeps its sources' licences (see the dataset
77
- card).
 
1
+ ---
2
+ language:
3
+ - en
4
+ - ru
5
+ license: mit
6
+ library_name: pytorch
7
+ pipeline_tag: text-generation
8
+ tags:
9
+ - language-model
10
+ - kronecker
11
+ - small-language-model
12
+ - bilingual
13
+ - parameter-efficiency
14
+ ---
15
+
16
+ # KronLLM
17
+
18
+ A compact bilingual (English/Russian) language model whose matrix layers are
19
+ built entirely from **Kronecker sums of rank-1 factors**. Every attention and
20
+ FFN projection is a composition of `L` factors instead of a dense `d × d`
21
+ weight: a layer that would need 102,400 numbers needs 15,753.
22
+
23
+ This repository hosts the model card, the code and the shipped int8
24
+ checkpoints. The training corpus is separate: see
25
+ [Icold21/kron-corpus](https://huggingface.co/datasets/Icold21/kron-corpus) and
26
+ the research log at [github.com/Icold21/kron-llm](https://github.com/Icold21/kron-llm).
27
+
28
+ ## Shipped checkpoints
29
+
30
+ | file | parameters | size | quality |
31
+ |---|---:|---:|---|
32
+ | `q8g_int8.pt` | 2,851,280 | 3.14 MB | **0.7542 bits/byte** (TinyStories val, 61.4M tokens seen) |
33
+ | `q2_int8.pt` | 2,079,992 | 2.34 MB | previous model, same corpus |
34
+
35
+ Int8 quantisation costs +0.0003 bpb on Q8g. The fp32 checkpoint is 11.4 MB and
36
+ is not shipped.
37
+
38
+ ## Usage
39
+
40
+ ```python
41
+ import torch
42
+ from kronllm.model import KronTransformer
43
+ from kronllm.quantization import load_int8
44
+
45
+ ckpt = torch.load("q8g_int8.pt", map_location="cpu")
46
+ model = KronTransformer(ckpt["cfg"]).eval()
47
+ load_int8(model, ckpt["model"])
48
+ ```
49
+
50
+ The model is a research artifact: it writes short English and Russian text and
51
+ is not an instruct-tuned assistant.
52
+
53
+ ## Architecture at a glance
54
+
55
+ | | |
56
+ |---|---|
57
+ | layers / width | 24 / 320, 8 heads, seq 192 |
58
+ | composition | product over L=4 factors, K=6 terms, depth carry `K_win=2` |
59
+ | FFN | gated (SwiGLU-style) |
60
+ | tokenizer | BPE-4096, tied factorised embedding (rank 128) |
61
+
62
+ Measured, not assumed: the depth carry is worth 1.1 % bpb, freezing its scalar
63
+ 0.8 %, and widening the window to four layers *costs* 1.4 %. Details in the
64
+ [research log](https://github.com/Icold21/kron-llm/blob/main/docs/results.md).
65
+
66
+ ## Next
67
+
68
+ The 10M model (Q10: d=512, 25 layers, K=10, 9,938,886 parameters) trains on
69
+ [KronCorpus](https://huggingface.co/datasets/Icold/kron-corpus) — 1.6B tokens of
70
+ bilingual English/Russian text with a science accent — on two Kaggle T4s. The
71
+ checkpoint will appear here when the first epoch finishes; the corpus card
72
+ documents every source and licence.
73
+
74
+ ## Licence
75
+
76
+ Code and weights: MIT. The corpus keeps its sources' licences (see the dataset
77
+ card).