BLYAT-6-97M

BLYAT 6 is a small (97.5M parameter) English-only chat language model that was trained completely from scratch (tokenizer, pretraining and fine-tuning) by an independent developer on a single GTX 1060 6GB. It is a hobby / learning project, published for transparency and experimentation. It is not a reliable assistant: it often states false things confidently.

Quick start

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM

repo = "your_hf_username_here/BLYAT-6-97M"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo).eval()

messages = [{"role": "user", "content": "Hi! How are you today?"}]
prompt = tok.apply_chat_template(messages, tokenize=False)
ids = tok(prompt, add_special_tokens=False, return_tensors="pt")
out = model.generate(**ids, max_new_tokens=200, stop_strings=["\n\nUser:"], tokenizer=tok)
print(tok.decode(out[0, ids["input_ids"].shape[1]:], skip_special_tokens=True))

Tips

  • The saved generation_config.json uses greedy decoding with repetition_penalty=1.1 and no_repeat_ngram_size=4, which stops loops in chat. For arithmetic use repetition_penalty=1.0, no_repeat_ngram_size=0, otherwise repeated numbers inside the working get penalised.
  • The model was trained on exactly this prompt layout (<bos>User:\n...\n\nAssistant:\n...); the chat template reproduces it. There is no system role; put instructions in the user message. The context window is 512 tokens.
  • It is English only. Spanish input gets a short notice that it only understands English.

Model

Architecture decoder-only Transformer, Llama layout (RMSNorm, SwiGLU, rotary embeddings, tied embeddings, no biases)
Parameters 97.5M (12 layers, 12 heads, hidden 768, MLP 2048, context 512)
Tokenizer custom 16,384-token byte-level BPE, trained for this project (English)
Precision float32 weights (model.safetensors, about 390 MB)

The weights were converted from the original training format (fused qkv and interleaved rotary pairs) to the standard Llama layout. The conversion was checked numerically before publishing: logits match the original model to float32 precision and greedy generations are token-for-token identical.

Training

  1. Pretraining from scratch - 90,000 steps x 32 sequences x 512 tokens, about 1.47B tokens, on one GTX 1060 6GB (about 4.4 days). Data mix: FineWeb-Edu (two shards), Wikitext, a Python source corpus, and chat-format conversation text. Held-out FineWeb-Edu validation loss: 3.10.
  2. Supervised fine-tuning (answer-only loss) in several rounds: general instruction/chat data (SmolTalk, Dolly, OASST English, Alpaca-cleaned), a small hand-written identity set, synthetic small-talk, and synthetic step-by-step arithmetic (see below).

What it can and cannot do

Works reasonably: greetings and small talk, short explanations, simple formatted answers, short Python snippets (right shape, often a wrong detail), simple arithmetic (below), saying it does not know about made-up people.

Does not work: facts (it often invents authors, plots, commands), long answers (it drifts and repeats), Spanish or other languages, multi-step reasoning, anything where being wrong matters.

Arithmetic (held-out test set of 320 problems, greedy decoding, no repetition penalty)

Category Accuracy
times table (1-12) 100%
division table 97.5%
2-digit addition 95%
2-digit subtraction 97.5%
word problems (add / subtract / multiply) 95%
2-digit x 1-digit multiplication 65%
3-digit addition 27.5%
3-digit subtraction 20%
Total 74.7%

It solves problems in small written steps (for example 45 + 30 = 75, then 75 + 8 = 83). Three-digit numbers are weak mainly because the tokenizer splits them inconsistently (223 becomes 22+3, 270 becomes 2+70). Problems used for testing are not in the training data. Raw logs are in eval/.

Limitations, bias and intended use

  • Trained on web text and model-generated chat data, so it can repeat inaccurate, biased or offensive content.
  • Intended for learning, experiments and as a baseline for small-model research. Not for production, advice, or anything safety-relevant.

Data and licenses

This model is released under CC BY-NC 4.0 (non-commercial) because the fine-tuning data is mixed:

Data License / note
FineWeb-Edu ODC-By 1.0
Wikitext CC BY-SA 3.0
Python source corpus Source and license not recorded (assembled for earlier BLYAT experiments); treated as unverified.
SmolTalk (smol-smoltalk) see the dataset card; parts are generated by other language models
Databricks Dolly 15k CC BY-SA 3.0
OpenAssistant (OASST1) English Apache 2.0
Alpaca-cleaned CC BY-NC 4.0; generated with OpenAI models, OpenAI terms apply
Identity, small-talk and arithmetic sets written / generated for this project

This is a good-faith summary, not legal advice. Check the original dataset cards before reusing the weights commercially.

Citation

BLYAT 6 (97M), an independent from-scratch small language model, 2026.

Downloads last month
331
Safetensors
Model size
97.5M params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support