第1集-引言-ChatGPT提示工程师|AI大神吴恩达教你写提示词

退休生活真精彩
29 Apr 202306:35

Summary

TLDR这门课程旨在教开发者如何利用ChatGPT进行提示工程。主讲者和OpenAI技术人员Iza Forfeit将介绍如何使用大型语言模型(LLM)API快速构建软件应用。课程将涵盖提示工程的最佳实践、常见使用案例(如总结、推理、转换、扩展)以及如何构建聊天机器人。强调了基础LLM和指令调整LLM的区别,并推荐使用后者来处理大多数实际应用。课程将帮助开发者了解和运用LLM API的潜力,并提供实用的提示技巧。

Takeaways

  • 🎓 本课程由Iza和另一位讲师共同讲授,Iza是OpenAI的技术团队成员,曾构建流行的Chat GPT检索插件,并致力于教授人们如何将大型语言模型技术应用于产品中。
  • 📘 网络上有很多关于如何提示(prompting)的文章,但很多都集中在Chat GPT的网页用户界面上,而作为开发者工具,通过API调用快速构建软件应用的能力被低估了。
  • 🚀 课程将分享使用大型语言模型(LLM)的可能性和最佳实践,包括软件开发中的提示最佳实践、常见用例以及如何构建聊天机器人。
  • 🔍 大型语言模型(LMS)主要分为两种类型:基础型(base LM)和指令调整型(instruction tuned LM)。基础型LMS根据文本训练数据预测下一个词,而指令调整型LMS被训练以遵循指令。
  • 🏛 指令调整型LMS通过进一步的训练和人类反馈强化学习(RLHF)技术进行优化,以提高其帮助性、诚实性和无害性,相比基础型LMS,它们更不容易输出有问题的文本。
  • 🛠️ 本课程将专注于指令调整型LMS的最佳实践,建议大多数应用使用这种类型的LMS,因为它们更易于使用,并且随着OpenAI和其他语言模型公司的工作,它们变得更加安全和一致。
  • 👥 感谢OpenAI和deep learning.ai团队对课程材料的贡献,包括Andrew、Maine、Job、Palermo、Boris、Power、Ted、Centers、Lilian Wang以及Jeff、Ludwig、Ed、Issue和Tommy Nelson。
  • 💡 使用指令调整型LMS时,要像给一个聪明但不了解任务细节的人下达指令一样。如果指令不够清晰,可能会导致LMS无法正确工作。
  • 📝 明确指定你想要的文本内容、风格和预期的输出,可以帮助LMS更准确地生成你想要的结果。
  • 🕒 下一视频中将展示如何清晰具体地提示LMS,这是提示LMS的一个重要原则,并且将介绍另一个原则:给LMS时间思考。

Q & A

  • 这个课程是关于什么的?

    -这个课程是关于如何使用大型语言模型(LLM)技术,特别是针对开发者的Chat GPT,来快速构建软件应用程序。

  • Iza Forfeit是谁,她在课程中扮演什么角色?

    -Iza Forfeit是OpenAI的技术团队成员,她构建了流行的Chat GPT检索插件,并且大部分工作是教授人们如何在产品中使用大型语言模型技术。

  • 为什么说使用API调用大型语言模型构建软件的能力被低估了?

    -因为许多人还在使用Chat GPT的网页用户界面来执行特定和一次性的任务,而没有意识到作为开发者工具,通过API调用大型语言模型可以更快地构建软件应用。

  • 课程中提到的AI基金是什么?

    -AI基金是deep learning.ai的姐妹公司,它与许多初创公司合作,将大型语言模型技术应用于不同的应用场景。

  • 大型语言模型(LLM)主要有两种类型,它们是什么?

    -大型语言模型主要有两种类型:基础型LLM和指令调整型LLM。基础型LLM被训练来预测基于文本训练数据的下一个词,而指令调整型LLM被训练来遵循指令。

  • 基础型LLM和指令调整型LLM有什么区别?

    -基础型LLM主要基于大量互联网和其他来源的数据来预测下一个最可能的词,而指令调整型LLM则是在基础LLM的基础上,通过进一步的训练使其能够遵循指令,并通过人类反馈的强化学习来提高其帮助性和指令遵循能力。

  • 为什么指令调整型LLM比基础型LLM更安全、更符合要求?

    -指令调整型LLM经过特别训练,以变得乐于助人、诚实和无害,因此它们不太可能输出有问题的文本,如有毒输出,与基础型LLM相比。

  • 课程中提到的最佳实践是什么?

    -课程中提到的最佳实践包括为软件开发提供明确的提示,以及一些常见的用例,如总结、推断、转换和扩展,还有如何使用LLM构建聊天机器人。

  • 为什么在使用指令调整型LLM时,需要给出清晰的指令?

    -清晰的指令有助于LLM更准确地理解任务的具体要求,从而生成所需的输出。如果指令不够清晰,LLM可能无法生成预期的结果。

  • 课程中提到的Rohf是什么?

    -Rohf是Reinforcement Learning from Human Feedback的缩写,即人类反馈的强化学习,这是一种通过人类评估者提供的反馈来改进系统性能的技术。

  • 课程中提到的OpenAI Cookbook是什么?

    -OpenAI Cookbook是一个教程,它教授人们如何提示(prompting),即使用特定的指令或问题来引导大型语言模型生成所需的输出。

  • 课程中提到的deep learning.ai是什么?

    -deep learning.ai是一个提供深度学习教育的平台,它与OpenAI紧密合作,共同开发和提供教育材料和课程。

Outlines

00:00

📚 课程介绍与讲师团队

本段介绍了一门关于如何为开发者使用大型语言模型(LLM)的课程。讲师Iza和AI基金团队成员将教授如何使用大型语言模型来快速构建软件应用。提到了Iza在openai的工作经历,包括构建流行的chat GPT检索插件和贡献于open AI cookbook。课程内容将涵盖最佳实践、常见用例以及如何使用LLM构建聊天机器人。强调了大型语言模型作为开发者工具的潜力,以及如何通过API调用快速构建应用。

05:00

🗣️ 提示最佳实践与指令调整

在这一段中,讲师讨论了如何有效地使用大型语言模型(LLM)。强调了清晰和具体的指令对于获得期望结果的重要性。举例说明了如何针对Alan Turing的不同方面(如科学工作、个人生活或历史角色)给出具体指令。还提到了指定文本的语气和风格,以及如何提供背景资料以帮助模型更好地完成任务。接下来,视频将展示如何清晰具体地提示LLM,并介绍如何给予LLM思考时间的第二个提示原则。

Mindmap

Keywords

💡大型语言模型

大型语言模型(Large Language Model, LLM)是通过大量文本数据训练的AI模型,能够预测文本中下一个最可能出现的词。视频中提到,LLM分为基础LLM和指令调优LLM,后者经过进一步训练,可以更好地遵循指令,适用于开发者构建软件应用。

💡指令调优LLM

指令调优LLM是通过基础LLM进行进一步训练,使其能够遵循指令输出更符合要求的文本。这种模型被训练为帮助、诚实且无害,常用于实际应用。视频中讲述了指令调优LLM如何更适合开发者使用,以及其相较于基础LLM的优势。

💡API调用

API调用是指通过应用程序编程接口(API)来使用LLM进行开发。视频中强调了API调用的重要性,指出许多开发者通过API调用快速构建软件应用,但这一潜力尚未被充分认识和利用。

💡最佳实践

最佳实践指在特定领域中被证明最有效和高效的方法。视频中介绍了针对软件开发的提示编写最佳实践,并且会展示如何使用这些最佳实践来实现常见的用例,例如总结、推断、转换和扩展。

💡总结

总结是视频中提到的一个常见用例,即从长文本中提取主要信息并生成简洁的概要。通过使用LLM的API调用,开发者可以快速实现文本总结功能,这是许多应用中的重要需求。

💡推断

推断是从文本数据中得出结论或进行预测的过程。视频中提到,开发者可以利用LLM进行推断,从而为用户提供有价值的信息和建议,例如根据提供的上下文回答问题。

💡转换

转换是指将一种形式的文本转换为另一种形式的过程,例如将非结构化数据转换为结构化数据。视频中提到,通过提示编写和使用LLM,开发者可以实现各种形式的文本转换,以满足不同应用的需求。

💡扩展

扩展是指在原有文本的基础上增加更多信息或细节。视频中讲述了如何使用LLM进行文本扩展,这在内容生成和增强用户体验方面具有重要作用。

💡给LLM时间思考

