The Future of AI: Get Ready for Prompt Engineering

Mauricio Arancibia
7 min readFeb 14, 2023

--

As Artificial Intelligence (AI) continues to evolve and revolutionize the way we interact with technology, we must be prepared for a new type of engineering — Prompt Engineering. This is the process of taking input from the user (images, text, music, and video) and accurately extracting the desired information from it.

Prompt engineering is a natural language processing (NLP) concept that involves discovering inputs that yield desirable or useful results. Prompting is the equivalent of telling the Genius in the magic lamp what to do. In this case, the magic lamp is DALL-E/Midjourney, ready to generate any image you wish for.

Prompt Engineering is the key to unlocking the full potential of AI. As Artificial Intelligence models become more sophisticated, they require more accurate input to produce the desired output. Without the proper input, AI models are unable to deliver the desired results. As AI continues to expand, Prompt Engineering will become a critical skill for all future workers.

The idea of Prompt Engineering is simple, it is the process of providing AI models with the right data in the right format, and in the right context. For example, a computer vision algorithm may need an image in a specific format for it to be able to recognize objects in the image. A natural language processing model may need text in a specific format for it to be able to interpret the user’s meaning.

The above description may sound a little complicated, but it is easier than one might think. Producing a good “Prompt” relies on a combination of business knowledge and imagination. Business knowledge provides a strong understanding of the subject matter, the context, and the desired outcome of the generated content. This helps to create precise and meaningful prompts that result in high-quality content. Imagination, on the other hand, allows for the creation of unique and creative prompts that engage and captivate the audience. By combining both business knowledge and imagination, prompts become more effective and tailored to the target audience, leading to more accurate and compelling generated content.

Let’s understand a little better what prompt engineering is with some examples, for this, we will focus on Midjourney a popular tool for image generation and ChatGPT for text generation, from a basic, intermediate and advanced level to improve and obtain better information.

AI Image and Text Generation (Midjourney and ChatGPT)

Two popular AI applications are image generation and text generation. For image generation we can find DALL-E, Midjourney and Stable Difussion. These tools use advanced deep learning technologies to create unique images from a given description or prompt. Midjourney, for example, allows users to generate images from a detailed description of what they want, resulting in great flexibility and precision in image generation.

On the other hand, in text generation we have OpenAI’s GPT-3 and the popular ChatGPT. GPT-3 is a language model that has been trained with millions of pages of text to produce coherent and natural text in a wide range of tasks, from answering questions to writing stories. Meanwhile, ChatGPT is an interactive language model that uses a chat interface to provide information to users. ChatGPT allows users to ask questions in natural language and receive precise and concise answers in real-time.

To start with the example we will create a simple science fiction story using ChatGPT, followed by image generation with MidJourney. After that, we will write more advanced prompts by adding some text generation techniques to enhance the story.

This is our first Basic Prompt in ChatGPT:

Generate a short scifi comic about humans and zombies war.

This is our output, looks promising.

Generated by ChatGPT

Midjourney

Great, let’s get started on generating images and increasing the complexity of our prompts for better results. It’s important to keep in mind that the quality of the images generated will depend on the quality of the input prompts, so it’s important to give clear and detailed prompts.

  • Basic Prompt

Let’s take the text generated from the first panel and use it as first prompt for MidJourney. We’ll see what we can come up with.

A group of human soldiers, armed to the teeth, cautiously make their 
way through a desolate, post-apocalyptic city.
Generated with midjourney

As you can see, with just our first prompt, which is rather simple and accompanied by a description generated by ChatGPT, we have obtained promising results. However, we will now try to provide a better context to ensure that the scene reflects what we have in mind.

  • Intermediate
A group of human soldiers, armed to the teeth, cautiously make their 
way through a desolate, post-apocalyptic city, sunset, landscape,
city with mountains and with buildings destroyed, skyline destroyed.

Essentially, what we have done here is to add a better context and description to the scene, such as a sunset. We have also added the terms “buildings” and “skyline” because our objective was to showcase the city from a different perspective. The results, as can be seen in the following image, are much better.

Generated with midjourney.
  • Advanced
A group of human soldiers, armed to the teeth, cautiously make their 
way through a desolate, post-apocalyptic city, sunset, landscape,
city with mountains and with buildings destroyed, skyline destroyed,
comic style, cartoon style, action comic style, drawings

Finally, the last step is to add certain technical features from a graphic design or photography perspective. For our story, we aim to generate comic book-style images, so we added features related to the graphic style, such as “comic style”, “drawings”, or any word associated with the style of drawing or painting.

Generated with Midjourney

We can go a step further and consider adding some japanese art, so we could try adding texts such as “anime styles” and specifying the color to achieve this effect.

A group of human soldiers, armed to the teeth, cautiously make their way 
through a desolate, post-apocalyptic city, sunset, landscape, city with
mountains and with buildings destroyed, skyline destroyed,
comic style, cartoon style, action comic style, drawings,
japanese style, anime style, white and black colors
Generated with Midjourney

The final results are impressive — by adding more context, improving description, and establishing technical features, we can get incredible images results. What is interesting is that by keeping these features, it is possible to have continuity and consistency to our images story.

Next, we will explore ChatGPT to generate dialogue and scenes for our Zombie story.

ChatGPT

To begin to explore ChatGPT’s text generation capabilities and obtain coherent conversations, we will use panel 2 of our story as an example for intermediate and advanced prompting.

Suddenly, one of the soldiers notices movement in the shadows. 
As they approach, they see a lone zombie stumbling towards them.
  • Intermediate

To improve our prompt, we provide ChatGPT with the context of the scene and then ask it to generate a conversation between two people (soldiers). The results are interesting as the generated conversation maintains the expected coherence.

This is the context of a scifi scene of human and zombie apocalypse story, 
generated a simple conversation between two soldiers:


Suddenly, one of the soldiers notices movement in the shadows. As they
approach, they see a lone zombie stumbling towards them.
  • Advanced

To enhance our scene, we can provide the context of the preceding conversation as input to ChatGPT, thus providing better contextualization of the situation. We aim to generate three scenes during the dialogue between the two soldiers, resulting in impressive outcomes that can be easily integrated into Midjourney to enrich our story.

Scene 3 Prompt:

Abandoned car, two soldiers cautiously approach the car door, but before 
they can reach it, a loud crash startles them. They spin around to see
a zombie crashing through the windshield of an abandoned car,
thrashing about wildly., post-apocalyptic city, close up picture,
close up shot, comic style, cartoon style, action comic style, drawings,
japanese style, anime style
Generated with Midjourney

Conclusions

It is important to understand the importance of Prompt Engineering. AI models are only as good as the data they are given. Without the right input, AI models will not be able to deliver the desired results. By understanding the basics of Prompt Engineering, we can ensure that we are providing AI models with the best input data possible.

The future of work will be shaped by the ability of people to interact with AI in a meaningful and productive way. Those who are able to master these skills will be the ones who are able to thrive in the changing job market, while those who are unable to adapt will likely be left behind.

The future of work is closely tied to the ability of people to understand and interact with AI in a way that is efficient, effective, and relevant to their particular line of work. By mastering these skills, we will be able to remain productive and valuable in the changing job market, we muste be prepared for the impact of AI in our lives.

--

--

Mauricio Arancibia

AI Engineer, Drummer, Lover of Science Fiction Reading. 🧠+🤖 Visit me at http://www.neuraldojo.org