Byte-Gemma 3 1B (GGUF): an offline C++ tutor that asks instead of tells
Byte-Gemma is a fine-tune of Gemma 3 1B IT that acts as a patient C++ tutor for beginners. Instead of dumping answers, it guides: it praises something the student got right, then asks one guiding question, in under ~100 words.
It is small enough (Q4_K_M, roughly 0.8 GB) to run fully offline on an Android phone, and was built for a friend learning C++ from scratch (Hacktoberfest Weekend Challenge: Build for a Friend).
Important: use the system prompt
This model was trained with a system prompt. Without it, it behaves like a generic Gemma. Always supply the prompt below.
You are Byte, a patient C++ tutor for beginners. Teach by guiding, not by giving answers. When giving feedback on student code, open with something they got right. Ask exactly one guiding question, and keep replies under about 100 words with at most one short code block. With no command or /explain: give an analogy, a tiny example and a question. /debug: hint 1 only. Point to where to look and never state the fix. /hint: a more specific hint, still not the full fix. /solution: always give the fix, explain why it works, and add one practice question. /review: praise one thing, name the single most important issue, and ask the student to fix it. /quiz: ask one question and wait for the answer. If the code is correct, say so and ask a what-if question. Never invent bugs.
Slash commands
| Command | Behaviour |
|---|---|
/explain <topic> | Analogy, tiny example, one question |
/debug | Only the first hint, never the fix |
/hint | A more specific hint, still not the full fix |
/solution | Full fix, why it works, one practice question |
/review | Praise one thing, name the key issue, student fixes it |
/quiz | One question, then waits for the answer |
Tip: paste code as a single message. Terminal apps like Termux send each pasted line as a separate message, which confuses the model.
How to run
Android (PocketPal)
- Download the
.gguffile from this repo and load it in PocketPal. - Create a Pal (Pals tab) and paste the system prompt above into its system prompt field.
- Set temperature to about 0.3 and chat with that Pal.
llama.cpp (Termux or desktop)
llama-cli -m FILENAME.gguf -sys "$(cat prompt.txt)" --temp 0.3 -n 200 -cnv
Save the system prompt to prompt.txt first. -n 200 caps reply length as a safety limit.
Ollama
Create a Modelfile:
FROM ./FILENAME.gguf
SYSTEM """<paste the system prompt here>"""
PARAMETER temperature 0.3
Then run:
ollama create byte-gemma -f Modelfile
ollama run byte-gemma
Training details
| Base model | google/gemma-3-1b-it |
| Method | LoRA (r=16, alpha=16) with Unsloth |
| Data | 349 multi-turn tutoring conversations (system / user / tutor format) |
| Data source | [Synthetic examples from a teacher model plus cleaned examples from real beginner mistakes. Edit to match exactly what you used.] |
| Chat template | Gemma 3 template, every tutor reply ends with <end_of_turn> |
| Loss | Computed on tutor replies only (train_on_responses_only) |
| Epochs / LR | 3 / 2e-4 |
| Quantization | Q4_K_M GGUF |
Version note
An earlier version (v1) was trained without proper end-of-turn handling and would not stop generating in llama.cpp: it wrote fake student replies and answered them in a loop. v2 fixes this by using the Gemma chat template and training only on tutor responses.
Evaluation
A friend compared v1 against stock Gemma 3 1B on three topics (struct vs class, pointers vs references, multithreading). This was a small, qualitative test, not a benchmark, and only Byte-Gemma received the tutoring system prompt, so it is not a controlled comparison.
What worked: a consistent tutor personality, concise replies, and follow-up questions that keep the learner thinking.
What didn't:
- Some technical explanations were wrong (for example, telling a student to use
&to access a value through a reference). - It sidestepped the multithreading question instead of explaining it.
- It misread very short student replies.
Stock Gemma 3 1B gave longer answers but also contained errors, including invented APIs and mixing Python concepts into C++.
A controlled re-evaluation of v2 (same system prompt, temperature, and questions for both models, with generated code compiled and run) is [pending / link here].
Limitations
- Not a reliable source of C++ knowledge. A 1B model makes factual and syntax mistakes. Verify explanations against a compiler and trusted references such as cppreference.com.
- Weak on advanced topics (multithreading, templates, move semantics).
- Works best with short, single-message inputs and the system prompt applied.
- English only.
Intended use
A practice companion for beginners alongside a textbook, course, or human instructor. Not intended as a standalone teacher or for grading.
License
Subject to the Gemma Terms of Use, as this is a derivative of Gemma 3.
Credits
Built by @99Amit99 for a friend learning C++. Evaluation feedback from Srujan. Base model by Google. Fine-tuned with Unsloth.