Sign In

The Importance of Prompt Design: Examples First, Instructions After

Haebom
Here's one sentence you should always remember when giving AI commands via prompts: Place example data at the front, and put the instructions at the end. (EFIL: examples first, instructions later) The reason is simple. Language models tend to be biased toward the most recent information they've received. To use this bias to our advantage, it's best to put the instructions at the end of the prompt.

Placement of examples and instructions

If you put examples at the beginning of the prompt, the language model doesn't become overly reliant on those examples. On the other hand, if you put the instructions at the end, the model is more likely to follow them closely.

Simplicity and effectiveness of structure

By keeping the structure simple, you can still achieve effective results. This setup helps reduce repetition and keeps the response on-topic. In short, how you frame your input has a big influence on the output of the language model. If your input is complicated or vague, the model’s response might be as well. On the other hand, clear and specific input helps the model generate more accurate output.

User input and the language model’s response

User input can take many different forms and styles—questions, instructions, or even just simple keywords. The language model needs to react appropriately to all these types of input. Placing examples first, the actual input in the middle, and instructions at the end helps the model respond more accurately and consistently.
Subscribe to 'haebom'
📚 Welcome to Haebom's archives.
---
I post articles related to IT 💻, economy 💰, and humanities 🎭.
If you are curious about my thoughts, perspectives or interests, please subscribe.
haebom@kakao.com
Subscribe