General Tips for Designing Prompts

Elvis Saravia
11 Apr 202410:34

Summary

TLDRفي هذا الفيديو، يقدم المتحدث نصائح حول كيفية تصميم واختبار التعليمات (المطالبات) المستخدمة مع النماذج اللغوية الكبيرة. يوضح أهمية البدء بمطالبات بسيطة وتجنب الغموض أو التفاصيل المفرطة التي قد تربك النموذج. ينصح بالتركيز على إعطاء تعليمات واضحة ومحددة للنموذج للحصول على نتائج دقيقة وفعالة. كما يشرح أهمية استخدام لغة إيجابية عند توجيه النموذج لأداء مهام معينة، وتجنب استخدام عبارات سلبية مثل 'لا تفعل'. الهدف هو مساعدة المطورين على بناء حالات استخدام فعالة باستخدام هذه النماذج.

Takeaways

  • 💡 تصميم المطالبات يتطلب نهجاً تكرارياً يبدأ ببساطة.
  • ❌ تجنب التعقيد الزائد في المطالبات، وابدأ بمهمة بسيطة لتحسين النتائج.
  • 🔍 تقسيم المهام المعقدة إلى مهام فرعية لزيادة قدرة النموذج على التنفيذ.
  • ✍️ التعليمات الواضحة والمحددة ضرورية للحصول على نتائج دقيقة.
  • 📢 استخدم أفعال وكلمات دقيقة لتعريف المهمة التي يجب على النموذج تنفيذها.
  • ✅ كلما كانت الكلمات أبسط وأكثر تحديداً، كانت النتائج أفضل.
  • 📝 تجنب اللغة الغامضة أو الكلمات غير المعروفة للنموذج لتحسين الأداء.
  • 🔧 تقديم أمثلة متعددة وإجراء اختبارات على النماذج لتحسين فهم وتحديد النتائج.
  • 🎯 كن دقيقاً في المطالبات وتجنب عدم الوضوح في التعليمات المقدمة للنموذج.
  • 🛑 تجنب استخدام لغة مثل "لا تفعل" أو "لا تطلب" مع النماذج، وبدلاً من ذلك قدم تعليمات إيجابية ومباشرة.

Q & A

  • ما هو الخطأ الشائع الذي يرتكبه العديد من المطورين عند تصميم النماذج اللغوية؟

    -الخطأ الشائع هو محاولة جعل النموذج يقوم بالعديد من المهام في وقت واحد. عندما لا يحصل المستخدمون على النتائج المطلوبة، يشعرون بالإحباط. من الأفضل البدء بمهام بسيطة وتطويرها بشكل تدريجي.

  • ما هي الخطوة الأولى عند تصميم نموذج لغوي؟

    -الخطوة الأولى هي البدء بمهمة بسيطة، والتركيز على جعل النموذج ينفذ تلك المهمة بشكل جيد قبل الانتقال إلى مهام أكثر تعقيدًا.

  • لماذا يجب تجنب اللغة الغامضة عند إعطاء تعليمات للنموذج؟

    -تجنب اللغة الغامضة مهم لأن النموذج قد لا يفهم التعليمات بشكل صحيح، مما يؤدي إلى نتائج غير مرضية. كلما كانت التعليمات واضحة ومحددة، كانت النتائج أفضل.

  • كيف يمكن تحسين دقة النماذج اللغوية في أداء المهام المعقدة؟

    -يمكن تحسين الدقة عن طريق تقسيم المهام المعقدة إلى مهام فرعية أصغر وتقديم تعليمات واضحة لكل مهمة على حدة.

  • ما هو الدور الذي تلعبه الأفعال والعبارات المحددة في تعليمات النماذج اللغوية؟

    -الأفعال والعبارات المحددة تساعد في توجيه النموذج بشكل دقيق نحو المهمة المطلوبة، مما يحسن من دقة النتائج.

  • لماذا يجب أن تكون التعليمات واضحة ومباشرة عند تصميم النماذج؟

    -التعليمات الواضحة والمباشرة تقلل من احتمال سوء الفهم وتزيد من فرصة الحصول على النتائج المطلوبة من النموذج.

  • ما هي بعض النصائح العامة لتحسين تصميم التعليمات للنماذج اللغوية؟

    -بعض النصائح تشمل البدء بمهمة بسيطة، استخدام لغة محددة وواضحة، تقسيم المهام المعقدة إلى مهام أصغر، وتجنب استخدام عبارات غامضة أو غير دقيقة.

  • كيف يمكن تجنب إعطاء تعليمات خاطئة أو غامضة للنماذج اللغوية؟

    -يمكن تجنب التعليمات الخاطئة أو الغامضة من خلال استخدام لغة دقيقة وواضحة، وتجنب إعطاء توجيهات مزدوجة أو غير واضحة.

  • ما هو التأثير المحتمل لاستخدام اللغة السلبية في تعليمات النماذج؟

    -استخدام اللغة السلبية مثل 'لا تفعل' قد يؤدي إلى نتائج غير مرغوبة من النموذج. من الأفضل تقديم التعليمات بطريقة إيجابية ومباشرة.

  • كيف يمكن تحسين أداء النموذج في استخراج المعلومات المطلوبة؟

    -يمكن تحسين الأداء من خلال تقديم تعليمات واضحة ومحددة حول المعلومات المطلوبة، والتأكد من أن النموذج يفهم بالضبط ما هو مطلوب منه.

