Gemma 3 hyperparameters
Hello,
I would like to clarify which hyperparameters can be adjusted for the Gemma 3 27B model (e.g., temperature or similar settings). Could you please provide a list of configurable parameters and instructions on how to access or change them, in order to better tailor the model for different tasks?
Thank you!
Hi @Augustas17 ,
Welcome to Gemma family of open source models, yes you can experiment with the different parameters like temperature, top_k, top_p, max_tokens, min_p, repetition_penalty..etc
.
temperature
: This parameter controls the randomness of the output. Higher values (e.g., 0.8-1.0) make the output more random, creative, and diverse, while lower values (e.g., 0.2-0.5) make it more focused, deterministic, and less prone to unexpected variations. A temperature of 0 typically means deterministic (greedy) sampling.
top_p
: This parameter controls the cumulative probability of tokens considered during sampling.
top_k
: This parameter limits the sampling to the k most probable tokens at each step.
max_tokens
: This sets the maximum number of tokens the model will generate in its response. It's crucial for controlling output length and preventing endless generation.
repetition_penalty:
: A penalty applied to tokens that have already appeared in the text, to discourage the model from repeating itself. Values greater than 1 penalize repetition, while values less than 1 encourage it.
Please find the attached sample gist file for you reference.
Thanks.