<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sahil</title>
    <description>The latest articles on DEV Community by Sahil (@sahilbansal17).</description>
    <link>https://dev.to/sahilbansal17</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F40516%2F87f801bd-8916-44d6-9276-f722299f7395.jpg</url>
      <title>DEV Community: Sahil</title>
      <link>https://dev.to/sahilbansal17</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sahilbansal17"/>
    <language>en</language>
    <item>
      <title>Prompt Engineering - Guidelines</title>
      <dc:creator>Sahil</dc:creator>
      <pubDate>Sun, 16 Jul 2023 12:37:55 +0000</pubDate>
      <link>https://dev.to/sahilbansal17/prompt-engineering-guidelines-3ana</link>
      <guid>https://dev.to/sahilbansal17/prompt-engineering-guidelines-3ana</guid>
      <description>&lt;h2&gt;
  
  
  Prompt Engineering - Guidelines
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Ask for clear and specific instructions
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. Use delimiters
&lt;/h4&gt;

&lt;p&gt;Example prompt:&lt;/p&gt;

&lt;p&gt;Summarize the text delimited by triple backticks.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;This is some text to summarize.&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Example output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"This is a summary of the text."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Summary:&lt;br&gt;
Delimiters help define and contain sections of the prompt, enhancing clarity and specificity.&lt;/p&gt;
&lt;h4&gt;
  
  
  2. Ask for structured output
&lt;/h4&gt;

&lt;p&gt;Example Prompt:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Generate a list of two book titles with authors
and genres in JSON format with keys:
book_id, title, author, genre."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"[{
    "book_id": 1,
    "title": "Fictional Book",
    "author": "Fictional Author",
    "genre": "Fiction"
  },
  {
    "book_id": 2,
    "title": "Fictional Book 2",
    "author": "Fictional Author 2",
    "genre": "Non-fiction"
  }
]"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Summary:&lt;br&gt;
Requesting structured output allows the model to generate a clear, well-organized response.&lt;/p&gt;
&lt;h4&gt;
  
  
  3. Check whether conditions are satisfied
&lt;/h4&gt;

&lt;p&gt;Example prompt:&lt;/p&gt;

&lt;p&gt;"Rewrite these instructions in step format if present:&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;First, do this. Then, do that.&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Example output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Step 1 - First, do this.
Step 2 - Then, do that."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Summary:&lt;br&gt;
Prompting the model to identify specific information and reformat it aids in getting responses that fulfill certain conditions.&lt;/p&gt;
&lt;h4&gt;
  
  
  4. Few-shot prompting - Give successful examples
&lt;/h4&gt;

&lt;p&gt;Example Input:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"&amp;lt;child&amp;gt;: Teach me about patience.
&amp;lt;grandparent&amp;gt;: Patience is a virtue.
&amp;lt;child&amp;gt;: Teach me about kindness."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"&amp;lt;grandparent&amp;gt;: Kindness is the act of being considerate, compassionate, and empathetic towards others."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Summary:&lt;br&gt;
Providing a few successful examples before asking the final query helps guide the model to respond in a particular style or format.&lt;/p&gt;

&lt;h3&gt;
  
  
  Give the model time to think
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Specify the steps required to complete a task

&lt;ol&gt;
&lt;li&gt;Ask for output in a specified format&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;
&lt;li&gt;Instruct the model to work out its own solution before rushing to a conclusion&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Model Limitations
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Hallucinations&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Reducing hallucinations
&lt;/h3&gt;

&lt;p&gt;First find relevant information, then answer the questions based on the relevant information&lt;/p&gt;




&lt;p&gt;My first prompt using these guidelines:&lt;/p&gt;

&lt;p&gt;Write a message to share on Twitter about this fantastic course I am doing: &lt;a href="https://learn.deeplearning.ai/chatgpt-prompt-eng/lesson/2/guidelines"&gt;https://learn.deeplearning.ai/chatgpt-prompt-eng/lesson/2/guidelines&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Please include the link to the course &lt;a href="https://learn.deeplearning.ai/chatgpt-prompt-eng/"&gt;https://learn.deeplearning.ai/chatgpt-prompt-eng/&lt;/a&gt; in the message.&lt;/p&gt;

&lt;p&gt;Please make sure the message is within the Twitter size limit.&lt;/p&gt;

&lt;p&gt;Please make sure the content highlights the keyword "prompt engineering".&lt;/p&gt;

&lt;p&gt;Please make sure it contains the relevant hashtags that can make the tweet popular.&lt;/p&gt;

&lt;p&gt;Please make sure it involves some call to action so users reading can take some action on the tweet.&lt;/p&gt;

&lt;p&gt;Output in the following format:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tweet:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hashtags:&lt;/strong&gt;&lt;/p&gt;




</description>
      <category>promptengineering</category>
      <category>guideline</category>
      <category>chatgpt</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