Outlines

00:00

💡 Tips for Effective Prompt Design

In this paragraph, the speaker discusses general tips for designing prompts, emphasizing the importance of starting simple. They mention the common mistake of overcomplicating prompts, which can lead to poor results and frustration. The speaker advises breaking down complex tasks into smaller subtasks, as language models may struggle to handle multiple instructions simultaneously. The key takeaway is to keep prompts straightforward and focus on optimizing the model's performance on basic tasks before scaling up.

05:02

🎯 Crafting Clear Instructions

This section focuses on the importance of providing clear and specific instructions when designing prompts. The speaker explains that the choice of words and the clarity of the task description directly impact the model's performance. They illustrate this with examples, such as translating text to Spanish, where clear instructions like 'translate' lead to better outcomes. The speaker also emphasizes avoiding ambiguous language, as it can confuse the model and result in suboptimal outputs.

10:02

📋 Importance of Precision in Prompts

The speaker elaborates on the significance of precision in prompt design. They explain how being too vague or imprecise can lead to poor results, as the model may misinterpret the instructions. The speaker provides examples of imprecise prompts and contrasts them with improved versions that specify the desired output more clearly. They stress that precise prompts help guide the model more effectively, leading to better performance and more accurate results.

Mindmap

Keywords

💡تصميم المطالبات

تصميم المطالبات يشير إلى عملية إنشاء وتعديل التعليمات التي يتم تقديمها لنماذج اللغة الكبيرة لتنفيذ مهام محددة. يتعلق هذا المفهوم بكيفية صياغة التعليمات بشكل صحيح للحصول على أفضل النتائج من النماذج. في الفيديو، يتم التأكيد على ضرورة البدء بتصميم بسيط ثم التحسين التدريجي للوصول إلى المطالبات المثلى.

💡مهام فرعية

المهام الفرعية هي عملية تقسيم المهمة المعقدة إلى أجزاء أصغر وأسهل للتنفيذ. يوضح الفيديو أهمية تقسيم المهام الكبيرة عند العمل مع نماذج اللغة لضمان فهم النموذج للمهمة وتقديم النتائج المرجوة بشكل أكثر فعالية.

💡تعليمات واضحة ومحددة

تقديم تعليمات واضحة ومحددة للنموذج يعني تحديد المطلوب من النموذج بشكل دقيق وباستخدام كلمات سهلة ومباشرة. الفيديو يوضح أن استخدام لغة غير واضحة أو غامضة يؤدي إلى نتائج غير مرضية، وبالتالي يجب استخدام تعليمات بسيطة وواضحة للحصول على الأداء الأمثل.

💡اللغة الغامضة

اللغة الغامضة تشير إلى استخدام مصطلحات أو عبارات قد تكون غير واضحة أو متعددة التفسيرات، مما يمكن أن يؤدي إلى إرباك نموذج اللغة. في الفيديو، يُنصح بتجنب مثل هذه اللغة لضمان فهم النموذج للمهمة المطلوبة وتنفيذها بشكل صحيح.

💡نماذج اللغة الكبيرة

نماذج اللغة الكبيرة هي أنظمة ذكاء اصطناعي تم تدريبها على كميات هائلة من البيانات النصية لتكون قادرة على فهم وإنتاج النصوص. في الفيديو، يتم التركيز على كيفية تقديم تعليمات لهذه النماذج بطريقة تزيد من دقتها وفعاليتها في أداء المهام المختلفة.

