logitcai/tinybrain

tinybrain downloads, cleans, and deduplicates data across sources from 26 public datasets, creating four tiers of Chinese datasets with 1B, 5B, 20B, and 60B tokens (hosted on ModelScope), accompanied by a custom-trained tokenizer; the model utilizes multi-stream residual connections (mHC), Engram lookup table memory, sliding window attention, and optional MoE, with Muon as the optimizer; post-training involves SFT, domain experts, and multi-teacher online distillation, followed by RLVR, agent RL, and RLAIF. On 11 19, the authors released the dialogue weights for small (1.67 billion parameters) and medium (4.99 billion parameters) models as RC1. The authors explicitly noted that its "facts and arithmetic are unreliable," while sharing real responses of varying quality. They stated that pretraining the small model on an RTX 5070 Ti with 16GB using 10 billion tokens took approximately 4 hours.

tinybrain downloads, cleans, and deduplicates data across sources from 26 public datasets, creating four tiers of Chinese datasets with 1B, 5B, 20B, and 60B tokens (hosted on ModelScope), accompanied by a custom-trained tokenizer; the model utilizes multi-stream residual connections (mHC), Engram lookup table memory, sliding window attention, and optional MoE, with Muon as the optimizer; post-training involves SFT, domain experts, and multi-teacher online distillation, followed by RLVR, agent RL, and RLAIF. On 11 19, the authors released the dialogue weights for small (1.67 billion parameters) and medium (4.99 billion parameters) models as RC1. The authors explicitly noted that its "facts and arithmetic are unreliable," while sharing real responses of varying quality. They stated that pretraining the small model on an RTX 5070 Ti with 16GB using 10 billion tokens took approximately 4 hours.

Why it matters Like MiniMind, the code is readable line by line, but the data is also cleaned and mixed from scratch, with specific training on classical Chinese and poetry; small models can be trained on consumer-grade GPUs.

Stars 492 (+25 / 24h)

Reasons

  • Gained 25 stars in the last 24 hours, totaling 492 stars (indicating attention only); the code is MIT licensed and includes a Bilibili video introduction
  • The README provides tables of training times for different hardware and data volumes, as well as the specific algorithm used by judges to determine "usable responses"

Usage

  • Requires Python 3.11+ and PyTorch 2.5+. After git clone, run pip install -e ".\[data\]". Use modelscope to download data such as pretrain_nano, then sequentially run tinybrain pretrain, tinybrain sft, and tinybrain chat --demo; if you only want to try the chat feature, download Medium Chat RC1 and run tinybrain chat

Risks

  • The training data for the weights includes datasets from OpenCSG; commercial use requires prior permission from OpenCSG. Some responses in the SFT phase were generated by GPT, DeepSeek, and Qwen.
  • Independent final evaluation is not yet complete. In 180 sampling attempts, Medium was judged as usable 29 times, making it suitable only for learning and research purposes.

Open

GitHub

Explore the latest AI Radar updates