使用ChatGPT API构建系统1——大语言模型、API格式和Token

宝玉的技术分享
31 May 202319:34

Summary

TLDR本视频提供了对OpenAI的大型语言模型工作原理的全面概述,从它们是如何训练的,到令牌化器如何影响输出,以及聊天格式如何指定系统与用户消息。视频深入探讨了监督学习如何成为训练这些模型的核心构建块,以及如何通过预测下一个词来构建大型语言模型。此外,还介绍了基本模型与指令调整模型的差异,以及如何通过人类反馈进行强化学习来提高模型质量。最后,视频还提供了关于如何安全地调用OpenAI API、如何有效地利用提示以及如何通过聊天格式来精细控制模型输出的实用技巧。

Takeaways

  • 😀 LMs are trained using supervised learning to predict the next word given a sequence of words
  • 😃 Instruction-tuned LMs like ChatGPT try to follow instructions rather than freely generate text
  • 🤓 The tokenizer breaks text into commonly occurring sequences called tokens
  • 😮 Reversing words is hard for LMs because they see tokens, not individual letters
  • 📝 The chat format lets you specify system and user messages to control the LM's behavior
  • 👍 Getting human feedback helps further improve LM quality over time
  • 🔢 On average each token is about 4 characters or 3/4 of a word long
  • ⚠️ Storing API keys locally is more secure than having them in plain text
  • 🚀 Prompting lets you build AI apps much faster than traditional ML methods
  • 📋 This doesn't work as well for structured/tabular data as for text

Q & A

  • 大型语言模型是如何工作的?

    -大型语言模型通过使用监督学习来预测下一个词汇,基于大量的文本数据进行训练,从而能够在给定的文本片段后预测出最可能的下一个词汇。

  • 在训练大型语言模型时,监督学习是如何应用的?

    -在监督学习中,模型通过学习输入和输出(X到Y)的映射关系,使用标记过的训练数据来进行学习。例如,通过给定的句子片段预测下一个词汇。

  • 什么是基础语言模型和指令调整语言模型?

    -基础语言模型通过文本训练数据重复预测下一个词汇。指令调整语言模型则进一步通过微调,让模型能够根据输入的指令产生输出,从而更好地遵循指令。

  • 指令调整语言模型的训练过程是怎样的?

    -首先训练一个基础语言模型,然后通过在更小的示例集上进行进一步的微调,这些示例显示了如何根据指令生成响应。这个过程可以在更小的数据集上,使用更少的计算资源完成。

  • 什么是从人类反馈中学习的强化学习(Rohf)?

    -这是一种通过获取人类对语言模型输出质量的评价(例如,是否有用、诚实和无害),然后进一步调整模型以提高生成高评价输出的概率的过程。

  • 如何改善大型语言模型处理单词游戏或特定任务的能力?

    -通过改变输入的格式,例如,在单词之间添加短划线或空格,可以帮助模型更好地理解和处理这些任务。

  • 在使用OpenAI API时,如何更安全地管理API密钥?

    -推荐使用环境变量来存储API密钥,而不是直接在代码中以明文形式输入。这可以通过读取本地的.env文件来实现,从而提高安全性。

  • 使用大型语言模型和传统的机器学习应用开发相比,有什么优势?

    -使用大型语言模型,可以通过简单地定义提示(prompting)快速构建文本应用,从而大大缩短从开发到部署的时间,这一过程可能只需几分钟到几小时。

  • 为什么大型语言模型对于处理结构化数据应用不那么有效?

    -因为这些模型主要是针对非结构化数据(如文本或图像)设计的。对于包含大量数值和表格数据的结构化数据应用,它们的效果可能不如专门的机器学习方法。

  • 如何使用系统、用户和助理消息来定制大型语言模型的输出?

    -通过指定系统消息来设定总体行为或语调,然后通过用户消息提供具体指令,可以定制语言模型的输出,使其符合既定的风格或回答特定的请求。

Outlines

00:00

🤖 大型语言模型的工作原理

