Home > Articles

This chapter is from the book

Necessary Components of an AI Prompt

Whether you’re asking for text, image, or video output, your AI prompt needs to include the same basic components. These components include

  • Task: What you want the AI to do, such as “write a…” or “summarize this…” or “generate a…,” in as much detail as possible.

  • Format: What kind of output you need, including length, type (blog post, letter, and so on), file format, and any other pertinent details.

  • Topic: The thing in which you’re interested. The subject of the verb presented in the task—write a paper about topic, answer a question about topic, or create a photo of a topic.

  • Tone or style: Serious, lighthearted, professional, and so on.

  • Context: Background information and relevant details about the topic, audience, or situation.

  • Requirements or constraints: Things that the AI should include or exclude from the task.

We’ll look at each of these elements in more detail next.

Task

Probably the most important part of a prompt is the task or objective—what you want the AI to do. This is the primary directive to the AI tool, in as much detail and specificity as possible.

Start out by using action verbs, such as

  • Write (a blog post, an email, a short story, and so on)

  • Explain (a topic or concept)

  • Tell me about (a topic)

  • Generate (ideas, a list, an outline)

  • Create (a photorealistic image, a watercolor painting, a short film)

  • Summarize (a document, a piece of text, meeting notes)

  • Analyze (a document, a piece of text, a web page, a report)

  • Translate (a word, a phrase, a document)

  • Compare (two documents, two pieces of text, two approaches or theories)

Format

The format describes, in as much detail as possible, the type of output you want. It can be rather broad, such as an article, story, or social media post. But it should also include other necessary details, such as

  • Length (number of words or pages or, for an audio or video, amount of time)

  • File format

  • Number of paragraphs or number of sections

  • Number of slides (for a presentation)

  • Aspect ratio or dimensions (for an image or video)

  • Professional formats (such as MLA or APA format for scholarly papers)

The format might also specify how you want the output structured, such as in a bulleted or numbered list, Q&A format, and so forth. If the result should include specific sections, such as an introduction or summary, notate that as well.

Topic

Every task should reference a specific topic or target. The topic is typically a noun with one or more descriptive adjectives.

The topic follows the task and the format. As an example, the task might be write, the format might be a blog post, and the topic would be what you want the post to be about, such as adopting a pet. Put it all together, and you get the prompt:

write a blog post about adopting a pet

The more specific the topic, the better. For example, instead of saying

write about banks

say

write about the history and different types of American banking institutions

Instead of saying:

create a picture of a girl

Describe the subject in more detail as

create a picture of a teenaged girl with long blonde hair and blue eyes wearing an orange t-shirt

Along the same lines, instead of saying

create a menu for dinner

say

Create a menu for dinner for four that includes appetizer, main course, and dessert and is gluten-free. Attendees prefer something light Mediterranean influenced.

Instead of saying

generate an outline for a detective story

Provide more details, such as

generate an outline for a detective story about a missing wife, mobsters, and an insurance scam, set in Chicago in the 1940s

The more details you can include about your topic, the better.

Tone and Style

With this element, you tell the AI what type of tone or style in which you want the results presented. This one isn’t necessarily mandatory, but it can help steer the AI toward the desired results.

When describing the desired tone, you can use words such as professional, friendly, witty, persuasive, formal, casual, academic, conversational, or concise. When it comes to style, use descriptors such as dark, dramatic, comedic, pompous, and the like. You can even reference defined dramatic styles, such as create a hardboiled mystery story or write a poem in the style of Robert Frost. Use whatever descriptors you need to convey how you want your results presented.

Context

Think of context as important background information that can help the AI model fine-tune its results. This background info might include details about the situation or characters, key facts about a given topic, important data points, where an image or video takes place, and the like.

Requirements/Constraints

This element details things that must be included in the output or should not be included in the output. For example, if you’re writing a paper for school, you can specify that the paper includes citations, a specific number of sources, and a summary or conclusion. You can specify elements or ideas that must be included, such as pointing to relevant data or arguments that should be referenced. For images, you also specify items that should be included in an image, such as background details and overall color scheme.

You can also specify things that should be avoided in the results, such as to avoid technical jargon, avoid inappropriate language or images, avoid mentioning specific arguments or approaches, or avoid mentioning particular individuals or groups. For images, you can also define colors or details to avoid.

In addition, you can note the intended audience for the output, as well as the desired reading level, such as write an article at an 8th grade reading level or present the information in a way that 4th graders can understand it.

Optional Elements

There are also several optional elements you can include in a prompt as appropriate for the task at hand and the type of output you desire. These elements include

  • Goal: If the objective is to persuade an audience to action or achieve some sort of response, let the AI know. For example, you might insert the goal of convince the reader to vote for the proposal or lead the reader to request a sample or something similar.

  • Role: Ask the AI to assume a specific identity or perspective or describe the likely consumer of the output. For example, you might include something like assume the role of a drill sergeant or assume you’re teaching a high school class or write as if you’re a seasoned political analyst. Or, to detail the role of the consumer, you might include something like direct the output to seniors considering Medicare plans or assume the readers are students at a liberal arts college.

  • Examples and references: One or more similar items that can serve as a reference for what type of output you want. You can use a specific URL to direct the AI to content on the web; cut and paste the example or reference into your prompt; or, with some AI tools, upload the reference as a separate file.

Which of these optional elements you include, if any, depends on the type of output you desire.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.