Easily Fine Tune ChatGPT 3.5 to Outperform GPT-4!

  Рет қаралды 12,481

Tech-At-Work

Tech-At-Work

Күн бұрын

I’ll show you how to set up your training data to fine-tune OpenAI’s ChatGPT 3.5 Turbo. A fine-tuned GPT 3.5 Turbo can be smarter than GPT-4. I’ll go step by step, and show you strategies for setting up your data to ensure you get the smartest model possible.
All Files & Data from Video:
drive.google.com/drive/folder...
Python Code: colab.research.google.com/dri...
Other Videos:
AI Phone Scheduler - • Build Your Own AI Rece...
AI for Automating Cold Calling - • Using ChatGPT to Autom...
Phone Negotiating Bot - • Save Money: AI Negotia...
GPT that makes Calls - • Custom GPT with Bland ...
Fine-Tune Llama-2 - • The Secret to Fine-Tun...
Fine-Tune ChatGPT 3.5 - • Easily Fine Tune ChatG...
Build an AI Texting Bot - • Fine-tuning ChatGPT to...
Fine-Tune ChatGPT 3 - • Transform ChatGPT into...
Embed Data with ChatGPT - • Learn to Embed Data wi...
Build a chatbot - • Create your own AI cha...
How I got GPT4 access - • Here's how I got appro...
API keys - • How to Access OpenAI A...
Chapters:
0:00 - Intro
2:05 - Data Formatting
7:17 - Coding
13:17 - Cost/Token Count
16:37 - Send Data to OpenAI
17:26 - Start Fine-Tuning
19:33 - Fine-Tuning Completes
20:48 - Test it out!
#ai #artificialintelligence #chatgpt #api #chatgpt4 #gpt4 #fine-tuning #openai #llm #gpt3 #howto #tutorial #tech #technology #python