这一部分介绍了大型语言模型(LM)的基础,包括它们是如何通过监督学习训练的,以及如何使用标记化(Tokenization)过程影响模型的输出。解释了大型语言模型通过预测下一个词来生成文本的过程,并区分了基础模型与经过指令调整的模型(如ChatGPT),后者能更好地遵循给定的指令。此外,还讨论了通过使用人工标注的数据对模型进行微调,以改进其遵循指令的能力。

05:01

🔍 优化模型输出的技术

介绍了如何通过人类反馈来优化语言模型的输出,特别是通过使用来自人类反馈的增强学习(Reinforcement Learning from Human Feedback, ROHF)技术来提高输出的质量。这一过程比基础模型的训练更快、所需的数据集更小,且计算资源要求更低。还展示了如何使用OpenAI提供的API和帮助函数来获取模型的输出,并讨论了模型是如何处理和预测“令牌”(而不是单个字词)的,这对于理解模型的工作方式至关重要。

10:02

📝 使用API和消息格式的高级技巧

探讨了使用API调用大型语言模型时的高级技巧,包括如何通过定义系统、用户和助理消息来精细控制模型的行为。通过具体例子展示了如何设置不同的系统消息来指定输出的风格和长度,以及如何通过添加助理消息来管理多轮对话。此外,提供了一种方法来估算使用的令牌数量,这对于优化和控制API调用非常有用。

15:03

🔐 安全地管理API密钥和提示编程的革命

讨论了如何安全地管理和使用API密钥,推荐了使用环境变量而不是将密钥硬编码到代码中的方法。强调了提示(Prompting)编程在AI应用开发中的革命性影响,使得原本需要数月才能完成的任务现在可以在几小时内完成。虽然这种方法适用于处理非结构化数据,如文本和图像,但对于结构化数据应用则不那么有效。最后,展望了使用大型语言模型,特别是在文本应用中的前景,并预告了下一个视频的内容。

Mindmap

Keywords

💡大型语言模型

大型语言模型(Large Language Model, LLM)是一种基于人工智能的工具,能够理解和生成人类语言。在视频中,大型语言模型通过预测文本序列中的下一个词来训练,从而学习语言的结构和用法。这种模型可以在各种文本生成任务中使用,例如完成句子、回答问题或写作。视频中以此为核心,解释了如何训练和使用这些模型来处理和生成文本。

💡监督学习

监督学习是机器学习的一种方法,它使用带有标签的数据来训练算法。在视频中,作者通过比喻说明了监督学习如何应用于大型语言模型的训练过程,即通过学习输入和输出(例如,文本片段和下一个单词)的映射关系来训练模型。这是大型语言模型学习生成合理文本的基础。

💡Tokenizer

Tokenizer(分词器)是用于将文本分解成更小的单位(例如单词或字符)的工具。在视频中,分词器的作用是将长文本切分成模型能够理解的小片段,即“tokens”。这对于模型的训练和文本生成至关重要,因为大型语言模型是基于这些tokens进行预测的。例如,将“lollipop”拆分为更小的序列来提高模型处理特定任务的能力。

💡基础LM

基础LM(Base Language Model)是未经特殊指令微调的原始语言模型。在视频中,基础LM是通过大量的文本数据训练而成,能够预测文本序列中的下一个单词。但是,它可能不会针对特定的指令或问题类型进行优化,如视频中提到的,基础LM可能会生成与提问不直接相关的内容。

💡指令调优LM

指令调优LM(Instruction-tuned Language Model)是在基础LM的基础上,通过对模型进行进一步的训练,使其更好地遵循用户的指令。在视频中,这通过使用特定的指令和响应的例子来实现,从而使模型更加适应解答直接问题或执行特定任务,如直接回答“法国的首都是什么”。

💡强化学习

强化学习是一种训练机器学习模型的方法,通过奖励或惩罚来引导模型行为。在视频中,强化学习从人类反馈(Reinforcement Learning from Human Feedback, RLHF)用于进一步调整语言模型,以生成更高质量的输出,这涉及到根据人类评价模型输出的质量并据此调整模型的行为。

💡API调用

