The Art of AI Prompt Engineering: How to write GenerativeAI Prompts

Skolo Online Learning
6 min readJul 21, 2023

In this article, we will discuss prompt engineering. With Generative AI models like ChatGPT and AI Art taking over, prompt engineering is going to become one of the most sought after skills withing GenerativeAI applications.

Generative AI Prompt Engineering

A prompt, in the context of artificial intelligence, is an instruction or input that guides an AI model’s behavior or response. It’s the question, statement, or command that you give to the AI, serving as a starting point for it to generate a response.

In the case of Generative AI models, a prompt might be a sentence or a phrase that the AI uses to produce a continuation, or it might be a more complex instruction for generating a specific type of content, such as a poem, a news article, or an answer to a trivia question.

The quality and specificity of the prompt can greatly influence the output, as it provides the AI with context, intent, and direction. Therefore, crafting effective prompts is an important skill when working with AI systems.

Structuring Effective Prompts for Generative AI

When crafting an AI prompt, you’ll need to determine at least two core components: the format and the subject.

  1. Format: This is what you want the AI to generate. It could be a short essay, a list, an official letter, a speech, or even a conversation. The format sets the general structure for the AI’s output.
  2. Subject: The subject is the topic you want the AI to focus on or discuss. It provides the thematic context for the AI’s output.

For example, consider the prompt:

Generate an Essay about The effects of the pandemic on mental health.

The format: An Essay

Subject: The effect of the pandemic on mental health

If we enter this in to out GenerativeAI Engine — MobileGPT — https://mobile-gpt.io — this is the output that we get.

Effects of Mental Health on Pandemic — Essay by AI

The output it pretty decent with just the format and subject, in fact for most content, this will be all that you will ever need to generate content.

But imagine you are writting a school assignment, perhaps you might want to consider adding more guidlines to the AI to generate the content in the structure, tone and quality that would be fir for top marks.

AI is completely capable — if you can guide it well. This is where prompt engineering comes in:

AI Promt Engineering

Enhancing the Quality of AI Output with Additional Variables

While a well-crafted format and subject can provide satisfactory AI output, they might not be enough to produce highly tailored results. To achieve this, we introduce additional variables:

  1. Tone: the tone or style you want the AI to adopt. It could be formal, conversational, humorous, or even poetic.
  2. Audience: This relates to the intended audience of the content. Identifying the demographic helps the AI adjust its language and tone accordingly.
  3. Goal: The goal defines the purpose or objective of the content. It could be to inform, persuade, entertain, or instruct.
  4. Role: The role instructs the AI to adopt a particular persona or perspective.

With these variables, we can expand our original prompt to something like this:

Acting as an Expert and using a Persuasive Tone, Generate an Essay about The effects of the pandemic on mental health for Health Professionals to Persuade them to take care of their mental health.

Delving into Advanced Prompt Engineering: A Multidimensional Approach

While the basic and additional variables mentioned above can guide AI to generate more targeted outputs, there are more advanced tools at our disposal. They can fine-tune the results even further, ensuring the AI-produced content is not just relevant but also rich, nuanced, and in line with your specific needs.

  1. Context Information: Providing additional context allows the AI to generate content that fits well within the larger picture. It can include background information, historical facts, or references to specific events.
  2. Key Phrases: Direct the AI to incorporate certain terms or phrases into the output. This can help make the content more relevant or tailored to your needs.
  3. Word Count: If you need the content to be of a certain length, specify a word count. This helps control the length of the AI’s output.
  4. Guidelines: Specific instructions about how the content should be structured or presented can guide the AI to produce outputs in a particular style or format.
  5. Outline: Providing a rough structure or sequence for the content can help shape the AI’s output more effectively.

Image Generation Prompt Engineering

Image Generation Prompt Engineering can be conceptualized as the strategic development of instructions given to a generative artificial intelligence system, which is designed to create visual content. The term ‘prompt’ in this context refers to the input or command given to the AI to generate an image.

The essence of Image Generation Prompt Engineering lies in crafting these prompts to obtain desired results. It requires a deep understanding of the AI’s interpretative structure and the specific nuances that lead to particular outcomes.

Effectively, it is an intricate blend of art and science. The engineer must design prompts that accurately convey the intended imagery, balancing between precision and creativity. Hence, Image Generation Prompt Engineering is a crucial skill set in the field of generative AI, enabling users to refine the system’s outputs to align closely with their creative vision.

Here is my cheatSheet on image generation prompts:

Image Generation Prompt Engineering

When it comes to image generation, there are two main elements to define:

  1. The type of image: This can be photo, oil painting, cartoon, etc.
  2. Settings and Background — this is where art and science meet, how well you define the background can be an art, and yes — it will probably take some trial and error, but eventually you will start to learn how certain keywords and descriptions affect the output.

For example — use studio settings for high quality images, outdoor scenes for landscaped and abstract backgrounds for artistic images. Let us test on some prompts:

A high-resolution, photo realistic image of a vast, snow-covered pine forest during sunrise. The sun just peeks above the horizon, casting a soft, golden hue over the untouched snow. Small rabbits leave tracks as they frolic among the trees.

AI Generated Image of a forrest: Photo Credit @MobileGPT

A soft, dreamy watercolor painting depicting an enchanted forest. Bioluminescent plants glow in the twilight, illuminating fairies that flutter about. A magical waterfall cascades into a serene pool, reflecting the soft colors of the fantastical foliage.

AI Generated Watercolour Image: Photo Credit @MobileGPT

Why don’t you try these out on MobileGPT and see what you get:

1. Pencil Art in an Urban Environment: A detailed, black and white pencil sketch capturing the hustle and bustle of a busy New York street. Skyscrapers towering overhead, people hurrying by with their umbrellas in the drizzling rain, taxis rushing down the street, neon signs from the shops reflecting off the wet asphalt.

2. Oil Painting in a Historical Setting: A richly textured oil painting depicting an opulent Victorian ballroom. Ladies in extravagant gowns and gentlemen in tails and top hats dance under grand chandeliers. An orchestra plays at the far end of the room, and waiters carry trays of champagne through the crowd.

3. Cartoon Image in an Indoor Scene: A brightly colored, lively cartoon image of a bustling diner in the 1950s. Waitresses in retro uniforms skate around delivering burgers and milkshakes to customers while an Elvis Presley song plays on the jukebox.

4. Pop Art in an Abstract Background: A vibrant, pop art image of a classic 1960s style girl with bubblegum pink hair against a background of geometric shapes. The shapes swirl around her, creating a wave of colors — blues, purples, and yellows.

5. Pointillism in a Studio Setting: A complex pointillist art piece showing an artist’s studio. The cluttered scene includes an easel with an unfinished painting, an array of colorful paint tubes, brushes, a palette, and a small window from where soft afternoon light spills in.

--

--

Skolo Online Learning

Founder of Tati Digital, passionate about digital transformation and ushering businesses in to the digital age and 4th industrial revolution.