Reverse prompt engineering is an emerging technique that is gaining some popularity. In this technique, a given text or code is transformed into a prompt, which can be used for a more general purpose. The idea behind reverse prompt engineering is to prime a model with a prompt and generate text from that prompt. We will explore how to use ChatGPT for reverse prompt engineering and create a step-by-step guide on how to accomplish it.
Lets start
To get started with reverse prompt engineering in ChatGPT, we need to prime the model. This step involves providing some context to ChatGPT. Lets first start with;
1Âş Prompt:
Can we talk about reverse prompt engineering? By reverse prompt engineering i mean creating a prompt from a given text.

Now, on the same window, let’s tell ChatGPT to give us some example:
2Âş Prompt:
Great. Can you give me a simple example of reverse prompt engineering?

The third step already involves reverse prompt engineering result, but we still want to make it a little better;
3Âş Prompt:
Great. Write a short explanation on how 5G technology works, and reverse prompt engineer the explanation.

The forth command to provide to ChatGPT is;
4Âş Prompt:
Great. can you create a very technical reverse prompt engineering template?

Reverse prompt engineering is now in action since we have primed the model and created the template that chatGPT must use for our real target. Now, we can use any text we want to apply the reverse prompt engineering technique on chatGPT. Let’s demonstrate with a description of a new smartphone (copy-pasted from the official product website):
Prompt:
Can you reverse engineer the following product description, capture the style and the length of the text:
EXPANSIVE SCREEN: See more and do more with the ultimate folding mobile phone screen that puts a super slim tablet right in your pocket.Form_factor : Foldable Screen.
NEARLY INVISIBLE CAMERA: Take in an incredible uninterrupted view with a true edge-to-edge viewing experience thanks to our first-ever Under Display Camera.
120Hz AMOLED 2X SCREEN: Everything looks brilliant on this big, beautiful clear display offering a mesmerizing and dynamic viewing experience.
MULTIPLE WINDOWS GET MORE DONE: Start working smarter, not harder with three multi-windows that allow you to schedule, edit, and build presentations in a snap — or take notes with the S Pen.
HYPER FAST SPEED: Live life in the fast lane with built-in 5G connectivity and hyper-fast processing power.
TWO SCREENS, MANY WAYS TO FLEX THEM: Do more of what you love at the same time with Galaxy Flex Mode; Fold it at any angle and hold it any way you like — or go hands free and not hold it at all.
CHARGED AT THE SPEED OF LIFE: Stay in charge, not beholden to your charger; With 25W Super Fast Charging, you can spend less time charging and more time taking care of business.

As we can see, ChatGPT has created an excellent PROMPT for us, based on the information we have provided. Now, we can use this prompt on a new window and enjoy the much better result than a simple question or vague prompt;

We used the case of a smartphone description, but the use cases are endless, ranging from personal letters, speeches, articles, advertisements, or even scientific purposes. We can then modify the reverse prompt to create a more general product prompt.
Reverse prompt engineering is a promising approach that involves generating prompts from a desired output, rather than generating output from a given prompt. This approach offers several advantages, including increased flexibility, better control over output, improved efficiency, and more accurate and diverse outputs. By starting with the desired output and generating a prompt that will produce that output and has the potential to improve the accuracy, efficiency, and flexibility of natural language processing tasks.