Run this model with HF Jobs

Run Ekkoliu/QwenMathSolving on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/Ekkoliu/QwenMathSolving. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/Ekkoliu/QwenMathSolving on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/Ekkoliu/QwenMathSolving. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/Ekkoliu/QwenMathSolving. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

Qwen3-4B-Thinking-2507 β€” Math Reasoning LoRA

LoRA adapter for Qwen/Qwen3-4B-Thinking-2507, fine-tuned for a CSE 151B math/statistics reasoning competition.

Training

  • Method: rejection-sampling fine-tuning (STaR). For each public training question, several reasoning traces were sampled from the base model; only traces whose extracted answer matched the gold answer were kept (1,205 traces from 624 questions). The adapter was trained on these with the prompt tokens masked, so loss is computed only on the reasoning + answer.
  • LoRA: rank 32, Ξ± 64, dropout 0.05, targets all attention + MLP projections (q/k/v/o/gate/up/down).
  • Optim: lr 1e-4, cosine schedule, 2 epochs, effective batch 16, bf16, gradient checkpointing.

Usage

from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer

base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-4B-Thinking-2507", dtype="bfloat16")
model = PeftModel.from_pretrained(base, "Ekkoliu/qwen3-4b-thinking-2507-math-lora")
tok = AutoTokenizer.from_pretrained("Qwen/Qwen3-4B-Thinking-2507")

Or with vLLM (as used in the competition pipeline, with self-consistency voting):

from vllm import LLM
from vllm.lora.request import LoRARequest
llm = LLM("Qwen/Qwen3-4B-Thinking-2507", enable_lora=True, max_lora_rank=32)
# pass lora_request=LoRARequest("adapter", 1, "<local_or_hub_path>") to llm.chat(...)

Framework versions

  • PEFT 0.19.1
Downloads last month
6
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for Ekkoliu/QwenMathSolving

Adapter
(78)
this model