Nvidia Unveils Futuristic Gaming Experience at Computex 2023
News

Nvidia Unveils Futuristic Gaming Experience at Computex 2023, Blending Gaming and AI

by Isabel
May 29, 2023
0

At Computex 2023, Nvidia displays a futuristic gaming experience that...

Read more
Adobe Introduces Powerful Generative AI Tools in Photoshop

Adobe Introduces Powerful Generative AI Tools in Photoshop Beta

May 29, 2023
Adobe Photoshop's Generative Fill Feature

Exploring the Power of Adobe Photoshop’s Generative Fill Feature

May 27, 2023
NVIDIA and Microsoft Partner to Accelerate AI

NVIDIA and Microsoft Partner to Accelerate AI

May 25, 2023
google photos security and privacy

Exploring the Top 5 Privacy and Security Risks of using Google Photos

May 24, 2023
everything you need to know about Adobe firefly

Everything You Need to Know About Adobe Firefly

May 29, 2023
Mojo Language Future of AI Programming

Mojo Language: The Future of AI Programming

May 15, 2023
ChatGPT iOS App

ChatGPT iOS App: A Powerful AI Chatbot for Your Mobile Device

May 19, 2023
Is ChatGPT down

Is ChatGPT Down? Here’s What You Need to Know

May 5, 2023
Top 5 Data Science Courses in 2023 for Better Job Opportunities

Top 5 Data Science Courses in 2023 for Better Job Opportunities

March 1, 2023
ChatGPT Plugins concepts and use cases

ChatGPT Plugins: Concepts and Use Cases

April 28, 2023
Cloudbooklet
  • News
  • Artificial Intelligence
  • Linux
  • Google Cloud
  • AWS
No Result
View All Result
Cloudbooklet
  • News
  • Artificial Intelligence
  • Linux
  • Google Cloud
  • AWS
No Result
View All Result
Cloudbooklet
No Result
View All Result
Home Artificial Intelligence

Advanced Prompt Engineering Guide

by Cloudbooklet
May 10, 2023
in Artificial Intelligence
Reading Time: 7 mins read
Automatic Prompt Engineering
Share on FacebookShare on TwitterShare on WhatsAppShare on Telegram

Prompt engineering is an essential element in the development, training, and usage of large language models (LLMs) and involves the skillful design of input prompts to improve the performance and accuracy of the model.

Table of Contents

  1. Advanced Prompting
    1. Zero-Shot Prompting
    2. Few-Shot Prompting
    3. Chain-of-Thought Prompting
    4. Zero-Shot CoT
    5. Self-Consistency
    6. Generated Knowledge Prompting
    7. Automatic Prompt Engineer (APE)

Advanced Prompting

It should be obvious at this point that it helps to enhance prompts in order to achieve better outcomes on various activities. That is the whole point of quick Prompt engineering.

You might also like

ChatGPT app

The Easiest Way to Download ChatGPT App Free

May 31, 2023
LLM Connected with APIs

Gorilla: LLM Connected with APIs

May 31, 2023

Zero-Shot Prompting

LLMs trained on massive amounts of data and adjusted to obey instructions may now do jobs on the fly. In the last part, we attempted a couple zero-shot instances. One of the examples we used was as follows:

Prompt:

Classify the text into neutral, negative, or positive. 

Text: I think the vacation is okay.
Sentiment:

Output:

Prompt

We didn’t provide the model any instances in the prompt above, which demonstrates the model’s zero-shot capabilities. When zero-shot fails, it is best to include demos or instances in the prompt. The method known as few-shot prompting is discussed more below.

Few-Shot Prompting

While large-language models already have impressive zero-shot capabilities, they fall short on more complex tasks when the zero-shot setting is used. To improve on this, we use few-shot prompting as a strategy to enable in-context learning, in which we present demos in the prompt to guide the model to higher performance. The examples serve as conditioning for later cases in which we want the model to respond.

Prompt:

