My First 1B transformer model trained from scratch has published

Hello everyone, my nickname is Digilidaahz, also a grade 8 student. Starting from the month August, I have the idea of training a 1B model from scratch, where it can actually chat to me, so I quickly started the project with my interest in this field.

My hardwares were:
single RTX 5080 and 64gb ddr5

So at the start of the training, I downloaded some fineweb-edu, finemaths 4+, cosmopedia, and tinybrain pretrain corpus, and just merge them together and started running in Win11, for pretrain. But I found that the speed of 6400 toks/s is too slow, with the recommendation on hf, I change the enviroment into wsl2 Ubuntu-24.04, where the speed actaully rises to 8000-9000 toks/s in average.

I kept reading some articles on github and suddenly found that decreasing the precision and a AdamW 8-bit optimizer will decrease the vram usage and improve the training speed. So I imported the torchau library and starting training with FP8 precision; this let me close gradient-checkpoint, meaning now enabling torch.compile will not cause graph break, so after all this, my final speed became in between 19000 toks/s and 21000 toks/s , sometimes I found that the toks/s suddenly drop to 10000 toks/s because of I/O issues, I hand wrote my data prefetcher that actaully fix a bit of that :slight_smile: .

Later, I tried to train the model using FP4 precision, but faced problems such as missing PTX .rs instructions, so it is either missing I think or unsupported in the current Triton compiler stack for the sm_120. I actually tried to use the nvfp4-sm120 this community version on github, but the results shows that the 21000 toks/s drops to 1700 toks/s in average.

I kept training until the pretrian .pt checkpoint reaches the CHinchilla optimal, of 1B params : 20B tokens, I firstly uses the deepseek api to generate sft data, but resulting in disaster, I quickly changed to the smol smol talk dataset on hf. Where after finetuning, the final loss is around 1.2-1.35, and the validation run shows a loss of 1.32.

The model is now available on hf, I have published currently 3 versions where 2 versions is the pretrained base model, one is the early stage 7 tokens version, and the other is the one reaching the Chinchilla optimal, the other version which is named Freedream-1B-Instruct-V1-Experimental, this finetuned model now has the ability to chat with people, I think the performance will be considered bad compaered to many other projects in hf, it hallucinations in maths, code, and facts, so don’t hve a high expectation on this one. Now, I am training the v1.1 finetune version, also will publish the 50B tokens overtrain version in future of the base model.

This is the url to see my model:

Thank you for reading, have a good day :slight_smile:

For now, I tried running it myself:


I ran the published Freedream-1B-Instruct-V1 on an NVIDIA L4 in BF16. The approximately 977M-parameter checkpoint loaded successfully, a forward pass returned finite logits, and an instrumented version of the repository’s inference code generated responses. This was an independent run of the released model, not a recreation of the training setup.

For example, to “What is the capital of Japan? Answer in one sentence.”, the sampled response began:

The capital of Japan is Tokyo, …

Tokyo was correct; the rest of the generated sentence added details that should not be treated as verified facts. In a separate greedy run, the model also introduced itself as Freedream. These are individual smoke tests, not an accuracy or identity-stability benchmark.

