--- library_name: transformers tags: - grpo - trl datasets: - openai/gsm8k metrics: - accuracy base_model: - google/gemma-2-2b-it --- # Model Card for Model ID This model is a fine-tuned version of [Google/gemma-2-2b-it](https://huggingface.co./google/gemma-2-2b-it) on the dataset [GSM8k](https://huggingface.co./datasets/openai/gsm8k). It has been trained using GRPOTrainer from TRL. ## Quick start ```python 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 = """\n\n\n\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](https://huggingface.co./papers/2402.03300). ### 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: ```bibtex @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: ```bibtex @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}} } ```