---
title: PromptCoT-Problem-Generation-Model
canonical_url: "https://www.modelscope.cn/models/zhaoxlpku/PromptCoT-Problem-Generation-Model"
md_url: "https://www.modelscope.cn/models/zhaoxlpku/PromptCoT-Problem-Generation-Model.md"
repository: zhaoxlpku/PromptCoT-Problem-Generation-Model
last_updated: 2025-03-05
license: "Apache License 2.0"
model_type:
  - llama
architectures:
  - LlamaForCausalLM
parameters: 8.0B
tensor_type:
  - BF16
library_name:
  - transformer
  - safetensors
language:
  - en
inference_backends:
  - "deploy_task text/emb"
  - "lmdeploy 0.9.1"
  - "lmdeploy_turbomind 0.9.1"
  - "sglang 0.5.2"
  - "vllm 0.9.2"
downloads: 59
stars: 0
---

# PromptCoT-Problem-Generation-Model

> PromptCoT-Problem-Generation-Model - zhaoxlpku 在 ModelScope 开源的模型。PromptCoT: Synthesizing Olympiad-Level Problems for Mathematical Reasoning in Large Language Modelsg

zhaoxlpku/PromptCoT-Problem-Generation-Model 是 ModelScope 魔搭社区上的 8.0B 参数机器学习模型，采用 Apache License 2.0 许可，可用 deploy_task text/emb、lmdeploy 0.9.1、lmdeploy_turbomind 0.9.1 部署。

- **Repository**: zhaoxlpku/PromptCoT-Problem-Generation-Model
- **License**: Apache License 2.0
- **Parameters**: 8.0B
- **Inference backends**: deploy_task text/emb, lmdeploy 0.9.1, lmdeploy_turbomind 0.9.1, sglang 0.5.2, vllm 0.9.2
- **Downloads**: 59
- **Stars**: 0
- **Last updated**: 2025-03-05

Source: https://www.modelscope.cn/models/zhaoxlpku/PromptCoT-Problem-Generation-Model

---

# **PromptCoT: Synthesizing Olympiad-Level Problems for Mathematical Reasoning in Large Language Modelsg**  

[![ArXiv](https://img.shields.io/badge/arXiv-2503.02324-red)](http://arxiv.org/abs/2503.02324)  
[![GitHub](https://img.shields.io/badge/GitHub-PromptCoT-blue)](https://github.com/zhaoxlpku/PromptCoT)  

---

## 🚀 **Overview**  
The **PromptCoT Problem Generation Model** is a lightweight yet powerful model for synthesizing high-quality Olympiad-level mathematical problems. It enables the scalable construction of problem sets to facilitate post-training tasks such as **Supervised Fine-Tuning (SFT) and Reinforcement Learning (RL)**. By systematically modeling expert problem design, PromptCoT helps generate logically consistent and intellectually demanding problems at scale.

For more details, refer to our **paper on ArXiv**: [🔗 PromptCoT: Synthesizing Olympiad-Level Problems for Mathematical Reasoning in Large Language Models](http://arxiv.org/abs/2503.02324).  

---

## 🔥 **Quick Start: Using the Model**  

### **1️⃣ Install Dependencies**  
```bash
pip install transformers vllm torch accelerate
```

### **2️⃣ Load the Model with Hugging Face Transformers**  
You can use the model for **direct inference** using Hugging Face’s `generate` API:  
```python
from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "xl-zhao/PromptCoT-Problem-Generation-Model"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name).to("cuda")

foundational_concepts = [
    "Ability to apply quantitative reasoning and estimation techniques to solve problems, including making approximations and using logical deductions to arrive at a solution.",
    "Ability to solve equations involving complex numbers, including finding conditions under which two complex numbers are equal, particularly in the context of their magnitudes and arguments.",
    "Fractional arithmetic: Performing calculations with fractions to determine the final probability.",
    "Interpreting and solving problems involving nested operations or functions.",
    "Using logical reasoning to connect given data points and derive conclusions."
]

difficulty_level = "HMMT-Feb"

prompt = (
    "Given foundational concepts and difficulty level, identify connections and develop a question "
    "that integrates these concepts with appropriate complexity.\n\n"
    "Foundational Concepts:\n"
    + "\n".join(f"{i+1}. {concept}" for i, concept in enumerate(foundational_concepts))
    + f"\n\nDifficulty Level: {difficulty_level}"
)

inputs = tokenizer(prompt, return_tensors="pt").to("cuda")

with torch.no_grad():
    output = model.generate(**inputs, max_length=4096, temperature=0.6)

generated_problem = tokenizer.decode(output[0], skip_special_tokens=True)
print(generated_problem)
```

---

## ⚡ **Using vLLM for Fast Inference**  
For optimized inference, use `vLLM`:  
```python
from vllm import LLM, SamplingParams

model_name = "xl-zhao/PromptCoT-Problem-Generation-Model"
llm = LLM(model=model_name, tensor_parallel_size=1)

foundational_concepts = [
    "Ability to apply quantitative reasoning and estimation techniques to solve problems, including making approximations and using logical deductions to arrive at a solution.",
    "Ability to solve equations involving complex numbers, including finding conditions under which two complex numbers are equal, particularly in the context of their magnitudes and arguments.",
    "Fractional arithmetic: Performing calculations with fractions to determine the final probability.",
    "Interpreting and solving problems involving nested operations or functions.",
    "Using logical reasoning to connect given data points and derive conclusions."
]

difficulty_level = "HMMT-Feb"

prompt = (
    "Given foundational concepts and difficulty level, identify connections and develop a question "
    "that integrates these concepts with appropriate complexity.\n\n"
    "Foundational Concepts:\n"
    + "\n".join(f"{i+1}. {concept}" for i, concept in enumerate(foundational_concepts))
    + f"\n\nDifficulty Level: {difficulty_level}"
)

sampling_params = SamplingParams(temperature=0.6, max_tokens=4096)
outputs = llm.generate([prompt], sampling_params)

print(outputs[0].outputs[0].text)
```

---

## 🔗 **Full Usage & Advanced Options**  
For advanced usage, including **batch inference and rejection sampling for filtering high-quality problems**, refer to the **full repository on GitHub**:  
🔹 [GitHub: PromptCoT](https://github.com/zhaoxlpku/PromptCoT)  

---

## 📜 **Citation**  
If you use **PromptCoT**, please consider citing:  
```
@article{zhao2025promptcot,
  author    = {Zhao, Xueliang and Wu, Wei and Guan, Jian and Kong, Lingpeng},
  title     = {PromptCoT: Synthesizing Olympiad-Level Problems for Mathematical Reasoning in Large Language Models},
  year      = {2025},
  journal   = {arXiv preprint arXiv:2503.02324},
  url       = {http://arxiv.org/abs/2503.02324}
}
```
