Selective Expert Guidance for Effective and Diverse Exploration in Reinforcement Learning of LLMs
Paper • 2510.04140 • Published
How to use Jiangzs/MENTOR_Qwen_7B with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="Jiangzs/MENTOR_Qwen_7B")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("Jiangzs/MENTOR_Qwen_7B")
model = AutoModelForCausalLM.from_pretrained("Jiangzs/MENTOR_Qwen_7B")
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]:]))How to use Jiangzs/MENTOR_Qwen_7B with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "Jiangzs/MENTOR_Qwen_7B"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "Jiangzs/MENTOR_Qwen_7B",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/Jiangzs/MENTOR_Qwen_7B
How to use Jiangzs/MENTOR_Qwen_7B with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "Jiangzs/MENTOR_Qwen_7B" \
--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": "Jiangzs/MENTOR_Qwen_7B",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "Jiangzs/MENTOR_Qwen_7B" \
--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": "Jiangzs/MENTOR_Qwen_7B",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use Jiangzs/MENTOR_Qwen_7B with Docker Model Runner:
docker model run hf.co/Jiangzs/MENTOR_Qwen_7B
MENTOR is a framework that enables LLMs to achieve effective and diverse exploration in reinforcement learning by providing expert guidance only at critical decision points, rather than imitating entire expert trajectories.
def build_MENTOR_chat_template(question, tokenizer):
system_prompt = (
"You are a helpful AI Assistant that provides well-reasoned and detailed responses. "
"You FIRST think about the reasoning process as an internal monologue and "
"then provide the final answer. The reasoning process MUST BE enclosed "
"within <think> </think> tags. The final answer MUST BE put in \\boxed{}."
)
return tokenizer.apply_chat_template(
[
{"role": "system", "content": system_prompt},
{"role": "user", "content": question}
],
tokenize=False,
add_generation_prompt=True
)
If you find our model useful, please kindly cite our paper:
@article{jiang2025selective,
title={Selective Expert Guidance for Effective and Diverse Exploration in Reinforcement Learning of LLMs},
author={Jiang, Zishang and Han, Jinyi and Li, Tingyun and Wang, Xinyi and Jiang, Sihang and Liang, Jiaqing and Dai, Zhaoqian and Ma, Shuguang and Yu, Fei and Xiao, Yanghua},
journal={arXiv preprint arXiv:2510.04140},
year={2025}
}