Instructions to use Bopalv/Qwen3-0.6B-quantized with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use Bopalv/Qwen3-0.6B-quantized with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Bopalv/Qwen3-0.6B-quantized", filename="Qwen3-0.6B-GGUF/Qwen3-0.6B.Q4_K_M.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use Bopalv/Qwen3-0.6B-quantized with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf Bopalv/Qwen3-0.6B-quantized:Q4_K_M # Run inference directly in the terminal: llama-cli -hf Bopalv/Qwen3-0.6B-quantized:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf Bopalv/Qwen3-0.6B-quantized:Q4_K_M # Run inference directly in the terminal: llama-cli -hf Bopalv/Qwen3-0.6B-quantized:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf Bopalv/Qwen3-0.6B-quantized:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf Bopalv/Qwen3-0.6B-quantized:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf Bopalv/Qwen3-0.6B-quantized:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf Bopalv/Qwen3-0.6B-quantized:Q4_K_M
Use Docker
docker model run hf.co/Bopalv/Qwen3-0.6B-quantized:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use Bopalv/Qwen3-0.6B-quantized with Ollama:
ollama run hf.co/Bopalv/Qwen3-0.6B-quantized:Q4_K_M
- Unsloth Studio
How to use Bopalv/Qwen3-0.6B-quantized with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Bopalv/Qwen3-0.6B-quantized to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Bopalv/Qwen3-0.6B-quantized to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Bopalv/Qwen3-0.6B-quantized to start chatting
- Pi
How to use Bopalv/Qwen3-0.6B-quantized with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf Bopalv/Qwen3-0.6B-quantized:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Bopalv/Qwen3-0.6B-quantized:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use Bopalv/Qwen3-0.6B-quantized with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf Bopalv/Qwen3-0.6B-quantized:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default Bopalv/Qwen3-0.6B-quantized:Q4_K_M
Run Hermes
hermes
- Docker Model Runner
How to use Bopalv/Qwen3-0.6B-quantized with Docker Model Runner:
docker model run hf.co/Bopalv/Qwen3-0.6B-quantized:Q4_K_M
- Lemonade
How to use Bopalv/Qwen3-0.6B-quantized with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Bopalv/Qwen3-0.6B-quantized:Q4_K_M
Run and chat with the model
lemonade run user.Qwen3-0.6B-quantized-Q4_K_M
List all available models
lemonade list
Upload DGPO-Training/DGPO-Training-README.md with huggingface_hub
Browse files
DGPO-Training/DGPO-Training-README.md
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Qwen3-0.6B DGPO Training
|
| 2 |
+
|
| 3 |
+
**Difficulty-Aware Group Policy Optimization (DGPO)** - ICLR 2026
|
| 4 |
+
|
| 5 |
+
## What is DGPO?
|
| 6 |
+
|
| 7 |
+
DGPO is an advanced reinforcement learning method that extends GRPO (Group Relative Policy Optimization) by adding difficulty-aware mechanisms. It's from the **MathForge** paper: "Harder Is Better: Boosting Mathematical Reasoning via Difficulty-Aware GRPO".
|
| 8 |
+
|
| 9 |
+
### Key Innovation
|
| 10 |
+
|
| 11 |
+
Standard GRPO has an implicit imbalance where **harder questions get lower policy updates**. DGPO fixes this by:
|
| 12 |
+
|
| 13 |
+
1. **Difficulty-Balanced Group Advantage Estimation**
|
| 14 |
+
- Uses Mean Absolute Deviation (MAD) instead of standard deviation
|
| 15 |
+
- Normalizes advantages based on question difficulty
|
| 16 |
+
|
| 17 |
+
2. **Difficulty-Aware Question Weighting (DQW)**
|
| 18 |
+
- Prioritizes harder questions during training
|
| 19 |
+
- Uses softmax weighting with temperature parameter
|
| 20 |
+
|
| 21 |
+
## DGPO vs DPO vs GRPO
|
| 22 |
+
|
| 23 |
+
| Method | Type | Key Feature | Best For |
|
| 24 |
+
|--------|------|-------------|----------|
|
| 25 |
+
| **DPO** | Preference | Pairwise preferences | General alignment |
|
| 26 |
+
| **GRPO** | RLVR | Group-based rewards | Math reasoning |
|
| 27 |
+
| **DGPO** | RLVR | Difficulty-aware | Hard math problems |
|
| 28 |
+
|
| 29 |
+
## Installation
|
| 30 |
+
|
| 31 |
+
```bash
|
| 32 |
+
# Install dependencies
|
| 33 |
+
pip install torch transformers trl peft datasets accelerate
|
| 34 |
+
|
| 35 |
+
# Clone MathForge (optional, for reference)
|
| 36 |
+
git clone https://github.com/AMAP-ML/MathForge.git
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
## Quick Start
|
| 40 |
+
|
| 41 |
+
### Basic DGPO Training
|
| 42 |
+
|
| 43 |
+
```bash
|
| 44 |
+
python train_dgpo_qwen3.py \
|
| 45 |
+
--model_name Qwen/Qwen3-0.6B \
|
| 46 |
+
--enable_dgpo \
|
| 47 |
+
--enable_dgpo_dqw \
|
| 48 |
+
--dgpo_dqw_temp 2.0
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
### With Custom Parameters
|
| 52 |
+
|
| 53 |
+
```bash
|
| 54 |
+
python train_dgpo_qwen3.py \
|
| 55 |
+
--model_name Qwen/Qwen3-0.6B \
|
| 56 |
+
--dataset_name DigitalLearningGmbH/MATH-lighteval \
|
| 57 |
+
--enable_dgpo \
|
| 58 |
+
--enable_dgpo_dqw \
|
| 59 |
+
--dgpo_dqw_temp 2.0 \
|
| 60 |
+
--num_generations 8 \
|
| 61 |
+
--max_completion_length 1024 \
|
| 62 |
+
--learning_rate 1e-6 \
|
| 63 |
+
--num_train_epochs 3
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
### Using Shell Script
|
| 67 |
+
|
| 68 |
+
```bash
|
| 69 |
+
chmod +x run_dgpo.sh
|
| 70 |
+
./run_dgpo.sh
|
| 71 |
+
```
|
| 72 |
+
|
| 73 |
+
## DGPO Parameters
|
| 74 |
+
|
| 75 |
+
| Parameter | Default | Description |
|
| 76 |
+
|-----------|---------|-------------|
|
| 77 |
+
| `--enable_dgpo` | True | Enable DGPO algorithm |
|
| 78 |
+
| `--enable_dgpo_dqw` | True | Enable Difficulty-aware Question Weighting |
|
| 79 |
+
| `--dgpo_dqw_temp` | 2.0 | Temperature for DQW (higher = more focus on hard questions) |
|
| 80 |
+
|
| 81 |
+
## Training Parameters
|
| 82 |
+
|
| 83 |
+
| Parameter | Default | Description |
|
| 84 |
+
|-----------|---------|-------------|
|
| 85 |
+
| `--num_generations` | 4 | Number of completions per prompt |
|
| 86 |
+
| `--max_completion_length` | 512 | Maximum tokens in completion |
|
| 87 |
+
| `--learning_rate` | 5e-7 | Learning rate (use small LR for DGPO) |
|
| 88 |
+
| `--num_train_epochs` | 1 | Number of training epochs |
|
| 89 |
+
| `--beta` | 0.0 | KL coefficient (0 = no reference model) |
|
| 90 |
+
| `--temperature` | 0.7 | Sampling temperature |
|
| 91 |
+
|
| 92 |
+
## Performance
|
| 93 |
+
|
| 94 |
+
From the MathForge paper (Qwen2.5-Math-7B):
|
| 95 |
+
|
| 96 |
+
| Method | AIME24 | AIME25 | AMC23 | MATH500 | Avg. |
|
| 97 |
+
|--------|--------|--------|-------|---------|------|
|
| 98 |
+
| GRPO | 20.94 | 8.44 | 58.98 | 72.20 | 37.61 |
|
| 99 |
+
| **DGPO** | 23.85 | 10.21 | **61.02** | 74.25 | **39.79** |
|
| 100 |
+
| MathForge | 24.58 | **12.60** | 59.84 | **79.95** | **42.17** |
|
| 101 |
+
|
| 102 |
+
**DGPO improves over GRPO by +2.18% on average!**
|
| 103 |
+
|
| 104 |
+
## References
|
| 105 |
+
|
| 106 |
+
- **Paper**: [Harder Is Better: Boosting Mathematical Reasoning via Difficulty-Aware GRPO](https://arxiv.org/abs/2601.20614)
|
| 107 |
+
- **Code**: [AMAP-ML/MathForge](https://github.com/AMAP-ML/MathForge)
|
| 108 |
+
- **Conference**: ICLR 2026
|
| 109 |
+
|
| 110 |
+
## Citation
|
| 111 |
+
|
| 112 |
+
```bibtex
|
| 113 |
+
@article{dai2026harder,
|
| 114 |
+
title={Harder Is Better: Boosting Mathematical Reasoning via Difficulty-Aware GRPO and Multi-Aspect Question Reformulation},
|
| 115 |
+
author={Dai, Yanqi and Ji, Yuxiang and Zhang, Xiao and Wang, Yong and Chu, Xiangxiang and Lu, Zhiwu},
|
| 116 |
+
journal={ICLR},
|
| 117 |
+
year={2026}
|
| 118 |
+
}
|
| 119 |
+
```
|