Understanding Prompt Engineering and Its Importance

by | Apr 27, 2023 | Learning, Mostly Human

Prompt Engineering is the process of meticulously designing and refining prompts for AI models, such as ChatGPT, MidJourney, and Stable Diffusion, with the objective of achieving a specific, desired outcome. A proficient Prompt Engineer crafts input questions, queries, guidance, or statements that enable AI systems to better comprehend the Engineer’s intentions and generate accurate and valuable results.

Consider the following scenario: A user seeks a brief summary of an article. After providing the text of the article to an AI language model:

Prompt A: “Tell me what the article is about.”

This is a poor prompt because:

  • It lacks specificity, with no indication of the desired output, length, or format.
  • The AI model might not understand that a summary is expected.

Prompt B: “Please provide a concise summary of the article in 3-4 sentences, highlighting the main points and conclusions.”

This is a good prompt because:

  • It offers clear guidance on the desired output format (a concise summary) and the length of the summary (3-4 sentences).
  • The AI model has explicit instructions to focus on the main points and conclusions, resulting in a more relevant and useful output.

The Power of Skillful Prompt Engineering

MidJourrney’s Visual representation of ChatGPT’s description of masterful prompt engineering.

Masterful prompt engineering extends beyond merely obtaining a “better result”. With practice, skill, and experience, a proficient engineer can enhance their user experience, efficiently utilize AI models, improve safety and ethics, adapt models to specific use cases, and offer refined customization of results.

Improved User Experience:

A well-crafted prompt helps the AI model better understand user intentions, leading to more accurate and relevant results. This diminishes frustration and heightens user satisfaction.

Efficient AI Utilization:

At the time of writing, ChatGPT-4 has a limit of 25 queries every 3 hours, and the GPT-4 API cost per token is exceptionally high. Good prompt engineering reduces the number of attempts or even model training needed to obtain the desired output. This improves efficiency and can lower costs and downtime.

Enhances Safety and Ethics:

Carefully constructed prompt design minimizes the risk of the AI model generating inappropriate or harmful content. This ensures that the AI model aligns with ethical guidelines and user expectations.

Adaptability and Training:

As AI models evolve, well-structured prompts can help adapt the models for more specific applications and use cases. This increases the versatility and usefulness of the technology.

Customization:

Well-engineered prompts enable the engineer to tailor the AI’s outputs to particular user requirements, industries, or contexts, facilitating more personalized results and solutions.

In closing

Prompt engineering is growing skillset and a vital aspect of effectively utilizing AI models to achieve desired and effective outcomes. By refining prompts and understanding user intentions, engineers can improve user experience, efficiently utilize AI systems, enhance safety and ethics, adapt models to various use cases, and provide customized results. As AI technology continues to advance, the emerging skill of prompt engineering will play an ever-expanding role in the use of these models.

Additional examples of bad prompts and their “good” counterparts

Translation

Instead of: “Translate this.”

Consider: “Please translate this English text to French: ‘Hello, how are you?'”

Weather

Instead of: “What’s the weather.”

Consider: “What is the current weather in New York City, including temperature and precipitation?”

Writing

Instead of: “Tell me a story”

Consider: Write a short story about a young girl discovering a magical world, set in a fantasy universe.”

Baking

Instead of: “How do I make a cake?”

Consider: “Provide a simple recipe for a vanilla sponge cake, including ingredients and step-by-step instructions.”

History

Instead of: “When was that battle?”

Consider: “In which year did the Battle of Waterloo take place?”

General Knowledge

Instead of: “Why is the sky Blue?”

Consider: “Explain the scientific reasons for the sky appearing blue during the day, including the role of atmospheric scattering.”

Related Posts >

ChatGPT just wrote a game

ChatGPT just wrote a game

ChatGPT astoundingly created a fully functional “choose your own adventure” game with exceptionally minimal input, generating HTML, CSS, and JS code that required no modifications to run on it’s own. It then proceeded to enhance the story, creating a more compelling narrative, and understood and recalled enough of the existing context to do so without assistance. Finally, ChatGPT was asked to describe the box art and a scene from the game it wrote, and MidJourney produced this artistic content exceptionally well.

read more
Mastering Prompt Engineering Techniques

Mastering Prompt Engineering Techniques

Mastering the art of prompt engineering is vital for making the best use of the tools available today, and will build a strong foundation for the increasingly powerful systems that will be available in the near future. By building experience in the areas of prompt phrasing, step-by-step guidance, incorporating examples, and experimentation, users can significantly enhance the quality of their interactions with these new AI systems.

read more