A "whatpu" is a small, furry animal native to Tanzania. An example of a sentence that uses
the word whatpu is:
We were traveling in Africa and we saw these very cute whatpus.
To do a "farduddle" means to jump up and down really fast. An example of a sentence that uses
the word farduddle is:

Output:

Prompt

We can observe that the model has somehow learned how to perform the task by providing it with just one example (i.e., 1-shot). For more difficult tasks, we can experiment with increasing the demonstrations (e.g., 3-shot, 5-shot, 10-shot, etc.).

Chain-of-Thought Prompting

Chain-of-thought (CoT) prompting, introduced by Wei et al. (2022), offers advanced reasoning skills via intermediary reasoning phases. It can be used in conjunction with few-shot prompting to improve performance on more difficult activities that need thought before answering.

Prompt:

The odd numbers in this group add up to an even number: 4, 8, 9, 15, 12, 2, 1.
A: Adding all the odd numbers (9, 15, 1) gives 25. The answer is False.

The odd numbers in this group add up to an even number: 15, 32, 5, 13, 82, 7, 1. 
A:

Output:

Prompt

Keep in mind that the authors suggest that this is an emergent capacity that develops when sufficiently big language models are used.

Zero-Shot CoT

One recent idea that came out more recently is the idea of zero-shot CoT (Kojima et al. 2022) that essentially involves adding “Let’s think step by step” to the original prompt. Let’s try a simple problem and see how the model performs:

Prompt:

I went to the market and bought 10 apples. I gave 2 apples to the neighbor and 2 to the repairman. I then went and bought 5 more apples and ate 1. How many apples did I remain with?

Output:

Prompt

It’s impressive that this simple prompt is effective at this task. This is particularly useful where you don’t have too many examples to use in the prompt engineering.

Self-Consistency

Self-consistency is one of the more advanced strategies for quick engineering. Self-consistency, as proposed by Wang et al. (2022), intends to “replace the naive greedy decoding used in chain-of-thought prompting.” The objective is to sample several, different reasoning routes using few-shot CoT and then utilize the generations to choose the most consistent solution. This improves the performance of CoT prompting on arithmetic and commonsense reasoning tests.

Prompt:

Q: Olivia has $23. She bought five bagels for $3 each. How much money does she have left?
A: She bought 5 bagels for $3 each. This means she spent 5

Q: When I was 6 my sister was half my age. Now I’m 70 how old is my sister?
A:

Output:

Prompt

Generated Knowledge Prompting

LLMs are always being improved, and one popular strategy is the ability to add knowledge or information into the model to help it generate more accurate predictions.

Can the model be used to create information before making a forecast, using a similar concept? That is what Liu et al. 2022 try in their paper: to develop information to be utilized as part of the prompt. How useful is this, in particular, for tasks like commonsense reasoning?

Prompt:

Input: A rock is the same size as a pebble.
Knowledge: A pebble is a clast of rock with a particle size of 4 to 64 millimetres based on the Udden-Wentworth scale of sedimentology. Pebbles are generally considered larger than granules (2 to 4 millimetres diameter) and smaller than cobbles (64 to 256 millimetres diameter).

Input: Part of golf is trying to get a higher point total than others.
Knowledge:

Output:

Prompt

Automatic Prompt Engineer (APE)

Prompt

Automatic prompt engineer (APE) is a framework for automatic instruction creation and selection proposed by Zhou et al., (2022). The instruction generation problem is described as a black-box optimization problem including natural language synthesis and the use of LLMs to produce and search over possible solutions.

The first phase includes generating instruction candidates for a task using a big language model (as an inference model) given output demonstrations. The search will be guided by these prospective solutions. The instructions are performed using a target model, and the best instruction is chosen based on the computed evaluation scores.

Also Read Basic Prompt Engineering.

This article is to help you learn about advanced prompt engineering. We trust that it has been helpful to you. Please feel free to share your thoughts and feedback in the comment section below.

Tags: ChatGPT
ShareTweetSendShare
Cloudbooklet

