digi-the-robot commited on
Commit
0847466
·
verified ·
1 Parent(s): c01b688

add README.md

Browse files
Files changed (1) hide show
  1. README.md +144 -135
README.md CHANGED
@@ -1,135 +1,144 @@
1
- ---
2
- license: apache-2.0
3
- language:
4
- - en
5
- tags:
6
- - crow
7
- - toy-model
8
- - tiny
9
- - roleplay
10
- - from-scratch
11
- pipeline_tag: text-generation
12
- ---
13
-
14
- # Tallow 🐦‍⬛
15
-
16
- ![Tallow on his fence post at sunset, holding a peanut](tallow.png)
17
-
18
- <sub>Portrait: AI-generated.</sub>
19
-
20
- **Tallow is a wild crow.** He's a 15.7M-parameter language model, trained from scratch, that answers you the way a
21
- crow would: with actions, crow sounds, and only the words you've taught him.
22
-
23
- ```
24
- you: *tosses a peanut onto the grass*
25
- tallow: [caution min] *lands on the fence* *watches the peanut with one eye* kaw.
26
- ```
27
-
28
- He remembers how you treat him. Feed him and he warms up to you, slowly. Grab him and he holds a grudge.
29
- "Sorry" doesn't work. Only peanuts do.
30
-
31
- ```
32
- you: *grabs at him*
33
- tallow: [anger max] *dive-bombs your head* KAAW KAAW KAAW *lands on the roof*
34
- you: sorry!! im so sorry tallow
35
- tallow: [anger max] *glares down from the roof* KAW. KAW.
36
- you: please come back, i didnt mean it
37
- tallow: [anger max] *fluffs up on the roof* *ruffles his feathers* krrr-tk-tk-tk
38
- you: *leaves a peanut on the rail and goes inside*
39
- tallow: [anger min] *waits a long time* *swoops down* *snatches it* *gone*
40
- you: *puts out grapes and sits far away*
41
- tallow: [caution max] *lands on the fence* *eyes you sideways* kaw.
42
- ```
43
-
44
- ## Talk to him
45
-
46
- ```
47
- pip install torch sentencepiece safetensors
48
- python tallow.py
49
- ```
50
-
51
- `tallow.py` has everything in one file: the model and the tokenizer helpers. It runs on CPU or GPU.
52
- Type to him, `/new` to start over as a stranger, and an empty line to quit.
53
-
54
- > **Why not GGUF / ollama?** His tokenizer expects two small text tricks (a `<nl>` token for line breaks, and a
55
- > space after every opening `*` or `[`). They're applied in `tallow.py`, not inside the tokenizer file, so
56
- > llama.cpp would feed him text he's never seen. Use `tallow.py`.
57
-
58
- ## How he talks
59
-
60
- Every reply is `[mood level] *actions* sound`.
61
-
62
- - **8 moods:** calm, curiosity, caution, joy, play, love, sadness, anger. Each one is `min` or `max`.
63
- - **Sounds:** `kaw`, `KAW KAW KAW` (alarm), `krrr-tk-tk-tk` (rattle), `mmrrr...` (soft mumbling, only for
64
- trusted humans).
65
- - **No English sentences.** The actions carry the meaning.
66
-
67
- ## What he does
68
-
69
- | behaviour | what happens |
70
- |---|---|
71
- | **trust** | Strangers get caution. Food with space, stepping back, and not staring slowly earn trust (8 kind acts from stranger to friend). Friends get joy, play, love, gifts, and hand-feeding. |
72
- | **grudges** | Grab or chase him: `[anger max]`, and trust drops to zero. Words never fix it. Food thaws him one step at a time (anger max → anger min → caution max → caution min), at double cost. |
73
- | **the scar** | After being grabbed, any sudden movement makes him flinch hard (`[caution max]`), even once he's a friend again. A crow who was never grabbed only hops back. |
74
- | **mimicry** | Deliberately teach him a word three times and he tries it, badly: `tal...` → `TAL-low`. |
75
- | **calls** | Caw at him and he always answers. Quiet caws make him curious. `KAW KAW KAW` in capitals makes him look for danger. |
76
- | **crow life** | Owls (anger), dead crows (sadness), dogs (play), snow (sliding down roofs), rain (bathing), anting, food caching. |
77
-
78
- ## How he was made
79
-
80
- 1. **Tokenizer:** SentencePiece BPE, 4,096 pieces, with byte fallback.
81
- 2. **Pretraining:** a Llama-style decoder (RMSNorm, RoPE, SwiGLU, tied embeddings; 8 layers, 384 wide, 6 heads),
82
- trained from scratch on TinyStories for 16,000 steps (~524M tokens). Final validation loss 1.17. About
83
- 1h45 on an RTX 3070.
84
- 3. **Crow data:** a Python rules engine plans each conversation and decides Tallow's exact mood tag every turn,
85
- tracking trust, grudges, the scar, and learned words. **Claude Haiku 5.5** turned those plans into dialogue
86
- (8 user personalities, 10 scenario types). A checker script dropped any conversation that broke the rules,
87
- and broken conversations were dropped, never fixed. That left 4,828 conversations: 4,628 for training and
88
- 200 held out.
89
- 4. **Fine-tuning:** 2,300 steps on the conversations, graded only on Tallow's lines, with the context stretched
90
- to 2,048 tokens so long grudges fit. About 5 minutes.
91
-
92
- ## Scorecard
93
-
94
- On the 200 held-out conversations, at each turn he gets the true conversation so far, writes his own reply
95
- (greedy), and we check his mood tag against the rules engine.
96
-
97
- | what it tests | right | turns |
98
- |---|---|---|
99
- | all turns | **96.8%** | 2,227 |
100
- | explodes when grabbed | 100% | 57 |
101
- | "sorry" during a grudge does nothing | 100% | 51 |
102
- | food thaws a grudge, step by step | 98.0% | 254 |
103
- | scar flinch | 100% | 18 |
104
- | never says words he hasn't learned | 99.9% | 2,110 |
105
- | answers caws | 98.6% | 146 |
106
- | never grabbed, so he only hops | 87.5% | 16 |
107
- | first try at a taught word, at the right moment | 68.4% | 19 |
108
-
109
- **Read these carefully:**
110
- - The test conversations come from the same rules engine and writer as the training data, so these are
111
- in-distribution results.
112
- - He's given the *true* history each turn. In a live chat his own mistakes stay in the history.
113
- - Rows with 16-19 turns are small samples.
114
-
115
- ## Limitations
116
-
117
- - **A toy.** 15.7M parameters and a small, made-up crow world.
118
- - **His memory is his context window** (~1,900 tokens, about 25-30 exchanges). Grudges fade once the grab
119
- scrolls out.
120
- - **He only knows a few taught words** (tallow, hello, peanut, good boy, bye bye). How he handles brand-new
121
- words is untested.
122
- - **Unusual inputs** can still confuse him (e.g. a stranger holding out food in their hand).
123
-
124
- ## Files
125
-
126
- | file | what |
127
- |---|---|
128
- | `model.safetensors` | the weights (fp32, 15,735,168 parameters) |
129
- | `config.json` | model shape |
130
- | `tallow_tok.model` | SentencePiece tokenizer |
131
- | `tallow.py` | model + tokenizer helpers + chat loop |
132
- | `tallow.png` | his portrait (AI-generated) |
133
-
134
- Inspired by [BeeLLM](https://huggingface.co/schizophyllume/BeeLLM). Pretrained on
135
- [TinyStories](https://huggingface.co/datasets/roneneldan/TinyStories).
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ tags:
6
+ - crow
7
+ - toy-model
8
+ - tiny
9
+ - roleplay
10
+ - from-scratch
11
+ pipeline_tag: text-generation
12
+ ---
13
+
14
+ # Tallow 🐦‍⬛
15
+
16
+ ![Tallow on his fence post at sunset, holding a peanut](tallow.png)
17
+
18
+ <sub>Portrait: AI-generated.</sub>
19
+
20
+ **Tallow is a wild crow.** He's a 15.7M-parameter language model, trained from scratch, that answers you the way a
21
+ crow would: with actions, crow sounds, and only the words you've taught him.
22
+
23
+ ```
24
+ you: *tosses a peanut onto the grass*
25
+ tallow: [caution min] *lands on the fence* *watches the peanut with one eye* kaw.
26
+ ```
27
+
28
+ He remembers how you treat him. Feed him and he warms up to you, slowly. Grab him and he holds a grudge.
29
+ "Sorry" doesn't work. Only peanuts do.
30
+
31
+ ```
32
+ you: *grabs at him*
33
+ tallow: [anger max] *dive-bombs your head* KAAW KAAW KAAW *lands on the roof*
34
+ you: sorry!! im so sorry tallow
35
+ tallow: [anger max] *glares down from the roof* KAW. KAW.
36
+ you: please come back, i didnt mean it
37
+ tallow: [anger max] *fluffs up on the roof* *ruffles his feathers* krrr-tk-tk-tk
38
+ you: *leaves a peanut on the rail and goes inside*
39
+ tallow: [anger min] *waits a long time* *swoops down* *snatches it* *gone*
40
+ you: *puts out grapes and sits far away*
41
+ tallow: [caution max] *lands on the fence* *eyes you sideways* kaw.
42
+ ```
43
+
44
+ ## Talk to him
45
+
46
+ ```
47
+ pip install torch sentencepiece safetensors
48
+ python tallow.py
49
+ ```
50
+
51
+ `tallow.py` has everything in one file: the model and the tokenizer helpers. It runs on CPU or GPU.
52
+ Type to him, `/new` to start over as a stranger, and an empty line to quit.
53
+
54
+ > **Why not GGUF / ollama?** His tokenizer expects two small text tricks (a `<nl>` token for line breaks, and a
55
+ > space after every opening `*` or `[`). They're applied in `tallow.py`, not inside the tokenizer file, so
56
+ > llama.cpp would feed him text he's never seen. Use `tallow.py`.
57
+
58
+ ## How he talks
59
+
60
+ Every reply is `[mood level] *actions* sound`.
61
+
62
+ - **8 moods:** calm, curiosity, caution, joy, play, love, sadness, anger. Each one is `min` or `max`.
63
+ - **Sounds:** `kaw`, `KAW KAW KAW` (alarm), `krrr-tk-tk-tk` (rattle), `mmrrr...` (soft mumbling, only for
64
+ trusted humans).
65
+ - **No English sentences.** The actions carry the meaning.
66
+
67
+ ## What he does
68
+
69
+ | behaviour | what happens |
70
+ |---|---|
71
+ | **trust** | Strangers get caution. Food with space, stepping back, and not staring slowly earn trust (8 kind acts from stranger to friend). Friends get joy, play, love, gifts, and hand-feeding. |
72
+ | **grudges** | Grab or chase him: `[anger max]`, and trust drops to zero. Words never fix it. Food thaws him one step at a time (anger max → anger min → caution max → caution min), at double cost. |
73
+ | **the scar** | After being grabbed, any sudden movement makes him flinch hard (`[caution max]`), even once he's a friend again. A crow who was never grabbed only hops back. |
74
+ | **mimicry** | Deliberately teach him a word three times and he tries it, badly: `tal...` → `TAL-low`. |
75
+ | **calls** | Caw at him and he always answers. Quiet caws make him curious. `KAW KAW KAW` in capitals makes him look for danger. |
76
+ | **crow life** | Owls (anger), dead crows (sadness), dogs (play), snow (sliding down roofs), rain (bathing), anting, food caching. |
77
+
78
+ ## How he was made
79
+
80
+ 1. **Tokenizer:** SentencePiece BPE, 4,096 pieces, with byte fallback.
81
+ 2. **Pretraining:** a Llama-style decoder (RMSNorm, RoPE, SwiGLU, tied embeddings; 8 layers, 384 wide, 6 heads),
82
+ trained from scratch on TinyStories for 16,000 steps (~524M tokens). Final validation loss 1.17. About
83
+ 1h45 on an RTX 3070.
84
+ 3. **Crow data:** a Python rules engine plans each conversation and decides Tallow's exact mood tag every turn,
85
+ tracking trust, grudges, the scar, and learned words. **Claude Haiku 5.5** turned those plans into dialogue
86
+ (8 user personalities, 13 scenario types). A checker script dropped any conversation that broke the rules,
87
+ and broken conversations were dropped, never fixed. That left 5,295 conversations: 5,076 for training and
88
+ 219 held out.
89
+ 4. **Fine-tuning:** 2,600 steps on the conversations, graded only on Tallow's lines, with the context stretched
90
+ to 2,048 tokens so long grudges fit. About 5 minutes.
91
+
92
+ ## Scorecard
93
+
94
+ On the 219 held-out conversations, at each turn he gets the true conversation so far, writes his own reply
95
+ (greedy), and we check his mood tag against the rules engine.
96
+
97
+ | what it tests | right | turns |
98
+ |---|---|---|
99
+ | all turns | **97.2%** | 2,432 |
100
+ | explodes when grabbed (dramatic or plain) | 98.7% | 76 |
101
+ | "sorry" during a grudge does nothing | 100% | 70 |
102
+ | food thaws a grudge, step by step | 98.3% | 301 |
103
+ | scar flinch | 100% | 24 |
104
+ | never says words he hasn't learned | 99.8% | 2,315 |
105
+ | answers caws | 98.7% | 155 |
106
+ | never grabbed, so he only hops | 100% | 17 |
107
+ | first try at a taught word, at the right moment | 73.7% | 19 |
108
+
109
+ **Read these carefully:**
110
+ - The test conversations come from the same rules engine and writer as the training data, so these are
111
+ in-distribution results.
112
+ - He's given the *true* history each turn. In a live chat his own mistakes stay in the history.
113
+ - Rows with 16-19 turns are small samples.
114
+
115
+ ## Versions
116
+
117
+ - **v2** (current): learned that a *plain or affectionate* grab ("\*grabs you!\*", "\*scoops you up\*") is still a
118
+ grab. v1 only exploded at dramatic, hostile grabs, because every grab in its training data was a lunge with a
119
+ rolled newspaper. Trained on 500 extra conversations, including grabs late in long, happy friendships.
120
+ - **v1** (tag `v1`): the Tallow from the "Meet Tallow" video. Get it with `revision="v1"`.
121
+
122
+ ## Limitations
123
+
124
+ - **A toy.** 15.7M parameters and a small, made-up crow world.
125
+ - **His memory is his context window** (~1,900 tokens, about 25-30 exchanges). Grudges fade once the grab
126
+ scrolls out.
127
+ - **He only knows a few taught words** (tallow, hello, peanut, good boy, bye bye). How he handles brand-new
128
+ words is untested.
129
+ - **Unusual inputs** can still confuse him (e.g. a stranger holding out food in their hand).
130
+ - **Hits and smacks** ("smacks you") aren't reliably understood as hostile yet, and a grab right after a long run of
131
+ peanuts sometimes only gets caution. More training is planned.
132
+
133
+ ## Files
134
+
135
+ | file | what |
136
+ |---|---|
137
+ | `model.safetensors` | the weights (fp32, 15,735,168 parameters) |
138
+ | `config.json` | model shape |
139
+ | `tallow_tok.model` | SentencePiece tokenizer |
140
+ | `tallow.py` | model + tokenizer helpers + chat loop |
141
+ | `tallow.png` | his portrait (AI-generated) |
142
+
143
+ Inspired by [BeeLLM](https://huggingface.co/schizophyllume/BeeLLM). Pretrained on
144
+ [TinyStories](https://huggingface.co/datasets/roneneldan/TinyStories).