Views
No views yet
Al-Khwarizmi-3BAn AI math tutor named after Muhammad al-Khwarizmi, the 9th-century mathematician whose name is the origin of the word "algorithm".
| ![]() |
main and socratic reasoning styles) across two LoRA passes, on top of an initial full fine-tune

| Dataset | GSM8K (main), 1,000 random samples, 90/10 train/val split |
| Steps | 450 (1 epoch) |
| Learning rate | 5e-5, cosine schedule |
| Final validation loss / accuracy | 0.569 / 84.75% |
| Method | LoRA, r=16, all-linear target modules |
| Dataset | Full GSM8K — both main and socratic reasoning styles |
| Steps | 3,550 (combined across two passes) |
| Learning rate | 5e-5, cosine schedule |
| Final validation loss / accuracy | 0.462 / 87.21% |
main/socratic split swapped between them so every problem was seen in both reasoning styles.1from llama_cpp import Llama
2
3# Use Al-Khwarizmi-3B-bf16.gguf or Al-Khwarizmi-3B-Q8_0.gguf
4llm = Llama.from_pretrained(
5 repo_id="mzoelfakar/Al-Khwarizmi-3B-GGUF",
6 filename="Al-Khwarizmi-3B-Q8_0.gguf",
7 n_ctx=2048,
8)
9
10messages = [
11 {"role": "system", "content": "You are a math tutor. Solve problems step by step."},
12 {"role": "user", "content": "If a train travels 120 miles in 2 hours, what is its average speed?"}
13]
14response = llm.create_chat_completion(messages=messages, max_tokens=300, temperature=0.7)
15print(response["choices"][0]["message"]["content"])You are a careful math tutor. Before answering:
- Use only the numbers and quantities explicitly stated in the problem. Do not introduce, assume, or carry over any value that wasn't given.
- Compute each arithmetic operation one at a time, and verify each result before using it in the next step.
- If asked to recheck or redo a calculation, ignore your previous answer entirely and recompute from the stated numbers.
- Before finalizing your answer, check whether every quantity mentioned in the problem (fees, taxes, discounts, additions) has been included in the final result — not just the main calculation.
- When asked to redo or resolve a problem "based on" a previous correction, use that corrected value as the starting point. Do not revert to an earlier, uncorrected path.
Reply in the user's last used language.
You are Al-Khwarizmi, named after Muhammad ibn Musa al-Khwarizmi, the mathematician who lived in the 9th century and whose name is the direct origin of the word 'algorithm'.
Refrain from repeating unnecessary information.
NEVER help with any topics other than math like the weather, cooking, sports, etc.socratic reasoning style), raw generations may contain training artifacts not meant for direct display:<<...>> — calculator-style intermediate annotations** — separator between a sub-question and its calculation in Socratic-style reasoning (not Markdown bold)#### <answer> — marker preceding the final numeric answer* — used as a multiplication sign (e.g. 8*9); if two or more appear in the same
response, Markdown may pair them as emphasis delimiters, causing text between them
to render in italic with the asterisks hidden** in particular can be misread as Markdown bold syntax if left unescaped.