MiniMind ROCm — PyTorch checkpoints (Dense and MoE)

English · Français · 简体中文

Native MiniMind PyTorch (.pth) checkpoints trained and evaluated on Windows with AMD ROCm, using an AMD Radeon RX 7800 XT. This repository contains the retained Dense baselines and the completed Mixture-of-Experts (MoE) Pretrain and Full SFT checkpoints. Subsequent LoRA, DPO, and distillation experiments are documented below.

Format: These are native MiniMind state_dict weights, not self-contained Hugging Face Transformers checkpoints. Use the matching MiniMind source code and tokenizer; do not expect AutoModelForCausalLM.from_pretrained() to load this repository directly.

Checkpoints

File Architecture Stage Training dataset
pretrain_mini_768.pth Dense Mini Pretrain pretrain_t2t_mini.jsonl
full_sft_mini_768.pth Dense Mini Full SFT, initialized from Mini Pretrain sft_t2t_mini.jsonl
pretrain_768.pth Dense Full Pretrain pretrain_t2t.jsonl
full_sft_768.pth Dense Full SFT, initialized from Dense Full Pretrain sft_t2t.jsonl
pretrain_768_moe.pth MoE Full Pretrain pretrain_t2t.jsonl
full_sft_768_moe.pth MoE Full SFT, initialized from MoE Full Pretrain sft_t2t.jsonl
lora_medical_768.pth Dense LoRA adapter LoRA on Dense Full SFT lora_medical.jsonl
dpo_768.pth Dense DPO, initialized from Dense Full SFT dpo.jsonl
full_dist_768.pth Dense student / MoE teacher Distillation from MoE Full SFT, initialized from Dense Full SFT sft_t2t.jsonl

The two MoE checkpoint files measured 387.88 MiB each in the local audit. Their presence in this table does not by itself confirm that they have been uploaded to the Hub: upload the corresponding .pth files together with these updated cards. The LoRA, DPO, and distillation files were also evaluated locally; their Hub availability must be checked separately.

Model configuration

Property Dense MoE
Hidden size 768 768
Transformer layers 8 8
Tokenizer vocabulary 6,400 6,400
Total parameters 63.91M 198.42M
Active parameters (reported) 63.91M 63.94M
Routed experts per MoE layer — 4
Experts selected per token — 1 (top-1)

The active-parameter count is not a measured FLOP count or proof of identical inference cost. The model's MoE feed-forward layers include an auxiliary router-balancing objective during training.

Evaluation — October 27 and November 24, 2026

The original four full-dataset Pretrain/Full SFT checkpoints were compared using the existing scripts/diagnose_validation.py protocol on October 27. The two historical Mini checkpoints are included as references. LoRA, DPO, and distillation were evaluated with the same diagnostics on November 24.

Local reference losses: seed=42, 256 randomly selected records each from pretrain_t2t_mini.jsonl and sft_t2t_mini.jsonl, identical reference datasets for Dense and MoE. The full checkpoints themselves were trained on pretrain_t2t.jsonl and sft_t2t.jsonl. Perplexity (PPL) is exp(loss).

Checkpoint Pretrain loss Pretrain PPL SFT loss SFT PPL External repetition
Dense Mini Pretrain 1.8275 6.22 2.5207 12.44 0.795
Dense Mini Full SFT 1.9992 7.38 1.5663 4.79 0.361
Dense Full Pretrain 1.6372 5.14 2.8685 17.61 Not retained as reliable
Dense Full SFT 1.8730 6.51 1.3771 3.96 0.244
MoE Full Pretrain 1.5468 4.70 2.1544 8.62 0.842*
MoE Full SFT 1.7544 5.78 1.2994 3.67 0.262
Dense Full SFT + LoRA (merged) 1.9250 6.86 1.4830 4.41 0.451
Dense DPO 1.8730 6.51 1.3772 3.96 0.237
Dense distilled student 1.9377 6.94 1.3698 3.93 0.218

What these results show: The MoE Full Pretrain checkpoint has lower Pretrain reference loss than the Dense Full Pretrain checkpoint (1.5468 vs 1.6372); the MoE Full SFT checkpoint has lower SFT reference loss than the Dense Full SFT checkpoint (1.2994 vs 1.3771). For MoE, SFT lowers SFT reference loss from 2.1544 to 1.2994 while raising Pretrain reference loss from 1.5468 to 1.7544.

November 24 follow-up: Relative to Dense Full SFT, merged LoRA has higher Pretrain/SFT reference losses (1.9250/1.4830) and repetition (0.451). DPO has essentially unchanged reference losses (1.8730/1.3772) and slightly lower repetition (0.237). The distilled Dense student has slightly lower SFT loss (1.3698 vs 1.3771) and repetition (0.218 vs 0.244), but higher Pretrain loss (1.9377 vs 1.8730). The MoE Full SFT teacher remains at 1.2994 SFT loss and 0.262 repetition on the same protocol.

Important limitations of the metrics:

  • These reference samples come from the training datasets. The losses reflect training-distribution fit; they are not held-out generalization results.
  • External repetition is the mean repeated-character 3-gram ratio over eight separate prompts, with deterministic greedy decoding and max_new_tokens=256. Lower means less repetition, not higher factual correctness. Historical Mini results are from the same diagnostic family.
  • * The Pretrain external benchmark uses a chat-formatted prompt in diagnose_validation.py, whereas upstream eval_llm.py uses BOS + prompt for Pretrain. The MoE Pretrain repetition figure (0.842) must be treated cautiously; the Dense Full Pretrain aggregate was not retained as reliable.
  • The MoE Full SFT repetition score (0.262) is slightly worse than the Dense Full SFT score (0.244) on this particular benchmark. Lower loss does not imply better generated answers.
  • The LoRA entry uses a locally merged full_sft_lora_medical_768.pth for evaluation, not the standalone adapter file. These general-language references do not evaluate medical-domain gains. No held-out DPO preference accuracy or win rate, nor teacher–student KL validation, was measured.

Qualitative findings

Both MoE checkpoints loaded and generated responses on the eight built-in upstream eval_llm.py prompts. Full SFT generally produced better-structured answers than Pretrain, but errors remain:

  • The MoE Full SFT returned 16 for 12 - 5 + 3 (correct answer: 10).
  • Its Fibonacci example described fibonacci(10) = 55, but the generated implementation had incorrect base cases.
  • A request for exactly three points began a fourth point.
  • Some answers were verbose, repetitive, scientifically imprecise, or truncated at the evaluation token limit. A simple Python add function was corrected, but the explanation repeated itself.

These models are educational and experimental, not reliable general-purpose assistants. No broad claim of MoE superiority in reasoning, correctness, or generalization is supported by these tests.

In the newer generations, merged LoRA frequently repeats content (notably on Fibonacci); DPO still fails the exact-three-points constraint and the add code fix; the distilled student answers 11 for 12 - 5 + 3 (correct: 10) and also fails the three-point constraint and code fix. Lower repetition is not proof of correct answers.

Download and run (native MiniMind)

From PowerShell on a compatible PyTorch/ROCm installation:

git clone https://github.com/Driw0x/minimind.git
cd minimind
# Install the requirements appropriate to your ROCm environment;
# see the linked GitHub README for the validated setup.
python -m pip install huggingface_hub
hf download Driw0x/minimind-rocm-pytorch pretrain_768_moe.pth full_sft_768_moe.pth --local-dir out

python eval_llm.py --weight pretrain --use_moe 1 --hidden_size 768 --num_hidden_layers 8 --max_new_tokens 512
# Select [0] for the built-in automatic test.
python eval_llm.py --weight full_sft --use_moe 1 --hidden_size 768 --num_hidden_layers 8 --max_new_tokens 512
# Select [0] again.

For a Dense checkpoint, download the corresponding .pth into out/ and use --use_moe 0 (or omit the flag). The model/ tokenizer comes from the GitHub repository. PyTorch on ROCm exposes AMD devices through the cuda / cuda:0 API.

To reproduce the MoE local diagnostics, also download the two Mini reference datasets into dataset/:

python -m scripts.diagnose_validation --weights pretrain full_sft --mode full --device cuda:0 --hidden_size 768 --num_hidden_layers 8 --use_moe 1 --eval_samples 256 --stat_samples 256 --batch_size 4 --max_new_tokens 256 --seed 42

Intended use and provenance

These checkpoints demonstrate a small-model training path (Pretrain → Full SFT, plus LoRA, DPO, and MoE-to-Dense distillation), Dense/MoE comparisons, native Windows AMD ROCm execution, checkpoint loading, and explicit evaluation limitations. They are suitable for research, learning, and reproducibility experiments; they are not validated for high-stakes decisions, factual reliability, or production deployment.

For implementation, training commands and additional results, see the GitHub README, training commands, and generation-quality report.

The fork retains MiniMind's Apache-2.0 license; see its LICENSE. Credits to the original MiniMind project and dataset authors.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Dataset used to train Driw0x/minimind-rocm-pytorch