Top 5 LLM Fine-Tuning Use Cases You Need to Know

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
few months ago Sam Altman said Size Doesn't Matter okay maybe I oversimplified things a little what he actually said is that open AI would no longer prioritize parameter camp and the size of large language models but would instead focus on delivering capable useful and safe models and that's how we found out that event giants like open AI are hesitant to train new large models from scratch because training foundational models like gpts is difficult and expensive as a result an alternative approach has emerged fine-tuning in recent months fine tuning has seen a 1150 increase in Google searches becoming the buzzword of the summer and of course Twitter in particular is obsessed with discussions about the benefits of fine tuning so in this video I'll present five practical use cases for fine-tuning large language models that you can apply to your own personal needs or your business I just like to mention that each use case deserves its own video so with this video I'm aiming to provide just enough information to help you understand the possibilities but before diving in let's quickly Define fine fine tuning it's a process of retraining a base foundational model such as Lama or GPT or Bloom on new data so you're not teaching your large language model new information instead you're guiding it to restructure its existing knowledge in a way you're teaching the model how to behave or how to communicate in a specific manner fine-tune models offer several benefits including improved user experience higher quality results with fewer hallucinations and cost savings through shorter prompts and excellent accuracy so with that in mind let's begin with use case number one finances and investment language models have the potential to turn you into a better investor also important disclaimer this is not Financial advice however there's a catch gpts have a general understanding of a language but they're dumb when it comes to interpreting numbers and grasping Financial context but that's not a complete story because unlike a general language model a fine-tuned model could help you make better Investments how so well it's possible with sentiment analysis this is the process of determining whether someone's opinion expressed in a piece of text is negative positive or a neutral one for example Finn GPT made by an open source Community AI for finance is a fine-tuned model trained on a data set that includes financial news social media Google Trends and SEC filings authors often Jeopardy believe that their fine-tuned model can be used for building many other products to services like personalized financial advisors and investment Guidance with Rob advisors Financial education and so on and if you're interested in fingipity you can try it out right now I'm going to provide the link to Google collab demo in the description box but let's go totally run through the code now first you should install all the necessary libraries then you're going to load a pre-trained large language model which is chat glm2 6 building parameters in this case as well as Laura adapter and if any of this sounds like foreign language to you you might want to check out my latest video where I explain what the process of fine tuning actually looks like next The Prompt is going to consist of two parts the first part would be instructions what is the sentiment of this news please choose an answer from negative neutral and positive in the next line you can copy paste the news headline and Define tune fin GPT is going to analyze the sentiment behind the news and give you an answer of course copy pasting these headlines is a waste of time so you can automate this process by writing a simple python script that scrapes a website and extracts headlines which you're going to replace in a prompt for the scripting script I'm going to use beautiful soup and request modules I'm going to write a simple function that takes URL and tag as parameters and as arguments I'm going to pass URL of investors place a website where you can read news about stocks and it'll pass h2 tag and whatever headline is scraped I'm going to embed in the prompt template with fstring and voila you can now collect the latest financial news and data like Finn GPT analyze the sentiment behind the headlines and hopefully make better investment decisions other fine-tuned models for finances and Analysis are Bloomberg GPT a 15 billion parameter large language model specifically designed for a finance related tests such as sentiment analysis and news classification and financial birth a model fine-tuned for sentiment analysis task on financial phrase Bank data set although fine-tuned large language models for investment style sounds exciting I need to address some obvious limitations the most obvious one is that life is unpredictable in weird unexpected things happen all the time which makes predicting stocks very unreliable another implementation would be that models quickly become outdated it large language models are typically trained on the vast data set collected from the internet which may include information that becomes obsolete over time Second Use case would be getting models to speak in a custom tone a practical use case would be for example customer support chatbot fine-tuning a model to speak in a custom tone can be useful for creating conversational agents or chat Bots that provide personalized customer support another use case would be content generation and brand void consistency fine tuning can help create content in a specific tone or style such as blog posts social media updates or marketing material that resonates with a target audience as CEO of Lang chain Harrison Chase shared in a tweet custom tone is one of his favorite use cases for fine tuning he also included a demo that generates tweets that sound like Elon Musk in the source code that Harrison shared on GitHub you can see how he has two chains a normal one GPT 3.5 that is simply prompted to write a tweet in an Elon Musk style and a chain with fine-tuned GPT 3.5 trained on a data set that contains Elon musk's tweet and if you play with a demo you'll discover that a fine-tuned model is doing a much better job at tweeting like Elon Musk this is a very interesting and important use case so if you want me to make a video on how to build your own custom fine tune chatbot just let me know in the comments and third use case would be language translation have you ever tried to translate a sentence with a slang but then Google translate failed miserably well in this case you could use a fine-tuned model for language translation because it provides much more accurate and contextually appropriate translations and you can find a very good practical example if you go to hugging faces website there's a particular refined to inversion of T5 model that specializes in translating from Spanish to Catra and a big part of the data set has been extracted from Biblical texts which makes this model Excel a translating Christian religious text in general the most popular preach trained base models used for translation are T5 Marion Mt and M bart50 and if you want to try fine-tuning a model for language translation you can use the most popular data set on hacking Face seems to be oppos 100 an English Centric multi-lingual multilingual data set that covers 100 languages you can check it out and you can even find models that are already fine-tuned with this data set but I have to be honest with you these fine-tuned models don't really have good scores a blue score of 40 to 50 would be considered excellent but only one fine-tune model scored over 30 which means that it isn't really great at the Translating so I honestly don't know why is this data set so popular however I found another data set kde4 also available through hugging face and models trained in this data set have excellent blue score over 50. so if I ever decide to fine tune a model for language translation I'd use this data set even though Opus 100 seems to be more popular fourth use case is extracting information and structuring data models can be trained to identify and extract key data points from documents such as names dates and addresses this can be useful for automating data entry tasks and processing large volumes of text I'm going to give you a high level overview of how to find June GPT 3.5 to extract information from unstructured data in this case sports headlines and of course I'll provide the link to the code in the description Box by the way this is the example that everyone can look at on Open the Eyes website first you'll need a data set with at least 10 examples and it has to be structured and saved as Json line format which essentially consists of several lines where each individual line is a valid Json object I know that it looks quite ugly and complicated at first glance but it's actually surprisingly simple essentially Json object turned into an individual line with this data set the fine tune model will be able to identify and extract the player teams Sport and gender from the sport headlines first you're going to install and import openai module as well as such our API key next you'll upload your data set and then you'll create a file for fine tuning with this openai method Next Step a fine tuning drop is created using this method the previously created file is used as a training data and the base model is set to GPT 3.5 turbo so at this point you'll receive in your email the name of the fine tune model and you can copy paste the name of it and there's the last step you should add messages as input the first message sets the context for the task we should be the same as the task in your data set and the second message provides the prompt and then when you run the code you'll see how your fourth headline is turned into a structured output this use case is a generation of code Snippets lumps can be fine-tuned to generate code Snippets in various programming languages the most important reason to use a fine tune model instead of gpt4 for example is privacy as this user on Hacker News put it my startup does data processing for clients in aviation and finance due to security legal and regulatory requirements sending our code onto a third party for example open AI is a no-go thanks to cold llama the wizard code refined I finally been able to get AI assistance with my code some of the most exciting open source fine-tuned models are wizard coder and cold llamas find too both fine-tuned on proprietary data sets which have shown promising results in generating code Snippets of course there was a little bit of drama regarding the latter at first find publish on their blog that their model beat gpt4 which is really important news but then the community realized that fine has actually beaten an old measurement for March this year and as of right now gpt4 which Powers GitHub copilot is still the best model for God generation and if you're interested in fine-tuning your own llm I recommend some public data sets like code alpaca evil instruct code and code parent GitHub code so that's it for today thank you for watching and have a good one
Info
Channel: Maya Akim
Views: 8,488
Rating: undefined out of 5
Keywords: fine tune llm, fine tune llm colab, finetune an llm, fine tuning, fingpt, llama, bloom, t5, opus100, kde4, openai, gpt3.5, gpt3.5 fine tuning, gpt3.5 fine, data scraping, data structure, data extraction, fine tuning openai, fingpt demo, phind, wizardcoder, phind 2, ai, sentiment analysis, financial analysis, ai for business, wizardcoder ai, financial analysis case study, sentiment analysis machine learning
Id: v1R8uPqjNAU
Channel Id: undefined
Length: 11min 4sec (664 seconds)
Published: Thu Sep 07 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.