Qwen3-4B-Base SFT on OpenMath Mini

This model is fine-tuned from Qwen3-4B-Base using Supervised Fine-Tuning (SFT) on the OpenMath Mini dataset.
The goal is to improve the model’s ability to solve and reason through mathematical problems in natural language.


🧠 Training Information

  • Base Model: Qwen3-4B-Base
  • Dataset: OpenMath Mini
  • Training Type: Full-parameter SFT
  • Framework: PyTorch + Hugging Face Transformers

💻 Usage Example

from transformers import AutoModelForCausalLM, AutoTokenizer,TextStreamer

model_name='wesjos/SFT-Qwen3-4B-Base'

tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
    model_name,
    device_map="auto",
)

prompt='Find the sum of the roots of the equation \((x+6)^{1/3} + (x-2)^{1/2} = 2\).'

messages = [
    {"role": "user", "content": prompt}
]

streamer= TextStreamer(tokenizer,skip_prompt=False,skip_special_tokens=False)

text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True,
)

model_inputs = tokenizer([text], return_tensors="pt",add_special_tokens=True,
).to(model.device)

outputs = model.generate(
    **model_inputs,
    max_new_tokens=4096,
    streamer=streamer,
)
Downloads last month
3
Safetensors
Model size
4B params
Tensor type
F32
·
BF16
·
U8
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for wesjos/SFT-Qwen3-4B-Base-math

Base model

Qwen/Qwen3-4B-Base
Quantized
(34)
this model

Dataset used to train wesjos/SFT-Qwen3-4B-Base-math