Skip to content

Instantly share code, notes, and snippets.

@mstatt
Last active July 17, 2023 20:23
Show Gist options
  • Select an option

  • Save mstatt/4b192a584803c7d264fc1540243b0d12 to your computer and use it in GitHub Desktop.

Select an option

Save mstatt/4b192a584803c7d264fc1540243b0d12 to your computer and use it in GitHub Desktop.
Prompt Engineering 101
Prompt engineering refers to the process of designing and refining prompts for language models or AI systems. It involves crafting specific instructions or queries to elicit desired responses from the model.
Prompt engineering is crucial because language models like ChatGPT, as powerful as they are, require clear and well-defined input to generate accurate and relevant outputs. By carefully constructing prompts, developers can guide the model's behavior, improve its performance, and make it more reliable for specific tasks or applications.
Effective prompt engineering involves several strategies:
1. Specifying the format: Designing prompts that specify the desired format of the response. For example, using placeholders like "[Title]" or "[Person]" to indicate where specific information should be inserted.
2. Providing context: Giving the model relevant background information or context to improve its understanding of the task or question at hand.
3. Asking for clarification: When the model's initial response is unclear or incorrect, asking it to rephrase or provide more details can help refine the output.
4. Adding instructions: Including explicit instructions for the model to follow, such as "List three reasons why..." or "Compare and contrast...". These instructions guide the model's thinking and guide it towards generating the desired type of response.
5. Iterative refinement: Continuously experimenting with different prompts, evaluating their effectiveness, and refining them based on feedback and performance metrics.
Prompt engineering is an ongoing process that requires an understanding of the model's strengths and limitations, as well as the specific requirements of the task at hand. It allows developers to shape the behavior of the language model and improve its ability to generate accurate, coherent, and useful responses.
//------------------------------------------------
Basic Large Language model Prompt #1:
// General instructions
Generate a list of ideas for a domain name.
//------------------------------------------------
Better LLM Prompt #2:
// List count and more detail about the site
Generate a list of 5 really cool domain names for a fashion e-commerce site.
//------------------------------------------------
Prompt Engineering (Zero-Shot) LLM Prompt #3:
// Start giving the prompt explicit instructions
Human:
- List means bulleted list.
- Cool in this sense means trendy, very modern sounding.
Generate a list of 5 really cool domain names for a luxury fashion e-commerce site.
//------------------------------------------------
Prompt Engineering (Few-Shot) LLM Prompt #4:
// Add in a few reference examples
Human:
- List means bulleted list.
- Cool in this sense means trendy, very modern sounding.
- Make the name easy to remember similar to the following: flashFash.now, glamourme.com, luxelife.com
Generate a list of 5 really cool domain names for a luxury fashion e-commerce site.
//------------------------------------------------
Prompt Engineering LLM Prompt #5:
// Add a time of day perspective
Human:
- List means bulleted list.
- Cool in this sense means trendy, very modern sounding.
- Make the name easy to remember similar to the following: flashFash.now, glamourme.com, luxelife.com
- Give it a Parisian sounding name by incorporating high end french words.
- Give them a nightlife feeling.
Generate a list of 5 really cool domain names for a luxury fashion e-commerce site.
//------------------------------------------------
Prompt Engineering LLM Prompt #6:
// Add a seasonal flair
Human:
- List means bulleted list.
- Cool in this sense means trendy, very modern sounding.
- Make the name easy to remember similar to the following: flashFash.now, glamourme.com, luxelife.com
- Give it a Parisian sounding name by incorporating high end french words.
- Give them a nightlife feeling.
- Maybe a fall sense of the leaves turning colors.
Generate a list of 5 really cool domain names for a luxury fashion e-commerce site.
//------------------------------------------------
Prompt Engineering LLM Prompt #7:
// Add a length constraint
Human:
- List means bulleted list.
- Cool in this sense means trendy, very modern sounding.
- Make the name easy to remember similar to the following: flashFash.now, glamourme.com, luxelife.com
- Give it a Parisian sounding name by incorporating high end french words.
- Give them a nightlife feeling.
- Maybe a fall sense of the leaves turning colors.
- Ensure that the names are no longer than 3 words, to ensure that they remain easy to remember.
Generate a list of 5 really cool domain names for a luxury fashion e-commerce site.
//------------------------------------------------
Prompt Engineering LLM Prompt #8:
// Add a little randomization in the list
Human:
- List means bulleted list.
- Cool in this sense means trendy, very modern sounding.
- Make the name easy to remember similar to the following: flashFash.now, glamourme.com, luxelife.com
- Give it a Parisian sounding name by incorporating high end french words.
- Give them a nightlife feeling.
- Maybe a fall sense of the leaves turning colors.
- Ensure that the names are no longer than 3 words, to ensure that they remain easy to remember.
- For one of the names, generate a completely random domain name for the site without any of the previous constraints.
Generate a list of 5 really cool domain names for a luxury fashion e-commerce site.
//------------------------------------------------
Prompt Engineering LLM Prompt #9:
// Get specific with your target audience
Human:
- List means bulleted list.
- Cool in this sense means trendy, very modern sounding.
- Make the name easy to remember similar to the following: flashFash.now, glamourme.com, luxelife.com
- Give it a Parisian sounding name by incorporating high end french words.
- Give them a nightlife feeling.
- Maybe a fall sense of the leaves turning colors.
- Ensure that the names are no longer than 3 words, to ensure that they remain easy to remember.
- The site is for women between the ages of 18 and 25, who travel and speak English and french.
- For one of the names, generate a completely random domain name for the site without any of the previous constraints.
Generate a list of 5 really cool domain names for a luxury fashion e-commerce site.
//------------------------------------------------
Prompt Engineering (Chain of Thought or CoT) LLM Prompt #10:
// Walk the LLm through the actual scenario
Human:
- You are the owner of an e-commerce website.
- Your website is a fashion shop.
- Your best customers have been women between the ages of 18 and 25, who travel and speak English and French.
- Your best selling items appear to be form fitting dresses used mainly for nightlife in New York and Paris.
- Your highest sales season is the Fall/Autumn.
- For each name, provide an explanation for this recommendation.
Generate a list of 5 highly specific domain names that are easy to remember for your website.
//------------------------------------------------
Prompt Engineering (Tree-of-Thought or ToT) LLM Prompt #11:
// Walk the LLm through the actual scenario
Human:
- You are the owner of an e-commerce website.
- You hire 3 high quality branding agencies to provide you a high quality domain name.
- You decide to have them compete for your business by providing you a domain name recommendation.
- Only 2 of the agencies are aware that your website is a fashion shop.
- Only 2 of the agencies know that your best customers have been women between the ages of 18 and 25, who travel and speak English and French.
- Only 1 of the agencies knows that your best selling items appear to be form fitting dresses used mainly for nightlife in New York and Paris.
- Only 1 of the agencies knows that your highest sales season is the Fall/Autumn.
- Not 1 agency has complete awareness of the situation.
- Provide a breakdown of how they could deliver to you precisely the domain name that is most aligned with your target customers and remain easy to remember during the peak times of purchases.
- Each agency is required to provide 2 high quality, easiest to remember domain names based on the information they have.
- For each name, provide an explanation for this recommendation.
Generate a list of 6 highly specific domain names that are easy to remember for your website.
//------------------------------------------------
Prompt Engineering (Tree-of-Thought or ToT) LLM Prompt #12:
// Now have it rank the results
Human:
- You are the owner of an e-commerce website.
- You hire 3 high quality branding agencies to provide you a high quality domain name.
- You decide to have them compete for your business by providing you a domain name recommendation.
- Only 2 of the agencies are aware that your website is a fashion shop.
- Only 2 of the agencies know that your best customers have been women between the ages of 18 and 25, who travel and speak English and French.
- Only 1 of the agencies knows that your best selling items appear to be form fitting dresses used mainly for nightlife in New York and Paris.
- Only 1 of the agencies knows that your highest sales season is the Fall/Autumn.
- Not 1 agency has complete awareness of the situation.
- Provide a breakdown of how they could deliver to you precisely the domain name that is most aligned with your target customers and remain easy to remember during the peak times of purchases.
- Each agency is required to provide 2 high quality, easiest to remember domain names based on the information they have.
- For each name, provide an explanation for this recommendation.
- Then rank the domain names based on the New York/Paris clientele, Highest selling season appeal, easiest to remember and provide the rationale for the ranking.
Generate a list of 6 highly specific domain names that are easy to remember for your website.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment