A Brief Review of the GPT-4.1 Prompting Guide
GPT-4.1 was announced on April 14, 2025. Currently available only through the API, it arrives in nano, mini, and full versions, with an emphasis on coding, instruction following, and long-context work.
The GPT-4.1 Release
GPT-4.1 was released in three versions: nano, mini, and full. It is said to be intended as a replacement for the existing GPT-4o line.
Although it accepts multimodal input, it produces text-only output. That may be why the “o” has been dropped from its name.
The nano model is said to be the cheapest model released so far. Its performance is reportedly comparable to GPT-4o mini, and better in some areas.
The three main areas of emphasis are coding, instruction following, and long context.
- Related announcement: https://openai.com/index/gpt-4-1/
A Dedicated Prompting Guide
One interesting aspect of the release is that it came with a dedicated prompting guide. Its first topic is agents, which gives a clear sense of the kind of use the model was designed with in mind.
- Prompting guide: https://cookbook.openai.com/examples/gpt4-1_prompting_guide
Agents
When building an agent, the guide suggests instructing it to do its best during its current turn and then wait for user input.
Rather than making assumptions, it should actively use tools. When necessary, it should also make plans and reflect on its work.
Long Context
The model can work with a 1M-token context and performs well on needle-in-a-haystack tasks.
Prompts should specify whether the model should answer using only the provided context or also draw on its own knowledge.
For long contexts, instructions should be repeated at both the beginning and the end. If they can be given only once, they should appear at the beginning. This is the opposite of Anthropic’s approach.
Chain of Thought
Ending a prompt with wording such as the following can encourage behavior similar to a reasoning model:
“First, think carefully step by step about what documents are needed to answer the query. Then, ...”
Instruction Following
A major strength is its ability to follow complex instructions. The suggested prompt order is: high-level instructions, examples, a workflow task list, and an instruction to work in that order.
Traditional techniques such as using capital letters, tips, or bribes are not necessary.
- If the model is told to follow a workflow but encounters a situation where it cannot—for example, it is told to use a tool but has nothing to use it for—add an instruction telling it to end the turn and ask for more information.
- If response sample wording is provided, the model may follow it too literally. Instruct it to vary its answers.
- If it keeps adding explanations, provide a concise example and instruct it to follow that style.
Recommended Prompt Structure
- # Role and Objective
- # Instructions
- ## Sub-categories for more detailed instructions
- # Reasoning Steps
- # Output Format
- # Examples
- ## Example 1
- # Context # Final instructions and prompt to think step by step
Delimiters
Markdown works well for sections and subsections, even down to H4-level headings. Code should be placed in designated code blocks, and numbered lists or bullet points also work well.
The model has been trained to follow XML well. Metadata can be placed in tags, and it understands nesting.
JSON is useful for coding-related tasks, but it increases token usage, so caution is needed. In general, it is not recommended.
Weaknesses
The model can struggle with very long and repetitive output, such as producing analyses for 100 items. Instructions should be written strongly, and it is generally better to split the work into smaller tasks.
It can also make mistakes with parallel tool calls. In that case, set parallel_tool_calls: false.
Coding
The remainder of the guide concerns coding-related material, so it is omitted here.
- Source: https://cookbook.openai.com/examples/gpt4-1_prompting_guide