What it is

According to the project, MiniMind is an open-source repository designed to train small language models from scratch. The README states that the project aims to lower the barrier to entry for learning large language models by providing structural code, training pipelines, and datasets. The repository is written in Python and is licensed under the Apache-2.0 license. As reported in the metadata, the project has accumulated 74,369 stars and 9,866 forks since its creation in July 2024.

What it does

The README explains that the software allows users to train compact language models, such as a 64M parameter version, using consumer-grade hardware. The project supports various training stages including pretraining, supervised fine-tuning, Low-Rank Adaptation, reinforcement learning from human and AI feedback, tool use, and model distillation. In addition to text-based models, the documentation notes experimental expansions for visual modalities, multimodal omni models, diffusion language models, and linear attention models.

How it works

The project implements core algorithms natively using PyTorch without relying on high-level abstractions from third-party libraries, according to the documentation. The workflow covers tokenizer training, dataset formatting, model training, evaluation, and inference. The README states that the training scripts support single-device and multi-device setups using DDP or DeepSpeed, along with integration for visualization tools and inference engines.

Maturity and limitations

The documentation notes that the project is intended as both a reproducible codebase and an educational tutorial for understanding large language models. The stated training time and cost apply to specific hardware configurations, such as a single NVIDIA 3090 GPU for a specific epoch duration. The README mentions that while the custom tokenizer helps control parameter counts in small architectures, it has lower encoding and decoding efficiency compared to larger mainstream tokenizers.

Sources