eventvoid commited on
Commit
3d88344
·
0 Parent(s):

backtalk-80m

Browse files
.gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Yeskendir Temiralinov
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
README.md ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: en
3
+ license: mit
4
+ library_name: transformers
5
+ pipeline_tag: text-generation
6
+ tags: [text-generation, reversed-text, code, small-model, trained-from-scratch]
7
+ ---
8
+
9
+ # backtalk-80m
10
+
11
+ **A language model that reads and writes English backwards.** Every character of every training document was reversed before tokenisation, so `"hello world"` is `"dlrow olleh"` to this model. 81.5M parameters, trained from scratch on 5.73B reversed tokens.
12
+
13
+ > **An experiment, not a product.** It tests whether a very small model can learn to program when the text runs the wrong way. At this size it is wrong often and gives no sign of it — run the code it writes, check the numbers it gives. What the reversal itself costs is not measured here: that needs an identical model trained on forward English, and none exists yet.
14
+
15
+ ## Results
16
+
17
+ Executed, never judged by a model. Temperature 0.6, 3 samples per task; pass@1 is the mean over all samples, pass@3 is best-of-3. Intervals are Wilson 95%; the suites are small.
18
+
19
+ | Python | valid syntax | defines the function | pass@1 | pass@3 |
20
+ |---|---:|---:|---:|---:|
21
+ | harder suite, 8 tasks | 100% | 83% | **25%** (6/24, 95% CI 12–45%) | 50% |
22
+ | harder suite, reasoning forced | 71% | 67% | **17%** (4/24, 95% CI 7–36%) | 50% |
23
+ | easy suite, 15 tasks | 96% | 89% | **42%** (19/45, 95% CI 29–57%) | 67% |
24
+ | base model, no instruction tuning | 0% | 0% | **0%** (0/45, 95% CI 0–8%) | 0% |
25
+
26
+ Eight of the fifteen easy tasks have their function name in the training data and the model solves those twice as often, so the harder suite is the one to read.
27
+
28
+ | | |
29
+ |---|---|
30
+ | addition, problems held out of training | 69.4% (111/160, CI 62–76%), greedy |
31
+ | by operand width | 1 digit 97.5% 2 digit 87.5% 3 digit 57.5% 4 digit 35.0% |
32
+ | C++, 10 tasks compiled and run | 33% compile · pass@1 7% (2/30, CI 2–21%) |
33
+ | fixed questions about what it is and cannot know | 11/11 |
34
+
35
+ ## Running it
36
+
37
+ ```python
38
+ from transformers import AutoModelForCausalLM, AutoTokenizer
39
+
40
+ name = "eventvoid/backtalk-80m"
41
+ tok = AutoTokenizer.from_pretrained(name)
42
+ model = AutoModelForCausalLM.from_pretrained(name)
43
+
44
+ ids = tok.apply_chat_template([{"role": "user", "content": "Write a Python function that reverses a list."}],
45
+ add_generation_prompt=True, enable_thinking=False,
46
+ return_tensors="pt")
47
+ out = model.generate(ids, max_new_tokens=400, repetition_penalty=1.1)
48
+ print(tok.decode(out[0][ids.shape[1]:], skip_special_tokens=True)[::-1])
49
+ ```
50
+
51
+ The chat template reverses your text on the way in; the `[::-1]` turns the answer back round on the way out. That is the only thing to remember.
52
+
53
+ - Give it 400+ tokens: hitting the limit removes the **start** of the answer, not the end.
54
+ - Use a repetition penalty of 1.05–1.15.
55
+ - `enable_thinking=False` asks for a direct answer, which is the mode to use: reasoning costs about 8 points of pass@1 on both Python suites and changes nothing on arithmetic. Drop it to let the model choose.
56
+ - The inference widget on this page will not work: the model expects reversed input.
57
+
58
+ ## Examples
59
+
60
+ One sample each, not selected from several.
61
+
62
+ **Hi** — Hi! I'm BackTalk. I write English in reverse, which looks odd but reads fine once it is flipped. What do you need?
63
+
64
+ **What is a fly?** — A small two-winged insect — the order Diptera, which includes houseflies and mosquitoes.
65
+
66
+ **Who are you?** — My name is BackTalk. I'm a small open-source language model — 81.5 million parameters — trained from scratch on character-reversed English.
67
+
68
+ **What's my cat's name?** — I don't know — you haven't told me. Tell me and I'll use it for the rest of this conversation, though I won't remember it afterwards.
69
+
70
+ **Can you browse the internet?** — No, I can't. No network, no search, no tools. If you need something current, I'm the wrong thing to ask.
71
+
72
+ ## Model
73
+
74
+ | | |
75
+ |---|---|
76
+ | shape | 20 layers · d_model 512 · 8 heads / 2 KV (GQA) · SwiGLU · RoPE · 2048 context |
77
+ | tokenizer | 49,152 byte-level BPE, trained on reversed English |
78
+ | pretraining | 5.73B tokens · 21,855 steps · val loss 1.7339 (reversed text, own tokenizer — not comparable across models) |
79
+ | instruction tuning | 1.23B tokens |
80
+ | data | public English web, code and mathematics corpora, plus synthetic instruction data |
81
+
82
+ Trained from scratch, not fine-tuned from any existing checkpoint.
83
+
84
+ ## Limitations
85
+
86
+ English only. 2048-token context. C++ barely works, and explanations longer than a few sentences fall apart. No safety tuning of any kind.
87
+
88
+ ## Licence
89
+
90
+ MIT — see [LICENSE](https://huggingface.co/eventvoid/backtalk-80m/blob/main/LICENSE).
91
+
92
+ ## Support
93
+
94
+ This is built by one person, and the limit is compute rather than ideas. Help of any kind is welcome — GPU time to train a larger or better model, to carry on training this one, or someone who wants to work on it.
95
+
96
+ The single most useful run would be the control: this same recipe on ordinary forward English, which is what would turn "the reversal costs little" from a guess into a number.
97
+
98
+ Questions and offers: the **Discussions** tab on this page.
config.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "LlamaForCausalLM"
4
+ ],
5
+ "model_type": "llama",
6
+ "hidden_size": 512,
7
+ "intermediate_size": 1408,
8
+ "num_hidden_layers": 20,
9
+ "num_attention_heads": 8,
10
+ "num_key_value_heads": 2,
11
+ "head_dim": 64,
12
+ "max_position_embeddings": 2048,
13
+ "rope_theta": 100000.0,
14
+ "rope_scaling": null,
15
+ "rms_norm_eps": 1e-05,
16
+ "vocab_size": 49152,
17
+ "tie_word_embeddings": true,
18
+ "hidden_act": "silu",
19
+ "attention_bias": false,
20
+ "mlp_bias": false,
21
+ "bos_token_id": 1,
22
+ "eos_token_id": 5,
23
+ "pad_token_id": 0,
24
+ "torch_dtype": "float16",
25
+ "transformers_version": "4.57.0"
26
+ }
generation_config.json ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 1,
3
+ "eos_token_id": 5,
4
+ "pad_token_id": 0,
5
+ "max_new_tokens": 400,
6
+ "temperature": 0.7,
7
+ "top_k": 40,
8
+ "repetition_penalty": 1.1,
9
+ "do_sample": true,
10
+ "transformers_version": "4.57.0"
11
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ed538bf627894ca070615cbfa9c22926809afa9e47efb9f0d17b58bda57e0a1a
3
+ size 163115688
special_tokens_map.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<|bos|>",
3
+ "eos_token": "<|eos|>",
4
+ "pad_token": "<|pad|>",
5
+ "unk_token": "<|unk|>",
6
+ "additional_special_tokens": [
7
+ "<|im_start|>",
8
+ "<|im_end|>",
9
+ "<|system|>",
10
+ "<|user|>",
11
+ "<|assistant|>",
12
+ "<|tool|>",
13
+ "<|tool_call|>",
14
+ "<|tool_result|>",
15
+ "<think>",
16
+ "</think>",
17
+ "<|reserved_2|>",
18
+ "<|reserved_3|>"
19
+ ]
20
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<|bos|>",
3
+ "clean_up_tokenization_spaces": false,
4
+ "eos_token": "<|eos|>",
5
+ "model_max_length": 2048,
6
+ "pad_token": "<|pad|>",
7
+ "tokenizer_class": "PreTrainedTokenizerFast",
8
+ "unk_token": "<|unk|>",
9
+ "chat_template": "{% for m in messages %}<|im_start|>{% if m['role'] == 'user' %}<|user|>{% elif m['role'] == 'assistant' %}<|assistant|>{% elif m['role'] == 'system' %}<|system|>{% else %}<|tool|>{% endif %}{{ m['content'] | reverse | join('') }}<|im_end|>{% endfor %}{% if add_generation_prompt %}<|im_start|><|assistant|>{% if enable_thinking is defined and not enable_thinking %}<think></think>{% endif %}{% endif %}"
10
+ }