API调用是指在编程中,通过应用程序编程接口(API)向其他软件应用程序或服务发送请求并获取数据或功能的过程。在视频中,作者展示了如何使用OpenAI的API调用大型语言模型来生成文本,这是与模型交互并利用其生成能力的重要方式。

💡Token

在大型语言模型的上下文中,Token是指文本被分词器切分后的单个单位。视频中解释了Token的概念,并指出它们是模型预测的基础。例如,模型预测的不仅仅是下一个单词,而是下一个Token,这可能是一个完整的单词、一个单词的一部分或一个标点符号。

💡提示技巧

提示技巧指的是在向语言模型提供输入时使用的策略,以获得更优质的输出。视频中提到了如何通过添加连字符来改善模型对特定词汇的处理能力,以及如何设置系统和用户消息以控制模型的响应风格和内容。这些技巧对于有效利用大型语言模型来说是非常重要的。

💡环境变量

环境变量是操作系统中用于存储配置信息的变量,如API密钥等敏感信息。视频中提到了使用环境变量来安全地存储和访问API密钥,避免在Jupyter笔记本等直接暴露密钥,这是保护敏感信息不被泄露的重要实践。

Highlights

Overview of how OpenAI's large language models (LMs) work, including training and output influence.

Explanation of supervised learning as a fundamental method for training LMs.

Description of the process of teaching LMs to predict the next word in a sentence.

Distinction between base LMs and instruction-tuned LMs like ChatGPT.

Explanation of the process of fine-tuning base LMs with human feedback.

The use of reinforcement learning from human feedback (RLHF) to improve LM outputs.

Discussion on computational resources and time required for training LMs.

Demonstration of how to use an LM with Python libraries and the OpenAI API.

Explanation of tokenization in LMs and its impact on text processing.

Techniques for improving LM responses in specific tasks like reversing letters.

Overview of token limits in models like GPT-3.5 Turbo and handling large inputs.

Introduction to the chat format for LMs specifying system, user, and assistant messages.

Illustration of customizing LM responses using system messages in chat format.

Examples of using system messages for style and length control in LM responses.

Tips on securely managing API keys for using LMs.

Comparison of traditional ML workflows with prompting-based ML for rapid development.

Transcripts

play00:04

in this first video I'd like to share

play00:07

with you an overview of how om's large

play00:09

language models work we'll go into how

play00:12

they are trained as well as details like

play00:15

the tokenizer and how that can affect

play00:17

the output of when you prompt an LM and

play00:20

we'll also take a look at the chat

play00:21

format for LMS which is a way of

play00:24

specifying both system as well as user

play00:27

messages and understand what you can do

play00:29

with that capability let's take a look

play00:32

first how does a large language model

play00:35

work you're probably familiar with the

play00:38

text generation process where you can

play00:40

give a prompt I love eating an awesome

play00:41

om to fill in what the things are likely

play00:45

completions given this problem and it

play00:47

may say Vegas with cream cheese or my

play00:49

Mother's Meatloaf or else with friends

play00:51

but how did the model learn to do this

play00:54

the mates who used to train in LOM is

play00:58

actually supervised learning

play01:00

in supervised learning a computer learns

play01:03

and input outputs or extra y mapping

play01:05

using label training data so for example

play01:08

if you're using supervised learning to

play01:10

learn to classify the sentiment of

play01:12

restaurant reviews you might collect a

play01:15

trading set like this where a review

play01:16

like the pest driving time which is

play01:18

great is labeled as a positive sentiment

play01:21

review and so on and

play01:24

service is slow the food was also is

play01:26

negative and the Earth Gray tea was

play01:27

fantastic has a positive label by the

play01:30

way both Ezra and I were born in the UK

play01:33

and so both of us like our Gray tea and

play01:36

so their process for supervised learning

play01:38

is typically to get label data and then

play01:41

train a model on data and after training

play01:44

you can then deploy and call the model

play01:46

and give it a new restaurant review like

play01:49

best pizza I've had you hopefully output

play01:52

that has a positive sentiment

play01:54

it turns out that supervised learning is

play01:56

a core building block for training large

play01:59

language models specifically a large

play02:01

