Skip to content
ModelListedExternal
Browse files

Gemma4 DPO Test

This model is a fine-tuned version of google/gemma-4-31B. It has been trained using TRL.

KindOtherBase modelgoogle/gemma-4-31BVersionRevision 36a51cdBgrade

Model source

Kind
Other
File size
934 MB–18.0 GB
Base model
google/gemma-4-31B
Version
vRevision 36a51cd
Updated
Oct 23, 2026
Downloads
11
Source
Hugging Face

Source description

Model Card for Gemma-DPO

This model is a fine-tuned version of google/gemma-4-31B. It has been trained using TRL.

Quick start

from transformers import pipeline

question = "If you had a time machine, but could only go to the past or the future once and never return, which would you choose and why?"
generator = pipeline("text-generation", model="None", device="cuda")
output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
print(output["generated_text"])

Training procedure

This model was trained with DPO, a method introduced in Direct Preference Optimization: Your Language Model is Secretly a Reward Model.

Framework versions

  • TRL: 1.5.1
  • Transformers: 5.10.2
  • Pytorch: 2.10.0+cu128
  • Datasets: 4.8.5
  • Tokenizers: 0.22.2

Citations

Cite DPO as:

@inproceedings{rafailov2023direct,
    title        = {{Direct Preference Optimization: Your Language Model is Secretly a Reward Model}},
    author       = {Rafael Rafailov and Archit Sharma and Eric Mitchell and Christopher D. Manning and Stefano Ermon and Chelsea Finn},
    year         = 2023,
    booktitle    = {Advances in Neural Information Processing Systems 36: Annual Conference on Neural Information Processing Systems 2023, NeurIPS 2023, New Orleans, LA, USA, December 10 - 16, 2023},
    url          = {http://papers.nips.cc/paper_files/paper/2023/hash/a85b405ed65c6477a4fe8302b5e06ce7-Abstract-Conference.html},
    editor       = {Alice Oh and Tristan Naumann and Amir Globerson and Kate Saenko and Moritz Hardt and Sergey Levine},
}

Cite TRL as:

@software{vonwerra2020trl,
  title   = {{TRL: Transformers Reinforcement Learning}},
  author  = {von Werra, Leandro and Belkada, Younes and Tunstall, Lewis and Beeching, Edward and Thrush, Tristan and Lambert, Nathan and Huang, Shengyi and Rasul, Kashif and Gallouédec, Quentin},
  license = {Apache-2.0},
  url     = {https://github.com/huggingface/trl},
  year    = {2020}
}

Sources

1 source
Hugging FacePrimaryVersion 36a51cd80b390b86bea0ba41bc902da2db7cf29f
huggingface.co/ConicCat/Gemma4-DPO-Test/tree/36a51cd80b390b86bea0ba41bc902da2db7cf29f

Verified Oct 23

Download files

Model artifacts

3 artifacts

adapter_model.safetensors

safetensors · 934 MB · SHA-256 d21fd5aa236b…4851 · Hugging Face

Download file

checkpoint-231/adapter_model.safetensors

safetensors · 934 MB · SHA-256 d21fd5aa236b…4851 · Hugging Face

Download file

model.safetensors

safetensors · 18.0 GB · SHA-256 776b9796bcaf…2b8a · Hugging Face

Download file

Source excerpts

3 excerpts

--- base_model: google/gemma-4-31B library_name: transformers model_name: Gemma-DPO tags: - generated_from_trainer - dpo - trl licence: license --- # Model Card for Gemma-DPO This model is a fine-tuned version of [google/gemma-4-31B](https://huggingface.co/google/gemma-4-31B). It has been trained using [TRL](https://github.com/huggingface/trl). ## Quick start ```python from transformers import pipeline question = "If you had a time machine, but could only go to the past or the future once and never return, which would you choose and why?" generator = pipeline("text-generation", model="None", device="cuda") output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0] print(output["generated_text"]) ``` ## Training procedure This model was trained with DPO, a method introduced in [Direct Preference Optimization: Your Language Model is Secretly a Reward Model](https://huggingface.co/papers/2305.18290). ### Framework versions - TRL: 1.5.1 - Transformers: 5.10.2 - Pytorch: 2.10.0+cu128 - Datasets: 4.8.5 - Tokenizers: 0.22.2 ## Citations Cite DPO as: ```bibtex @inproceedings{rafailov2023direct, title = {{Direct Preference Optimization: Your Language Model is Secretly a Reward Model}}, author = {Rafael Rafailov and Archit Sharma and Eric Mitchell and Christopher D. Manning and Stefano Ermon and Chelsea Finn}, year = 2023, booktitle = {Advances in Neural Information Processing Systems 36: Annual Conference on Neural Information Processing Systems 2023, NeurIPS 2023, New Orleans, LA, USA, December 10 - 16, 2023}, url = {http://papers.nips.cc/paper_files/paper/2023/hash/a85b405ed65c6477a4fe8302b5e06ce7-Abstract-Conference.html}, editor = {Alice Oh and Tristan Naumann and Amir Globerson and Kate Saenko and Moritz Hardt and Sergey Levine}, } ``` Cite TRL as: ```bibtex @software{vonwerra2020trl, title = {{TRL: Transformers Reinforcement Learning}}, author = {von Werra, Leandro and Belkada, Younes and Tunstall, Lewis and Beeching, Edward and Thrush, Tristan and Lambert, Nathan and Huang, Shengyi and Rasul, Kashif and Gallouédec, Quentin}, license = {Apache-2.0}, url = {https://github.com/huggingface/trl}, year = {2020} } ```

Source context: 11 downloads · 0 likes · Pipeline image-text-to-text · Library transformers · Repo ConicCat/Gemma4-DPO-Test

Source context: 25 downloads · 0 likes · Pipeline image-text-to-text · Library transformers · Repo ConicCat/Gemma4-DPO-Test