General Tips for Designing Prompts
Summary
TLDRفي هذا الفيديو، يقدم المتحدث نصائح حول كيفية تصميم واختبار التعليمات (المطالبات) المستخدمة مع النماذج اللغوية الكبيرة. يوضح أهمية البدء بمطالبات بسيطة وتجنب الغموض أو التفاصيل المفرطة التي قد تربك النموذج. ينصح بالتركيز على إعطاء تعليمات واضحة ومحددة للنموذج للحصول على نتائج دقيقة وفعالة. كما يشرح أهمية استخدام لغة إيجابية عند توجيه النموذج لأداء مهام معينة، وتجنب استخدام عبارات سلبية مثل 'لا تفعل'. الهدف هو مساعدة المطورين على بناء حالات استخدام فعالة باستخدام هذه النماذج.
Takeaways
- 💡 تصميم المطالبات يتطلب نهجاً تكرارياً يبدأ ببساطة.
- ❌ تجنب التعقيد الزائد في المطالبات، وابدأ بمهمة بسيطة لتحسين النتائج.
- 🔍 تقسيم المهام المعقدة إلى مهام فرعية لزيادة قدرة النموذج على التنفيذ.
- ✍️ التعليمات الواضحة والمحددة ضرورية للحصول على نتائج دقيقة.
- 📢 استخدم أفعال وكلمات دقيقة لتعريف المهمة التي يجب على النموذج تنفيذها.
- ✅ كلما كانت الكلمات أبسط وأكثر تحديداً، كانت النتائج أفضل.
- 📝 تجنب اللغة الغامضة أو الكلمات غير المعروفة للنموذج لتحسين الأداء.
- 🔧 تقديم أمثلة متعددة وإجراء اختبارات على النماذج لتحسين فهم وتحديد النتائج.
- 🎯 كن دقيقاً في المطالبات وتجنب عدم الوضوح في التعليمات المقدمة للنموذج.
- 🛑 تجنب استخدام لغة مثل "لا تفعل" أو "لا تطلب" مع النماذج، وبدلاً من ذلك قدم تعليمات إيجابية ومباشرة.
Q & A
ما هو الخطأ الشائع الذي يرتكبه العديد من المطورين عند تصميم النماذج اللغوية؟
-الخطأ الشائع هو محاولة جعل النموذج يقوم بالعديد من المهام في وقت واحد. عندما لا يحصل المستخدمون على النتائج المطلوبة، يشعرون بالإحباط. من الأفضل البدء بمهام بسيطة وتطويرها بشكل تدريجي.
ما هي الخطوة الأولى عند تصميم نموذج لغوي؟
-الخطوة الأولى هي البدء بمهمة بسيطة، والتركيز على جعل النموذج ينفذ تلك المهمة بشكل جيد قبل الانتقال إلى مهام أكثر تعقيدًا.
لماذا يجب تجنب اللغة الغامضة عند إعطاء تعليمات للنموذج؟
-تجنب اللغة الغامضة مهم لأن النموذج قد لا يفهم التعليمات بشكل صحيح، مما يؤدي إلى نتائج غير مرضية. كلما كانت التعليمات واضحة ومحددة، كانت النتائج أفضل.
كيف يمكن تحسين دقة النماذج اللغوية في أداء المهام المعقدة؟
-يمكن تحسين الدقة عن طريق تقسيم المهام المعقدة إلى مهام فرعية أصغر وتقديم تعليمات واضحة لكل مهمة على حدة.
ما هو الدور الذي تلعبه الأفعال والعبارات المحددة في تعليمات النماذج اللغوية؟
-الأفعال والعبارات المحددة تساعد في توجيه النموذج بشكل دقيق نحو المهمة المطلوبة، مما يحسن من دقة النتائج.
لماذا يجب أن تكون التعليمات واضحة ومباشرة عند تصميم النماذج؟
-التعليمات الواضحة والمباشرة تقلل من احتمال سوء الفهم وتزيد من فرصة الحصول على النتائج المطلوبة من النموذج.
ما هي بعض النصائح العامة لتحسين تصميم التعليمات للنماذج اللغوية؟
-بعض النصائح تشمل البدء بمهمة بسيطة، استخدام لغة محددة وواضحة، تقسيم المهام المعقدة إلى مهام أصغر، وتجنب استخدام عبارات غامضة أو غير دقيقة.
كيف يمكن تجنب إعطاء تعليمات خاطئة أو غامضة للنماذج اللغوية؟
-يمكن تجنب التعليمات الخاطئة أو الغامضة من خلال استخدام لغة دقيقة وواضحة، وتجنب إعطاء توجيهات مزدوجة أو غير واضحة.
ما هو التأثير المحتمل لاستخدام اللغة السلبية في تعليمات النماذج؟
-استخدام اللغة السلبية مثل 'لا تفعل' قد يؤدي إلى نتائج غير مرغوبة من النموذج. من الأفضل تقديم التعليمات بطريقة إيجابية ومباشرة.
كيف يمكن تحسين أداء النموذج في استخراج المعلومات المطلوبة؟
-يمكن تحسين الأداء من خلال تقديم تعليمات واضحة ومحددة حول المعلومات المطلوبة، والتأكد من أن النموذج يفهم بالضبط ما هو مطلوب منه.
Outlines
💡 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.
🎯 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.
📋 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
hi everyone in this video I want to talk
a little bit about some general tips for
Designing prompts so I've been designing
and optimizing some prompts for uh
various use cases for a variety of
clients from different domains ranging
from uh Health Providers all the way to
uh companies building HR Solutions and
what I want to share here is a few tips
and things to keep in mind as you design
your prompt we know that the process of
Designing prompts is very iterative in
nature so when you're designing a prompt
for a language model you need to start
very simple one error and mistake that I
see a lot of developers and users make
is they get pretty clever and they want
to ask the mod to do a variety of things
and they prompt the model they don't get
the results they give up they get
discouraged based on what the language
models are producing and the reason for
that is that that's not the right uh
framework or the right strategy to
design good prompts the right way to do
this is really to start simple right
start with a very basic task also if you
have a very complex task it might help
to break down the task into separate
subtasks because it could be the case
that the model you know it's not capable
enough to handle all the instructions
that you're giving the model to perform
so that's why it's really important to
always start really simple right to get
the mod to do something really well and
optimize the mod to perform that task
and it's important to keep the
instructions keep the prompt really
simple The Next Step here is really the
instruction so we spoke about the prompt
elements and one thing we mentioned
there is that we need to specify
instruction right what do we want the
model to perform what is the task the
model needs to perform whether it's a
classification task summarization
translation so it's important to think
about what exactly this model is going
to achieve and to use the right verbs or
the right words to describe that task
right so it's important to identify that
when you're working on your use cases so
let's say we were to create some type of
ation system um here is an example here
at the bottom let's say we wanted to
build some kind of translation system
that converts uh text into Spanish right
so English text to Spanish to do that
it's you know you just instruct them mod
translate the text below to Spanish and
then you pass in the text we're using
text as the input indicator and the
input is going to be hello and once we
pass it to the model the model is going
to understand okay this is a translation
task because I'm using the keyword here
is translate the more clear and the more
specific you know the wording for that
instruction is the better results you're
going to get right so try to avoid
ambiguous language try to avoid you know
using words that the model might not
know of right so the simpler the words
are the more specific are the better the
results are going to be okay and we we
can try this actually um so for this
prompt we don't really need instruction
you can add the instruction part but you
will see here that with modern
interfaces like the one provided by the
open ey
playground we can basically just write
the task that we want to perform and
then we can take for instance we can
take this uh in fact I'll just leave it
as is and then I'll show you another
version that uses the user
role so you can see that we got Alla
right so we we got the right translation
here now I can also do something like
this and this is something I showed in a
previous tutorial so I can take this
remove this and then I can use the user
role to provide my input that I want to
translate to Spanish and then I can
submit
this right and we got Ola here so so we
got the right translation that's how you
would you would you would think about
the instruction right try to make the
instruction as as clear and concise as
possible now there's also a lot of
recommendations you know if you go
online lot of conversations about how to
design prompts and one of the main tips
that come up is specificity really be
very specific about what you want right
so for some use cases you want for
instance you want a specific format you
want a specific tone it's important to
think about what exactly do you want
from this mod right the M cannot really
guess it the model has an understanding
of what it was trained on but in order
for you to get the per to get the
performance or get the results that you
want or a specific output that you want
you need to be as specific as possible
so I have an example here actually what
I'll do is I'll just take this Ser again
here and I'll show you how uh you can
play around with this in the playground
so I have here extract the name of
places in the following text now the
desired format I need to change this a
bit I could keep it the way it was but I
just want to make it more clear um and
then we have a place right and I say
here I want the comma separate the list
of places that are provided in input I'm
using input here as input indicator but
you know I could also take this and put
it right here um as part of a as part of
user but I'll just keep it like this and
then you can try the other version that
I was
testing so you can see here that the
place was and it actually kept the
indicator which is good you know you
could tell the model further that maybe
you don't want this indicator as part of
the output that's something you can be
more specific about and can instruct
them all to Output whoever you want the
the the output and so we can see we can
confirm that this is the right
information that we were expecting from
this particular uh Place extractor
system the other tip here is to avoid
impr precises and this has to do its
specificity as well and the reason for
that is because you want to again as I
mentioned earlier you want to avoid
ambiguous language right because you're
you're all you're doing is you are
confusing the models so the the the
message has to be clear the message has
to be direct whatever instruction you're
passing to the model has to be as direct
and that's how you're going to get the
best results from a system so I have
some example here explain the concept
from engineering keep the explanation
short only a few sentences don't be too
descriptive um we're telling the mo to
do a lot of things here and we're not
being too precise right this is about
being imprecise because you're you're
not telling it how much sentences you
want you say short but what do you mean
by short you say don't be too
descriptive what do we even mean by that
so we want to make it a lot simpler for
the multile forment task to get the
desired results right so we want some
level of customization in the output
that we're getting and so we need to be
as precise as possible so here is a
better example uh compared to the one
above use two to three sentences to exp
to explain the concept of promp
engineering to a high school student now
I think this is a bit more clear because
it the target would be high school
students right and I'm using things like
two to three sentences to explain the
concept right I could even go a little
bit more detailed but I think this is
good enough as a first iteration that
improves the preciseness of the prompt
itself right the instruction here is a
lot more
precise
so here this tip here is is actually
interesting these models are trained to
do right they're trained to do and to
perform tasks to perform instructions
that users are giving it so when you use
language like do not ask for interest or
anything like that it's like you're
communicating to human but in reality
these molds might not be trained
effectively to perform tasks where
they're told not to do specific things
so you want to avoid language like that
what what would work instead is
to better guide the model or better
steer the model be more precise and just
follow the above tips that I shared so
something like this can be converted to
something like like this instead um
where you're being a little bit more
specific right you're telling them all
what exactly you want to behavior to be
and you kind of explain the logic
without using language I do not right
just do not use that do not um a
language with the models because they
tend to fail or they tend to the mods
tend to kind of derail and give you
really bad output that you may not
desire and the models are getting a lot
better right so so some Modern models
might be able to deal with these
particular instructions a lot better but
I would say this is unnecessary right
you don't really need to tell them all
do not ask for personal information as
shown in this example I think it's
better if you tell them all specifically
what you want in the behavior right
instead of telling it what to avoid so
the more specific you are about what the
model should perform or the task should
it should perform because it was trained
to perform task it makes sense to be
more positive in and and be more direct
and precise in what you want from the
model okay so those are kind of some
best practices uh there's also a link
here that you can click on and it will
take you to uh the openi official
documentation where they have a little
bit more on on on some further tips
there are you know other tips that I
might be missing here but we continue to
update the guide and provide better tips
for all our developers and people that
are using these large language Ms so
that will be it for this video hopefully
it was useful and hopefully you can work
on those examples and you can consider
this when you're designing your prompts
so that they can help you efficiently
and effectively build your use cases
with large language molds so I'll catch
you in the next one by
5.0 / 5 (0 votes)