给LLM时间思考是视频中提到的一个提示编写原则,即在提示中提供足够的信息和上下文,以便LLM能够生成更准确和相关的输出。这个原则帮助确保模型输出的质量和实用性。

💡强化学习

强化学习(Reinforcement Learning, RL)是视频中提到的一种训练技术,通过人类反馈来进一步优化模型,使其更好地遵循指令并生成有用的输出。这种方法使得指令调优LLM能够提供更高质量和更安全的结果。

Highlights

欢迎来到这门关于为开发者设计的Chat GPT工程课程

Iza Forshayit是OpenAI的技术团队成员,她构建了流行的Chat GPT检索插件并教授人们如何使用大型语言模型技术

Iza Forshayit还为Open AI的食谱书做出了贡献,该食谱书教授人们如何提示

大型语言模型作为开发者工具的使用,通过API调用快速构建软件应用程序,这一能力被严重低估

AI基金团队与许多初创公司合作,将这些技术应用于不同的应用,看到语言模型API能快速帮助开发者构建软件非常令人兴奋

本课程将分享使用大型语言模型的可能性和最佳实践

首先学习软件开发的提示最佳实践,然后介绍常见用例:总结、推断、转换、扩展,并构建一个聊天机器人

大型语言模型(LMS)主要有两种类型:基础LMS和指令调整LMS

基础LMS被训练用于根据文本训练数据预测下一个词

指令调整LMS被训练以遵循指令,更有可能输出有用的答案

指令调整LMS通过人类反馈的强化学习进一步优化,以更好地提供帮助和遵循指令

指令调整LMS被训练为有用、诚实和无害,不太可能输出有问题的文本

本课程将专注于指令调整LMS的最佳实践,推荐用于大多数应用

感谢OpenAI和deep learning.ai团队对材料的贡献

使用指令调整LMS时,想象给另一个人下达指令,比如一个聪明但不了解你任务细节的人

如果OM工作不正常,有时是因为指令不够清晰

在下一个视频中,你将看到如何清晰具体地给出指令,这是提示OM的一个重要原则

你还将学习到提示OM的第二个原则:给DLM时间思考

Transcripts

play00:04

welcome to this course on chat GPT prom

play00:07

engineering for developers I'm thrilled

play00:10

to have with me Iza forfeit to teach

play00:13

this along with me she is a member of

play00:15

the technical staff of openai and had

play00:18

built the popular chat GPT retrieval

play00:20

plugin and a large part of work has been

play00:22

teaching people how to use om or large

play00:25

language model of technology in products

play00:27

she's also contributed to the open AI

play00:29

cookbook that teaches people prompting

play00:31

so thrilled to have you with you and I'm

play00:33

thrilled to be here and share some

play00:35

prompting best practices with you all

play00:38

so there's been a lot of material on the

play00:40

internet for prompting with articles

play00:42

like 30 prompts everyone has to know

play00:45

a lot of that has been focused on the

play00:48

chat GPT web user interface which many

play00:50

people are using to do specific and

play00:52

often one-off tasks but I think the

play00:56

power of om's large language models as a

play00:59

developer tool that is using API calls

play01:02

to OMS to quickly build software

play01:04

applications I think that is still very

play01:06

underappreciated in fact my team at AI

play01:09

fund which is a sister company to deep

play01:11

learning.ai has been working with many

play01:13

startups on applying these Technologies

play01:16

to many different applications and it's

play01:19

been exciting to see what LM apis can

play01:22

enable developers to very quickly build

play01:25

so in this course we'll share with you

play01:28

some of the possibilities for what you

play01:30

can do as well as best practices for how

play01:33

you can do them

play01:34

there's a lot of material to cover first

play01:37

you'll learn best certain prompting best

play01:39

practices for software development then

play01:41

we'll cover some common use cases

play01:43

summarizing inferring transforming

play01:46

expanding and then you'll build a chat

play01:48

bot using an llm

play01:50

we hope that this will spark your

play01:52

imagination about new applications that

play01:53

you can build

play01:55

so in the development of large language

play01:57

models or LMS they've been broadly two

play01:59

types of LMS which I'm going to refer to

play02:02

as base LMS and instruction tuned orms

play02:06

so base om has been trained to predict

play02:08

the next word based on text training

play02:11

data often trained on large amounts of

play02:13

data from the internet and other sources

play02:15

to figure out what's the next most

play02:17

likely word to follow

play02:19

so for example if you were to prompt

play02:21

