December 29, 2023
How to write a good system prompt (Instructions to GPT)
Writing prompts is not an exquisite art that few can master. In fact, just by following the simple pointers that I share here, the consistency of the prompt response can increase up to 90%.

If you ask GPT now, “How to write a good prompt” the responses will give you 10 items, ranging from “be clear and specific” to “test and review responses” explaining each one of them and giving simple examples. This is not bad, but it is standard and somewhat, “empty”. What you want, is to get a repeatable structure for your answers.

Let me walk you through an example.

You need to draft an email that conveys your style, a response to your team, for what needs to be done when the stock arrives from Iowa city (or any city).

 

The first structure that I will share with you today is called RTF (Role, Task, Format). Here end-users define what “role” the AI has to take, as well as the “task”, being guided with a certain “format”. For our previous example, a system prompt (“Instruction”) could look like this:

You are an incredible email writer (Role). Create an email instructing how to proceed with the topic I present to you (Task). Follow the style given in the format,

subject title: <Warehouse Storage>

body (3 sentences, max.)

Regards,

Company A (Format).

Another useful structure to have in mind is the CTF (Context, Task, Format). For our example, we could use a tool to generate responses upon a triggering event. Integrations are needed, but for our example, it could be drafted like this:

 

“For inbound material events (Context), prepare an email with my inputs, providing the actions for storage (Task). Follow the style given in the format,

subject title: <Warehouse Storage>

body (3 sentences, max.)

Regards,

Company A (Format).”

And finally, the RASCEF (Role, Action, Steps, Context, Examples, Format). Think of it as a mixing of the previous two styles. The outcome should be more structured and repeatable. Use it when the outcome demands more specificity.

 

“As an exceptional email writer (Role), draft an email (Action) breaking into steps the instructions given by me (Steps), for the material inbound events that happen in our warehouse (Context). For example, event: 20 barrels of oil reached on December 17 at 17:40. The email drafted for that was:

subject title: <Warehouse Storage for 20 Barrels of Oil from Iowa>

Morning operations leads,

20 Barrels arrived on Dec 17 at 5.40pm. Please take note of storing them based on weight, height and expiration date.

Update the WMS accordingly and inform customers of new availability.

Regards,
Company Oil (Example)

Follow the style given in the format,

subject title: <Warehouse Storage>

Body (3 sentences, max.)

Regards,

Company A (Format).”

And just like that, you can have a more repeatable outcome. This is how the email looks after providing the trigger event

Example Email

It is worth mentioning that “Guardrails” are also needed (I will leave that for another time), but with the provided structure, the system prompts can generate valuable outcomes for your use cases.

Author: Walter Frank Pintor O.

keywords: Prompting Structure, Prompt Techniques, Large Language Models, Enterprise AI Solutions, LLM in Business, Machine Learning in Enterprises, Prompt Engineering, AI for Document Processing, Artificial Intelligence Ethics, AI Data Handling Laws, Enterprise AI Applications, AI for Email Classification, AI in Customer Service, Secure AI Deployment, AI Training Data Privacy, Personal Data Protection in AI, AI Regulatory Compliance, AI and Proprietary Data.

Try out Query Vary

Fast-track your LLM development with Query Vary. Be a part of prompt excellence and witness the shift in prompt design, testing, and refinement!

Book a Demo

Recent Blogs posted from our team

Check out our other blog posts to help you learn more about our product and also Large Language Models