Пікірлер: 91
@michaellavelle7354
@michaellavelle7354 10 ай бұрын
Great job. You don't miss a thing in your description. Thanks a lot.
@tech-at-work
@tech-at-work 10 ай бұрын
Glad you enjoyed!
@turyng-or1js
@turyng-or1js 10 ай бұрын
Man, you really rock! Very concise and strict to the point. Love it.
@tech-at-work
@tech-at-work 10 ай бұрын
Thanks! Appreciate the comment!
@truckfinanceaustralia1335
@truckfinanceaustralia1335 10 ай бұрын
Love your work! haven't found anything else like it on youtube 👌
@tech-at-work
@tech-at-work 10 ай бұрын
Amazing, thank you!
@yizhouqian5899
@yizhouqian5899 10 ай бұрын
I'm pretty sure this video will reach millions of views in a short period of time! Thank you so much for the detailed instructions!
@arupmmi07
@arupmmi07 5 ай бұрын
Excellent, Best fine-tuning video I saw! Thanks a Lot.
@tech-at-work
@tech-at-work 5 ай бұрын
Thanks!!
@deltagamma1442
@deltagamma1442 9 ай бұрын
From scratch and to the point. I generally don't comment, but great job!
@tech-at-work
@tech-at-work 9 ай бұрын
Thanks, glad you found it useful!
@TuryngsTech-cc1gy
@TuryngsTech-cc1gy 10 ай бұрын
Thank you for your awesome videos!
@silviocavini163
@silviocavini163 5 ай бұрын
This must be the best tutorial I've ever seen. Thanks!.
@tech-at-work
@tech-at-work 5 ай бұрын
Glad it was helpful!
@farhanafridi8694
@farhanafridi8694 10 ай бұрын
Your channel will boom in the coming months..
@tech-at-work
@tech-at-work 10 ай бұрын
Thanks!
@user-xd5ne5nl4e
@user-xd5ne5nl4e 10 ай бұрын
Excellent video!
@tech-at-work
@tech-at-work 10 ай бұрын
Thank you!
@adrianorobson6365
@adrianorobson6365 9 ай бұрын
Good work man. Thansk for your time
@tech-at-work
@tech-at-work 9 ай бұрын
Glad you found it useful!
@wiktormigaszewski8684
@wiktormigaszewski8684 2 ай бұрын
Nice one, thnx!
@tech-at-work
@tech-at-work 2 ай бұрын
Glad you found it useful!
@adriaanb7371
@adriaanb7371 10 ай бұрын
thanks, nice level of hands-on! This just changed the style of answering right. You could actually teach it on a bunch of information particular to your airbnb, surroundings, usual problems etc? It should be more common to get chatbots that have been fed all the docs on some company's product line etc. Would love to fine-tune on particular info that is past the models date... (with a single press of a button though)
@tech-at-work
@tech-at-work 10 ай бұрын
You’re correct, the fine tuning is setting the style and tone of the response, but not really adding new information. Embedding is the best way to teach the model new facts. My video on building a business chatbot does this with facts on Apple’s Vision Pro. Otherwise, you’re stuck pre-promoting the bot but that has token limitations (length of pre-prompt content)
@adriaanb7371
@adriaanb7371 10 ай бұрын
@@tech-at-work companies and projects should make it easy to feed their docs to an ai to be able to use it immediately with it. AI optimization instead of SEO. Anyway, this is the future: 😉 kzfaq.info/get/bejne/aJp_ZK6UrrWXdoE.htmlsi=pF0ou4rI4rpu_Dom
@davidlepold
@davidlepold 10 ай бұрын
Just found this video and channel, which I like though I do watch tech videos when I am NOT in front of my computer, say in a pause somewherre in a café or on a sofa, so on a phone with small screen, though u're good looking lad I don't care to see it face over half the screen all the time, I want to be able to see the text of the subject matter rather than you, then I lol regularly come back even if watching off desk. 😉 great video though, congrats
@tech-at-work
@tech-at-work 10 ай бұрын
Thanks for the feedback, I’ll look at making the screen portion bigger, and my face smaller 👍🏼
@Rentaplace
@Rentaplace 8 ай бұрын
@@tech-at-work That would really help as that was my first concern. Otherwise, this is a great tutorial. SUBSCRIBED!
@tech-at-work
@tech-at-work 8 ай бұрын
@@Rentaplace thanks for the feedback and subscribing! I've adjusted for my next video
@joelswann2310
@joelswann2310 9 ай бұрын
Awesome job brother! Would you do a tutorial on fine tuning and embedding ChatGPT 3.5 to write a fiction novel?
@VarshaShirole-vz8fk
@VarshaShirole-vz8fk 7 ай бұрын
Excellent video !! thanks a lot Great effort One question if i am having one pdf file data to train model ,i have to follow same step as above that is convert to training data?
@tech-at-work
@tech-at-work 7 ай бұрын
Thank you! Yes it would be the same steps, and data formatting - it might be easier to copy the data from the pdf and then format it in excel (easier to format data in excel) - ChatGPT can help you with excel format formulas if you feed it an example
@NikhilKopardeMusicComposer
@NikhilKopardeMusicComposer 7 ай бұрын
Such an amazing Demo. Thank you. :) I have a specific use case where I want to train the model on long-form stories/content written by me and later generate new ones on other topics section by section maintaining my style of writing. Should I be loading each story as one example in the data set or breaking them up would be suggested?
@tech-at-work
@tech-at-work 7 ай бұрын
Thank you! For this, I would break them up, so for example "write an introductory paragraph for an article covering elephant migrations" etc
@hocklintai3391
@hocklintai3391 9 ай бұрын
Thanks for this excellent video. BTW, how do you get the chatbot to retain the context of the earlier conversation?
@tech-at-work
@tech-at-work 9 ай бұрын
ChatCompletions is the easiest (platform.openai.com/docs/guides/gpt/chat-completions-api) or I have a video about using LangChain to make a business chatbot that maintains context (kzfaq.info/get/bejne/m9eCgMh018nJnIE.html)
@cryptoairdroppp
@cryptoairdroppp 9 ай бұрын
bro thank you a lot
@tech-at-work
@tech-at-work 9 ай бұрын
Glad you found it useful!
@FireWireHTH
@FireWireHTH 8 ай бұрын
@tech-at-work . I need help fine tuning chatgpt 3.5 for a very specific use case. Is there anyway i can reach out to you for help?
@caiyu538
@caiyu538 10 ай бұрын
Great. Great. Great
@tech-at-work
@tech-at-work 10 ай бұрын
Thanks!!!
@TuryngsTech-cc1gy
@TuryngsTech-cc1gy 10 ай бұрын
Do you mind a question? I need to develop an AI-powered chatbot for company support, which goes beyond normal things. For example, I will dynamically provide invoicing information to the AI, etc. Also, they want to be able to modify/add the training data themselves. 1. Do you think it is a wise idea to fine-tune the model ONLY to set the general tone and style, but for specific information, like telephone numbers, opening hours, etc., which can potentially change, used vector database with embeddings? I could build a simple UI for the customer to operate this data. Then they update/add data, which is vectorized and updated/added in the database. Do you think this separation is good? 2. Can fine-tuned model be retrained? What if the Wi-Fi password from your example is now somewhere else, not below the router. Do you need to fine-tune another model, so recreate the same model, but with this one change, or can the fine-tuned model be further fine-tuned with just one more prompt? Because if it can, wouldn't it be better than having the embeddings in parallel? Very much appreciate your answer if possible!
@patrickmauboussin
@patrickmauboussin 7 ай бұрын
Your separation of concerns make sense. It’s hard to add knowledge effectively using fine tuning, rag is much better. However, Look into HyDE - a RAG strategy. U can use ur fine tuned model to generate responses to the users query. If the model is trained to respond using info from the knowledge base the synthetic response will retrieve the right chunk of context from the knowledge base much more consistently than if u just embed the users prompt. Lmk if u want to know more about
@user-up2sd1wq1n
@user-up2sd1wq1n 8 ай бұрын
Hello, thank you for such a clear explanation of topic, it was very useful. I have a question : Will openai charge for the usage of fine-tuned model? Or it charges once for training process only?
@tech-at-work
@tech-at-work 8 ай бұрын
Yea, unfortunately they do; it's currently $0.008/1K tokens to train, and then $0.003/1K tokens for the prompt, and $0.006/1K tokens for the response
@user-up2sd1wq1n
@user-up2sd1wq1n 8 ай бұрын
thank you so much for response. @@tech-at-work
@user-up2sd1wq1n
@user-up2sd1wq1n 8 ай бұрын
it would also be very helpful if you can share the way to use trained model to test after the session on colab is timed out@@tech-at-work
@user-up2sd1wq1n
@user-up2sd1wq1n 8 ай бұрын
Ah, well, I figured out how to use fine-tuned model, thank you once again
@abdulrahmanalrabah8324
@abdulrahmanalrabah8324 9 ай бұрын
Excellent video !! thanks for that.. I have tried the data that was in the file and it worked, but Im having a hard time making the code ready my data set though I made sure it followed the correct format. any thoughts? Also the UI "Gradio" at the end doesn't seem to have a place for input, any updates on that?
@tech-at-work
@tech-at-work 9 ай бұрын
Thanks! I'll need more info on the error you're getting, but common issues are not saving the file as a UTF-8 .csv or formatting it correctly. Input on the gradio interface should be in the text box that loads when you run it - just type in the box!
@abdulrahmanalrabah8324
@abdulrahmanalrabah8324 9 ай бұрын
@@tech-at-work I got the first to make sure my data is running, the second part is that when i run gradio I only get one box which is the outbox, on the left side i don't have a box where i can add my input. Also, say I do have multiple fine-tuning id's created how can i switch between them to run each file?
@yizhouqian5899
@yizhouqian5899 10 ай бұрын
Is the functionality of the text classifier, an example of the APT application, distinct from the general model? I pose this question as I am engaged in a project where I observed notable performance disparities between the baseline playground and the text classifier playground, despite using the same prompt. The results from the text classifier mode were significantly superior. If there are operational differences between the two, could you guide me on how to fine-tune the text classifier? Your assistance is greatly appreciated!
@abduallahalkhudhayr9219
@abduallahalkhudhayr9219 8 ай бұрын
I aim to to fine-tune this model for binary classification task then get the accuracy of the model. Did you get any tips.
@yizhouqian5899
@yizhouqian5899 8 ай бұрын
@@abduallahalkhudhayr9219 not yet but I think fine-tuning is the way to go
@SofiaMyNutritionist
@SofiaMyNutritionist 6 ай бұрын
thanks so much for this. I have a B2C Saas and Need to implement AI as a support system for the user. It needs to provide motivation and coaching for the user to keep going throughout the saas learning and activities journey. how should i proceed and what do you recommend ? I need the AI to develop a with the user. Just like a client would do with his coach. thank you so much. Looking forward for the answer.
@tech-at-work
@tech-at-work 6 ай бұрын
This sounds like a fun project! The issue with trying to maintain previous conversations is the token limit set by OpenAI, as you reach the limit, you lose the first conversations. Langchain has tools to help with this, including langchain.memory which will keep a historic conversation summary that it can reference for responses. I have a video that touches on this some for making a customer service chatbot here: kzfaq.info/get/bejne/m9eCgMh018nJnIE.html
@PlanetaryChess
@PlanetaryChess 10 ай бұрын
Does the systems role has to stay the same? In your example, could there be times perhaps where another chatbot could answer a billing question?
@tech-at-work
@tech-at-work 10 ай бұрын
Good question! OpenAI doesn’t directly address this, but from my experience switching the system role is possible, but it can give you less precise responses for topics that cross between the two. It seems best to just include the billing portion in the single system prompt
@shantanudas6319
@shantanudas6319 5 ай бұрын
Wow
@Bboreal88
@Bboreal88 5 ай бұрын
Hi! Is there a reason for using Google Colab for this job? Can this be run on python with VS Code?
@tech-at-work
@tech-at-work 5 ай бұрын
You can certainly use VS code, it’s just easier for those who are learning to use Google Colab (less setup)
@mauritsmosterd5691
@mauritsmosterd5691 9 ай бұрын
I'm creating a product selector and I'm letting GPT 4 judge GPT 3.5 automatically to create a dataset. So I only have to say good correction/bad correction. Times have changed, times have changed...
@tech-at-work
@tech-at-work 9 ай бұрын
That’s super cool, making your own reinforcement learning from human feedback!
@uzzy28
@uzzy28 5 ай бұрын
Is it possible to fine tune 3.5 to outperform 4 just through the prompt alone? What I've noticed is GPT 3.5 seems to answer irrelevant questions but GPT 4 is much better at not answering irrelevant questions.
@mikgol81
@mikgol81 6 ай бұрын
is it necessary to keep repeating the same system prompt in the training data?
@tech-at-work
@tech-at-work 6 ай бұрын
Yea that’s how it reassigns weights from the base model
@mikgol81
@mikgol81 6 ай бұрын
@@tech-at-work ahh cool, thank you
@Shahid_An-AI-Engineer
@Shahid_An-AI-Engineer 7 ай бұрын
OpenAIError: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable
@tech-at-work
@tech-at-work 7 ай бұрын
It should work if you have your API key in this line, I would double check your key is correct openai.api_key = "YOUR-API-KEY"
@trackerprince6773
@trackerprince6773 8 ай бұрын
Whats the diff between custom gpts & fine-tuning gpt?
@tech-at-work
@tech-at-work 8 ай бұрын
Good question! Custom GPT’s are only able to be used on the OpenAI platform (currently at least) so you can’t incorporate into any program or app outside of OpenAI. Custom GPT’s can be fine-tuned, but you won’t have a “fine-tuned” model that you can save and use across multiple applications like you do with fine-tuning through Python, for example
@trackerprince6773
@trackerprince6773 8 ай бұрын
@@tech-at-work looking more into it it seems custom gpts are not fine tuned. They are only using prompt engineering+ RAG to add some extra knowledge
@tech-at-work
@tech-at-work 8 ай бұрын
Fair point, the weights and parameters are not adjusted to the base model like in fine-tuning, but you can prompt engineer the GPT to perform like a “fine-tuned” model. There are token/context limits imposed, so they’re not truly the same
@eugenefedorov3498
@eugenefedorov3498 10 ай бұрын
the noise from mic... you need some how to remove too loud sounds...
@tech-at-work
@tech-at-work 10 ай бұрын
I’ll work on a better mic, thanks for the feedback
@eugenefedorov3498
@eugenefedorov3498 10 ай бұрын
@@tech-at-work Thanks
@stefanusayudha1853
@stefanusayudha1853 7 ай бұрын
{ message: "are you smarter than gpt4?", reply: "yes" }
@forheuristiclifeksh7836
@forheuristiclifeksh7836 8 ай бұрын
8:00
@phuongtv9336
@phuongtv9336 9 ай бұрын
Hey, didn't the answers appear to be incorrect? {"role": "user", "content": "Where can I park?"}, {"role": "assistant", "content": "Parking is available in the underground garage. Make sure to validate your ticket at the front desk! Let me know if you have any trouble finding it."}]} {"role": "user", "content": "Is parking free?"}, {"role": "assistant", "content": "Parking is an additional fee of $20 per night. Let me know if you need further details!"}]}
@tech-at-work
@tech-at-work 9 ай бұрын
This was from the examples I auto populated from ChatGPT - I should have read through them closer to ensure all examples reflected an airbnb. If you have quality examples to train with, it will be more accurate.
@saeedasgaritehrani
@saeedasgaritehrani 5 ай бұрын
Dude your content is great, but your voice recording quality is awful 😂 how one can prepare datasets just like this clean and great but not using most simple audio enhancers? Super paradox!
@antorio
@antorio 8 ай бұрын
this is not outperform GPT-4, this is not makin it smarter than GPT-4. This is just fine-tuning, that's why we call it "fine-tuning". Give me back my 20 minutes.
@tech-at-work
@tech-at-work 8 ай бұрын
In specific applications, a fine-tuned GPT3.5 outperforms the stock GPT-4. I tried to make approach clear in the title and thumbnail
@fecleskid
@fecleskid 4 ай бұрын
Nice one, I love this video I have been able to download your training data as jsonl and I want to use it to fine tune my AI software But I don't want to use the python script you provided I want to use fine-tuning features on my AI software which my developer added Am still confused, please how can I contact you via mail for further assistance
@johan_at_node
@johan_at_node 9 ай бұрын
Thanks for a great video that really got me started with fine-tuning. I ran into an issue with Gradio though, seems like the module isn't loaded, as I am getting error on "gr." Here's the code I've added for it: > !pip install Gradio > import gradio as gd >#Gradio for a better UI def generate_completion(user_prompt): hidden_context = "" messages = [ {"role": "system", "content": hidden_context}, {"role": "user", "content": user_prompt} ] response = openai.ChatCompletion.create( model=fine_tuned_model_id, messages=messages, max_tokens=100, temperature=0 ) return response['choices'][0]['message']['content'].strip() iface = gr.Interface(fn=generate_completion, inputs=gr.inputs.Textbox(lines=5, placeholder='Question about the Airbnb?'), outputs='text', title="Chatner The Airbnb Helper", input_labels="Question", output_labels="Response") iface.launch(share=True) Which returns the following error message: NameError Traceback (most recent call last) in () 14 return response['choices'][0]['message']['content'].strip() 15 ---> 16 iface = gr.Interface(fn=generate_completion, 17 inputs=gr.inputs.Textbox(lines=5, placeholder='Question about the Airbnb?'), 18 outputs='text', NameError: name 'gr' is not defined
@tech-at-work
@tech-at-work 9 ай бұрын
Thanks! I see in your code you have “import gradio as gd” but you’re calling at the bottom as gr (iface = gr.interface…) Change the gd to gr (import gradio as gr) and it should work
@johan_at_node
@johan_at_node 9 ай бұрын
ah - my bad - thank!@@tech-at-work
@vasarostyle
@vasarostyle 7 ай бұрын
Great video!
@tech-at-work
@tech-at-work 7 ай бұрын
Glad you enjoyed!
Learn to Embed Data with ChatGPT to make a Recommendation Bot
16:48
Tech-At-Work
Рет қаралды 4,1 М.
Transform ChatGPT into any Expert with Unlimited Excel Data!
17:26
Tech-At-Work
Рет қаралды 24 М.
Пранк пошел не по плану…🥲
00:59
Саша Квашеная
Рет қаралды 7 МЛН
UNO!
00:18
БРУНО
Рет қаралды 2,3 МЛН
"okay, but I want Llama 3 for my specific use case" - Here's how
24:20
Fine-tuning ChatGPT to my text messages… feels weird
26:39
Tech-At-Work
Рет қаралды 1,7 М.
Fine-Tune ChatGPT For Your Exact Use Case
6:29
Matthew Berman
Рет қаралды 60 М.
The REAL Reason Your GPT-3 Fine Tunes Suck (and how to fix them)
10:40
Fine-tuning Large Language Models (LLMs) | w/ Example Code
28:18
Shaw Talebi
Рет қаралды 286 М.
Сколько реально стоит ПК Величайшего?
0:37
Новые iPhone 16 и 16 Pro Max
0:42
Romancev768
Рет қаралды 2,3 МЛН