Simple Self-Distillation training pipeline for MLX models
Project description
mlx-ssd
mlx-ssd is a practical MLX CLI implementation of simple self-distillation for code generation models on Apple Silicon.
Method
This project follows the method introduced in:
Ruixiang Zhang, Richard He Bai, Huangjie Zheng, Navdeep Jaitly, Ronan Collobert, Yizhe Zhang.
Embarrassingly Simple Self-Distillation Improves Code Generation.
arXiv:2604.01193, 2026.
https://arxiv.org/abs/2604.01193
Implementation by Amirani Labs.
Core flow:
- Sample responses from a base model with train-time decoding settings.
- Fine-tune on those self-generated samples.
- Evaluate/run with eval-time decoding settings.
Dataset defaults:
--problems microsoft/rStar-Coder--dataset-config seed_sft--dataset-split train- Records must contain a non-empty
questionfield.
This repository is an independent implementation and is not the original paper repository.
Presets
Presets encode paper-aligned hyperparameters (Table 3 mapping) for supported model families.
mlx-ssd sample --model mlx-community/Qwen3-4B-Instruct-4bit --preset qwen3-4b-instruct --output ./ssd_data
mlx-ssd train --model mlx-community/Qwen3-4B-Instruct-4bit --preset qwen3-4b-instruct --data ./ssd_data --output ./ssd_model
mlx-ssd run --model ./ssd_model/fused --preset qwen3-4b-instruct --prompt "Write a function that..."
Usage
Install:
pip install -e .
Three-stage flow:
# 1) Sample
mlx-ssd sample \
--model mlx-community/Qwen3-4B-Instruct-4bit \
--problems microsoft/rStar-Coder \
--dataset-config seed_sft \
--dataset-split train \
--output ./ssd_data \
--batch-size 16 \
--temperature 1.6 \
--top-k 20 \
--top-p 0.8 \
--limit 10
# 2) Train
mlx-ssd train \
--model mlx-community/Qwen3-4B-Instruct-4bit \
--data ./ssd_data \
--output ./ssd_model \
--iters 2500
# 3) Run
mlx-ssd run \
--model ./ssd_model/fused \
--temperature 1.1 \
--top-k 20 \
--top-p 0.8 \
--prompt "Write a function that..."
One-command flow:
mlx-ssd distill \
--model mlx-community/Qwen3-4B-Instruct-4bit \
--preset qwen3-4b-instruct \
--output ./my-better-qwen
Local smoke test (quick validation):
mlx-ssd sample \
--model mlx-community/SmolLM2-135M-Instruct \
--problems microsoft/rStar-Coder \
--dataset-config seed_sft \
--dataset-split train \
--output ./.smoke/data \
--batch-size 4 \
--temperature 0.8 \
--top-k 20 \
--top-p 0.8 \
--max-tokens 64 \
--limit 5
Apple Silicon
mlx-ssd itself is the Apple Silicon implementation: it is built on mlx-lm and targets local MLX workflows.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mlx_ssd-0.1.0.tar.gz.
File metadata
- Download URL: mlx_ssd-0.1.0.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b596062d175c9e762c300988d938ee0933a8177139773b913d400dbc2c2b3d9c
|
|
| MD5 |
1b24b307d4324fa35df8bf252b97cdbb
|
|
| BLAKE2b-256 |
6e5cd63ac190b59581c014f96925e8a3601342ebf3f15b0fdb6467191c083f5e
|
Provenance
The following attestation bundles were made for mlx_ssd-0.1.0.tar.gz:
Publisher:
publish.yml on AmiraniLabs/mlx-ssd
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mlx_ssd-0.1.0.tar.gz -
Subject digest:
b596062d175c9e762c300988d938ee0933a8177139773b913d400dbc2c2b3d9c - Sigstore transparency entry: 1227969476
- Sigstore integration time:
-
Permalink:
AmiraniLabs/mlx-ssd@dd4cbec66f27cab2bb6052a4904c1e7c6dc5b407 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/AmiraniLabs
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@dd4cbec66f27cab2bb6052a4904c1e7c6dc5b407 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file mlx_ssd-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mlx_ssd-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
795dc8174e09a03ee630bcaa2ec152e8c00fcbbe5b0dfbe09af09cb8a0971425
|
|
| MD5 |
966a1ed78213957c197849623a579da8
|
|
| BLAKE2b-256 |
4ecdce8c9078b17fb11bfb8bf9908de4b20ea11935cae85c7532fd4219871518
|
Provenance
The following attestation bundles were made for mlx_ssd-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on AmiraniLabs/mlx-ssd
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mlx_ssd-0.1.0-py3-none-any.whl -
Subject digest:
795dc8174e09a03ee630bcaa2ec152e8c00fcbbe5b0dfbe09af09cb8a0971425 - Sigstore transparency entry: 1227969486
- Sigstore integration time:
-
Permalink:
AmiraniLabs/mlx-ssd@dd4cbec66f27cab2bb6052a4904c1e7c6dc5b407 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/AmiraniLabs
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@dd4cbec66f27cab2bb6052a4904c1e7c6dc5b407 -
Trigger Event:
workflow_dispatch
-
Statement type: