Personal tools

Prompt and Prompt Engineering

Harvard_3171
(Harvard University - Joyce Yang)


- Overview 

A prompt is a natural language text that requests the generative AI (GenAI) to perform a specific task. GenAI is an artificial intelligence (AI) solution that creates new content like stories, conversations, videos, images, and music.

Prompt engineering is the process of creating and refining prompts to guide AI models to produce the desired output. It's a complex process that involves providing the AI with context, instructions, and examples to help it understand the user's intent.

Here are some things to consider when using prompt engineering:

  • Quality of prompts: The quality of the prompts provided to the AI model can impact the quality of the model's responses.
  • Chain-of-thought prompting: This method breaks down complex reasoning into intermediate steps to help the model produce more accurate results.
  • Giving the model time to "think": Instructing the model to work out its own solution before rushing to a conclusion can help.
  • Using inner monologue: Using inner monologue or a sequence of queries can hide the model's reasoning process.
  • Asking the model if it missed anything: Asking the model if it missed anything on previous passes can help.

Prompt engineering is expected to become a larger hiring category in the next few years. Organizations are also expected to reskill their existing employees in AI. 

Prompt engineering is the process where you guide GenAI solutions to generate desired outputs. Even though GenAI attempts to mimic humans, it requires detailed instructions to create high-quality and relevant output.

 

- A Prompt in Natural Language Text

A prompt in natural language text is a request that instructs a GenAI model to perform a specific task. The process of creating and refining prompts is called prompt engineering. 

Here are some examples of prompts:

  • Text-to-text: A query like "what is Fermat's little theorem?" or a command like "write a poem about leaves falling"
  • Text-to-image: A description of the desired output like "a high-quality photo of an astronaut riding a horse"
  • Text-to-audio: A description of the desired output like "Lo-fi slow BPM electro chill with organic samples"


- Types of LLM Prompt Technologies

LLM (Large Language Model)) prompt technologies mainly include the following types:

  • Few-Shot Prompting
  • In-Context Learning
  • Chain-of-Thought Prompting
  • Zero-Shot-CoT 
  • Role Prompting 
  • Emotion Prompting 
  • Self-Criticism 
  • Answer Engineering


- Best Practices for Prompt Engineering

Some best practices for prompt engineering include:

  • Understanding the model's capabilities and limitations
  • Using clear and specific language
  • Providing examples and feedback
  • Explaining the context in as much detail as possible
  • Experimenting with different formats and styles
  • Evaluating and refining the prompts



[More to come ...]



Document Actions