language model can be built by using

play02:04

supervised learning to repeatedly

play02:06

predict the next word let's say that

play02:09

in your training sets of a lot of text

play02:12

Data you have to sentence my favorite

play02:14

food is a bagel with cream cheese and

play02:16

locks then this sentence is turned into

play02:20

a sequence of training examples where

play02:22

given a sentence fragment my favorite

play02:25

fruit is a if you want to predict the

play02:28

next word in this case was Bagel or

play02:30

given the sentence fragment or sentence

play02:33

prefix my favorite food is a bagel the

play02:36

next word in this case would be with and

play02:39

so on and given the last training sets

play02:42

of hundreds of billions or sometimes

play02:44

even more words you can then create a

play02:46

massive training set where you can start

play02:49

off with part of a sentence or part of a

play02:52

piece of text and repeatedly ask the

play02:54

language model to learn to predict what

play02:57

is the next word so today there are

play02:59

broadly two major types of large

play03:03

language models the first is a base om

play03:06

and the second which is what is

play03:09

increasingly used is the instructions

play03:11

you know um

play03:12

so the base om repeatedly predicts the

play03:14

next word based on text training data

play03:18

and so if I give it a prompt once upon a

play03:20

time there was a unicorn then it may by

play03:22

repeatedly predicting one word at the

play03:24

time come up over completion that tells

play03:26

a story about their unicorn living in

play03:27

the magical forest with all unicorn

play03:29

friends

play03:30

now the downside of this is that if you

play03:33

were to prompt it with what is the

play03:34

capital of France quite plausible that

play03:37

on the internet there might be a list of

play03:39

quiz questions about France so let me

play03:41

complete this with what is France's

play03:42

largest city what is France's population

play03:43

and so on

play03:46

but what you really want is you wanted

play03:48

to tell you what is the capital of

play03:50

France probably rather than list all

play03:52

these questions

play03:54

so the instruction tune om instead tries

play03:57

to follow instructions and will

play03:58

hopefully say the couple of friends is

play04:00

Paris

play04:01

how do you go from a base LM to the

play04:03

instruction Tunes om

play04:05

this is what the process of training an

play04:07

instruction to an LM like chat GPC looks

play04:11

like you first train a base om on a lot

play04:13

of data so hundreds of billions of words

play04:15

maybe even more and this is a process

play04:17

that can take months on a large

play04:20

supercomputing system

play04:22

after you've trained the base LM you

play04:25

would then further train the model by

play04:28

fine-tuning it on a smaller set of

play04:30

examples where the output

play04:33

follows an input instruction and so for

play04:37

example you may have contractors

play04:39

help you write a lot of examples of an

play04:42

instruction and then a good response to

play04:44

an instruction and that creates a

play04:46

training set to carry out this

play04:48

additional fine-tuning so the learns to

play04:50

predict what is the next word if it's

play04:51

trying to follow an instruction

play04:54

after that to improve the quality of the

play04:57

lm's output a common process now is to

play05:01

obtain human ratings of the quality of

play05:03

many different LM outputs on criteria

play05:06

such as whether the output is helpful

play05:08

honest and harmless and you can then

play05:11

further tune the LM to increase the

play05:14

probability of its generating the more

play05:16

highly rated outputs and the most common

play05:18

technique to do this is rohf which

play05:21

stands for reinforcement learning from

play05:22

Human feedback

play05:24

and whereas training the base our own

play05:26

can take months the process of going

play05:29

from the base LM to the instructions You

play05:31

Know M can be done in maybe days on much

play05:34

more on a much more modest size data set

play05:37

and much more modern size computational

play05:38

resources

play05:40

so this is how you would use an OM

play05:43

um you can import a few libraries

play05:45

I'm going to load my open AI key here

play05:48

I'll say a little bit more about this

play05:50

later in this video and here's a helper

play05:53

function to get a completion given a

play05:56

prompt if you have not yet installed the

play05:59

open AI package on your computer you

play06:03

might have to run pip install open AI

play06:06

but I already have an install here so I

play06:08

won't run that and let me hit shift

play06:10

enter

play06:11

