YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

πŸ€– Gemma-3-270M Fine-Tuned on OpenThoughts-114k

A compact, reasoning-capable assistant trained on 114K high-quality synthetic examples covering math, science, code, and logic puzzles.

License Made with Unsloth Dataset


🌟 Overview

This model is a LoRA fine-tuned version of gemma-3-270m-it, trained on the OpenThoughts-114k dataset β€” a high-quality synthetic reasoning dataset with 114,000 examples spanning math, coding, science, and puzzles.

βœ… Trained with Unsloth for 2Γ— faster training & 60% less VRAM
βœ… Supports local inference via GGUF (Q8_0, BF16) and continued training via LoRA
βœ… Ideal for local LLM enthusiasts, developers, and researchers needing a small but smart model


πŸ“Š Model Details

Attribute Value
Base Model unsloth/gemma-3-270m-it
Dataset open-thoughts/OpenThoughts-114k
Training Method LoRA (rank=64) + Unsloth-optimized SFT
Context Length 2048 tokens
Hardware Used Google Colab T4 (16GB VRAM)
Training Steps 300 steps (~30 minutes)
Final Loss ~2.81
Trainable Params 15.2M (5.36% of total)
License LGPL-3.0

πŸ” The dataset uses a structured "Thought β†’ Solution" format, teaching the model to reason step-by-step before answering β€” ideal for complex tasks.


πŸš€ Quick Start

▢️ Run with Ollama

# Create Modelfile
echo 'FROM ./gemma-3-270m-openthoughts.Q8_0.gguf
TEMPLATE "{{ if .Prompt }}<start_of_turn>user\n{{ .Prompt }}<end_of_turn>\n<start_of_turn>model\n{{ end }}"
PARAMETER temperature 0.8
PARAMETER top_p 0.95
PARAMETER top_k 64' > Modelfile

# Build and run
ollama create my-gemma -f Modelfile
ollama run my-gemma

▢️ Use with llama.cpp

./main -m gemma-3-270m-openthoughts.Q8_0.gguf -p "Explain backpropagation like I'm 12." -n 150

▢️ Load in Python (Transformers + Unsloth)

from unsloth import FastModel
model, tokenizer = FastModel.from_pretrained("your-hf-username/gemma-3-270m-openthoughts")
# Use for inference or continued training

πŸ“₯ Download Files

File Format Use Case
gemma-3-270m-openthoughts.Q8_0.gguf 8-bit quantized Best for llama.cpp, Ollama, LM Studio
gemma-3-270m-openthoughts.BF16.gguf Full precision Highest quality, larger size
adapter_model.safetensors LoRA adapter For continued training or merging

πŸ’‘ Recommendation: Use Q8_0 for most local applications (~500 MB). Use BF16 only if you need maximum fidelity.


πŸ” Continue Training

You can resume training on new datasets (e.g., teknium/OpenHermes-2.5) using the LoRA checkpoint:

from unsloth import FastModel
model, tokenizer = FastModel.from_pretrained(
    model_name = "your-hf-username/gemma-3-270m-openthoughts",  # LoRA folder
    max_seq_length = 2048,
    load_in_4bit = True,
)
# Add new data and train!

🧠 Why OpenThoughts?

  • βœ… 114K diverse reasoning examples
  • βœ… Verified correctness (solutions validated during generation)
  • βœ… Covers math, algorithms, physics, logic puzzles
  • βœ… Structured chain-of-thought format improves reasoning
  • βœ… Fully open-source (paper, code, data available)

πŸ“„ Read the OpenThoughts paper for full methodology.


πŸ› οΈ Training Code (Unsloth)

Trained in <30 minutes on a free T4 using:

from unsloth import FastModel
from datasets import load_dataset

# Load model
model, tokenizer = FastModel.from_pretrained(
    "unsloth/gemma-3-270m-it",
    load_in_4bit=True,
    max_seq_length=2048,
)

# Apply LoRA
model = FastModel.get_peft_model(model, r=64)

# Load & format OpenThoughts
dataset = load_dataset("open-thoughts/OpenThoughts-114k", split="train[:50000]")
# (system + conversations β†’ user/assistant only for Gemma-3)

# Train
trainer = SFTTrainer(..., max_steps=300, per_device_train_batch_size=4)
trainer.train()

# Export to GGUF
model.save_pretrained_gguf("gemma-3-270m-openthoughts", tokenizer, quantization_method="Q8_0")

πŸ“œ License

⚠️ Commercial use: Review Gemma’s terms before deployment.


πŸ™Œ Acknowledgements

Downloads last month
28
GGUF
Model size
0.3B params
Architecture
gemma3
Hardware compatibility
Log In to add your hardware

8-bit

16-bit

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

Paper for KenSensei/gemma-3-270m-openthoughts