this once upon a time there was a

play02:23

unicorn it may complete this that is

play02:26

they may predict the next several words

play02:27

are that live the magical forest with

play02:29

all unicorn friends

play02:31

but if you were to prompt us with what

play02:34

is the capital of France then based on

play02:36

what articles on the internet might have

play02:40

is quite possible that the base LM will

play02:43

complete this with what is France's

play02:45

largest city what is France's population

play02:46

and so on because articles on the

play02:49

internet could quite plausibly be list

play02:51

of quiz questions about the country of

play02:54

France

play02:55

in contrast an instruction Tunes om

play02:58

which is where a lot of the momentum of

play03:00

LM research and practice has been going

play03:03

an instruction team has been trained to

play03:06

follow instructions so if you were to

play03:09

ask it what is the capital of France is

play03:10

much more likely to output something

play03:12

like the capital Francis Paris

play03:15

so the way that instruction tuned orms

play03:18

are typically trained is you start off

play03:20

with a base orm doesn't train on a huge

play03:22

amount of Text data and further train it

play03:25

for the fine tune it with inputs and

play03:28

outputs that are instructions and good

play03:30

attempts to follow those instructions

play03:32

and then often further refine using a

play03:34

technique called rohf reinforcement

play03:36

learning from Human feedback to make the

play03:39

system better able to be helpful and

play03:42

follow instructions because instruction

play03:44

tune OMS have been trained to be helpful

play03:47

honest and harmless so for example

play03:49

they're less likely to Output

play03:51

problematic text such as toxic outputs

play03:54

compared to base om

play03:55

a lot of the Practical usage scenarios

play03:58

have been shifting into all the

play03:59

instructions you know arms some of the

play04:01

best practices you find on the internet

play04:03

may be more suited for a base om but for

play04:06

most practical applications today we

play04:08

would recommend most people instead

play04:10

focus on instruction Tunes OMS which are

play04:14

easier to use and also because of the

play04:16

work of openai and other LM companies

play04:19

becoming safer and more aligned

play04:22

so this course will focus on best

play04:25

practices for instruction tuner homes

play04:28

which is what we recommend you use for

play04:30

most of your applications

play04:32

before moving on I just want to

play04:33

acknowledge the team from openai and

play04:36

deep learning.ai that contributed to the

play04:38

materials that Iza and I will be

play04:41

presenting I'm very grateful to Andrew

play04:43

Maine job Palermo Boris power Ted

play04:46

centers and Lilian Wang from open AI

play04:48

that we're very involved with our

play04:50

springstorming materials vetting the

play04:51

materials to put together the curriculum

play04:54

for this short course and I'm also

play04:56

grateful on the Deep learning side for

play04:58

the work of Jeff Ludwig Ed issue and

play05:00

Tommy Nelson so when you use an

play05:02

instruction tuned oom think of giving

play05:06

instructions to another person say

play05:08

someone that's smart but doesn't know

play05:10

the specifics of your task so when an OM

play05:13

doesn't work sometimes it's because the

play05:16

instructions weren't clear enough for

play05:18

example if you were to say please write

play05:20

me something about Alan Turing well in

play05:23

addition to that it can be helpful to be

play05:25

clear about whether you want the text to

play05:29

focus on his scientific work or his

play05:31

personal life or his role in history or

play05:33

something else and if you specify what

play05:37

you want the tone of the text to be

play05:39

should it take on the tone like a

play05:41

professional journalist would write or

play05:43

is it more of a casual note that you

play05:45

dash off to a friend that holds the OM

play05:47

generate what you want and of course if

play05:50

you picture yourself asking say a fresh

play05:53

college graduate to carry out this task

play05:55

for you if you can even specify what

play05:58

Snippets of text they should read in

play06:00

advance to write this text about Alan

play06:02

Turing then that even better sets up

play06:04

fresh college track for success to carry

play06:07

out the sauce for you

play06:09

so in the next video you see examples of

play06:12

how to be clear and specific which is an

play06:15

important principle of prompting OMS and

play06:18

you also learn from either a second

play06:20

principle of prompting that is giving a

play06:22

dlm time to think so that let's go on to

play06:26

the next video

Rate This

5.0 / 5 (0 votes)

Related Tags
大型语言模型API调用软件开发教学最佳实践聊天机器人AI技术创新应用技术教程OpenAI
Do you need a summary in English?