Text Generation
Transformers
Safetensors
English
qwen3
math
reasoning
olympiad-math
supervised-fine-tuning
lora
cs-552
conversational
text-generation-inference
Instructions to use cs-552-2026-group1/math_model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cs-552-2026-group1/math_model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="cs-552-2026-group1/math_model") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("cs-552-2026-group1/math_model") model = AutoModelForCausalLM.from_pretrained("cs-552-2026-group1/math_model") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use cs-552-2026-group1/math_model with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cs-552-2026-group1/math_model" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cs-552-2026-group1/math_model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/cs-552-2026-group1/math_model
- SGLang
How to use cs-552-2026-group1/math_model with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "cs-552-2026-group1/math_model" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cs-552-2026-group1/math_model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "cs-552-2026-group1/math_model" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cs-552-2026-group1/math_model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use cs-552-2026-group1/math_model with Docker Model Runner:
docker model run hf.co/cs-552-2026-group1/math_model
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,93 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
base_model: Qwen/Qwen3-1.7B
|
| 6 |
+
pipeline_tag: text-generation
|
| 7 |
+
library_name: transformers
|
| 8 |
+
tags:
|
| 9 |
+
- qwen3
|
| 10 |
+
- math
|
| 11 |
+
- reasoning
|
| 12 |
+
- olympiad-math
|
| 13 |
+
- supervised-fine-tuning
|
| 14 |
+
- lora
|
| 15 |
+
- cs-552
|
| 16 |
+
datasets:
|
| 17 |
+
- EleutherAI/hendrycks_math
|
| 18 |
+
- open-r1/OpenR1-Math-220k
|
| 19 |
+
- AI-MO/NuminaMath-CoT
|
| 20 |
+
metrics:
|
| 21 |
+
- accuracy
|
| 22 |
---
|
| 23 |
+
|
| 24 |
+
# Math Model — Olympiad-Focused SFT Checkpoint
|
| 25 |
+
|
| 26 |
+
This model is a fine-tuned version of **Qwen/Qwen3-1.7B** for mathematical reasoning, developed for the CS-552 standard project math track.
|
| 27 |
+
|
| 28 |
+
The model was trained to solve competition-style mathematics problems and produce final answers in boxed LaTeX format.
|
| 29 |
+
|
| 30 |
+
## Base Model
|
| 31 |
+
|
| 32 |
+
- Base model: `Qwen/Qwen3-1.7B`
|
| 33 |
+
- Fine-tuning method: LoRA supervised fine-tuning
|
| 34 |
+
- Target task: mathematical reasoning and short-answer competition problems
|
| 35 |
+
|
| 36 |
+
## Training Data
|
| 37 |
+
|
| 38 |
+
The final submitted checkpoint was trained on approximately **25,165** examples from hard mathematical reasoning datasets:
|
| 39 |
+
|
| 40 |
+
| Dataset / Source | Examples |
|
| 41 |
+
|---|---:|
|
| 42 |
+
| Hendrycks MATH | 4,759 |
|
| 43 |
+
| OpenR1-Math-220k | 7,999 |
|
| 44 |
+
| NuminaMath-CoT | 12,407 |
|
| 45 |
+
| **Total** | **25,165** |
|
| 46 |
+
|
| 47 |
+
The NuminaMath subset was filtered to focus on harder mathematical sources:
|
| 48 |
+
|
| 49 |
+
- Olympiads
|
| 50 |
+
- AoPS Forum
|
| 51 |
+
- AMC/AIME
|
| 52 |
+
- MATH
|
| 53 |
+
|
| 54 |
+
The OpenR1 subset was filtered to competition-relevant categories:
|
| 55 |
+
|
| 56 |
+
- Algebra
|
| 57 |
+
- Geometry
|
| 58 |
+
- Number Theory
|
| 59 |
+
- Combinatorics
|
| 60 |
+
- Inequalities
|
| 61 |
+
|
| 62 |
+
## Training Details
|
| 63 |
+
|
| 64 |
+
| Setting | Value |
|
| 65 |
+
|---|---|
|
| 66 |
+
| Base model | Qwen/Qwen3-1.7B |
|
| 67 |
+
| Fine-tuning method | LoRA |
|
| 68 |
+
| Epochs | 1 |
|
| 69 |
+
| LoRA rank | 32 |
|
| 70 |
+
| LoRA alpha | 64 |
|
| 71 |
+
| LoRA dropout | 0.05 |
|
| 72 |
+
| Learning rate | 1e-4 |
|
| 73 |
+
| Batch size | 1 |
|
| 74 |
+
| Gradient accumulation steps | 8 |
|
| 75 |
+
| Precision | bfloat16 |
|
| 76 |
+
| Hardware | 1 × NVIDIA A100 40GB |
|
| 77 |
+
| Training steps | 3,146 |
|
| 78 |
+
| Runtime | 6,761 seconds |
|
| 79 |
+
| Tokens processed | 14.7M |
|
| 80 |
+
| Final training loss | 0.6114 |
|
| 81 |
+
| Mean token accuracy | 0.8302 |
|
| 82 |
+
|
| 83 |
+
## Generation Configuration
|
| 84 |
+
|
| 85 |
+
The submitted generation configuration uses sampling:
|
| 86 |
+
|
| 87 |
+
```json
|
| 88 |
+
{
|
| 89 |
+
"do_sample": true,
|
| 90 |
+
"temperature": 0.25,
|
| 91 |
+
"top_p": 0.85,
|
| 92 |
+
"top_k": 30
|
| 93 |
+
}
|