CoolFace
Modelpublic

CanisAI/teach-math-qwen3-4b-2507-r1-merged

sourceHugging Faceapache-2.0updated 1y agoView on Hugging Face
0likes
Model Card

Canis.teach — Qwen3‑4B Instruct (Math) — Merged

Merged full model (LoRA adapters applied to the base), ready for direct use with Transformers.

  • —Base: Qwen/Qwen3-4B-Instruct-2507
  • —Release: CanisAI/teach-math-qwen3-4b-2507-r1-merged
  • —Project: Canis.teach, Learning that fits.
  • —Tags: canis-teach, qwen3, education, lora-merged, transformers

What is this?

This repository contains a merged checkpoint: the LoRA adapters fine‑tuned on Math tutoring dialogues have been merged into the base model (Qwen/Qwen3‑4B‑Instruct‑2507). This allows you to load and run the model directly with Transformers (no PEFT merge step at runtime).

For lightweight adapters or Ollama-friendly quantized builds, see the “Related” section.

Quick usage (Transformers)

python
from transformers import AutoTokenizer, AutoModelForCausalLM

repo = "CanisAI/teach-math-qwen3-4b-2507-r1-merged"

tok = AutoTokenizer.from_pretrained(repo, use_fast=True)
model = AutoModelForCausalLM.from_pretrained(
    repo,
    device_map="auto",
    torch_dtype="auto"
)

prompt = "Explain how to solve 2x + 1 = 5 step by step."
inputs = tok(prompt, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=256, temperature=0.7, top_p=0.8, top_k=20)
print(tok.decode(out[0], skip_special_tokens=True))

Recommended decoding (for instruct-style usage):

  • —temperature ≈ 0.7
  • —top_p ≈ 0.8
  • —top_k ≈ 20 Adjust to your needs.

Intended use

  • —Subject‑aware tutoring for Math with didactic, step‑by‑step responses.
  • —Suitable for educational prototypes, demonstrations, and research.
  • —Built to “teach, not just answer”: stepwise hints, clarity, and rubric‑aligned structure.

Safety and limitations

  • —Human oversight is required. The model may hallucinate or oversimplify.
  • —For fact‑heavy tasks, consider Retrieval‑Augmented Generation (RAG) with curriculum sources.
  • —Follow data privacy and compliance rules in your environment (e.g., school policies).

Training summary

  • —Base model: Qwen/Qwen3-4B-Instruct-2507
  • —Method: Supervised fine‑tuning with LoRA (Unsloth + TRL/PEFT), then merged to full weights
  • —Data: Subject‑specific tutoring dialogues generated/curated via Canis.lab
  • —Goal: Improve clarity, hints, and step-by-step pedagogy for Math

Note: Exact hyperparameters and logs are provided in the LoRA training pipeline (if published) or available on request.

Related

  • —LoRA adapters (lightweight):
  • —CanisAI/teach-math-qwen3-4b-2507-r1
  • —Quantized GGUF for Ollama/llama.cpp:
  • —CanisAI/teach-math-qwen3-4b-2507-r1-gguf
  • —Base model:
  • —Qwen/Qwen3-4B-Instruct-2507

License

  • —Inherits the base model’s license. Review the base model terms before use.
  • —Dataset licensing and any third‑party assets should be respected accordingly.

Acknowledgments

  • —Qwen3 by Qwen team
  • —Unsloth, TRL, PEFT, and Transformers for training/serving
  • —Educators and contributors supporting Canis.teach

Learning that fits.