Instructions to use QizhiPei/DiffGen-8B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use QizhiPei/DiffGen-8B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="QizhiPei/DiffGen-8B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("QizhiPei/DiffGen-8B") model = AutoModelForCausalLM.from_pretrained("QizhiPei/DiffGen-8B") 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
- vLLM
How to use QizhiPei/DiffGen-8B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "QizhiPei/DiffGen-8B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "QizhiPei/DiffGen-8B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/QizhiPei/DiffGen-8B
- SGLang
How to use QizhiPei/DiffGen-8B 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 "QizhiPei/DiffGen-8B" \ --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": "QizhiPei/DiffGen-8B", "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 "QizhiPei/DiffGen-8B" \ --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": "QizhiPei/DiffGen-8B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use QizhiPei/DiffGen-8B with Docker Model Runner:
docker model run hf.co/QizhiPei/DiffGen-8B
Paper: ScaleDiff: Scaling Difficult Problems for Advanced Mathematical Reasoning
Code: https://github.com/QizhiPei/ScaleDiff
DiffGen-8B
This model is a fine-tuned version of Qwen/Qwen3-8B-Base.
Model description
DiffGen-8B is a specialized difficult problem generator developed as part of the ScaleDiff pipeline, an approach designed to scale the creation of challenging mathematical problems for advanced mathematical reasoning. The model is trained on a filtered dataset of difficult problems, enabling it to efficiently produce a vast number of new, complex mathematical problems. This process eliminates the need for complex, per-instance prompting and its associated high API costs, addressing the scarcity of high-quality, difficult training data for Large Reasoning Models (LRMs).
Intended uses & limitations
Intended Uses: DiffGen-8B is primarily intended for generating large-scale datasets of challenging mathematical problems. These generated problems are then used to augment training data for Large Reasoning Models (LRMs), thereby enhancing their mathematical reasoning capabilities. It serves as a crucial component in pipelines focused on improving LRM performance on difficult benchmarks by providing a continuous supply of intricate reasoning challenges.
Limitations: While DiffGen-8B excels at generating difficult problems, its primary scope is mathematical problem generation. The quality and relevance of the generated problems are further ensured through subsequent solution distillation and filtering steps within the broader ScaleDiff pipeline. Its performance may not be optimized for other general text generation tasks.
Training and evaluation data
DiffGen-8B is a fine-tuned version of Qwen/Qwen3-8B-Base. It was trained on a subset of difficult problems selected from the AM-Qwen3-Distilled dataset. This selection was performed efficiently using AdaptThink, an adaptive thinking model that perceives problem difficulty with only a single forward pass, eliminating the need for solutions during selection. The problems generated by DiffGen-8B contribute to the creation of the ScaleDiff-Math dataset.
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 5e-05
- train_batch_size: 16
- eval_batch_size: 8
- seed: 42
- distributed_type: multi-GPU
- num_devices: 8
- total_train_batch_size: 128
- total_eval_batch_size: 64
- optimizer: Use adamw_torch with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
- lr_scheduler_type: linear
- lr_scheduler_warmup_ratio: 0.1
- num_epochs: 1.0
Training results
Framework versions
- Transformers 4.52.0.dev0
- Pytorch 2.6.0+cu124
- Datasets 2.21.0
- Tokenizers 0.21.1
- Downloads last month
- 5