Build Specialized Fine-Tuned AI Agents | No Code
Summary
TLDRThe video tutorial guides viewers through creating AI agents using fine-tuned models without needing to write code. It emphasizes the underestimated power of fine-tuning, which can dramatically enhance AI's performance in various tasks, such as replicating a brand's tone across social media channels. The presenter offers step-by-step instructions on setting up fine-tuned models, using platforms such as Relevance AI and OpenAI, to create versatile content creation agents. He illustrates this with a case where a client used agents to handle content across platforms like LinkedIn and Instagram. Additionally, the video touches on other potential applications for fine-tuning, including customer service. Throughout, the tutorial highlights the setup's potential to revolutionize content management and digital strategy by automating and optimizing content generation, paving the way for businesses to engage more effectively with their audience.
Takeaways
- 🤖 Fine-tuning AI can significantly optimize content creation.
- 🔍 No-code tutorials make advanced AI setups accessible.
- 📊 Fine-tuned models adapt content to different platforms seamlessly.
- 🛠️ Using OpenAI and Relevance AI simplifies fine-tuning processes.
- 💬 AI agents can maintain brand voice across social media platforms.
- 🚀 Companies can scale content creation with minimal effort.
- 🎯 Fine-tuning aligns AI outputs with specific business goals.
- 💡 Learn to customize AI models to your brand’s tone of voice.
- 🌐 Explore diverse use cases for fine-tuned AI models.
- 🧠 Understanding fine-tuning's potential is crucial for digital expansion.
Timeline
- 00:00:00 - 00:05:00
In this video, the creator aims to demystify the process of fine-tuning AI models for creating specialized agents without coding. The main focus is to show the potential of fine-tuned AI models for various business applications, particularly in content creation across different social media platforms. Fine-tuning allows for customized AI interactions, a practice that's underutilized but highly beneficial in aligning AI outputs with specific brand styles and tones.
- 00:05:00 - 00:10:00
The creator shares an overview of a content management system built on Relevance AI. This system uses fine-tuned models for each social media platform, effectively managing and repurposing content through Slack. By integrating AI agents within existing platforms like Slack, the workflow resembles human interaction, creating content or repurposing existing media based on simple commands. This setup minimizes the need for new software solutions, leveraging existing communication channels.
- 00:10:00 - 00:15:00
Each social media platform has a specialized AI agent with tools tailored for specific tasks, like transcription or content scraping, enabling the AI to create platform-specific posts. A demonstration agent for LinkedIn uses a fine-tuned model to produce content closely mimicking a brand's past posts. The aim is to enhance consistency and engagement through tailored AI output, showcasing the stark difference between generic and fine-tuned model outputs.
- 00:15:00 - 00:20:00
The intricacies of fine-tuning AI models involve refining pre-trained models with specific datasets to improve task-specific accuracy. While fine-tuning increases proficiency for certain tasks, it reduces generalization beyond trained data. The creator emphasizes the crucial balance between dataset size and task specificity to avoid overfitting and memory degradation in AI models, which can limit flexibility and performance.
- 00:20:00 - 00:25:00
Fine-tuning is highlighted as beneficial for customizing style, improving reliability for specific tasks, and managing edge cases, with practical use cases like content creation and customer service. Limitations include overfitting and the potential loss of generalized knowledge, necessitating careful dataset preparation—ideally between 100-1000 data points for optimal tone adaptation in content generation tasks.
- 00:25:00 - 00:30:00
Steps for fine-tuning include preparing specific datasets, converting them to a recognized format (JSONL), training the model, and integrating it with Relevance AI for real-world application. Detailed guidance is provided on leveraging tools and platforms like Replicate and OpenAI for effective, cost-efficient fine-tuning processes. The importance of high-quality and correctly formatted datasets is stressed for successful training outcomes.
- 00:30:00 - 00:36:49
Finally, connecting the fine-tuned models with application tools like API setups in platforms such as Relevance AI is explained, ensuring optimized integration and usage of the models. The potential of fine-tuning for enhancing AI tasks and tone adaptation is praised, along with an announcement about a new online community for further collaboration and knowledge sharing with people interested in AI advancements.
Mind Map
Video Q&A
What is the main focus of the video?
The video focuses on creating highly specialized AI agents using fine-tuned models without coding.
Why is fine-tuning considered powerful according to the video?
Fine-tuning is powerful because it allows increased accuracy for specific tasks and can be tailored to different use cases, such as content creation on social media.
What example is given for using fine-tuned models?
An example given is a content creation agent for a client that utilizes fine-tuned models to align with their brand's tone across different social media platforms.
How is fine-tuning done without code in this video?
Fine-tuning without code is achieved using platforms like OpenAI and tools like Replicate, where users can upload their data sets and configure models easily.
What are the possible use cases mentioned for fine-tuned models?
Use cases include content creation for social media, customer service agents, and specialized systems requiring brand-aligned responses or knowledge-rich interactions.
View more video summaries
Metamorphosis by Franz Kafka | Full Audiobook | part 1 (of 3)
10 things to do instead of doomscrolling
STEAM - Learning That is Representative of the Whole World
These CSS PRO Tips & Tricks Will Blow Your Mind!
The Rise of STEM Education: A Short History of Education
How Andrew Carnegie Became The Richest Man In The World
- 00:00:00hey guys so in this video I'm going to
- 00:00:02show you how to create highly
- 00:00:03specialized AI agents by giving them
- 00:00:05access to your own fine tuned models now
- 00:00:08I really wanted to make this video
- 00:00:09because in my opinion fine tuning has
- 00:00:11been really underused and is actually
- 00:00:13extremely powerful for many different
- 00:00:15use cases and I think it is because most
- 00:00:18people are a bit intimidated by the
- 00:00:20setup and most tutorials out there are
- 00:00:22code based so in this video I'm going to
- 00:00:24show you how to set up your own fet
- 00:00:26models without code and secondly I'll
- 00:00:29show you how you can get give your AI
- 00:00:30agents access to multiple specialized
- 00:00:33fine tuned models which opens up a whole
- 00:00:35range of very interesting use cases I
- 00:00:37recently for example delivered a Content
- 00:00:40creation agent to a client that had
- 00:00:42access to five different optimized
- 00:00:44ftuned models each trained on a past
- 00:00:47post tone of voice and style of each of
- 00:00:50their different social media platforms
- 00:00:52LinkedIn X Instagram Facebook and their
- 00:00:55blog and the results were pretty amazing
- 00:00:57both to me and the company uh and by
- 00:01:00giving one agent access to all these
- 00:01:02different fine tuned models companies
- 00:01:04can create and post hyper optimized and
- 00:01:07brand aligned content across all their
- 00:01:09platforms by simply interacting inside a
- 00:01:11one chat uh but you can imagine there
- 00:01:13are many more interesting use cases and
- 00:01:16possibilities with this setup so if you
- 00:01:18finally want to learn how to F tune the
- 00:01:20easy way and learn how to build
- 00:01:22specialized AI agents stick with me and
- 00:01:24I'll show you how to do it so I've
- 00:01:26broken this video down into four steps
- 00:01:28first I'll show you the content team
- 00:01:30system overview because I think this
- 00:01:32system will give you a good Insight of
- 00:01:34the possibilities for this setup and um
- 00:01:37the use cases for this setup then I'll
- 00:01:39give you a quick example of a fine-tuned
- 00:01:41LinkedIn post writer agent that I just
- 00:01:43recreated for myself quickly so you can
- 00:01:45also see the difference between a normal
- 00:01:47model output and a fine-tuned model
- 00:01:49output then I'll give you a very quick
- 00:01:51practical breakdown on what fine tuning
- 00:01:52actually is when to use it and why to
- 00:01:54use it and lastly I'll show you step by
- 00:01:56step how you can fine-tune your own
- 00:01:58model now before starting uh I'm very
- 00:02:00excited to announce that I just launched
- 00:02:02my community I'll be sharing everything
- 00:02:05I've learned all my templates will be
- 00:02:06available on there too and really I'm
- 00:02:08there to help out with anything I can
- 00:02:11and but it really is about for anyone
- 00:02:13who sees the potential in this and wants
- 00:02:15to become one of the first experts in
- 00:02:17the AI agent field uh because if you
- 00:02:19jump on this bandw bandwagon right now
- 00:02:22you will be one of the first experts
- 00:02:24which in my opinion ideally positions
- 00:02:26yourself when this Market matures and
- 00:02:28the AI space actually Tak off so if
- 00:02:31you're interested in something like this
- 00:02:32I have more information uh in a link in
- 00:02:34the description below and uh I would
- 00:02:36love to see you there anyway that aside
- 00:02:38let me get to the content team system
- 00:02:40overview as always I built this system
- 00:02:43on relevance AI if you're completely new
- 00:02:45to my channel um this might go over your
- 00:02:47head a little bit uh it's not the
- 00:02:49easiest setup so if it's hard to follow
- 00:02:51make sure to check out my beginner
- 00:02:53tutorial and on relevance AI I do have
- 00:02:55many other tutorials on relevance AI too
- 00:02:57but uh I'll try to keep it
- 00:02:59straightforward and and simple now if
- 00:03:01you've seen my previous video on the AI
- 00:03:02agent social media team this is quite a
- 00:03:04similar setup um with a a few slight
- 00:03:07adjustments but the way this system is
- 00:03:10uh set up is here we have our triggers
- 00:03:12here we have our content manager agent
- 00:03:14and his tools and here we have the sub
- 00:03:16agents with their uh specific tools
- 00:03:19right so in this case I've actually uh
- 00:03:22set this agent up inside of their slack
- 00:03:24which I notic is a very interesting use
- 00:03:26case to delivering these AI agents to
- 00:03:27clients or to companies because instead
- 00:03:29of having to manage another software
- 00:03:31they could just uh whenever they need
- 00:03:32their agent they could just open their
- 00:03:34slack channel of their agent and
- 00:03:36basically instruct them what to do and
- 00:03:38it sort of makes sense because uh most
- 00:03:40people already manage sort of their
- 00:03:41employees or their or their U colleagues
- 00:03:44inside of slack so it makes sense to
- 00:03:46sort of put these agents inside of their
- 00:03:48slack too so the way the system uh is
- 00:03:51set up it could basically do two things
- 00:03:53right it can either repurpose content uh
- 00:03:55based on long form content like uh
- 00:03:57YouTube videos uh podcasts or blog posts
- 00:04:00and basically sort of repurpose that
- 00:04:02across all the different social channels
- 00:04:04or it can generate uh posts from ideas
- 00:04:08right so someone could just have an idea
- 00:04:10write it in the slack Channel and it
- 00:04:12will start generating posts for the
- 00:04:13different platforms based on that idea
- 00:04:15so the way this in practice works out is
- 00:04:18in the following way you can see here I
- 00:04:19have the two different triggers right
- 00:04:20generate from idea or repurpose content
- 00:04:23right now that will be sent to the
- 00:04:24content manager agent who has three main
- 00:04:27responsibilities now the first one as
- 00:04:29always
- 00:04:30is to delegate this task to the right
- 00:04:32sub agent and you can see each of the
- 00:04:34sub agent is basically a specialist in
- 00:04:37each of the platforms right so we have
- 00:04:38our blog writer agent our X writer agent
- 00:04:41LinkedIn writer agent Facebook writer
- 00:04:42agent and Instagram writer agent now
- 00:04:45they're all set up in a very similar way
- 00:04:46so for example if we look at the
- 00:04:47LinkedIn writer agent he has access to
- 00:04:49three tools right and if this is really
- 00:04:52where the magic happens because in his
- 00:04:54first tool he will have access to the
- 00:04:56fine-tuned model right so the first tool
- 00:04:58is the LinkedIn writer and that fine tun
- 00:05:00model is trained on all the past
- 00:05:02LinkedIn post of this company to mimic
- 00:05:06the style T of voice and sort of length
- 00:05:09as much as possible on this specific
- 00:05:11platform in this case LinkedIn right
- 00:05:13then the other tools he has are more for
- 00:05:15the repurposing right we have the
- 00:05:16YouTube transcription tool so if we
- 00:05:18actually want to repurpose it will need
- 00:05:20context on the YouTube video so it will
- 00:05:21first transcribe to understand the
- 00:05:23context and then write the LinkedIn post
- 00:05:25right and the same for podcast with the
- 00:05:26audio transcription and I actually
- 00:05:28forgot one which is uh scraper tool
- 00:05:30where it can for example if they share a
- 00:05:32blog post link then it can scrape that
- 00:05:35blog post on understand the context and
- 00:05:36then write the LinkedIn uh post now
- 00:05:39basically this is the way all of these
- 00:05:40agents are set up but with the
- 00:05:42difference that each of these uh agents
- 00:05:44has access to a different fine-tuned
- 00:05:47model right that's trained on that
- 00:05:49specific platform's data right so that's
- 00:05:53the way this uh system is set up so
- 00:05:54let's say our LinkedIn WR agent writes a
- 00:05:57post and then he reports it back to the
- 00:05:59content manager agent and then basically
- 00:06:02his second responsibility comes into
- 00:06:03play which is we've instructed him to
- 00:06:04always first report back that uh post to
- 00:06:08us and that's why we have here a tool
- 00:06:10that's called send slap message on slack
- 00:06:13um to make sure that everything's all
- 00:06:15right we can check if we like the post
- 00:06:17if we want to change something um and if
- 00:06:19we approve we send it back to the
- 00:06:21content manager agent and then he can
- 00:06:24perform his third responsibility which
- 00:06:25is actually posting it to the different
- 00:06:27platforms and that's why you can see he
- 00:06:28has these other tools post to X post to
- 00:06:31LinkedIn post to blog post to Instagram
- 00:06:34and again I forgot one which is post to
- 00:06:36Facebook right so that's how it's set up
- 00:06:39um you can see quite powerful sort of
- 00:06:41setup uh and this is just one use case
- 00:06:44of using sort of These Fine T models
- 00:06:46inside of agent systems but you I can
- 00:06:49imagine there are many more uh very
- 00:06:51interesting use cases for this you can
- 00:06:52for example imagine a customer service
- 00:06:55agent that has access to a fine Tu model
- 00:06:58so it can actually really resp respond
- 00:06:59in the tone of voice of a company which
- 00:07:01is still really hard to do with normal
- 00:07:03LMS and you can also imagine that a
- 00:07:06combination of a knowledge base or a rag
- 00:07:08so getting the the context of the
- 00:07:10information context of the company
- 00:07:12combined with the tone of voice through
- 00:07:13a fine to model can also be a very very
- 00:07:15powerful uh um solution for companies so
- 00:07:20unfortunately but understandably the uh
- 00:07:22the company I built this for actually
- 00:07:23didn't want me to share this uh inside
- 00:07:26of inside of this YouTube channel and to
- 00:07:28recreate the whole
- 00:07:30uh system for myself would be quite a
- 00:07:31big job especially considering that I
- 00:07:33have to fine tune each of these
- 00:07:34different social media platforms which
- 00:07:36would be quite a big job so what I did
- 00:07:38is I basically recreated the LinkedIn
- 00:07:40writer agent for myself and through that
- 00:07:43example I'll also share that template
- 00:07:45with you uh on the on the community um
- 00:07:49and also through that example you
- 00:07:51understand how to do this for other
- 00:07:52platforms if you want to and also how
- 00:07:54you could recreate this entire system
- 00:07:56because again it's very similar to the
- 00:07:58social media
- 00:07:59um agent team template that I do have
- 00:08:02available uh so if you understand how to
- 00:08:04do this you could set this system up for
- 00:08:06yourself if you're interested now let me
- 00:08:08show you a quick example of the LinkedIn
- 00:08:09writer agent I set up for myself so here
- 00:08:12we are in my relevance AI dashboard um
- 00:08:15now here I have my fine-tuned LinkedIn
- 00:08:16writer agent and basically I copied that
- 00:08:18one and recreated another one LinkedIn
- 00:08:21writer one which basically has access to
- 00:08:22a normal GPT 40 model so not a fine
- 00:08:25tuned one just so we can check the
- 00:08:27differences in output now for context
- 00:08:30it's good to know that I trained this
- 00:08:32fine T model based on LinkedIn posts
- 00:08:34that I like which are sort of in the AI
- 00:08:36space that are the characteristics are
- 00:08:39sort of like these short Punchy
- 00:08:41sentences very value driven and uh with
- 00:08:44a strong sort of uh call to action if
- 00:08:47you're on LinkedIn you probably know
- 00:08:48what I mean uh but let's check so here
- 00:08:50we have our non fine tuned uh agent
- 00:08:53right so normally of course this would
- 00:08:56be uh instructed this agent would be
- 00:08:57instructed by the manager agent but now
- 00:08:59we just uh for example purposes do it on
- 00:09:02uh directly to the LinkedIn writer agent
- 00:09:04and let's say in this case we want to
- 00:09:06generate a blog post based on an idea
- 00:09:08not repurposing uh we can say something
- 00:09:11like right uh
- 00:09:13LinkedIn
- 00:09:15post
- 00:09:16[Music]
- 00:09:17on uh let's
- 00:09:19say in the era of
- 00:09:23AI English is the new programming
- 00:09:27language
- 00:09:31and maybe
- 00:09:33say uh end with a
- 00:09:36CTA to my free prompting
- 00:09:42guide all right let's say let's copy
- 00:09:45this and put in exactly the same uh
- 00:09:47prompt inside of the ftuned LinkedIn WR
- 00:09:50agent so let's
- 00:09:54check and now let's check the
- 00:09:57difference so here we have non-
- 00:09:59fine-tuned LinkedIn post so in the area
- 00:10:02of AI English becoming the new
- 00:10:03programming language as artificial
- 00:10:05intelligence continues to evolve the
- 00:10:06ability to communicate effectively in
- 00:10:08English is more crucial than ever I'm
- 00:10:10already seeing that it didn't understand
- 00:10:12what I was trying to say just this
- 00:10:13coding languages like Python and
- 00:10:15JavaScript have shaped the tech
- 00:10:16landscape the way we articulate our
- 00:10:18thoughts and ideas in English is now a
- 00:10:19key skill in Levering leveraging AI
- 00:10:21tools and Technologies whether you're
- 00:10:22crafting prompts for AI models or
- 00:10:24collaborating with teams across the
- 00:10:26globe mastering English can okay so yes
- 00:10:28you can see didn't really understand uh
- 00:10:31uh what I was trying to say and second I
- 00:10:33don't really like the tone of voice
- 00:10:34especially for LinkedIn post it's it's
- 00:10:37uh it's not very engaging and you've
- 00:10:39probably seen this right when you try to
- 00:10:41create content with uh with chat gbt for
- 00:10:44for your social media or for your
- 00:10:45company maybe it's very hard to get the
- 00:10:47tone of voice right uh even with a lot
- 00:10:50of prompting it's very hard to get that
- 00:10:51tone of voice uh and that's why I think
- 00:10:54it's such a good use case for these fine
- 00:10:56to models now let's check the fine model
- 00:10:59so here's a LinkedIn Post in the era you
- 00:11:01can already see by the way that the the
- 00:11:02sort of layout is very different right
- 00:11:04in the era of AI English is the new
- 00:11:06programming language the better you
- 00:11:08communicate with AI the more you can
- 00:11:09automate the more you automate the more
- 00:11:10you can scale the more you scale the
- 00:11:12more you win to help you win I've
- 00:11:15created a free guide to help you master
- 00:11:16the art prompting I love it you can see
- 00:11:18the difference in style it's it's very
- 00:11:20different and way more the style I'm
- 00:11:22looking for it covers the three types of
- 00:11:24prompts how to create effective prompts
- 00:11:26how to use AI to create your prompts how
- 00:11:28to use AI to refine your PR promps how
- 00:11:29to use AI to create your own prompt
- 00:11:31Library the the guide also includes a
- 00:11:33video tutorial on Ocean template to get
- 00:11:35access simply click my name plus follow
- 00:11:37plus Bell okay I can already tell you
- 00:11:39this part directly comes from the
- 00:11:41training data because this is sort of
- 00:11:43the style that I've trained this uh
- 00:11:45model on comment prompting on this post
- 00:11:48I'll send you the link BS if you don't
- 00:11:49want to wait you can grab it here so yes
- 00:11:51you can see the difference and the power
- 00:11:52of These Fine T model you can really you
- 00:11:55know enhance that tone of voice and
- 00:11:57really get it lots more like you you
- 00:11:58actually want it so I want to go over
- 00:12:01quickly what is actually fine-tuning
- 00:12:03when to use it and how we can set this
- 00:12:05up so I want to go very quickly over the
- 00:12:07basics of fine tuning I want to keep it
- 00:12:08practical so it's not going to be long
- 00:12:10but you do need to understand it a
- 00:12:11little bit so fine tuning basically
- 00:12:13refines pre-trained AI models with
- 00:12:15specific data right so if you see the
- 00:12:17diagram here uh we have a base model
- 00:12:19just like GPT 40 for example that of
- 00:12:21course is trained on a huge data set and
- 00:12:24then we have our base model and what we
- 00:12:25do when we fine tuning is we basically
- 00:12:27refine that base model with a smaller
- 00:12:29data set to make it specialized on a
- 00:12:32specific task right so and through that
- 00:12:35sort of specialization we can of course
- 00:12:36get increased accuracy on those specific
- 00:12:38tasks now important to note you get
- 00:12:40increased accuracy on those specific
- 00:12:42tasks right because you actually get
- 00:12:44decreased accuracy on any task that's
- 00:12:46not related to your training data and
- 00:12:48you'll lose that you get that decreased
- 00:12:51accuracy on these other tasks very
- 00:12:52quickly right even with a small data set
- 00:12:54like 500 or a thousand data points now
- 00:12:57lastly some people have heard have some
- 00:12:59confusion between fine tuning and rag
- 00:13:02now the the difference very easy fine
- 00:13:03tuning actually adjusts the underlying
- 00:13:05language model while rag or knowledge
- 00:13:07base just adds context um or knowledge
- 00:13:11to the base model right so it doesn't
- 00:13:13actually change the underlying model it
- 00:13:15just adds context to it and why do we
- 00:13:18actually find tune now I got this from
- 00:13:19the open website uh uh these sort of but
- 00:13:22I tried to put in an example for each
- 00:13:24one now of course the first one is the
- 00:13:26one I've been using which is setting the
- 00:13:27style tone format or other qualitative
- 00:13:30aspects right of course I think this is
- 00:13:32one of the really powerful use cases
- 00:13:34that's actually already working pretty
- 00:13:36well uh which is you know trying to get
- 00:13:38brand alligned or Persona alligned
- 00:13:40content out right or you can even
- 00:13:42imagine inside of chat Bots this could
- 00:13:43also be a very interesting use case
- 00:13:45right now uh secondly uh there are more
- 00:13:48right but secondly you have improving
- 00:13:50reliability at a produce producing a
- 00:13:52desired output right so you can imagine
- 00:13:54if you're looking for uh always have to
- 00:13:57have a always have a very specific
- 00:13:59output you can imagine that if you train
- 00:14:01a model based on that specific output
- 00:14:03you get high reliability in getting that
- 00:14:05desired output right so for example an
- 00:14:07e-commerce product description right uh
- 00:14:09it always needs to be in the exact same
- 00:14:11format length the different sections
- 00:14:14right and you're using a model only to
- 00:14:16do that well then it makes sense to F
- 00:14:18tune it to get that reliability um
- 00:14:21higher right and then uh the third one
- 00:14:23is correcting failures to follow complex
- 00:14:25prompts you can imagine you've already
- 00:14:27experienced it probably language model
- 00:14:29strugle with very long prompts and uh if
- 00:14:32you need to do very complex things you
- 00:14:34can better probably find tuno model or
- 00:14:36uh to to get those sort of specifics
- 00:14:39inside of a very large prompt I think
- 00:14:40some of these use cases you can also
- 00:14:42attack with chain prompting of course
- 00:14:44breaking down a larger prompt into
- 00:14:45smaller prompts and put it in a chain
- 00:14:47but uh you can imagine they for example
- 00:14:49had an example here detailed technical
- 00:14:51manuals right and then uh the fourth one
- 00:14:54is handling many edge cases in specific
- 00:14:56ways you can imagine these base models
- 00:14:58are are uh better at sort of this broad
- 00:15:01knowledge and and generalized knowledge
- 00:15:04so if you need to do something which
- 00:15:07involves a lot of edge cases you can
- 00:15:09imagine it's probably better to train a
- 00:15:11a specific model on that sort of uh
- 00:15:14smaller data set with the more Edge case
- 00:15:17um uh data right for example diagnosing
- 00:15:20rare or complex medical cases that fall
- 00:15:22outside of the norm right you can
- 00:15:23imagine a base model would be would have
- 00:15:25a hard time with it because it would
- 00:15:27first uh look at the general and the
- 00:15:30broad picture while if you're really
- 00:15:31looking for those specific identifying
- 00:15:33those specific uh medical cases that
- 00:15:36fall outside of the norm you can better
- 00:15:37have a fine tube model that's
- 00:15:38specialized in recognizing those uh
- 00:15:41diseases right and then the last one is
- 00:15:43uh performing a new scale skill or task
- 00:15:45that's hard to articulate in a prompt
- 00:15:47now a lot of the fine tuning that people
- 00:15:49are doing right now is with images and
- 00:15:51this is a very good use case for that
- 00:15:53you can imagine it's very difficult to
- 00:15:54describe in a prompt you've Al probably
- 00:15:57also experienced it um to to uh to to
- 00:16:01let a model generate a specific type of
- 00:16:03image you want right it's hard to do
- 00:16:05that in language so you can better train
- 00:16:07or fine tuna model by showing it the
- 00:16:09actual images of the type of images you
- 00:16:12want in your output then doing it
- 00:16:14through language with prompting right uh
- 00:16:16so I think this is also a very
- 00:16:18interesting use case especially for the
- 00:16:19image uh image generation fine T models
- 00:16:23so you can see here customizing model to
- 00:16:24create artwork in a specific hardto
- 00:16:26describe style now what are some of the
- 00:16:28limitations right now or F tuning uh
- 00:16:30because there are limitations still and
- 00:16:33the main ones are really first of all
- 00:16:35overfitting and overfitting basically
- 00:16:36means overly specialized right so it
- 00:16:40basically as soon as you start sort of
- 00:16:41training this on this specific task it
- 00:16:45very quickly even again with 500 to
- 00:16:471,000 data points start to struggle with
- 00:16:50generalization or new or unseen tasks so
- 00:16:53any task you haven't traded on and
- 00:16:55therefore these models become very
- 00:16:57limited in terms of their flexibility
- 00:16:58it's it's very important to keep these
- 00:17:00models very specific to a specific task
- 00:17:03right and then the second thing is which
- 00:17:05also happens quite quick is forgetting
- 00:17:07right models very quickly lose some of
- 00:17:10the broad knowledge they originally had
- 00:17:12but because they're focusing so narrowly
- 00:17:14on that specific data set right so you
- 00:17:16can see this also happening I've seen it
- 00:17:18happening you know with 700 800 data
- 00:17:21points it already starts hallucinating
- 00:17:23completely stop making sense and uh
- 00:17:26putting in weird symbols and things like
- 00:17:27this so this will happen quite quickly
- 00:17:30so again you have to sort of find this
- 00:17:33uh data set size and I'll I'll tell you
- 00:17:34my recommendations later uh to to get
- 00:17:37these models right right and then the
- 00:17:38last one is of course data dependency
- 00:17:40the output of of or the the the the
- 00:17:43model output of your fine model only
- 00:17:45depends on the quality of your data your
- 00:17:47quality the quality of your data has to
- 00:17:48be good if you expect a good outcome and
- 00:17:51second as I said the quantity of data is
- 00:17:53very important right so too much data
- 00:17:56will mean more forgetting and more
- 00:17:57overfitting so more specialized which
- 00:17:59could be good for some use cases but if
- 00:18:01you still need some broad knowledge or
- 00:18:03general knowledge then you need to go
- 00:18:05lower right but if you go too low uh
- 00:18:07then it will not perform the way you
- 00:18:09want of course so you have to sort of
- 00:18:11find that sweet spot and I'll tell you
- 00:18:14the sweet spot I found for getting sort
- 00:18:16of that tone of voice uh right so how do
- 00:18:19we actually fine-tune and how do we
- 00:18:21actually F tune without code now there's
- 00:18:22two main ways uh the first one is with
- 00:18:24replicate right I really like replicate
- 00:18:27um basically replicate makes it easy for
- 00:18:29you to F tune your models and you the
- 00:18:32cool thing is you can use all these open
- 00:18:33source models you can use llama you can
- 00:18:35use Mist you can choose the model you
- 00:18:38want to um fine tune and you can also
- 00:18:42use images video uh you can really do
- 00:18:45anything you want here and then they
- 00:18:46make it also really easy to export your
- 00:18:49own fine tuned llm into an API which you
- 00:18:51can then use wherever you want and you
- 00:18:53could also for example export it into um
- 00:18:56relevance AI uh for you can see there's
- 00:18:59already a lot of people making fine two
- 00:19:01models and putting them public here on
- 00:19:03replicate so you can see take photos in
- 00:19:05style ready Tokyo kns so they have many
- 00:19:07of these image uh models but you can uh
- 00:19:10you can check it out they have some cool
- 00:19:11cool fine T models here already
- 00:19:13available but in this specific use case
- 00:19:16uh in this video I'm going to do it on
- 00:19:18Open AI why because it's actually
- 00:19:19completely for free to find two new
- 00:19:21models uh the GPT 40 and GPT 40 mini
- 00:19:24until the end of September on open Ai
- 00:19:26and it's quite an easy process even
- 00:19:28easier than replicate I'd say so we're
- 00:19:30going to do it on Open Ai and lastly how
- 00:19:34do we actually set this up there's
- 00:19:36basically four steps involved and the
- 00:19:37first one is the hardest one uh which is
- 00:19:40preparing our data set right um now the
- 00:19:43second one is converting that data set
- 00:19:46to adjacent L file and basically
- 00:19:48adjacent L file is what these models
- 00:19:50expect to be trained on right so I I'll
- 00:19:52explain in detail how you can do this
- 00:19:53later it's not that difficult and uh
- 00:19:56then we have to actually train our model
- 00:19:58and lastly I'll show you how you can
- 00:20:00give your uh trained model or your 52
- 00:20:02model to your agent on relevance AI now
- 00:20:05before doing that we actually have to
- 00:20:07decide which data set we're going to go
- 00:20:09for the size of our data set now as I
- 00:20:12said take this with a greater salt
- 00:20:14there's no art science and you sort of
- 00:20:15have to play around with this a bit but
- 00:20:17I have been doing it for quite some
- 00:20:19weeks now so in my experience what I
- 00:20:21found for this specific use case which
- 00:20:23is matching a tone of voice uh we need
- 00:20:26to go for a data set between 100 to a
- 00:20:30th000 data points right and this is
- 00:20:33still quite a a broad range so I wanted
- 00:20:36to get even more specific um because
- 00:20:39what I what I've been seeing is even if
- 00:20:41you go close to the thousands right or
- 00:20:43the upper hundreds let's say you already
- 00:20:46start losing a lot of this general
- 00:20:47knowledge it starts doing some weird
- 00:20:49things sometimes or putting out weird
- 00:20:51symbols so if we go for the content
- 00:20:54generation from ideas if that's your
- 00:20:55main use case for this uh F2 model then
- 00:20:58we want to go a little bit on the lower
- 00:21:00end of our data set why because we still
- 00:21:02need a little bit of that broad
- 00:21:03knowledge and general knowledge we don't
- 00:21:05want it to start hallucinating and stop
- 00:21:07making sense so if you want to sort of
- 00:21:09do it like I did in my example then
- 00:21:12probably a data set between 100 and 300
- 00:21:14would work uh better for you it will get
- 00:21:16the tone of voice pretty pretty good and
- 00:21:19uh it will it will keep making sense
- 00:21:21right uh but for repurposing we can
- 00:21:23actually do it on a little bit of a a
- 00:21:26bigger data set why because when we
- 00:21:29repurpose content for example blog post
- 00:21:31we give the L&M the model a lot more
- 00:21:33context on what we want our post to be
- 00:21:35about right so it has to do less
- 00:21:37thinking in terms of generating and it
- 00:21:40needs Les less knowledge right so
- 00:21:42therefore we can get away with a little
- 00:21:44bit uh of a lack of of of broad
- 00:21:47knowledge uh and therefore we can trade
- 00:21:50it on a little bit of a larger data uh
- 00:21:51set right so I put in there three to 600
- 00:21:54right now even even if you go over that
- 00:21:56it starts I was pretty surprised how
- 00:21:58quick it loses sort of that general
- 00:22:00knowledge and starts doing weird things
- 00:22:02so now take you step by step uh through
- 00:22:04setting up this LinkedIn data set and
- 00:22:06actually training fine-tuning your model
- 00:22:07and giving it to your age now as I said
- 00:22:10the hardest thing is actually preparing
- 00:22:11this data set of course we don't want to
- 00:22:13start manually uh copying and pasting
- 00:22:16these LinkedIn posts or whatever uh post
- 00:22:18we're trying to gather to the data set
- 00:22:19so in this specific one for the LinkedIn
- 00:22:21one I actually set up a tool that will
- 00:22:23help you scrape LinkedIn posts and
- 00:22:26automatically update them to a knowledge
- 00:22:27base inside relevance Ai and we can then
- 00:22:29export it into uh CSV which we can then
- 00:22:33later transform into Json L but uh the
- 00:22:35reason I could do this in relevance AI
- 00:22:37because they actually have uh built in
- 00:22:39LinkedIn post scraper right so I'm going
- 00:22:41to share this tool with you so you can
- 00:22:43use it yourself and it'll basically
- 00:22:45allow you to very quickly create this
- 00:22:47data set for you uh you will have to
- 00:22:49change uh one or two things so I'm going
- 00:22:51to show you that right now so uh I'll
- 00:22:54put that that uh link of this tool in
- 00:22:56the description here below for the other
- 00:22:58platform
- 00:22:59um uh Instagram Facebook x uh the blog
- 00:23:02post I actually use make.com to get that
- 00:23:06data into a spreadsheet um and I'll make
- 00:23:08sure to share those templates in the uh
- 00:23:11community so anyway if you've cloned
- 00:23:13your tool um you will come to a screen
- 00:23:16like this
- 00:23:17right which is the build the build
- 00:23:20screen right and basically the tool
- 00:23:21works like this we have three user
- 00:23:23inputs right you can either choose if
- 00:23:24you want a company or a user LinkedIn
- 00:23:26URL so which type of profile you want to
- 00:23:28scrape right a company or LinkedIn so
- 00:23:30let's say in this case we want to do a
- 00:23:31company then we have to add in very
- 00:23:34simple just the LinkedIn of the
- 00:23:36companies we want to scrape so let's say
- 00:23:39just for example we're going to scrape
- 00:23:41two
- 00:23:42companies um so we're just going to
- 00:23:45scrape hopspot
- 00:23:48and uh maybe pipe
- 00:23:51Drive uh not a good example of course
- 00:23:54these are competitors but it's just an
- 00:23:56example so we put in these is uh
- 00:23:59LinkedIn URS just here and
- 00:24:02hopspot and then we can decide here uh
- 00:24:05the amount of days in the past we want
- 00:24:07to retrieve uh these post from so for
- 00:24:09example we only want it from the last
- 00:24:11four months so we can put in 120 days in
- 00:24:14the past right so uh this tools already
- 00:24:16set up for you the only thing you will
- 00:24:18have to change here is this third step
- 00:24:20which is called insert data to knowledge
- 00:24:22right now because this this will
- 00:24:24actually upload these scraped LinkedIn
- 00:24:26posts onto your knowledge base now of
- 00:24:28course this on my knowledge base which
- 00:24:29will not be available in your relevance
- 00:24:31so you have to click here on create new
- 00:24:33right you can call it whatever you
- 00:24:35want um find tuning
- 00:24:38LinkedIn right create
- 00:24:40table and I will upload it to that
- 00:24:43knowledge base in your relevance AI
- 00:24:45account now here actually I used a
- 00:24:46little bit of code to transform that
- 00:24:49scrape data into um an array of objects
- 00:24:52which we need for uploading it to our
- 00:24:55relevance AI knowledge base and here you
- 00:24:57can actually change
- 00:24:58you will have to change the amount of
- 00:25:00LinkedIn post per LinkedIn URL to
- 00:25:03retrieve right so let's say one out 50
- 00:25:05but you can change this to if you want a
- 00:25:07different number so uh that's what we do
- 00:25:11uh so let's say I want to do 100 for now
- 00:25:1250 for each company uh and what we do is
- 00:25:15we can just run
- 00:25:23it so it's scraping all the profiles now
- 00:25:26it's transforming it into the right
- 00:25:28array of objects right to upload it to
- 00:25:30our knowledge
- 00:25:33base and here you can see it's inserted
- 00:25:35it so we can see it
- 00:25:38now and we can see now we have all the
- 00:25:41scraped LinkedIn post here in the
- 00:25:42knowledge base right we are you official
- 00:25:45apology yesterday video yeah whatever so
- 00:25:48you now we from here we can just uh
- 00:25:50export it into a CSV so that's what we
- 00:25:52do
- 00:25:58so now we've downloaded it and we have
- 00:26:00to do one more thing which is actually
- 00:26:02adding two empty columns right before we
- 00:26:04take the next step which is transforming
- 00:26:06this into a Json L file right so we just
- 00:26:09open a Google um Google Sheets we import
- 00:26:13and we import
- 00:26:15the um the CSV we just exported right oh
- 00:26:19it still loading right so we add that
- 00:26:23one
- 00:26:31and then we can delete this assistant
- 00:26:33row right we don't need that and then
- 00:26:35we're going to add in because these are
- 00:26:37basically the the the the the the tool
- 00:26:40outputs right or the the model outputs
- 00:26:42right but to train these models we also
- 00:26:44need the prompt right for these outputs
- 00:26:47and we also need the system message or
- 00:26:49the system prompt um just like the roll
- 00:26:52prompt in this case so we're going to
- 00:26:54leave those empty for now because we're
- 00:26:56going to add in those later so we just
- 00:26:57going to add in two um two empty columns
- 00:27:02on the
- 00:27:04left right and like this we're just
- 00:27:06going to export it again so LinkedIn F
- 00:27:10turn um whatever hop spot right
- 00:27:15so we go and Export this into a
- 00:27:24CSV right now the CSV file and now we
- 00:27:26have to convert that into adjacent L now
- 00:27:28easiest way to found uh to do that which
- 00:27:30I found is through a platform or website
- 00:27:33called novel crafter I'll share the link
- 00:27:35in the description below too where they
- 00:27:36have a very simple tool to to do this
- 00:27:39right so we can just upload our our file
- 00:27:42here right
- 00:27:45so so we upload our
- 00:27:49file and basically Auto automatically
- 00:27:51you can see it added in all these um all
- 00:27:54the posts inside of the assistant
- 00:27:56message right and the assistant message
- 00:27:58is basically our our output right where
- 00:28:01you can see we also have uh the user
- 00:28:04message here and the system message
- 00:28:06right which is a system prompt now do we
- 00:28:08actually have to add in a prompt I've
- 00:28:10experimented a lot with this and in my
- 00:28:12experience actually I've tried like sort
- 00:28:14of like describing what the post is
- 00:28:16about like to maybe give it a bit more
- 00:28:18context but actually my experience it
- 00:28:19works best when you leave the prompt
- 00:28:21field empty while training this data
- 00:28:24right um so we're leaving that empty and
- 00:28:26we're just going to add in a system
- 00:28:28prompts right so in this case you could
- 00:28:31add something like you are uh world
- 00:28:34class LinkedIn post writer you just give
- 00:28:39it a roll right with some
- 00:28:40characteristics the post it's writing
- 00:28:42right so normally you could sort of
- 00:28:44check what kind of posts you like right
- 00:28:46what what what sort of the
- 00:28:47characteristics of them um in this case
- 00:28:49I haven't checked but let's say uh um
- 00:28:53your four let's say four hopspot and
- 00:28:57pipe
- 00:28:59D and uh whatever always use emojis
- 00:29:03right really really bad prompt but uh
- 00:29:07you understand uh what what you should
- 00:29:09do here for example the other one I got
- 00:29:11like you know use short Punchy sentences
- 00:29:13um value driven always include a you
- 00:29:16know CTA so you can sort of look at the
- 00:29:18post and describe the characteristics
- 00:29:20inside of the system message right so
- 00:29:22once you've done that you can then click
- 00:29:24on set for all right and then it will
- 00:29:26automatically set it the system message
- 00:29:28for all of these different posts and the
- 00:29:30user message we leave empty um of course
- 00:29:33you could try maybe in your experience
- 00:29:35it works better if you actually put in a
- 00:29:36prompt uh but it also saves time uh and
- 00:29:40then we can here just click on download
- 00:29:41Json L right and that's the type of file
- 00:29:44we need to actually start uh fine-tuning
- 00:29:46our model now we have our JSL file all
- 00:29:49we do now is we go to platform. open.com
- 00:29:52I can imagine you have an open account
- 00:29:54by now if you don't have you can create
- 00:29:56a free account and then we go go here to
- 00:29:59uh dashboard and in your dashboard you
- 00:30:01can click here on
- 00:30:03fine-tuning and this is for free right
- 00:30:05to do until the end of September so
- 00:30:07really recommend to try it out and all
- 00:30:09we do here is we click on
- 00:30:11Create and there we can first choose on
- 00:30:14which base model we want to fine tune uh
- 00:30:17our our our model on and then here we
- 00:30:19can upload our training data which in is
- 00:30:23of course our jonl file so I don't know
- 00:30:26why it's not loading I'll do the jonl
- 00:30:28file
- 00:30:33first try
- 00:30:42again yeah that's working so you can
- 00:30:44choose your model here I would recommend
- 00:30:46choosing GPT 40 best model and it's for
- 00:30:48free anyway I don't think even on these
- 00:30:51data sets we're using which is like a
- 00:30:53few hundred this will be actually very
- 00:30:55cheap even though even if you have to
- 00:30:56pay uh it will probably
- 00:30:58not be more than a few dollars so you
- 00:31:01upload your JSL file and the rest you
- 00:31:03don't really have to touch you can
- 00:31:04change the name here if you want so we
- 00:31:06can say something like typ Drive um
- 00:31:10right and this the seed you can IGN
- 00:31:12ignore this for now of course you can
- 00:31:14play around with it when you get better
- 00:31:15but uh you don't have to really touch
- 00:31:17this and then you just click
- 00:31:19create and then it starts fine tuning
- 00:31:22mod now this will actually take some
- 00:31:23time right so uh on a data set like this
- 00:31:26100 probably takes around around 20
- 00:31:28minutes to 30 minutes but of course if
- 00:31:30you bigger data data set it can take up
- 00:31:32to a few hours or a couple of hours and
- 00:31:35you can actually when it's done sort of
- 00:31:37play around with it here in the open ey
- 00:31:39playground you can also sort of compare
- 00:31:41it to the original base model uh to see
- 00:31:44to see the differences and if you like
- 00:31:46the model and then once you like the
- 00:31:47model and you actually want to give it
- 00:31:48to an agent uh I'm going to show you
- 00:31:52right now how you can do that right so
- 00:31:54it's not extremely straightforward in
- 00:31:55relevance AI to get access to your own f
- 00:31:57model but I explain right now how to do
- 00:31:59it so if you're in your relevance SI
- 00:32:02dashboard um actually I will I will also
- 00:32:06share um the tool of this one in uh in
- 00:32:11the description below too so it makes it
- 00:32:13a lot easier for you to do this yourself
- 00:32:16so but I'll still show you how to do
- 00:32:17this because you will have to adjust
- 00:32:18some things so unfortunately we can't
- 00:32:21actually uh use the L&M step inside a
- 00:32:23relevance AI right because normally you
- 00:32:25can see L&M we can actually choose our
- 00:32:27model like this too but the problem is
- 00:32:29it won't allow us to add in our own fine
- 00:32:32tuned model it will only allow the major
- 00:32:34model so instead of the L&M model we
- 00:32:35actually have to use an API step um now
- 00:32:38again I will share this template so all
- 00:32:40you'd have to change here because the
- 00:32:42the all of these were already configured
- 00:32:45for you is the API key here right so
- 00:32:48behind Bearer you will have to add in
- 00:32:50your personal API key from open AI if
- 00:32:52you don't know where to find it you can
- 00:32:53go back and here you have a section with
- 00:32:55API key there you can generate it and
- 00:32:58you add that in here behind beer right
- 00:33:00make sure to have a space and then put
- 00:33:02in your API key then this you can leave
- 00:33:04the same content type application Json
- 00:33:06and the authorization and then here the
- 00:33:08body type is raw then we have to add in
- 00:33:10this uh Json uh string which basically
- 00:33:15has a few things the first one here is
- 00:33:16the model which would you would have to
- 00:33:18change right so this part you CH change
- 00:33:20out for your own fine tube model now
- 00:33:21where do you find that number really
- 00:33:23easy you go here on your F Tube model
- 00:33:26and here you have the name of the model
- 00:33:28right so you copy this and you paste
- 00:33:30that in
- 00:33:32there right and uh here you have the
- 00:33:35system prompt right which you can add in
- 00:33:37here too you can just write it in right
- 00:33:39so you probably want to change this
- 00:33:41too and uh and then lastly here we have
- 00:33:44the content which is our prompt of
- 00:33:46course right which prompt are we going
- 00:33:48to send to our uh fine tune model now in
- 00:33:51this case I've given of course my agent
- 00:33:54access to write this so my agent just
- 00:33:56adds in the prompt in to the variable
- 00:33:58right here the user input right and then
- 00:34:01we passing that prompt to the API to
- 00:34:04actually get the outcome of our fine
- 00:34:07tube model now I actually add in one
- 00:34:08more step because unfortunately this API
- 00:34:11step the way we're doing it it can't
- 00:34:13accept like these special characters or
- 00:34:15you know bold or things like that it
- 00:34:17will give an error so I just added in
- 00:34:19one more step here which is before it
- 00:34:22actually um calls our F Tube model we
- 00:34:25pass in that prompt which it gets from
- 00:34:27the agent below you'll see a prompt the
- 00:34:28only job is to take out special
- 00:34:30formatting for the prompt below do not
- 00:34:31change any uh anything or add add or
- 00:34:34take away any text right so then we
- 00:34:36actually pass this variable inside of
- 00:34:38the API col right and we do that here by
- 00:34:42just adding it in the strings right and
- 00:34:44adding in the variable right so that's
- 00:34:47that's the way you can also change the
- 00:34:48max tokens here right we can add that a
- 00:34:51little bit to that and you can change
- 00:34:52the temperature not recommendable
- 00:34:54especially if you're using these fine T
- 00:34:55models because they will start
- 00:34:56hallucinating very quick quickly so uh
- 00:35:00that should be it uh lastly you can
- 00:35:03actually change the output right because
- 00:35:05the normal API call you get a response
- 00:35:07body which is sort of a piece of codes
- 00:35:09Etc all we want back really from this
- 00:35:11step is a message right the output of
- 00:35:13our fine tuned LM so the way you do that
- 00:35:16you'll see that when you uh do this
- 00:35:19you'll actually have two other outputs
- 00:35:21which is the response body and another
- 00:35:22one the status I think you could just
- 00:35:24take those away by clicking on the this
- 00:35:27here and then you can add in uh a new
- 00:35:30one right add new input and there you
- 00:35:32just add this one right which is the
- 00:35:34message right you'll find that in your
- 00:35:36variables right I find I don't find that
- 00:35:38right now because I haven't run it but
- 00:35:40you'll find it when once you've run it
- 00:35:42and then you can uh you can add that and
- 00:35:45you can change also the the the name
- 00:35:47here message and then basically what it
- 00:35:49will do is will only output message
- 00:35:51there and that's Bas the output of our
- 00:35:53fine tun nlm we don't want really
- 00:35:55anything else so that's it it that's how
- 00:35:58you set it up and give it to your agent
- 00:36:00uh quite straightforward and easy I
- 00:36:02think the hardest part again is
- 00:36:03preparing the data set um but I think
- 00:36:06really interesting use cases especially
- 00:36:08for this Stone of voice uh I think you
- 00:36:11this the you can really start
- 00:36:13implementing these things in your in
- 00:36:14your builds and to make them better and
- 00:36:17uh yeah I think these models will only
- 00:36:19get better and this fine tuning will get
- 00:36:20better so I see a bright future in in
- 00:36:23fine tuning these models and as I said
- 00:36:25before giving agents access to this sort
- 00:36:27of knowledge bases tools and fine tube
- 00:36:29models we can make these agent systems
- 00:36:32even more powerful now if you're still
- 00:36:34with me thank you so much for watching
- 00:36:35again uh if you're interested uh please
- 00:36:38check out my uh my community I'm really
- 00:36:40excited to get started and uh work
- 00:36:42together with you guys there so check it
- 00:36:44out if you're if you're interested and
- 00:36:46uh again thank you so much and I'll see
- 00:36:48you in the next one
- AI agents
- fine-tuning
- content creation
- no-code tutorial
- OpenAI
- Relevance AI
- digital strategy
- social media marketing
- automation
- customer service