to run these and now I can set response

play06:15

equals

play06:17

get completion

play06:19

what is the capital of France

play06:27

and hopefully

play06:29

it will

play06:31

give me a good result

play06:34

now

play06:35

about

play06:36

now in the description of the large

play06:39

language model so far I talked about it

play06:41

as predicting one word at a time but

play06:44

there's actually one more important

play06:46

technical detail if you were to tell it

play06:49

take the letters in the word word

play06:51

lollipop

play06:53

and reverse them

play06:55

this seems like an easy task maybe like

play06:57

a four-year-old could do this toss but

play07:00

if you were to ask chai GPT to do this

play07:04

it actually

play07:05

outputs are somewhat gobble whatever

play07:08

this is this is not l-o-l-i-p-o-p this

play07:11

is not

play07:12

lollipops lets us reverse so why is Chad

play07:15

GPC unable to do what seems like a

play07:18

relatively simple task it turns out that

play07:20

there's one more important detail for

play07:22

how a large language model Works which

play07:24

is it doesn't actually repeatedly

play07:26

predict the next word it instead

play07:28

repeatedly predicts the next token and

play07:32

what that LM actually does is it will

play07:34

take a sequence of characters like

play07:36

learning new things is fun and group the

play07:39

characters together to form tokens that

play07:42

comprise comedy occurring sequences of

play07:45

characters so here learning new things

play07:48

is fun each of them is a fairly common

play07:51

word and so each token corresponds to

play07:53

one word or one word in a space or an

play07:56

exclamation mark

play07:57

but if you were to give it input with

play08:00

some somewhat less frequently used words

play08:02

like prompting a powerful developer to

play08:04

the word prompting is still not that

play08:08

common in the English language that's

play08:10

certainly gaining a popularity and so

play08:13

prompting is actually broken down to

play08:14

three tokens with prompt and ing because

play08:17

those three are commonly occurring

play08:19

sequences of letters

play08:22

and if you were to give it the word

play08:24

lollipop

play08:25

the tokenizer actually breaks us down

play08:27

into three tokens L and O and epop and

play08:31

because chai GPT isn't seeing the

play08:34

individual letters is instead seeing

play08:36

these three tokens

play08:37

is more difficult for it to correctly

play08:40

print out these letters in reverse order

play08:42

so here's a trick you can use to fix

play08:46

this

play08:47

if I were to add dashes

play08:51

between these letters and spaces would

play08:53

work too or other things would work too

play08:55

until I take the lesson a lot of the

play08:56

apartment reverse them then it actually

play08:58

does a much better job this Loi pop and

play09:02

the reason for that is if you pass it

play09:04

lollipop with dashes in between the

play09:06

letters it tokenizes each of these

play09:09

characters into the individual token

play09:11

making it easier for it to see the

play09:13

individual letters and print them out in

play09:15

reverse order

play09:16

so if you ever want to use chai GPD to

play09:20

play a word game like where are they all

play09:22

Scrabble or something this Nifty trick

play09:24

helps it to better see the individual

play09:26

letters of the words

play09:29

for the English language one token

play09:31

roughly on average corresponds to about

play09:33

four characters or about three quarters

play09:35

of a word

play09:37

and so different large language models

play09:39

will often have different limits on the

play09:42

number of input plus output tokens it

play09:45

can accept the input is often called the

play09:47

context and the output is often called

play09:49

the completion and the model GPT 3.5

play09:52

turbo for example is the most commonly

play09:54

used check GPT model has a limit of

play09:57

roughly 4 000 tokens in the inputs plus

play10:00

output

play10:01

so if you try to feed in an input

play10:03

context that's much longer than this so

play10:05

actually throw an exception of

play10:06

generating an error

play10:08

next I want to share with you another

play10:10

powerful way to use an API

play10:15

which involves specifying separate

play10:18

system user and assistant messages

play10:22

let me show you an example then we can

play10:25

explain in more detail what is actually

play10:27

doing

play10:29

here's a new helper function called get

play10:31

completion from messages and when we

play10:34

prompt this LM we are going to give it

play10:37