💡التحسين التدريجي

التحسين التدريجي يعني البدء بمطالبات بسيطة والعمل على تحسينها بمرور الوقت من خلال تعديلات صغيرة لتحقيق أفضل النتائج. يُعتبر هذا النهج أساسياً عند تصميم المطالبات لنماذج اللغة لضمان استجابة دقيقة وفعالة.

💡التعليمات المحددة

التعليمات المحددة هي تعليمات تفصيلية توضح بشكل دقيق ما هو مطلوب من نموذج اللغة القيام به. في الفيديو، يتم التركيز على أهمية استخدام التعليمات المحددة للحصول على نتائج أفضل، مثل تحديد عدد الجمل المطلوبة في الشرح أو توضيح النبرة المطلوبة.

💡عدم استخدام لغة النهي

عدم استخدام لغة النهي يشير إلى تجنب استخدام تعليمات سلبية مثل 'لا تفعل' مع نماذج اللغة. الفيديو يوضح أن هذا النوع من التعليمات قد يربك النموذج ويفضل بدلاً من ذلك تقديم تعليمات إيجابية ومحددة.

💡تنسيق المخرجات

تنسيق المخرجات يشير إلى كيفية تنظيم وتنسيق المعلومات التي ينتجها نموذج اللغة استجابة للمطالبات. في الفيديو، يُنصح بتحديد الشكل المطلوب للمخرجات بوضوح للحصول على النتائج في الشكل المرغوب.

💡أمثلة تطبيقية

الأمثلة التطبيقية هي استخدام حالات عملية ومحددة لتوضيح كيفية تطبيق مفهوم أو تقنية معينة. في الفيديو، يتم استخدام عدة أمثلة مثل ترجمة النصوص أو استخراج أسماء الأماكن لتوضيح كيفية تصميم المطالبات بشكل فعال.

Highlights

General tips for designing prompts for language models are discussed.

The process of designing prompts is iterative in nature.

Starting simple is crucial when designing prompts for language models.

Breaking down complex tasks into subtasks can improve model performance.

Keeping instructions simple is key to optimizing language model tasks.

Specifying clear instructions is vital for the model to understand the task.

Using the right verbs and words to describe the task improves results.

Avoiding ambiguous language helps in getting better results from language models.

Being specific about the desired format and tone is important for model output.

An example of a translation system prompt is provided.

Using input indicators helps the model understand the task better.

Modern interfaces allow for simple task description without complex instructions.

Avoiding imprecise language prevents confusion for the language model.

An example of an improved explanation prompt is given.

Models are trained to perform tasks, not avoid them, so instructions should be positive and direct.

A link to OpenAI's official documentation for further tips is provided.

The video aims to help efficiently and effectively build use cases with large language models.

Transcripts

play00:00

hi everyone in this video I want to talk

play00:03

a little bit about some general tips for

play00:06

Designing prompts so I've been designing

play00:09

and optimizing some prompts for uh

play00:12

various use cases for a variety of

play00:14

clients from different domains ranging

play00:17

from uh Health Providers all the way to

play00:21

uh companies building HR Solutions and

play00:24

what I want to share here is a few tips

play00:27

and things to keep in mind as you design

play00:30

your prompt we know that the process of

play00:33

Designing prompts is very iterative in

play00:35

nature so when you're designing a prompt

play00:38

for a language model you need to start

play00:43

very simple one error and mistake that I

play00:45

see a lot of developers and users make

play00:48

is they get pretty clever and they want

play00:52

to ask the mod to do a variety of things

play00:55

and they prompt the model they don't get

play00:57

the results they give up they get

play00:59

discouraged based on what the language

play01:01

models are producing and the reason for

play01:03

that is that that's not the right uh

play01:06

framework or the right strategy to

play01:08

design good prompts the right way to do

play01:11

this is really to start simple right

play01:13

start with a very basic task also if you

play01:16

have a very complex task it might help

play01:18

to break down the task into separate

play01:23

subtasks because it could be the case

play01:25

that the model you know it's not capable

play01:28

enough to handle all the instructions

play01:30

that you're giving the model to perform

play01:32

so that's why it's really important to

play01:35

always start really simple right to get

play01:37

the mod to do something really well and

play01:40

optimize the mod to perform that task

play01:42

and it's important to keep the

play01:44

instructions keep the prompt really

play01:46

simple The Next Step here is really the

play01:49

