"okay, but I want GPT to perform 10x for my specific use case" - Here is how
Summary
TLDRهذا النص يناقش التقنيات الأساسية لتحسين نموذج لغة واسعة النطاق مثل GPT، مثل ال微调 والقاعدة المعرفة. يشرح ال微調 كيف يمكن استخدامه لتدريب النموذج على التصرف بطريقة معينة، مثل تحويل تعليقات بسيطة إلى مدونة مبتكرة، باستخدام بيانات خاصة. ويناقش النص أيضًا كيفية إنشاء قاعدة معرفة مدمجة للتعامل مع الاستعلامات المحددة للنطاق، مثل القضايا القانونية أو الإحصاءات المالية. يتضمن النص خطوات تفصيلية ل如何选择 النموذج وتحضير البيانات وتدريبه على Google Colab، مع توضيح على كيفية تحسين النتائج من خلال زيادة حجم البيانات.
Takeaways
- 🔧 fine-tuning هي طريقة تعديل نموذج لغوي كبير لتحقيق سلوك معين عن طريق تغذية البيانات الخاصة بعينها.
- 📚 base هي طريقة أخرى تتضمن إنشاء قاعدة بيانات متضمنة معرفة معينه لتحسين الاستجابة لنماذج اللغات الكبيرة.
- 🤖 fine-tuning مناسب لdigitizing شخصية معينة مثل ترامب، لكن ليس مناسبًا لتقديم بيانات دقيقة مثل الحالة القانونية أو الإحصاءات المالية.
- 📈 base مناسب لاستخدام المعرفة المتخصصة مثل القضايا القانونية أو الإحصاءات الماليه، حيث يمكنها توفير البيانات الفعلية.
- 🛠️ يمكن استخدام GPT لإنشاء مجموعة تدريبية كبيرة من خلال تحليل وتحويل بيانات موجودة.
- 🌐 يمكن العثور على مجموعات بيانات عامة عبر الإنترنت مثل Kaggle و Hugging Face.
- 📝 يمكن أن تكون مجموعة البيانات الخاصة التي لا تتوفر في أي مكان آخر هي الأكثر فائدة لتحسين أداء fine-tuning.
- 💻 يمكن استخدام بотات مثل Randomness AI لإنشاء مجموعة بيانات تدريبية على نطاق واسع.
- 🎯 عند fine-tuning، يجب اختيار النموذج المناسب مثل Falcon الذي يحتوي على إصدارات مختلفة بلغات متعددة.
- 🔧 يمكن استخدام Google Colab لتحسين النماذج، مع القدرة على اختيار بين GPU مختلفة.
- 📝 بعد fine-tuning، يمكن حفظ النموذج محليًا أو رفعه إلى Hugging Face لمشاركة واستخدام آخر.
- 🎉 يمكن أن تكون fine-tuning مفيدة في مجالات مثل الدعم العملاء، ووثائق القوانين، وتشخيص طبي، ونصائح مالية.
Q & A
ما هي الطريقة الأساسية للتحسين التقني للنماذج النصية الكبيرة؟
-التحسين التقني للنماذج النصية الكبيرة يمكن أن يشمل طريقتان رئيسيتان: التكيف الدقيق وإنشاء قاعدة المعرفة. التكيف الدقيق يتضمن استرداد النموذج الكبير ببيانات خاصة، بينما إنشاء قاعدة المعرفة يتضمن إنشاء تضمين أو قاعدة متجه لجميع المعرفة وإيجاد البيانات المناسبة لتقديمها إلى النموذج النصي الكبير.
لماذا يمكن أن تكون الطريقة التكيف الدقيق مفيدة في الاستخدامات المتخصصة مثل الطب أو القانون؟
-التكيف الدقيق مفيد في الاستخدامات المتخصصة لأنه يمكنه جعل النموذج النصي الكبير يتصرف بطريقة معينة، مثل تحويل المحادثات أو المقابلات الإعلامية مع شخص ما، مما يمكن أن يساعد في توليد بيانات محددة للاستخدامات المتخصصة.
ماذا يقصد بقاعدة المعرفة في سياق التحسين التقني؟
-قاعدة المعرفة هي مجموعة من البيانات التي تم تجميعها وترتيبها بطريقة يمكن من خلالها إيجاد المعلومات ذات الصلة وتقديمها إلى النموذج النصي الكبير كجزء من المعالجة.
لماذا قد لا تكون التكيف الدقيق مناسبًا للاستخدامات التي تتضمن معرفة مجالية مثل القضايا القانونية أو الإحصاءات المالية؟
-التكيف الدقيق قد لا يكون مناسبًا للاستخدامات التي تتضمن معرفة مجالية لأنه ليس م擅长 في توفير بيانات دقيقة، بل يفضل استخدام التضمين لإنشاء قاعدة معرفة يمكن من خلالها توفير البيانات الفعلية للاستخدامات المتخصصة.
ما هي الخطوات الأساسية لتحسين تكيف النموذج النصي الكبير؟
-الخطوات الأساسية لتحسين تكيف النموذج النصي الكبير تشمل اختيار النموذج، تحضير المجموعة البيانات، استيراد المجموعة البيانات، تحليل بيانات التكيف، وتشغيل عملية التكيف، ثم حفظ النموذج المحسن.
لماذا يجب اختيار النموذج الذي يناسب الاستخدامات المتخصصة؟
-اختيار النموذج الذي يناسب الاستخدامات المتخصصة يضمن أن النموذج يمكنه التعامل مع نوع البيانات والمحتوى الخاص بتلك الاستخدامات بطريقة أكثر فعالية.
ما هي المصادر التي يمكن من خلالها الحصول على مجموعات البيانات العمومية للتدريب؟
-يمكن الحصول على مجموعات البيانات العمومية من مصادر مثل كغل وهاUGING، التي توفر مجموعة واسعة من البيانات عبر مختلف الموضوعات.
كيف يمكن استخدام GPT لإنشاء مجموعة بيانات تدريبية كبيرة؟
-يمكن استخدام GPT لإنشاء مجموعة بيانات تدريبية كبيرة من خلال إعطائه مجموعة من الأمثلة المهمة وطلبه من النموذج توليد إدخالات مستخدم جديدة تتناسب مع هذه الأمثلة لاستخدامها في التدريب.
ما هي الخطوات التي يجب إتباعها لإعداد مجموعة بيانات التدريب؟
-الخطوات لإعداد مجموعة بيانات التدريب تشمل تحميل المجموعة البيانات، تحليل البيانات، تحويل البيانات إلى تنسيق مناسب للتدريب، وتحضير البيانات مع الإدخالات والنوع المناسب للنماذج.
ما هي الفوائد الأساسية لتحسين تكيف النموذج النصي الكبير؟
-التحسين التقني للنموذج النصي الكبير يمكن أن يوفر تقليل في التكلفة، وتحسين الأداء، وقدرة على توليد بيانات محددة للاستخدامات المتخصصة، مما يمكن أن يؤدي إلى تحسين النتائج بشكل عام.
Outlines
🤖_FINE-TUNING LARGE LANGUAGE MODELS
The first paragraph discusses two methods for utilizing large language models (LLMs) in specific domains such as medical or legal: fine-tuning and knowledge base embedding. Fine-tuning involves retraining the model with private data to achieve desired behavior, while knowledge base embedding involves creating a vector database to find relevant data for the model. The paragraph emphasizes the importance of choosing the right method based on the use case, with fine-tuning being suitable for mimicking specific behaviors and knowledge base embedding for providing accurate domain-specific data. It also introduces a step-by-step guide on fine-tuning a model named Falcon for creating military power prompts, highlighting the selection of the model, preparation of data sets, and the use of platforms like Randomness AI for generating training data at scale.
🛠_FINE-TUNING PROCESS AND RESULTS
The second paragraph continues the discussion on fine-tuning, focusing on the technical process of fine-tuning the Falcon model using Google Colab. It details the setup, including selecting the right hardware, installing necessary libraries, and preparing the data set. The paragraph explains the use of a specific method called 'Low ranks adapters' for efficient fine-tuning and shares the initial results from the base model versus the fine-tuned model. The fine-tuned model's improved performance in generating Mediterranean prompts is showcased, demonstrating the effectiveness of fine-tuning for specific tasks. The paragraph concludes with the suggestion to save and upload the fine-tuned model to Hugging Face for sharing and further use, and mentions an ongoing contest that offers significant computational resources for training, inviting viewers to explore fine-tuning for various applications.
Mindmap
Keywords
💡GPT
💡Fine-tuning
💡Knowledge base
💡Embedding
💡Domain knowledge
💡Falcon
💡Data sets
💡Tokenizer
💡API key
💡Mid-journey prompt
Highlights
Two methods for utilizing GPT for specific use cases: fine-tuning and knowledge base.
Fine-tuning involves retraining the model with private data for specific behaviors.
Knowledge base creation involves embedding domain knowledge without retraining the model.
Fine-tuning is suitable for replicating specific behaviors, such as emulating a personality like Trump.
For domain-specific knowledge like legal cases, embedding is more effective than fine-tuning.
Embedding can provide accurate data for queries, such as stock price movements.
Creating a large knowledge model can reduce costs by teaching the model specific behaviors.
A step-by-step case study on fine-tuning a large language model for creating military power prompts.
Choosing the right model for fine-tuning, such as the powerful Falcon model.
The importance of dataset quality for the success of fine-tuning.
Utilizing public datasets and private datasets for fine-tuning.
Using GPT to generate training data by reverse engineering prompts.
Platforms like Randomness AI can automate the generation of training data at scale.
Google Colab as a platform for fine-tuning the Falcon model.
The process of preparing and tokenizing the training data for fine-tuning.
Creating training arguments and starting the training process with the trainer.
Saving the fine-tuned model locally and uploading it to Hugging Face.
Comparing the results of the base model with the fine-tuned model for generating prompts.
The potential of fine-tuning for various use cases such as customer support and financial advisory.
An upcoming video on creating an embedded knowledge base.
Transcripts
so a lot of people are saying that I
want GPT for a specific use case like
medical or legal but there are two
methods you should consider to achieve
the outcome one method is fine tuning
which means you retrieve the large
layout model with a lot of private data
you're holding and another is knowledge
base which means you are not actually
retraining the model instead you are
creating an embedding or vector database
of all your knowledge and try to find
the relevant data to feed into large
language model as part of prop and these
two methods are feet for different
purpose so what fine tuning is good at
is making sure the large knowledge model
behave in certain way for example if you
want to digitize someone like the other
AI talks like Trump that's where you
will use fine too because you can feed
all those chat history or broadcast
interview transcript into large language
model so it can have certain type of
behavior but if your use case is that I
have a bunch of domain knowledge like a
legal case or financial Market stats
fine tune is actually not going to work
because it's not good at providing very
accurate data instead you should use
embedding to create a knowledge base so
so that where someone asking which stock
has the highest price movement yes it
will get real data and feed it as part
of pop so those two methods are three
different use case a lot of times you
can just create it in betting but find
here is still super valuable for you to
create a larger knowledge model that
have certain Behavior it's a pretty way
to decrease cost because instead of
adding a big chunk of prompt to making
sure large language model can behave in
a certain way you can just teach large
language models so you cut the cost so
there's still a lot of legit use case
where you should fine tune the legendary
model unless I want to show you a
step-by-step case study how can you
fine-tune large language model for
creating military power and this is a
great use case because it is not a task
that base model like GPT are good at
what I want is a large energy model can
take a simple instruction like this and
turn it into a Miss Journey prompt so
let's get started firstly we need to
choose which model to use for fine
tuning hacking face has this leaderboard
for all the open larger launcher model
and you can take a look to choose is the
one that suits you most the one I'm
going to use is the Falcon it is one of
the most powerful large Lounge model
there has been a number one place on the
leaderboard in a very very short time
it's also a few ones that are available
for the commercial use so you can
actually use this for production level
products for your own company and it's
actually not just our English a large
set of different type of languages like
German Spanish French and it has couple
versions 40b version which is most
powerful but also a bit slower think
about more like gpd4 but it also a 7B
version which is much faster and cheaper
to train as well the next which is most
important step is getting your data sets
ready the quality of your data set
decides the quality of your fine tune
model there are two type of data sets
you might use one is public data sets
that you can get from internet and their
model place you can get it like Kegel
which is data set library that has a
wide range of data across different
topics like sports Health software you
can just click on any of them preview
the details of the data and if it's good
you can download to use on the outside
hugging is also have very big data set
library and to find the ones that you
will use for training large Lounge model
you can click on data sets move down
here try to find the text generation and
you can try to find the relevant data
sets that you want for example this is
one public data set for medical related
QA data sets you can preview what data
actually inside but on the other side I
think the most of the use case for fine
tuning is actually use your own private
data sets that is not available anywhere
else it actually didn't require too big
a data sets you can even start as little
as 100 rows of data so it should be
still manageable so this is one tip I
want to share is that you can actually
use GPT to create a huge amount of
training data for example I have
collected list of really high quality
mid-journey prompts and I want chat GPD
to reverse engineer generate a simple
user instruct that might generate this
mid-journing prompt and what I will do
is give charity GPD a prompt like this
you will help me create training data
sets for generating text to image
prompts and then I'll give it a few
examples like this is from and this is
user input and in the end it will start
generating a user input that pair with
this prompt which I can use them as a
training data for fine-tuning Falcon
model and all we need to do just repeat
this process for hundreds or thousands
of rows but luckily there are platforms
like Randomness AI where you can run the
GPT prompt f scale in bulk for example I
can create an AI chain with this input
variable called mediterating pump and
then I will copy paste The Prompt that I
was using in charge GPT the point the
last prompt to the variable that we
created here and let's run this so you
can see it is working properly as it
generates a user input and all we need
to do next is go to the use tab this
running block option allow me to upload
the whole CSV file of the military
prompt and then it will import the whole
CSV file and run the GPD prompt for
every single row hundreds of time
automatically in the end I can have the
training data like this so there's a
pair of the user inputs as well as a
corresponding mid Journey prompt so now
let's fine tune the Falcon model I'm
using Google collab as a platform to
fine tune the model and I decided to use
a 7B version which is much faster but if
you want to use the 40p version it's
basically the same code you just need to
find more powerful computer before you
run this making sure you check the
runtime type and choose the GPU and at
default I think you will be on T4
version which still works but I have
upgraded so I can choose 800 model which
will be faster so firstly let's install
a few libraries once it's finished you
will see a little check mark here then
the next step is we will import all
those libraries okay great and you will
run this notebook login which will ask
for your hacking face API key if you
don't have hacking face account just
create account and then copy the link
here and paste here we will need to use
hugging face as a way to upload and
share our model the next thing we will
do is we will try to load the Falcon
model and tokenize it first and here the
model I choose is 7B instruct shared so
instruct is a fine-tuned 7B model
specifically for conversation so think
about as chat GPT versus gpt3 and share
it just a version of samd model and
shared shared is this version of 7B
model that would be faster and easier to
run and it will take a while for you and
it is downloading the whole bottles it
will take a while okay so the model is
downloaded and then let's load the model
Q Laura is a specific type of method
called Low ranks adapters which is one
way to fine-tune the large language
model much more efficient and fast
before we fine-tune 7B let's try this
prompt with the base model to see what
kind of results we get so I will create
a prompt and then start loading a bunch
of configuration for the model and click
around so this is the results we get
it's not even close to generating a good
Mediterranean prop as they didn't really
understand the context and as I
mentioned before even check GPT is not
doing a good job for this task so I'm
pretty curious to see the results and
let's first try to prepare the data sets
so what I'll do is I will drag and drop
the training data says here and once
it's finished I should see this file
showing up on the left side you can
click on this file button to open this
side panel by the way and then the first
is we will load this data set that we
store locally and we can preview of this
data so it has two column user and
prompt it has 289 rows so this is
actually another point I would mention
you actually don't need a huge data set
even 100 or 200 rows can already
generate a really good results for fine
tuning and if we pick up the first row I
can see the data that is properly loaded
and then what we want to do is to map
the whole data sets in this format human
and assistant and then tokenize the
prompt into our data set so once it's
finished you can see the data set is
fully prepared with input IDs token type
IDs and attention masks and firstly we
will need to create the list of training
arguments and you can use this one I
have here as default and then we'll just
run trainer.train to start the training
process and this will take a while for
the higher end GPU I choose it take me
two minutes I think if you're using T4
version it will probably take you around
10 minutes okay great so we just
finished fine-tuning the model
next we will need to save the model that
we've just trained you can either save
locally by doing modal.save pre-trained
and once it is finished you will see on
the left side there's a folder called
train model and inside this is model
that we just created but you can also
upload this model to hugging face so you
will come to hugging phase click on this
new model under your profile give a name
and choose a license then click create
model once you finish that you can copy
this and then coming back to paste on
here this will upload the model to your
hanging face repo okay we successfully
load the model and let's run this again
I will create a list of configuration
for the model then I will create this
prop mid Journey prompt for a boy
running in the snow and let's run this
okay great so we got this result as you
can see it produced a really great
prompt that I just tell you that why
running in the snow and it is able to
generate prompt if by running the snow
with backpack a red scarf by the famous
artist The Simpsons style the red is a
bit messed up and I think if I provide
him more data it probably will produce
better results but it's already much
better result than the base model and
chatty GPT so this is how you can fine
tune a large language model I'm really
Keen to see the results you are getting
here I'm training the 7B model because
40b takes a lot more computer power but
luckily tii which is maker of Falcon
model they are running a contest where
the winner will be awarded with huge
amount of training computer power so I
think this is a brilliant opportunity if
you really want to get into the fine
tune space and there are a few use case
you can try either customer support
legal document medical diagnose or
financial advisories I'm very keen to
see what kind of models you guys got to
train I hope you enjoyed this video if
you're interested I will also produce
another video talking about how can you
create embedded knowledge base so if you
like this video please like And
subscribe and I see you next time
Browse More Related Video
كيفية إنشاء شخصية متحركة تتحدث باستخدام أدوات الذكاء الاصطناعي مجانية و الربح منها
1 كورس شرح أساسيات البرمجة في بايثون خلال ساعة واحدة - جزء | Python in 1 Hour - Part 1 - Algorithms
Google Analytics 4 for better ROI / Think Measurement - Ready. Set. Grow.
استراتيجية sk (شرح مختصر جدا)
بدء ترقيم صفحة الوورد من صفحة معينة ورقم معين في الوورد 2010
20 PIPS per DAY with Supply & Demand Scalping (15 Minute Strategy)
5.0 / 5 (0 votes)