multiple messages here's an example of

play10:40

what you can do

play10:42

I'm going to specify first a message in

play10:45

the row of a system so this a system

play10:48

message

play10:49

and the contents of the system messages

play10:51

you're an assistant who responds to the

play10:54

style of Dr Seuss

play10:56

then I'm going to specify a user message

play10:58

so the row of the second message is row

play11:01

user and the content of this is write me

play11:03

a very short poem about a happy carrot

play11:06

and so let's run that

play11:09

and with temperature equals one I

play11:11

actually never know what's going to come

play11:12

out but okay that's a cool point oh how

play11:15

Jolly is this character that I see and

play11:17

it actually Rhymes pretty well all right

play11:19

well done chat GPD

play11:22

and so in this example the system

play11:24

message specifies the overall tone of

play11:29

what you want the large language model

play11:31

to do and the user message is a specific

play11:34

instruction that you wanted to carry out

play11:36

given this higher level behavior that

play11:39

was specified in the system message

play11:42

here's an illustration of how it all

play11:44

works

play11:45

so this is how the chat format works

play11:51

the system message sets the overall tone

play11:54

or behavior of the large language model

play11:56

or the assistant and then when you give

play11:59

the user message such as maybe such as a

play12:02

tell me a joke or write me a poem it

play12:05

will then output

play12:07

an appropriate response following what

play12:10

you asked for in the user message and

play12:13

consistence with the overall Behavior

play12:15

set in the system message

play12:18

and by the way although I'm not

play12:20

illustrating it here if you want to use

play12:23

this in a multi-term conversation you

play12:26

can also input assistant messages

play12:30

in this messages format to let chai GPD

play12:33

know what it had previously said

play12:36

if you wanted to continue the

play12:37

conversation based on things that had

play12:39

previously said as well

play12:41

but here are a few more examples

play12:44

if you want to set the tone

play12:47

to tell it to have a one sentence long

play12:50

output then in the system message I can

play12:53

say all your responses must be one

play12:55

sentence long

play12:56

and when I execute this it outputs a

play13:00

single sentence is no longer a poem not

play13:02

in a soft Dr Seuss but this is a single

play13:04

sentence there's a story about the happy

play13:08

carrots

play13:09

and

play13:11

if we want to combine both specifying

play13:14

the style and the length then I can use

play13:17

the system message to say you're an

play13:18

assistant in response to style Dr Seuss

play13:20

all your sentences must be one sentence

play13:22

long and now

play13:25

this generates a nice one sentence poem

play13:30

it was always smiling and never scary I

play13:33

like that that's a very happy poem

play13:35

and then lastly just for fun if you are

play13:39

using an OM and you want to know how

play13:42

many tokens are you using

play13:44

here's the hope for function that is a

play13:46

little bit more sophisticated in that it

play13:49

gets a response from the open AI API

play13:52

endpoint and then it uses other values

play13:56

in the response to tell you how many

play13:58

prompt tokens completion tokens and

play14:01

total tokens were used in your API call

play14:04

let me Define that

play14:07

and if I

play14:09

run this now

play14:11

here's the response and here is

play14:18

accounts of how many tokens we use so

play14:21

this output which had 55 tokens whereas

play14:24

The Prompt input had 37 tokens so this

play14:27

used up 92 tokens altogether when I'm

play14:32

using our models in practice I don't

play14:34

worry that much frankly about the number

play14:36

of tokens I'm using maybe one case where

play14:39

it might be worth checking the number of

play14:41

tokens is if you're worried that the

play14:43

user might have given you too long an

play14:45

inputs that exceeds the 4000 or so token

play14:48

limits of chai GPT in which case you

play14:50

could double check how many tokens it

play14:52

was and trunk later to make sure you're

play14:53

staying within the input token limit of

play14:56

the launch language model

play14:58

now I want to share with you one more

play15:01

tip for how to use a large language

play15:03

model

play15:04

calling the open AI API requires using

play15:07

an API key that's tied to either free or

play15:11

a paid account and so many developers

play15:14

will write the API key in plain text

play15:16

like this into the jupyter notebook and

