Writing a prompt for an LLM like ChatGPT is not unlike writing instructions for an employee you manage. Eventually, the employee you manage…
3 min read
May 28, 2024
Writing a prompt for an LLM like ChatGPT is not unlike writing instructions for an employee you manage. Eventually, the employee you manage will start to manage their own employees. Just as you were able to give them instructions on how to do their specific job, you can give them instructions on how to give their subordinates instructions.
The same principle can be applied to prompt design. The art of writing prompts that write prompts is called Meta-Prompting.
So what is meta-prompting? How do you write a good meta-prompt? And what can meta-prompting realistically achieve?
Let’s dive in!
What is Meta-Prompting
Meta-Prompting is a branch of prompt design that focuses on prompts that write other prompts. This allows an AI to tackle multi-step problems by writing subsequent prompts. It also saves you time when writing prompts.
When you develop a strong sense of what a desirable prompt looks like, you can codify it as a meta-prompt.
For example, this Automatic GPT Generator is a meta prompt. You explain the GPT you want, and it automatically generates the prompt to power your GPT.
For example, let’s say you want your prompts to have multiple sections, like a persona section, a rules section, a task section, and a writing style section. You can create a meta prompt that would write prompts that always fulfill these requirements.
How to write a meta prompt
To write a good meta prompt you need to explain the idea to the LLM.
Here’s an example:
Next you need to explain the structure of the prompt you want. This requires creating a section that discusses structure and examples.
Like all prompting, the more specific you can be the better. If you are using these meta prompts in automated pipelines, then you should orient them towards predictability.
What Can Meta-Prompting Do?
Meta-prompting has two big use cases:
- Speed up writing your own prompts
2. Automation for LLM pipelines.
Writing prompts can be time-consuming, just like writing anything. And the hardest part is facing the blank page. Conversational meta-prompting (i.e. casually talking to a tool that writes your prompt for you) is a lot easier than writing everything yourself. Products that have AI prompts that write prompts, can significantly speed up the prompt writing process. In these cases, you’ll want to to generate a prompt and then edit it afterwards.
Truly automated systems often require the LLM to do slightly new tasks, which means it needs the ability to generate its own prompt. For these agentic workflows, meta-prompting is very important in order to give the tools agency.
Get started Meta-prompting
Meta-prompting is a game-changer. It speeds up creating prompts, automates tasks, and allows you to see prompt design and AI systems design in a totally new light.
If you want to start meta-prompting, explore asking LLMs to write instructions for themselves. An easy way to get started is taking your favorite prompt structure and codifying it as a meta-prompt!