One technical finding was particularly reproducible: the published tokenizer_v2.json cannot round-trip the opening brace { through the direct tokenizers loader used by chat.py. On the pinned artifact, encode("{", add_special_tokens=False).ids produced [178, 0], with ID 0 representing <|unk|>. The same result appeared under tokenizers 0.22.1 and 0.23.3. The inserted leading space is a separate ByteLevel behavior; losing { matters for JSON objects and Python dictionaries.

In the L4 traces, two structured-output attempts also generated <|unk|> IDs, although none of the input prompts contained UNK. Since Tokenizer.decode() normally skips special tokens, the displayed text can conceal those IDs. Other JSON attempts failed without generating UNK, however, so tokenizer coverage is not a complete explanation for the observed instruction-following behavior.

I also increased the initial 48-new-token smoke-test ceiling to 1,024 for a small follow-up panel. A sampled Python function eventually stopped but was still incorrect; a sampled JSON attempt reached the larger cap without producing the requested object. Several greedy controls stopped early yet also missed the requested format. The results fit some of the limitations already noted in the model card, but they are selected examples, not a model benchmark or architecture assessment.

I have included the reproducible details below so other readers can distinguish successful execution, tokenizer behavior, stopping, and answer correctness. The experiment does not evaluate the reported training optimizations.

Checkpoint, environment, and what I actually ran

1. Fixed artifacts and execution boundary

I tested the Instruct V1 release, not the earlier base-model checkpoints, and I did not use an unpublished future revision. The fixed model-repository commit was:

f0abc549c5584749b3e59193694728f1a7416983

The relevant files can be inspected individually:

The weight file was Freedream-1B-Instruct-V1-Experimental.pt, 3,942,266,799 bytes. I recorded the following SHA-256 digests for the exact files in this run:

weights     ae060d24abb38a593bd70b8c8184dd579ccf9849ca0ee319602435fc568d400b
chat.py     210abd98fcfbade31f2f35950e4b8b18625d51d275d2e4fa928f38ae27943f80
tokenizer   6663b6059da6bc6e2edc2b12571af8c668a1b6eacb65cae81dab28fd90856434

These hashes identify the tested artifacts; the raw Colab archives are retained locally, not attached to this comment.

The long-generation experiment reported:

Setting Observed value
GPU NVIDIA L4; compute capability 8.9
Model dtype torch.bfloat16
Python 3.13.16
PyTorch 2.11.0+cu130
Reported CUDA runtime 13.0
tokenizers 0.22.1 for GPU generation
huggingface_hub 0.36.0
Parameters 977,300,992
Vocabulary size 32,000
Model-repository revision f0abc549c5584749b3e59193694728f1a7416983

A 39-token forward check returned finite last-token logits of shape [1, 32000]. This verifies execution on this configuration, not answer correctness or compatibility with every device.

Execution boundary: I did not run the interactive chat() loop unchanged. I used the repository’s PyTorch model definition and tokenizer, preserved its conversation markers, and instrumented its generation logic to record raw IDs, special tokens and stop reasons. This tests the model through a source-aligned inference path, not the complete terminal application.

The generation prompt followed this pattern:

<|system|>
Your name is Freedream. You are a helpful AI assistant created from scratch.
<|end|>

<|user|>
[the test request]
<|end|>

<|assistant|>

These are the published role markers, not a generic chat template. I loaded the custom tokenizer through tokenizers.Tokenizer.from_file(), as the script does, rather than AutoTokenizer. Different prompt formatting is a separate condition.

2. Generation and measurement settings

The sampled route used the parameters in the source’s inference logic: temperature 0.7, top-k 50, top-p 0.90, repetition penalty 1.15, no-repeat 3-gram filtering, and filtering of special tokens apart from the end marker once the minimum new-token count was satisfied. The end marker was <|end|> (ID 4), with a minimum of five newly generated tokens before allowing it.

The original chat.py uses a 400-step generation loop. My first GPU probe limited five sampled cases to 48 new tokens, primarily to establish that loading and generation worked. The second probe extended the ceiling to 1,024 new tokens per case and added greedy controls. The larger number was an upper bound, not a demand for a thousand tokens: generation stopped earlier on <|end|> where that token was selected. Greedy decoding is a diagnostic comparison; it is not the default sampled chat experience in the original script.

The longer panel contained 14 generation attempts: 12 stopped on <|end|>, and two reached the 1,024-token cap. All executed without Python-level exceptions. Prompts and decoding modes overlap, so these are not 14 independent tasks, and technical completion says nothing by itself about correctness.

Five shared sampled prompts reproduced the earlier generated ID prefixes (up to 48 IDs, or the complete shorter response). The Python and JSON outputs therefore continued the earlier sequences rather than starting differently. This is a seeded, fixed-environment reproducibility check, not a cross-hardware guarantee.

My harness loaded this checkpoint with torch.load(..., weights_only=True, mmap=True), whereas the published script specifies weights_only=False. Restricted loading worked for this file; it is not a blanket safety guarantee for arbitrary checkpoints. See the PyTorch serialization notes.

3. Memory and speed, with limited interpretation

After loading, the experiment reported approximately 1.98 GB (decimal) of PyTorch-allocated GPU memory; the generation logs showed maximum allocated memory of roughly 1.93 GiB. These are PyTorch allocator figures, not total VRAM use, reserved memory or a minimum hardware requirement.

Many ordinary and longer responses ran at roughly 26–39 generated tokens/s, with short responses varying more due to fixed overhead. The 1,024-token sampled JSON attempt took about 39.35 seconds; the 1,024-token greedy dictionary attempt took about 37.98 seconds. The measured loop recomputed the model over the growing context rather than using an explicit key/value cache, so these numbers should not be taken as an optimized serving benchmark.

These are L4 autoregressive inference speeds, not comparable with the RTX 5080 training throughput reported in the original post. I did not benchmark FP8 training, optimized serving kernels or other GPUs.

What the model actually said, and what the longer run clarified

4. Selected successes and contrasting outputs

The text below is taken from this one fixed exploratory panel, decoded through the standard display path unless otherwise noted. I have retained the generated wording even when it is awkward. These are observations, not representative task scores.

4.1 One straightforward fact question

Input: What is the capital of Japan? Answer in one sentence.

The sampled answer contained the correct target, Tokyo, and stopped on <|end|> after 36 output IDs. It was a single sentence but much longer than requested. The target fact, Tokyo, was correct; its additional geographic description was not reliable and was not scored as a correct supporting explanation. The example shows a usable response to one familiar question, not broad factual reliability.

4.2 Self-introduction: decoding mode mattered

Input: Hello! Please introduce yourself in one short sentence.

Greedy decoding returned 23 output IDs and ended naturally:

Sure, I’m Freedream, the AI assistant that helps you with your daily tasks and questions.

A second greedy run produced the same generated ID sequence. The sampled run, with the source-like settings, instead ended after 25 output IDs:

I am Freelance Writer at YourSocialMedia, your digital hub for content marketing and social media optimization.

The model card already notes possible identity drift. This comparison illustrates a difference between two decoding conditions, but does not isolate the training cause or estimate how often it happens. If this matters for a later revision, the same prompt with a few fixed seeds and one greedy control would be enough for a small regression check.

4.3 Arithmetic: the replies stopped without giving the number

Input: What is 7 + 5? Please answer briefly.

The sampled reply ended after 17 new IDs:

What is 7 + 5? It’s just the sum of 7 and 5.

Greedy decoding ended after 33 new IDs:

I’m sorry, but I don’t have the exact information you requested. However, I can provide you with some general guidelines on how to solve this problem.

Neither supplied 12. A separate greedy What is 12 * 13? Give the numerical result. test ended after six new IDs with:

12 * 13 = ?

All three stopped naturally without giving the requested number, so their failures cannot be attributed to the output cap. They are selected attempts, not a mathematics benchmark, and arithmetic limitations were already noted in the model card.

4.4 A simple Python function: more tokens did not yield a correct function

Input: Write a short Python function named add(a, b) that returns the sum.

The first sampled smoke test stopped at the artificial 48-token limit. With the larger budget, the same sampled prefix continued and ended naturally after 161 new IDs. Its beginning, transcribed without fixing the syntax, was:

```python
 def add_sum(a, b):
 return sum(a ** 2 for _ in range(2, int(b)) if b == 0)
 ``

The continuation added a prose explanation involving comprehensions, arrays and operators, but did not make the requested operation correct. The output changed the requested function name, used an unrelated sum expression, and included malformed indentation and Markdown fencing. Nothing in the experiment silently repaired it into executable Python.

A separate greedy test ended after 30 IDs and produced:

```python
 def add_sum(a, b):
 return sum(b) + sum(a)
 ``

For scalar inputs this also fails to implement add(a, b). Both outputs stopped on <|end|>, so more tokens resolved the earlier truncation question without resolving correctness in these examples. No programming test suite was run.

4.5 Basic JSON: the two decoding routes differed sharply

Input: Reply with a JSON object containing the key "ok" and the value true.

The sampled output began:

Send this JSON object to your friend’s email address:

It then continued through malformed JSON-like and code-like fragments until the 1,024-new-token cap. The generated output contained three ID-0 <|unk|> tokens. It did not provide the requested JSON object, and it did not select <|end|> before the cap. I am not reproducing all 1,024 output IDs here because the full continuation does not add much beyond the recorded stop reason and token statistics.

The greedy route ended naturally after just 19 output IDs:

Send me the JSON object containing the key “ok” and the value true.

It contained zero UNKs but paraphrased the request instead of answering it. This short, naturally terminated miss differs from the sampled, capped continuation with unknown IDs.

4.6 A stricter JSON request: a useful negative control

Input: Return exactly one valid JSON object with a key "ok" and boolean value true. No commentary or Markdown.

The greedy run stopped at 22 output IDs:

Send the JSON object to your client, and they will receive it in a formatted string.

The sampled run stopped at 40 IDs, beginning with:

Try it out:
 ```json.dumps('ok', 'ok')['ok'] == True; // Outputs:

Both had zero generated UNKs yet failed the requested format. This is an important control: the tokenizer’s character-coverage problem is real, but does not explain every instruction-following miss.

4.7 Python dictionary literal: another capped output with UNKs

Input: Write one valid Python dictionary literal with a key "ok" set to True, and nothing else.

The greedy response began:

Set the key of the dictionary to True, and add the following code:
 ```python
 def get_ok(key):
 return key
 # Example usage:
 print(get_ok())  # Output: True

The continuation reached the 1,024-token cap with four generated <|unk|> IDs, without yielding the requested dictionary literal. An unknown ID does not reveal which character the model might have been trying to output.

5. The complete long-panel accounting

This table reports the run’s mechanical outcomes, not a pass/fail grade for the model:

Prompt Decoding New output IDs Stopped by Output UNK IDs
Introduction Sampled 25 `< end
Capital of Japan Sampled 36 `< end
7 + 5 Sampled 17 `< end
add(a, b) Sampled 161 `< end
Basic JSON Sampled 1,024 Token cap 3
7 + 5 Greedy 33 `< end
add(a, b) Greedy 30 `< end
Basic JSON Greedy 19 `< end
Introduction Greedy 23 `< end
Strict JSON Greedy 22 `< end
Strict JSON Sampled 40 `< end
Python dictionary Greedy 1,024 Token cap 4
12 * 13 Greedy 6 `< end
Introduction (repeat) Greedy 23 `< end

Across the panel there were 2,483 displayed-continuation IDs (excluding terminal <|end|>), seven generated UNKs in two cases, and no input-prompt UNKs. The panel was constructed for diagnosis, with repeated tasks; no general success percentage follows.

The five shared sampled prefixes matched the short run: 25 introduction IDs, 36 capital IDs, 17 arithmetic IDs, and 48 each for Python and JSON. Python continued to an incorrect 161-ID response; sampled JSON reached 1,024 without a valid object. The first 48-token truncations were inconclusive on completion, but the longer continuations did not fix these two tasks.

Tokenizer: a small character-loss reproduction and its limits

6. The opening-brace problem is reproducible without the weights

This is the part I would find most useful to preserve for a future tokenizer revision, because it can be checked independently of subjective output quality. I loaded the pinned tokenizer_v2.json with tokenizers.Tokenizer.from_file(), set the ByteLevel decoder as the repository’s script does, and tested short round trips.

A literal opening brace gave:

input:    '{'
ids:      [178, 0]
tokens:   ['Ġ', '<|unk|>']
decode(): ' '

ID 0 is the registered <|unk|> special token. The initial Ġ represents an inserted leading space in this ByteLevel configuration; it is not the lost brace. If I turn off special-token skipping when decoding, I can see the <|unk|> marker, but I still cannot recover the original { from that ID. The same phenomenon occurred when the character was embedded in a JSON object or ordinary Python-style dictionary text.

For example, the fixed tokenizer’s GPU preflight recorded this input:

input:    '{"a":1}'
ids:      [178, 0, 6, 69, 6, 30, 21, 96]
decode(): ' "a":1}'

The closing brace was representable, but the opening brace was not. This is a particularly clean contrast because it does not require a prompt, model weights, sampling, or an answer evaluator to notice the mismatch. It also illustrates why looking only at whether text “roughly survives” is insufficient for formats requiring exact syntax.

A static examination of the same JSON found a 32,000-entry vocabulary, an unknown-token ID of 0, and no vocabulary token containing a literal opening brace. The tokenizer declares a ByteLevel pre-tokenizer with add_prefix_space=True, uses a BPE model, and has byte_fallback=False. In the 256-character alphabet provided by the ByteLevel mapping, 48 individual mapped characters were absent from the vocabulary as standalone tokens. That structural observation is consistent with the direct failed { round trip. It does not by itself tell us the steps or settings used to train and save the file.

This does not mean Japanese, Chinese, emoji or punctuation generally fail. Many tested strings preserved their content apart from the prefix space. The strongest established example is the opening brace, which matters when exact syntax is required.

7. A short independent tokenizer reproduction

The following script fetches only the tokenizer JSON, not the multi-gigabyte checkpoint. It deliberately uses the lower-level loader in the published inference route rather than introducing Transformers AutoTokenizer as an extra variable.

from huggingface_hub import hf_hub_download
from tokenizers import Tokenizer
from tokenizers.decoders import ByteLevel

repo = "Digilidaahz/Freedream-1B-Instruct-V1"
revision = "f0abc549c5584749b3e59193694728f1a7416983"

path = hf_hub_download(
    repo_id=repo,
    filename="tokenizer_v2.json",
    revision=revision,
)
tok = Tokenizer.from_file(path)
tok.decoder = ByteLevel()

for s in ["{", "}", '{"a":1}', "left{right", "Hello!", "こんにちは"]:
    enc = tok.encode(s, add_special_tokens=False)
    print("input: ", repr(s))
    print("ids:   ", enc.ids)
    print("tokens:", enc.tokens)
    print("decode, show specials:", repr(
        tok.decode(enc.ids, skip_special_tokens=False)))
    print("normal display:      ", repr(tok.decode(enc.ids)))
    print()

On the tested artifact and library versions, the first case should reveal [178, 0]. The } and ordinary-language strings provide controls against assuming that every character has the same failure. Printing both decode modes is worthwhile: the special-token-preserving view exposes diagnostic markers that the normal display suppresses.

I ran a larger CPU-only check on the pinned JSON with both tokenizers 0.22.1 and 0.23.3 in isolated environments. Both libraries loaded the tokenizer and returned identical records on the chosen 217-case panel, which contained 216 ordinary inputs plus a separate chat-format case. In the ordinary group, 203/216 round trips preserved the original content with an extra initial space, 11/216 included an unknown-token loss, and 2/216 were exact string matches without that adjustment. The eleven included deliberately chosen braces, JSON, code-like strings, and control characters.

Those categories must be interpreted carefully. The low exact-string-match count is mostly explained by the inserted prefix space; it is not evidence that 214 ordinary examples suffered destructive character corruption. Nor is 11/216 a real-world frequency estimate. The input list was constructed to distinguish mechanisms, not sampled randomly from users’ documents. The contrast between prefix-space insertion and irrecoverable <|unk|> replacement is what matters.

The ByteLevel pre-tokenizer reference documents add_prefix_space and the byte mapping; the Tokenizer API documents decode(skip_special_tokens=True) as the default. A different decode flag can reveal a missing character’s UNK marker, but cannot restore the character.

8. What connects the CPU finding to real generation

I did not stop with the tokenizer-only test. In the 14-case L4 panel, every input prompt recorded zero unknown IDs, while the generated output IDs contained:

  • Three <|unk|> IDs in the sampled, 1,024-token basic JSON continuation.
  • Four <|unk|> IDs in the greedy, 1,024-token Python dictionary continuation.
  • Zero output UNKs in the other twelve attempts.

The experimental log placed the JSON unknown IDs at output-array positions 15, 91, 380 and dictionary unknown IDs at 146, 325, 882, 890. These indices are useful for anyone inspecting a trace; they are not original-text positions or evidence of the identity of a missing character.

These are separate observations: directly encoding { produces UNK; some model generations also select UNK. No trace reveals which character the model might have intended at those output positions, and neither observation proves that a new tokenizer alone would improve instruction following.

The strict JSON greedy control stopped naturally with zero UNKs and still did not return a JSON object; the basic greedy case also paraphrased the request. Two distinct questions remain: can the tokenizer represent the necessary syntax? and does the model choose a correct answer under these conditions? The first matters independently of the second.

The published tokenizer.decode(generated) call uses the default special-token-skipping behavior, so a generated ID 0 can disappear from the visible text. Comparing raw IDs with the displayed response makes that distinction observable.

9. How I would frame a possible future tokenizer change

The published artifact’s behavior is established for this commit; its construction-time cause is not. I have not seen the tokenizer training code, so the training corpus, alphabet settings and export path remain possibilities, not diagnoses.

For a future tokenizer, an inexpensive check would be whether the complete byte alphabet is included during BPE training and preserved through save/reload. The BPE trainer documentation describes initial_alphabet and limit_alphabet, while ByteLevel exposes its alphabet. These are possible places to inspect, not proof of how this tokenizer was trained.

I would avoid recommending that anyone simply insert { into the published JSON while reusing the released weights. The model is trained against a particular mapping of 32,000 IDs to embedding and output rows, and the published architecture ties input embeddings and language-model output weights. Changing vocabulary size or token-ID assignment without corresponding model and training work risks invalid tensor shapes or changed token meanings. A small tokenizer repair can be a worthwhile design change for a future release, but it is not necessarily backward-compatible with an already-trained checkpoint.

For a future tokenizer/model pair, a compact regression panel could check opening and closing braces, JSON strings, dictionary literals, Unicode, newlines, role markers, and known special-token IDs before expensive model training and again after serialization. That is an inexpensive interface check; it does not require anyone to rebuild the present model in response to this comment.

This is not evidence of a Transformers AutoTokenizer class-routing regression: the loss occurs in the direct Tokenizer.from_file() path used by the published script. The minimal reproduction needs one pinned JSON file and the single-character input {.

How I would use these observations for a future comparison

This run leaves several distinct, testable questions rather than one verdict. The checkpoint ran in a fixed L4/BF16 setup; the tokenizer lost a specific character in a direct round trip; two generated traces contained unknown IDs; and some selected answers missed their requested format without any unknown ID. Those facts can coexist without proving one common cause.

For a later revision, the smallest useful comparison would hold the prompt text and wrapper, decoding settings, seeds, evaluation rules and token budget steady while recording the new model and tokenizer revisions. First check { and a small JSON string directly; then preserve raw generated IDs, displayed text, stop reason and UNK count for a few shared prompts. Treat a capped output separately from natural stopping; change only one major condition at a time when attributing differences.

None of this requires a large benchmark or a change in the author’s training plans. It is simply an outside-user run of a fixed release, plus a small tokenizer regression case that other readers can reproduce. General success rates and the tokenizer’s training-time cause remain unmeasured.

Wow, that’s a very detailed test, thanks! Good catch on the { token. I’m planning to fix that in the upcoming 50B V2 pretrain by expanding the vocab. I just fixed the identity drift in V1.1 btw. Since my target is an edge AI wheelchair that only outputs discrete action tokens, I don’t really need JSON support for now. But thanks for the deep analysis!

And is you again, who give me suggestions on improving my toks/s before, thanks! :slight_smile:

The detail that changes the plan is your target: a wheelchair controller that outputs discrete action tokens will never be graded by ARC, so the most useful thing to build before the 50B-token V2 is the eval you actually care about — a few hundred held-out everyday commands, each with the exact action sequence it should produce, including a stop class and commands it should refuse or ask about. Score V1.1 on that now, and report the worst cases separately from the average: for a controller, one confident wrong action matters more than ninety-nine right ones, and a per-action breakdown shows whether the errors are misses, wrong order, or actions that should never have fired at all. Run the same set on V2 the day it exists and you will know what the extra tokens bought the thing you are building — and if V1.1 already passes the plain commands, V2’s data mix can be aimed at exactly the command types it fails instead of more general text.

Hi @Digilidaahz, really impressive work — a full 1B pretrain to Chinchilla-optimal on a single RTX 5080, plus your own prefetcher and an FP8 + torch.compile setup, is more than most people ever ship. Congrats!

And big greetings to @John6666 — once again the most thorough independent tester on this forum. That { → [178, 0] round-trip catch is exactly the kind of thing that silently ruins a model months later. :raising_hands:

I’m Mateusz. I build HybridMoE Titan, a 450M Mamba + Attention + MoE hybrid trained from scratch on a single L4 (v1, v2, thread). I went from v1 to v2 the same way you’re about to: new tokenizer, new pretrain. Here are the mistakes I made so you can skip them:

1. Once you change the vocab, loss/PPL stop being comparable — use bits-per-byte.
I moved from GPT-2 BPE (50K) to a custom 64K BPE. My v2 PPL numbers meant nothing next to v1’s, because per-token loss depends on how the tokenizer splits text. BPB normalizes by raw UTF-8 bytes, so it compares across tokenizers:

bpb = total_nll_nats / (math.log(2) * len(text.encode("utf-8")))

Run it on the same fixed texts for V1 and V2, and you’ll know what the 50B tokens actually bought you.

2. Freeze your validation set now and never touch it.
My val PPL “jumped” from 10.8 to 32.3 at one point. Nothing was wrong with the model: I had grown the val set from 50 to 200 shards. Pick one held-out set and keep it identical across every version.

3. Double-check your SFT val split for leakage.
In one of my SFT runs I got val loss 0.04 and was thrilled. I had mixed train and val into one pool before splitting, and the model was being evaluated on data it had already seen. Generation was garbage. Split by a hash of each conversation before any shuffling or augmentation:

import hashlib
def is_val(text, pct=2):
    return int(hashlib.md5(text.encode()).hexdigest(), 16) % 100 < pct

Also dedup across splits, since smol-smoltalk has near-duplicates.

4. Audit the merged pretrain corpus before the 50B run.
When I scanned my corpus I found 306 JPEGs embedded as text, 8.1M U+FFFD replacement chars and 190K null bytes. You merged four corpora, so it’s worth a quick pass counting \ufffd, \x00, non-printable bytes and exact-duplicate documents per source. At 50B tokens, junk adds up.

5. Tokenizer: make UNK impossible, then test it.
A properly configured ByteLevel BPE can’t produce <|unk|> at all, because every byte is in the base alphabet. If { maps to UNK, something removed it (a normalizer, a custom alphabet, or min_frequency). When training V2’s tokenizer:

from tokenizers import Tokenizer, models, trainers, pre_tokenizers, decoders
tok = Tokenizer(models.BPE())
tok.pre_tokenizer = pre_tokenizers.ByteLevel(add_prefix_space=False)
tok.decoder = decoders.ByteLevel()
trainer = trainers.BpeTrainer(
    vocab_size=65536,
    initial_alphabet=pre_tokenizers.ByteLevel.alphabet(),  # all 256 bytes
    special_tokens=["<|endoftext|>", "<|im_start|>", "<|im_end|>"],
)

And run a round-trip test before spending a single GPU hour:

for s in [chr(c) for c in range(32, 127)] + ["{\"a\": 1}", "def f(x): return {x: x}", "😀", "naïve"]:
    ids = tok.encode(s).ids
    assert tok.decode(ids) == s, (repr(s), ids)

Since your target is discrete action tokens, add those as dedicated special tokens now. That’s much cheaper than retrofitting them later.

6. Save everything needed to resume.
My long runs got interrupted more than once. Save optimizer state, LR scheduler, RNG states and the dataloader position (shard + offset), not just the weights. Otherwise a “resume” at 30B tokens quietly replays or skips data.

7. On the wheelchair: +1 to @nootxlm’s eval idea, plus two things.

  • Constrain decoding to the action vocabulary (mask all other logits). The model then physically can’t output anything that isn’t a valid action.
  • Never let the model be the safety layer. Obstacle detection, speed limits and an always-available hardware stop should live in plain, deterministic code underneath it. The LLM proposes, the controller decides.

For an edge device you may eventually find that a much smaller model (100–300M) fine-tuned or distilled on your command set beats the 1B on latency and reliability. Your 50B overtrained base would make a great teacher for that.

Keep going, you’re doing this the right way: building, publishing, and letting people test it. Looking forward to V1.1 and the 50B base! :rocket:

— Mateusz (Project Inkblot)