In this article
Gemma 4 adds native system support, so legacy first-user system instructions need a deliberate format migration.
Gemma 4 introduces native system-prompt support and a different rendered conversation format. A migration from Gemma 3 should update prompt construction deliberately rather than simply replace the model identifier.
Read the old and new role rules
The Gemma 4 formatting guide describes system instructions and new turn delimiters. The earlier formatting guide says the older instruction format supports user and model roles and places system-level instructions inside the initial user prompt.
The Gemma 4 card explicitly identifies native system support as a new capability. An instruction embedded in the old first user message does not automatically become a separate system message after changing checkpoints.
Separate message objects from rendered tokens
A client can use structured conversation roles while a tokenizer renders model-specific labels and delimiters. The Gemma 4 documentation uses a model turn label in its serialized format; this should not be confused with whatever role vocabulary the surrounding API expects.
Use the selected processor or template to perform the mapping. Do not globally replace assistant with model in an API request merely because a rendered example contains the latter. Inspect the generated prompt for the actual checkpoint.
Remove duplicated legacy instructions
Suppose the old user prompt begins with a requirement to answer in a fixed concise format. During migration, that instruction is moved into a system message. Leaving the old copy in the first user message can create duplication or, after later edits, contradiction.
| Prompt component | Migration check |
|---|---|
| System instruction | Exists in the intended new role |
| First user request | Contains the actual task without a stale duplicate |
| Assistant history | Is rendered with the selected template |
| Turn delimiters | Come from the Gemma 4 format |
| Generation prefix | Starts the next model response correctly |
The migration should preserve the instruction’s meaning while changing its placement through the supported format.
Test a benign conflict fixture
Create a fictional rewriting task with a system-level output rule and a user request containing quoted source material that looks like an instruction. Check that quoted content remains task data under the intended application policy.
This is a diagnostic fixture, not proof of complete resistance to prompt attacks. Preserve both structured messages and rendered text so that an unexpected response can be traced to the actual input rather than attributed automatically to model capability.
Accept the prompt migration separately
Keep the old and new fixtures, checkpoint revisions and final-answer checks. Verify unchanged task facts, the required output form and correct conversation continuation.
A successful format migration establishes that the new prompt is encoded and used as intended for the tested task. It does not establish universal instruction hierarchy, identical behavior across all runtimes or complete application security. Model replacement and prompt-format migration are related changes whose acceptance evidence should remain individually inspectable.