ChatGPT Prompt Engineering for Developers (ChatGPT prompt engineering for developers) resource summary

ChatGPT Prompt Engineering for Developers (ChatGPT prompt engineering for developers) resource summary

Teacher Wu Enda took a new class "ChatGPT Tips Engineering Course for Developers".

Official website address:

The link address is ChatGPT Prompt Engineering for Developers

B station Chinese and English subtitle video

01. Course Introduction (Wu Enda x Open AI ChatGPT Tips Engineering Tutorial) https://www.bilibili.com/video/BV1s24y1F7eq/?spm_id_from=333.1007.top_right_bar_window_history.content.click&vd_source=2a987c3774539d2fa53ee052ab6 a2381

github notebook

prompt-engineering-for-developers

This course is taught by Isa Fulford and Wu Enda. Isa Fulford is a technician at OpenAI, responsible for developing the ChatGPT retrieval plug-in and teaching how to use large language model technology in products.

The course will share best practices for ChatGPT tips, focusing on how to use LLM's API calls to quickly build software applications. Course content covers best practices in software development, common use cases (summarization, inference, transformation, extension), and building chatbots. It is hoped that the course will stimulate the imagination of students and help them build new applications.
insert image description here
insert image description here

Introduction Introduction

The course explores how to quickly build software applications using LLM API calls and introduces best practices in software development. We'll discuss some common use cases such as summarization, inference, transformation, and expansion, and walk you through building a chatbot using LLM. We hope this course will spark your imagination and help you build new applications.

Principles

The first principle is to write clear and specific instructions, and the second principle is to give the model enough time to think.

Principle One: Write Clear and Specific Instructions

Principle 2: Give the model enough time to think

Giving the model enough time to think is what it is: instructing the model to solve the problem first and then draw a conclusion. For example, we asked the model to judge whether the student's math solution was correct. The student's solution has an error, but it may not be noticeable when reading quickly. To address this, we let the models compute independently and compare solutions. We use a specific format, including the question, the student's solution, the correct solution, and then judge the agreement and give the student's grade. This way, the model would first do its own calculations, get the correct answer, and then find an inconsistency when comparing, inferring that the student's solution was wrong. This example illustrates the importance of requiring the model to solve the problem first and then compare the solutions for more accurate results.

Tip: Delimiters

By using delimiters in the text, we can clearly tell the model which part of the text we want to summarize. Delimiters can be various punctuation marks, such as triple backticks, quote marks, XML tags, or section headings, as long as they unambiguously separate a particular portion of text from the rest of the prompt. This approach helps to avoid the problem of hint injection, where the user may add some instructions to the hint that conflict with our desired actions, thus making the model do what the user says instead of what we want.

Trick: You can ask the model to check conditions

Asks the model to check whether a condition is met. If the task is based on assumptions that are not necessarily satisfied, we can tell the model to check those assumptions first. If the assumption is not met, instruct the model to point this out and stop trying to fully complete the task. You can also consider potential edge cases and how the model should handle them to avoid unexpected errors or results.

Our next strategy is

NOTE: Answers may be fictitious

May make up things that sound plausible but are not.

Guess you like

Origin blog.csdn.net/qq_37553692/article/details/130824626