Gemma3 - shift labels to the right

I am trying to fine-tuning the new Gemma3 1B parameters. I am using the unsloth version: unsloth/gemma-3-1b-it-unsloth-bnb-4bit

I am using the DataCollatorForLanguageModeling, and as I see in other posts the shifting of the labels actually happens inside the model (I know this happens in GPT2). Now I am not sure the same thing happens in this Gemma3 model, or if I need to create the labels manually by shifting the input_ids 1 to the right.

Does anyone know how the model worse?

1 Like

Hmm…?

Wanted to know if Gemma would be the same

1 Like

i found it quite unexpected hence calling it “silently”. as this is for a causal LM, shouldn’t it be not shifting the labels by default? in modeling GPT2, this is at least documented explicitly.

in gemma2, it has the same behavior and no explicit mentioning in the docstring.

Maybe same. But I think that if you use the Transoformers Trainer or TRL, they will absorb the differences between models without you having to be particularly aware of them.