Easily Fine Tune ChatGPT 3.5 to Outperform GPT-4!

  Рет қаралды 13,272

Tech-At-Work

Tech-At-Work

Күн бұрын

Пікірлер: 93
@2010Sisko
@2010Sisko 4 ай бұрын
This is an excellent video on Fine Tuning. Truly one of the best. Thanks so much for making this one. Instant subscribe.
@arupmmi07
@arupmmi07 10 ай бұрын
Excellent, Best fine-tuning video I saw! Thanks a Lot.
@tech-at-work
@tech-at-work 10 ай бұрын
Thanks!!
@tutubinbin97
@tutubinbin97 4 ай бұрын
Doing god work, clear and precise presentation, easy to follow, good day to you great sir
@tyrealq
@tyrealq Жыл бұрын
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!
@michaellavelle7354
@michaellavelle7354 Жыл бұрын
Great job. You don't miss a thing in your description. Thanks a lot.
@tech-at-work
@tech-at-work Жыл бұрын
Glad you enjoyed!
@silviocavini163
@silviocavini163 10 ай бұрын
This must be the best tutorial I've ever seen. Thanks!.
@tech-at-work
@tech-at-work 10 ай бұрын
Glad it was helpful!
@NikhilKopardeOfficial
@NikhilKopardeOfficial Жыл бұрын
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 Жыл бұрын
Thank you! For this, I would break them up, so for example "write an introductory paragraph for an article covering elephant migrations" etc
@deltagamma1442
@deltagamma1442 Жыл бұрын
From scratch and to the point. I generally don't comment, but great job!
@tech-at-work
@tech-at-work Жыл бұрын
Thanks, glad you found it useful!
@truckfinanceaustralia1335
@truckfinanceaustralia1335 Жыл бұрын
Love your work! haven't found anything else like it on youtube 👌
@tech-at-work
@tech-at-work Жыл бұрын
Amazing, thank you!
@VarshaShirole-vz8fk
@VarshaShirole-vz8fk Жыл бұрын
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 Жыл бұрын
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
@TuryngsTech-cc1gy
@TuryngsTech-cc1gy Жыл бұрын
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 Жыл бұрын
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
@turyng-or1js
@turyng-or1js Жыл бұрын
Man, you really rock! Very concise and strict to the point. Love it.
@tech-at-work
@tech-at-work Жыл бұрын
Thanks! Appreciate the comment!
@SaraMusaeva-n3n
@SaraMusaeva-n3n Жыл бұрын
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 Жыл бұрын
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
@SaraMusaeva-n3n
@SaraMusaeva-n3n Жыл бұрын
thank you so much for response. @@tech-at-work
@SaraMusaeva-n3n
@SaraMusaeva-n3n Жыл бұрын
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
@SaraMusaeva-n3n
@SaraMusaeva-n3n Жыл бұрын
Ah, well, I figured out how to use fine-tuned model, thank you once again
@SofiaMyNutritionist
@SofiaMyNutritionist Жыл бұрын
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 Жыл бұрын
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: kzbin.info/www/bejne/m6K1fph5p8iYoq8
@farhanafridi8694
@farhanafridi8694 Жыл бұрын
Your channel will boom in the coming months..
@tech-at-work
@tech-at-work Жыл бұрын
Thanks!
@adriaanb7371
@adriaanb7371 Жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
@@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: 😉 kzbin.info/www/bejne/aGWyYn6ZfrRmfK8si=pF0ou4rI4rpu_Dom
@PlanetaryChess
@PlanetaryChess Жыл бұрын
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 Жыл бұрын
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
@TuryngsTech-cc1gy
@TuryngsTech-cc1gy Жыл бұрын
Thank you for your awesome videos!
@mauritsmosterd5691
@mauritsmosterd5691 Жыл бұрын
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 Жыл бұрын
That’s super cool, making your own reinforcement learning from human feedback!
@tyrealq
@tyrealq Жыл бұрын
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 Жыл бұрын
I aim to to fine-tune this model for binary classification task then get the accuracy of the model. Did you get any tips.
@tyrealq
@tyrealq Жыл бұрын
@@abduallahalkhudhayr9219 not yet but I think fine-tuning is the way to go
@adrianorobson6365
@adrianorobson6365 Жыл бұрын
Good work man. Thansk for your time
@tech-at-work
@tech-at-work Жыл бұрын
Glad you found it useful!
@davidlepold
@davidlepold Жыл бұрын
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 Жыл бұрын
Thanks for the feedback, I’ll look at making the screen portion bigger, and my face smaller 👍🏼
@Rentaplace
@Rentaplace Жыл бұрын
@@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 Жыл бұрын
@@Rentaplace thanks for the feedback and subscribing! I've adjusted for my next video
@joelswann2310
@joelswann2310 Жыл бұрын
Awesome job brother! Would you do a tutorial on fine tuning and embedding ChatGPT 3.5 to write a fiction novel?
@hocklintai3391
@hocklintai3391 Жыл бұрын
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 Жыл бұрын
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 (kzbin.info/www/bejne/m6K1fph5p8iYoq8)
@fecleskid
@fecleskid 10 ай бұрын
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
@vasarostyle
@vasarostyle Жыл бұрын
Great video!
@tech-at-work
@tech-at-work Жыл бұрын
Glad you enjoyed!
@FireWireHTH
@FireWireHTH Жыл бұрын
@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?
@RobertoCifuentes-t7k
@RobertoCifuentes-t7k Жыл бұрын
Excellent video!
@tech-at-work
@tech-at-work Жыл бұрын
Thank you!
@batigol_9
@batigol_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 Жыл бұрын
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!
@batigol_9
@batigol_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?
@Bboreal88
@Bboreal88 11 ай бұрын
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 11 ай бұрын
You can certainly use VS code, it’s just easier for those who are learning to use Google Colab (less setup)
@mikgol81
@mikgol81 11 ай бұрын
is it necessary to keep repeating the same system prompt in the training data?
@tech-at-work
@tech-at-work 11 ай бұрын
Yea that’s how it reassigns weights from the base model
@mikgol81
@mikgol81 11 ай бұрын
@@tech-at-work ahh cool, thank you
@wiktormigaszewski8684
@wiktormigaszewski8684 8 ай бұрын
Nice one, thnx!
@tech-at-work
@tech-at-work 7 ай бұрын
Glad you found it useful!
@uzzy28
@uzzy28 10 ай бұрын
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.
@trackerprince6773
@trackerprince6773 Жыл бұрын
Whats the diff between custom gpts & fine-tuning gpt?
@tech-at-work
@tech-at-work Жыл бұрын
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 Жыл бұрын
@@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 Жыл бұрын
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 Жыл бұрын
the noise from mic... you need some how to remove too loud sounds...
@tech-at-work
@tech-at-work Жыл бұрын
I’ll work on a better mic, thanks for the feedback
@eugenefedorov3498
@eugenefedorov3498 Жыл бұрын
@@tech-at-work Thanks
@Shahid_An-AI-Engineer
@Shahid_An-AI-Engineer Жыл бұрын
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 Жыл бұрын
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"
@cryptoairdroppp
@cryptoairdroppp Жыл бұрын
bro thank you a lot
@tech-at-work
@tech-at-work Жыл бұрын
Glad you found it useful!
@caiyu538
@caiyu538 Жыл бұрын
Great. Great. Great
@tech-at-work
@tech-at-work Жыл бұрын
Thanks!!!
@stefanusayudha1853
@stefanusayudha1853 Жыл бұрын
{ message: "are you smarter than gpt4?", reply: "yes" }
@phuongtv9336
@phuongtv9336 Жыл бұрын
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 Жыл бұрын
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.
@shantanudas6319
@shantanudas6319 10 ай бұрын
Wow
@SphereofTime
@SphereofTime Жыл бұрын
8:00
@saeedasgaritehrani
@saeedasgaritehrani 10 ай бұрын
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 Жыл бұрын
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 Жыл бұрын
In specific applications, a fine-tuned GPT3.5 outperforms the stock GPT-4. I tried to make approach clear in the title and thumbnail
@johan_at_node
@johan_at_node Жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
ah - my bad - thank!@@tech-at-work
Learn to Embed Data with ChatGPT to make a Recommendation Bot
16:48
Tech-At-Work
Рет қаралды 4,3 М.
"okay, but I want Llama 3 for my specific use case" - Here's how
24:20
요즘유행 찍는법
0:34
오마이비키 OMV
Рет қаралды 12 МЛН
The Lost World: Living Room Edition
0:46
Daniel LaBelle
Рет қаралды 27 МЛН
Fine-tuning Large Language Models (LLMs) | w/ Example Code
28:18
Shaw Talebi
Рет қаралды 387 М.
Run your own AI (but private)
22:13
NetworkChuck
Рет қаралды 1,8 МЛН
3X-UI v2.4.9 & v2.4.10 - XHTTP: stream one
14:57
MHSanaei
Рет қаралды 6 М.
Fine-Tuning GPT Models with Python
23:14
NeuralNine
Рет қаралды 15 М.
Transform ChatGPT into any Expert with Unlimited Excel Data!
17:26
Tech-At-Work
Рет қаралды 24 М.