instruction so we spoke about the prompt

play01:52

elements and one thing we mentioned

play01:55

there is that we need to specify

play02:00

instruction right what do we want the

play02:02

model to perform what is the task the

play02:03

model needs to perform whether it's a

play02:06

classification task summarization

play02:08

translation so it's important to think

play02:11

about what exactly this model is going

play02:15

to achieve and to use the right verbs or

play02:18

the right words to describe that task

play02:21

right so it's important to identify that

play02:24

when you're working on your use cases so

play02:26

let's say we were to create some type of

play02:30

ation system um here is an example here

play02:32

at the bottom let's say we wanted to

play02:35

build some kind of translation system

play02:38

that converts uh text into Spanish right

play02:42

so English text to Spanish to do that

play02:45

it's you know you just instruct them mod

play02:47

translate the text below to Spanish and

play02:50

then you pass in the text we're using

play02:52

text as the input indicator and the

play02:54

input is going to be hello and once we

play02:56

pass it to the model the model is going

play02:58

to understand okay this is a translation

play03:01

task because I'm using the keyword here

play03:03

is translate the more clear and the more

play03:07

specific you know the wording for that

play03:09

instruction is the better results you're

play03:11

going to get right so try to avoid

play03:13

ambiguous language try to avoid you know

play03:16

using words that the model might not

play03:18

know of right so the simpler the words

play03:20

are the more specific are the better the

play03:22

results are going to be okay and we we

play03:26

can try this actually um so for this

play03:28

prompt we don't really need instruction

play03:30

you can add the instruction part but you

play03:32

will see here that with modern

play03:35

interfaces like the one provided by the

play03:38

open ey

play03:39

playground we can basically just write

play03:43

the task that we want to perform and

play03:45

then we can take for instance we can

play03:48

take this uh in fact I'll just leave it

play03:50

as is and then I'll show you another

play03:53

version that uses the user

play03:56

role so you can see that we got Alla

play04:00

right so we we got the right translation

play04:02

here now I can also do something like

play04:04

this and this is something I showed in a

play04:06

previous tutorial so I can take this

play04:09

remove this and then I can use the user

play04:13

role to provide my input that I want to

play04:16

translate to Spanish and then I can

play04:18

submit

play04:20

this right and we got Ola here so so we

play04:23

got the right translation that's how you

play04:25

would you would you would think about

play04:27

the instruction right try to make the

play04:28

instruction as as clear and concise as

play04:31

possible now there's also a lot of

play04:34

recommendations you know if you go

play04:36

online lot of conversations about how to

play04:39

design prompts and one of the main tips

play04:42

that come up is specificity really be

play04:45

very specific about what you want right

play04:48

so for some use cases you want for

play04:51

instance you want a specific format you

play04:52

want a specific tone it's important to

play04:55

think about what exactly do you want

play04:57

from this mod right the M cannot really

play04:59

guess it the model has an understanding

play05:01

of what it was trained on but in order

play05:04

for you to get the per to get the

play05:06

performance or get the results that you

play05:08

want or a specific output that you want

play05:10

you need to be as specific as possible

play05:12

so I have an example here actually what

play05:14

I'll do is I'll just take this Ser again

play05:16

here and I'll show you how uh you can

play05:19

play around with this in the playground

play05:21

so I have here extract the name of

play05:23

places in the following text now the

play05:25

desired format I need to change this a

play05:27

bit I could keep it the way it was but I

play05:29

just want to make it more clear um and

play05:32

then we have a place right and I say

play05:34

here I want the comma separate the list

play05:36

of places that are provided in input I'm

play05:38

using input here as input indicator but

play05:41

you know I could also take this and put

play05:43

it right here um as part of a as part of

play05:47

user but I'll just keep it like this and

play05:48

then you can try the other version that

play05:50

I was

play05:52

testing so you can see here that the

play05:54

place was and it actually kept the

play05:56

indicator which is good you know you

play05:57

could tell the model further that maybe

play06:00

you don't want this indicator as part of

play06:01

the output that's something you can be

play06:03

more specific about and can instruct

play06:05

them all to Output whoever you want the

play06:08

the the output and so we can see we can

play06:10

confirm that this is the right

play06:12

information that we were expecting from

play06:14

this particular uh Place extractor

play06:19

system the other tip here is to avoid

play06:22

impr precises and this has to do its

play06:24

specificity as well and the reason for

play06:26

that is because you want to again as I

