Elliott/LUFFY-Qwen-Math-1.5B-Zero

Model

📖Introduction

0

5 commits

8 linked in READMEs

updated Apr 23, 2025

See the code

README

📖Introduction

Github

LUFFY is a reinforcement learning framework that bridges the gap between zero-RL and imitation learning by incorporating off-policy reasoning traces into the training process. Built upon GRPO, LUFFY combines on-policy rollouts with off-policy demonstrations during advantage estimation and introduces policy shaping via regularized importance sampling to emphasize low-probability yet crucial actions.

Key Highlights:

  • Off-Policy Guidance: Seamlessly integrates external reasoning traces to bootstrap learning from stronger models.
  • Dynamic Balance: Learns when to imitate and when to explore, adapting over the course of training.
  • Policy Shaping: Emphasizes important actions often ignored in standard policy gradients, enabling better generalization.

Inference

Here’s an example of using LUFFY for inference:

from transformers import AutoTokenizer
from vllm import LLM, SamplingParams

model_path="Elliott/LUFFY-Qwen-Math-7B-Zero"

question = "which number is larger? 9.11 or 9.9?"

tokenizer = AutoTokenizer.from_pretrained(model_path)
messages = [{"role": "user", "content": question}]
chat = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)

llm = LLM(model=model_path)
params = SamplingParams(temperature=0.6, max_tokens=8192)
outputs = llm.generate([chat], params)
print(outputs[0].outputs[0].text)

📃Evaluation

ModelAIME 24AIME 25AMCMATH-500MinervaOlympiadAvg.
Qwen2.5-Math-1.5B-Base7.94.726.431.012.121.517.3
Qwen2.5-Math-1.5B-Instruct11.48.547.475.227.638.734.8
SFT15.214.343.574.830.936.940.3
On-Policy RL12.66.542.668.822.134.436.1
LUFFY-1.5B-Zero15.212.746.879.426.542.442.1

🌻Acknowledgement

LUFFY builds upon veRL and deepscaler, and utilizes vLLM for inference. We utilize Math-Verify for math reasoning evaluation. We thank the open-source community for datasets and backbones, including NuminaMath, OpenR1-Math-220k, Qwen2.5-Math, and DeepSeek-R1 model.

Code: https://github.com/ElliottYan/LUFFY

Citation

If you find our model, data, or evaluation code useful, please kindly cite our paper:

@misc{luffy,
      title={Learning to Reason under Off-Policy Guidance}, 
      author={Jianhao Yan and Yafu Li and Zican Hu and Zhi Wang and Ganqu Cui and Xiaoye Qu and Yu Cheng and Yue Zhang},
      year={2025},
      eprint={2504.14945},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2504.14945}, 
}
conversational
endpoints_compatible
qwen2
reasoning
safetensors
text-generation
text-generation-inference
transformers
Zero-RL

Contributors

Elliott

5 commits

Elliott/LUFFY-Qwen-Math-1.5B-Zero

Model

📖Introduction

0

5 commits

8 linked in READMEs

updated Apr 23, 2025

See the code

README

📖Introduction

Github

LUFFY is a reinforcement learning framework that bridges the gap between zero-RL and imitation learning by incorporating off-policy reasoning traces into the training process. Built upon GRPO, LUFFY combines on-policy rollouts with off-policy demonstrations during advantage estimation and introduces policy shaping via regularized importance sampling to emphasize low-probability yet crucial actions.

Key Highlights:

  • Off-Policy Guidance: Seamlessly integrates external reasoning traces to bootstrap learning from stronger models.
  • Dynamic Balance: Learns when to imitate and when to explore, adapting over the course of training.
  • Policy Shaping: Emphasizes important actions often ignored in standard policy gradients, enabling better generalization.

Inference

Here’s an example of using LUFFY for inference:

from transformers import AutoTokenizer
from vllm import LLM, SamplingParams

model_path="Elliott/LUFFY-Qwen-Math-7B-Zero"

question = "which number is larger? 9.11 or 9.9?"

tokenizer = AutoTokenizer.from_pretrained(model_path)
messages = [{"role": "user", "content": question}]
chat = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)

llm = LLM(model=model_path)
params = SamplingParams(temperature=0.6, max_tokens=8192)
outputs = llm.generate([chat], params)
print(outputs[0].outputs[0].text)

📃Evaluation

ModelAIME 24AIME 25AMCMATH-500MinervaOlympiadAvg.
Qwen2.5-Math-1.5B-Base7.94.726.431.012.121.517.3
Qwen2.5-Math-1.5B-Instruct11.48.547.475.227.638.734.8
SFT15.214.343.574.830.936.940.3
On-Policy RL12.66.542.668.822.134.436.1
LUFFY-1.5B-Zero15.212.746.879.426.542.442.1

🌻Acknowledgement

LUFFY builds upon veRL and deepscaler, and utilizes vLLM for inference. We utilize Math-Verify for math reasoning evaluation. We thank the open-source community for datasets and backbones, including NuminaMath, OpenR1-Math-220k, Qwen2.5-Math, and DeepSeek-R1 model.

Code: https://github.com/ElliottYan/LUFFY

Citation

If you find our model, data, or evaluation code useful, please kindly cite our paper:

@misc{luffy,
      title={Learning to Reason under Off-Policy Guidance}, 
      author={Jianhao Yan and Yafu Li and Zican Hu and Zhi Wang and Ganqu Cui and Xiaoye Qu and Yu Cheng and Yue Zhang},
      year={2025},
      eprint={2504.14945},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2504.14945}, 
}
conversational
endpoints_compatible
qwen2
reasoning
safetensors
text-generation
text-generation-inference
transformers
Zero-RL

Contributors

Elliott

5 commits