ChairReasoner β€” Full SFT on Gemma 4 E4B (MLX)

A full-parameter supervised fine-tune of Google Gemma 4 E4B on a diverse synthetic reasoning and instruction dataset, converted to MLX for Apple Silicon.

Model: ElijahSdjsiaofjdasiofjs/chairreasoner-full-sft-gemma
Base: google/gemma-4-E4B (4.5B effective / ~8B total params)
Format: MLX, bfloat16 (unquantized) β€” optimised for Apple Silicon Macs
Context length: 128K tokens
License: Apache 2.0 (inherited from Gemma 4)


Model Details

Why full SFT?

Unlike LoRA or QLoRA adapters which only train a small subset of parameters, this run performs true full-parameter SFT β€” every weight in the 8B-parameter model is updated. This was done on a 16 GB Apple Silicon Mac using MLX with aggressive memory management (lazy weight loading, gradient checkpointing, short sequence lengths).

Architecture

Property Value
Base model Gemma 4 E4B (dense)
Total parameters ~8B (4.5B effective)
Layers 42 (hybrid sliding + full attention)
Hidden size 2560
Attention heads 8 Γ— 256-dim
KV heads 2 (with 18 KV shared layers)
Sliding window 512
Context length 128K
Vocabulary 262K tokens (SentencePiece)
Precision bfloat16

Training Configuration

Hyperparameter Value
Optimizer AdamW
Learning rate 2e-5
Batch size 1 (gradient accumulation: 8)
Max sequence length 512
Total iterations 1500
Hardware Apple Silicon Mac (16 GB unified memory)
Framework MLX + mlx-lm

Inference Settings (recommended)

temperature = 1.0
top_p = 0.95
top_k = 64

Training Data

The model was fine-tuned on a synthetic multi-turn instruction dataset covering a broad range of expert domains. Each conversation is grounded in a specific system persona.

Dataset stats:

Stat Value
Training examples 8,706
Validation examples 435
Multi-turn conversations (3+ messages) ~95%
Max conversation turns 13
Average messages per conversation 4.1
Total message turns 35,373
Unique system personas 5,516

Domain Coverage

The data spans a wide range of expert domains, each with tailored system prompts:

  • πŸ§ͺ Science & Technology β€” physics, chemistry, biology, engineering
  • πŸ’» Coding & Engineering β€” software engineering, DevOps, data engineering, frontend, security
  • πŸ“š Humanities β€” philosophy, history, comparative literature, political science
  • ✍️ Creative Writing β€” narrative craft, comedy, unreliable narrators, story structure
  • 🧠 Cognitive Science β€” psychology, behavioral ecology, neuroscience
  • πŸ₯ Medicine β€” oncology, clinical decision-making, pharmacology
  • πŸ’° Economics & Social Science β€” economic theory, game theory, research methodology
  • πŸ€– AI & ML β€” machine learning, reasoning, agentic systems

Thinking Mode

Training data leverages Gemma 4's built-in reasoning capability via <think> tags, where the model produces step-by-step reasoning before answering:

<think>
Step-by-step reasoning...
</think>
Final response.

Usage

The model is stored in MLX safetensors format and is intended for use with MLX and mlx-lm.

Loading with MLX

from mlx_lm.utils import load_model, load_tokenizer

model, _ = load_model("/path/to/chairreasoner-full-sft-gemma")
tokenizer = load_tokenizer("/path/to/chairreasoner-full-sft-gemma")

Loading with Transformers (via conversion)

The model originates from the Transformers-compatible Gemma 4 format. To use it with Hugging Face Transformers, convert the MLX weights back or download the base separately.


Technical Notes

  • This model was trained fully offline β€” no internet access during training (HF_HUB_OFFLINE=1)
  • Weights are unquantized bf16 β€” the model.safetensors file is ~15 GB
  • The training script (train.py) includes full-parameter unfreezing via model.unfreeze(), as opposed to the default LoRA mode in mlx-lm
  • Training was tuned to fit within 16 GB unified memory on Apple Silicon using memory-mapped weight loading and aggressive Metal cache clearing
  • Checkpoints (if any) are stored in checkpoints/ as full weight dumps

Repository Structure

β”œβ”€β”€ README.md                          # This file
β”œβ”€β”€ train.py                           # Full SFT training script
β”œβ”€β”€ mlx_unquantized_gemma/             # Base model + fine-tuned weights
β”‚   β”œβ”€β”€ model.safetensors              # ~15 GB unquantized weights
β”‚   β”œβ”€β”€ config.json                    # Model configuration
β”‚   β”œβ”€β”€ generation_config.json         # Generation hyperparameters
β”‚   β”œβ”€β”€ tokenizer.json                 # SentencePiece tokenizer
β”‚   β”œβ”€β”€ tokenizer_config.json          # Tokenizer configuration
β”‚   β”œβ”€β”€ processor_config.json          # Multimodal processor config
β”‚   β”œβ”€β”€ chat_template.jinja            # Chat template (with thinking support)
β”‚   └── .gitattributes                # Git LFS config
β”œβ”€β”€ local_dataset/                     # Original Hugging Face Arrow dataset
β”‚   β”œβ”€β”€ data-00000-of-00001.arrow      # 66 MB β€” source training data
β”‚   β”œβ”€β”€ dataset_info.json              # Dataset metadata
β”‚   └── state.json                     # Dataset state
β”œβ”€β”€ mlx_data/                          # Cached JSONL files
β”‚   β”œβ”€β”€ train.jsonl                    # 64 MB β€” 8,271 training examples
β”‚   └── valid.jsonl                    # 3.4 MB β€” 435 validation examples
β”œβ”€β”€ checkpoints/                       # Training checkpoints (if resumed)
└── model_params/                      # Reserved for parameter exports

Acknowledgements

  • Google DeepMind for the Gemma 4 model family (Apache 2.0)
  • Apple MLX team for the MLX framework enabling full SFT on Mac
  • Built with mlx-lm

License

This repository is licensed under Apache 2.0, inherited from the Gemma 4 base model license.

Downloads last month

-

Downloads are not tracked for this model. How to track
MLX
Hardware compatibility
Log In to add your hardware

Quantized

Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for ElijahSdjsiaofjdasiofjs/chairreasoner-full-sft-gemma

Finetuned
(76)
this model