play06:29

mentioned earlier you want to avoid

play06:31

ambiguous language right because you're

play06:34

you're all you're doing is you are

play06:36

confusing the models so the the the

play06:38

message has to be clear the message has

play06:40

to be direct whatever instruction you're

play06:42

passing to the model has to be as direct

play06:45

and that's how you're going to get the

play06:47

best results from a system so I have

play06:49

some example here explain the concept

play06:51

from engineering keep the explanation

play06:53

short only a few sentences don't be too

play06:55

descriptive um we're telling the mo to

play06:57

do a lot of things here and we're not

play07:00

being too precise right this is about

play07:03

being imprecise because you're you're

play07:05

not telling it how much sentences you

play07:07

want you say short but what do you mean

play07:09

by short you say don't be too

play07:11

descriptive what do we even mean by that

play07:13

so we want to make it a lot simpler for

play07:16

the multile forment task to get the

play07:18

desired results right so we want some

play07:21

level of customization in the output

play07:23

that we're getting and so we need to be

play07:25

as precise as possible so here is a

play07:27

better example uh compared to the one

play07:30

above use two to three sentences to exp

play07:32

to explain the concept of promp

play07:34

engineering to a high school student now

play07:36

I think this is a bit more clear because

play07:39

it the target would be high school

play07:41

students right and I'm using things like

play07:44

two to three sentences to explain the

play07:46

concept right I could even go a little

play07:48

bit more detailed but I think this is

play07:51

good enough as a first iteration that

play07:53

improves the preciseness of the prompt

play07:55

itself right the instruction here is a

play07:57

lot more

play07:58

precise

play08:00

so here this tip here is is actually

play08:03

interesting these models are trained to

play08:05

do right they're trained to do and to

play08:09

perform tasks to perform instructions

play08:11

that users are giving it so when you use

play08:13

language like do not ask for interest or

play08:15

anything like that it's like you're

play08:16

communicating to human but in reality

play08:19

these molds might not be trained

play08:21

effectively to perform tasks where

play08:24

they're told not to do specific things

play08:26

so you want to avoid language like that

play08:28

what what would work instead is

play08:31

to better guide the model or better

play08:33

steer the model be more precise and just

play08:35

follow the above tips that I shared so

play08:38

something like this can be converted to

play08:40

something like like this instead um

play08:42

where you're being a little bit more

play08:44

specific right you're telling them all

play08:46

what exactly you want to behavior to be

play08:48

and you kind of explain the logic

play08:50

without using language I do not right

play08:53

just do not use that do not um a

play08:57

language with the models because they

play08:59

tend to fail or they tend to the mods

play09:03

tend to kind of derail and give you

play09:05

really bad output that you may not

play09:08

desire and the models are getting a lot

play09:10

better right so so some Modern models

play09:14

might be able to deal with these

play09:17

particular instructions a lot better but

play09:20

I would say this is unnecessary right

play09:22

you don't really need to tell them all

play09:23

do not ask for personal information as

play09:25

shown in this example I think it's

play09:28

better if you tell them all specifically

play09:31

what you want in the behavior right

play09:34

instead of telling it what to avoid so

play09:36

the more specific you are about what the

play09:39

model should perform or the task should

play09:41

it should perform because it was trained

play09:43

to perform task it makes sense to be

play09:45

more positive in and and be more direct

play09:48

and precise in what you want from the

play09:51

model okay so those are kind of some

play09:54

best practices uh there's also a link

play09:56

here that you can click on and it will

play09:58

take you to uh the openi official

play10:01

documentation where they have a little

play10:02

bit more on on on some further tips

play10:05

there are you know other tips that I

play10:06

might be missing here but we continue to

play10:09

update the guide and provide better tips

play10:12

for all our developers and people that

play10:14

are using these large language Ms so

play10:16

that will be it for this video hopefully

play10:18

it was useful and hopefully you can work

play10:21

on those examples and you can consider

play10:24

this when you're designing your prompts

play10:25

so that they can help you efficiently

play10:27

and effectively build your use cases

play10:30

with large language molds so I'll catch

play10:32

you in the next one by

Rate This

5.0 / 5 (0 votes)

Related Tags
تصميم المحكماتالذكاء الاصطناعيالتعليماتتحسين الأداءنصائح فعالةتحديد المهامتفاصيل دقيقةالتفاعل مع النماذجالتطبيقات العمليةممارسات مثلى
Do you need a summary in English?