play15:20

this is a less secure way of using API

play15:24

keys that I would not recommend you use

play15:27

because it's just too easy to share this

play15:31

notebook with someone else or check this

play15:32

into GitHub or something and does end up

play15:35

leaking your API key to someone else

play15:38

in contrast

play15:40

what you saw me do in the Jupiter

play15:43

notebook was this piece of code where I

play15:46

use the Library dot end and then run

play15:49

this commands and load Dot and find.n to

play15:52

read a local file which is called dot

play15:55

end that contains my secret key

play15:58

and so with this code snippet

play16:00

I have locally stored a file called dot

play16:03

enth that contains my API key and this

play16:06

loads it into the operating systems

play16:09

environmental variable

play16:11

and then OS dot get nth open-air API key

play16:15

stores it into this variable and in this

play16:19

whole process I don't ever have to enter

play16:22

the API key in plain text in unencrypted

play16:24

plain text into my Jupiter notebook so

play16:27

this is a relatively more secure and a

play16:30

better way to access the API key and in

play16:33

fact this is a general method for

play16:34

storing different API keys from lots of

play16:37

different online services that you might

play16:40

want to use and call for the Jupiter

play16:42

notebook

play16:43

lastly

play16:45

I think

play16:46

the degree to which prompting is

play16:49

revolutionizing AI application

play16:50

development is still underappreciated

play16:53

in the traditional supervised machine

play16:55

learning workflow like the restaurant

play16:58

reviews sentiment classification example

play17:00

that I touched on just now if you want

play17:02

to build a classifier to classify

play17:04

restaurant review positive and negative

play17:05

sentiments you at first get a bunch of

play17:07

label data Maybe hundreds of examples

play17:09

this might take I don't know weeks maybe

play17:11

a month

play17:12

then you would train a model on data and

play17:16

getting an appropriate open source model

play17:18

tuning on the model evaluating it that

play17:21

might take

play17:22

days weeks maybe even a few months

play17:24

and then you might have to find a cloud

play17:27

service to deploy it and then get your

play17:30

model upload to the cloud and then run

play17:32

the model and finally be able to call

play17:33

your model and it's again not in common

play17:35

for this to take a team a few months to

play17:38

get working

play17:39

in contrast with prompting base machine

play17:42

learning when you have a text

play17:45

application you can specify a prompt

play17:47

this can take minutes maybe hours if you

play17:50

need to iterate a few times to get an

play17:52

effective prompt and then in hours maybe

play17:56

at most days but frankly more often

play17:59

hours you can have this running using

play18:02

API calls and start making calls to the

play18:05

model and once you've done that in just

play18:07

again maybe minutes or hours you can

play18:09

start calling the model and start making

play18:12

inferences

play18:13

and so there are applications that used

play18:15

to take me maybe six months or a year to

play18:17

build that you can now build in minutes

play18:19

or hours maybe very small numbers of

play18:22

days using prompting and this is

play18:24

revolutionizing what AI applications can

play18:27

be built quickly one important caveat

play18:30

this applies to many unstructured data

play18:33

applications including specifically text

play18:35

applications and maybe increasing the

play18:38

vision applications although division

play18:40

technology is much less mature right now

play18:42

but it's kind of getting there this

play18:44

recipe doesn't really work for

play18:46

structured data applications meaning

play18:49

machine learning applications on tabular

play18:51

data with lots of numerical values and

play18:54

Excel spreadsheets say

play18:55

but for applications to which this does

play18:57

apply the fact that AI components can be

play19:01

built so quickly is changing the

play19:03

workflow of how the entire system might

play19:06

be built build the entire system I still

play19:08

take days or weeks or something but at

play19:10

least this piece of it can be done much

play19:12

faster

play19:13

and so with that let's go on to the next

play19:15

video where Iza will show how to use

play19:18

these components to evaluate the input

play19:21

to a customer service assistant and this

play19:25

will be part of a bigger example that

play19:26

you see developed through this course

play19:28

for building a customer service

play19:31

assistant for an online retailer

Rate This

5.0 / 5 (0 votes)

Do you need a summary in English?