Code Monkey home page Code Monkey logo

chatgpt-prompt-engineering's Introduction

ChatGPT Prompt Engineering for Developers

Jupyter code notebooks of "ChatGPT Prompt Engineering for Developers" by DeepLearning.AI and OpenAI. This short course taught by Isa Fulford (OpenAI) and Andrew Ng (DeepLearning.AI) will describe how LLMs work, provide best practices for prompt engineering, and show how LLM APIs can be used in applications for a variety of tasks, including:

  • Summarizing (e.g., summarizing user reviews for brevity)
  • Inferring (e.g., sentiment classification, topic extraction)
  • Transforming text (e.g., translation, spelling & grammar correction)
  • Expanding (e.g., automatically writing emails)

Elements of a prompt

A prompt contains any of the following elements:

  • Instruction - a specific task or instruction you want the model to perform
  • Context - external information or additional context that can steer the model to better responses
  • Input Data - the input or question that we are interested to find a response for
  • Output Indicator - the type or format of the output.

Most important techniques

Zero-shot prompting:

Zero-shot prompting is like giving your friend a puzzle without telling them the answer. You provide a hint or question, and even if they haven't seen it before, they can use their knowledge to figure out the solution.

Few-shot prompting:

Few-shot prompting is similar to having a few examples or clues to help your friend understand a topic better. It's like showing them a small set of similar puzzles before tackling a new one, making it easier to grasp.

Chain-of-thought prompting:

Chain-of-thought prompting is connecting ideas like building blocks. Imagine explaining a story step by step, with each part linking to the next. It's like telling a friend a series of events, helping them follow your thoughts in a logical order.

Self-consistency prompting:

Self-consistency prompting is about making sure your explanations make sense and don't contradict each other. It's like telling your friend a story and making sure the characters and events stay true to the rules you set, creating a world that's logical and believable.

ReAct prompting:

ReAct prompting is a bit like having a conversation where you respond to your friend's questions. Instead of just providing information, you adjust your explanations based on what your friend is curious about. It's like tailoring your answers to fit their interests and questions.

Used resources

prompt engineering guide

ChatGPT Prompt Engineering for Developers

chatgpt-prompt-engineering's People

Contributors

ralphcajipe avatar vicba avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.