Cloudbooklet

Help us grow and support our blog! Your contribution can make a real difference in providing valuable content to our readers. Join us in our journey by supporting our blog today!
Buy me a Coffee

Related Posts

Soundstorm-Pytorch

Soundstorm-Pytorch: A Powerful Tool for Audio Generation

May 30, 2023
Midjourney vs Adobe Firefly

Midjourney vs Adobe Firefly: A Comparison of Two AI Image Generation Tools

May 30, 2023
ChatGPT

How to Use ChatGPT Code Interpreter

May 31, 2023
Leonardo AI Login

How to login and use Leonardo AI to generate high-quality image

May 30, 2023

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

I agree to the Terms & Conditions and Privacy Policy.

  • Trending
  • Comments
  • Latest
DragGAN The AI-Powered Image Editing Tool

DragGAN: The AI-Powered Image Editing Tool That Makes Editing Images Easy

May 30, 2023
DragGAN AI editing Tool Install and Use DragGAN Photo Editor

DragGAN AI editing Tool Install and Use DragGAN Photo Editor

May 27, 2023
Bard API key

Everything You Need to Know About Google’s Bard API Key

May 20, 2023
Install PHP 8.1 on Ubuntu

How to Install or Upgrade PHP 8.1 on Ubuntu 20.04

May 17, 2023
DragGAN The AI-Powered Image Editing Tool

DragGAN: The AI-Powered Image Editing Tool That Makes Editing Images Easy

75
Upgrade PHP version to PHP 7.4 on Ubuntu

Upgrade PHP version to PHP 7.4 on Ubuntu

28
Install Odoo 13 on Ubuntu 18.04 with Nginx - Google Cloud

Install Odoo 13 on Ubuntu 18.04 with Nginx – Google Cloud

25
Best Performance WordPress with Google Cloud CDN and Load Balancing

Best Performance WordPress with Google Cloud CDN and Load Balancing

23
How to Setup SSH Keys on Ubuntu

How to Setup SSH Keys on Ubuntu 20.04

May 31, 2023
ChatGPT app

The Easiest Way to Download ChatGPT App Free

May 31, 2023
LLM Connected with APIs

Gorilla: LLM Connected with APIs

May 31, 2023
Soundstorm-Pytorch

Soundstorm-Pytorch: A Powerful Tool for Audio Generation

May 30, 2023

Popular Articles

  • DragGAN The AI-Powered Image Editing Tool

    DragGAN: The AI-Powered Image Editing Tool That Makes Editing Images Easy

    1437 shares
    Share 575 Tweet 359
  • DragGAN AI editing Tool Install and Use DragGAN Photo Editor

    333 shares
    Share 133 Tweet 83
  • Auto-Photoshop-Stable Diffusion-Plugin: A New Way to Create AI-Generated Images in Photoshop

    70 shares
    Share 28 Tweet 18
  • InternGPT: A New Way to Interact with ChatGPT

    54 shares
    Share 22 Tweet 14
  • Midjourney vs Adobe Firefly: A Comparison of Two AI Image Generation Tools

    10 shares
    Share 4 Tweet 3
Cloudbooklet

Welcome to our technology blog, where we explore the latest advancements in the field of artificial intelligence (AI) and how they are revolutionizing cloud computing. In this blog, we dive into the powerful capabilities of cloud platforms like Google Cloud Platform (GCP), Amazon Web Services (AWS), and Microsoft Azure, and how they are accelerating the adoption and deployment of AI solutions across various industries. Join us on this exciting journey as we explore the endless possibilities of AI and cloud computing.

  • About
  • Contact
  • Disclaimer
  • Privacy Policy

Cloudbooklet © 2023 All rights reserved.

No Result
View All Result
  • News
  • Artificial Intelligence
  • Linux
  • Google Cloud
  • AWS

Cloudbooklet © 2023 All rights reserved.

This website uses cookies. By continuing to use this website you are giving consent to cookies being used. Visit our Privacy and Cookie Policy.