Model Card for Model ID

This model is a fine-tuned version of Google/gemma-2-2b-it on the dataset GSM8k. It has been trained using GRPOTrainer from TRL.

Quick start

from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline

tokenizer_name = "Google/gemma-2-2b-it"
model_name="lmassaron/gemma-2-2b-it-grpo-gsm8k"
tokenizer = AutoTokenizer.from_pretrained(tokenizer_name,
                                          trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(model_name,
                                             device_map="auto",
                                             use_cache=True)

FORMAT = """<reasoning>\n</reasoning>\n<answer>\n</answer>\n"""

question = "Which is bigger? 9.11 or 9.9?"
generator = pipeline("text-generation",
                      model=model,
                      tokenizer=tokenizer,
                      do_sample=False,
                      batch_size=1)
output = generator([{"role": "user", "content": FORMAT + question}],
                    max_new_tokens=256,
                    return_full_text=False)[0]
print(output["generated_text"])

Training procedure

This model was trained with GRPO, a method introduced in DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models.

Framework versions

  • TRL: 0.15.1
  • Transformers: 4.49.0
  • Pytorch: 2.5.1+cu124
  • Datasets: 3.3.1
  • Tokenizers: 0.21.0

Citations

Cite GRPO as:

@article{zhihong2024deepseekmath,
    title        = {{DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models}},
    author       = {Zhihong Shao and Peiyi Wang and Qihao Zhu and Runxin Xu and Junxiao Song and Mingchuan Zhang and Y. K. Li and Y. Wu and Daya Guo},
    year         = 2024,
    eprint       = {arXiv:2402.03300},
}

Cite TRL as:

@misc{vonwerra2022trl,
    title        = {{TRL: Transformer Reinforcement Learning}},
    author       = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallouédec},
    year         = 2020,
    journal      = {GitHub repository},
    publisher    = {GitHub},
    howpublished = {\url{https://github.com/huggingface/trl}}
}
Downloads last month
28
Safetensors
Model size
2.61B params
Tensor type
BF16
·
Inference Providers NEW
This model is not currently available via any of the supported Inference Providers.

Model tree for lmassaron/gemma-2-2b-it-grpo-gsm8k

Base model

google/gemma-2-2b
Finetuned
(416)
this model

Dataset used to train lmassaron/gemma-2-2b-it-grpo-gsm8k