Fine tuning LLMs for Memorization

Поделиться
HTML-код
  • Опубликовано: 1 янв 2025

Комментарии • 59

  • @bobg-abc123
    @bobg-abc123 10 месяцев назад +26

    You have the best AI content out there hands down. While other people are just out there parroting the obvious you are actually teaching how this stuff really works. I thank you!

  • @yashm1735
    @yashm1735 3 дня назад

    Just 15 minutes in, and you have taught me things I didn't know, and taught them in such a way that I understood every single point as if it were obvious. Love this video!

  • @HistoryIsAbsurd
    @HistoryIsAbsurd 10 месяцев назад +2

    Awesome, always a good day when you upload. Thanks again good sir!

  • @ojilee
    @ojilee 7 месяцев назад +3

    This guy is a professor? excellent!!!!

  • @johnkidsman
    @johnkidsman 2 месяца назад

    Awesome video and very good learning material both for beginners and more advanced! Thank you!

  • @soccer2themax
    @soccer2themax 5 месяцев назад

    New to fine tuning and found this extremely helpful. Thank you for putting it together.

  • @abhishekjakhotiya9144
    @abhishekjakhotiya9144 3 месяца назад

    You create very high quality content. Thank you so much.

  • @unsaturated8482
    @unsaturated8482 10 месяцев назад +1

    awesome, was waiting for this

  • @JulianHarris
    @JulianHarris 10 месяцев назад

    Wow I’d appreciated rephrasing for data augmentation in general but not specifically to handle the reversal curse. Brilliant insight!

  • @hanzo_process
    @hanzo_process 4 месяца назад

    this is really useful, the best thing i found on youtube

  • @СтаниславКолчин-н7ы
    @СтаниславКолчин-н7ы 5 месяцев назад

    amazing video guide. thank you man!

  • @francycharuto
    @francycharuto 10 месяцев назад

    Wow! Glad I found you

  • @alchemication
    @alchemication 10 месяцев назад +1

    This is very cool, and indeed similar to my recent approach to data generation for gpt3.5 fine tuning (needed milti-lingual support). It would be great to evaluate the diff in performance between FT and RAGs, as in theiry RAGs might be easier to manage when data changes more often, right?

    • @TrelisResearch
      @TrelisResearch  10 месяцев назад +1

      Yes, definitely RAG generally the preferred option. I'm just separating here and focusing on fine-tuning, will be back fairly soon with more on the RAG front.

  • @felipeekeziarosa4270
    @felipeekeziarosa4270 6 месяцев назад

    Awesome. Congrats 🎉

  • @kshitijdesai2402
    @kshitijdesai2402 2 месяца назад

    Awesome tutorials, we should be friends😀

  • @abhisheksingh1510
    @abhisheksingh1510 10 месяцев назад +2

    Excellent

  • @ShijunJu
    @ShijunJu 2 месяца назад

    Is there a way to finetune LLM to say I don't know? This is very important for domain-specific LLMs. Thanks.

    • @TrelisResearch
      @TrelisResearch  Месяц назад

      It will also be subject to hallucination, but you have two options:
      1. Train and prompt the llm to only answer based on info provided by the context/RAG
      2. add some rows of data with "wrong/difficult/unknown" questions and have the answer be "I don't know". Probably less robust

    • @ShijunJu
      @ShijunJu Месяц назад

      @@TrelisResearch I'm finetuning the model to memorize certain data, so I should probably go with the second approach. Thanks. Your videos are immensely helpful!

  • @loicbaconnier9150
    @loicbaconnier9150 10 месяцев назад +1

    Awasome video

  • @嗟怀人
    @嗟怀人 2 месяца назад

    Wow, that's such an excellent tutorial. But I have a question, is the process of generating testing samples the same as training samples? Is the difference between the two just a difference in the number of question and answer pairs generated?

    • @TrelisResearch
      @TrelisResearch  2 месяца назад

      Yes! And yea you want more samples for training. For eval you want enough to be statistically significant when measuring improvement

    • @嗟怀人
      @嗟怀人 2 месяца назад

      @@TrelisResearch Thanks!!! It really helped me a lot!!! But how do you ensure the quality of generated dataset? Is there a method to evaluate?

    • @TrelisResearch
      @TrelisResearch  2 месяца назад

      @@嗟怀人 Well if your training run scores well on evaluation / validation questions, then you know it's good!

  • @Vman-j5u
    @Vman-j5u 10 месяцев назад

    Thanks for this tutorial! How does this approach compare to something like MemGPT?

    • @TrelisResearch
      @TrelisResearch  9 месяцев назад +1

      I'm not intimately familiar with MemGPT but it involves taking your conversation history and storing it in a database so it can be reused. By comparison, if you fine-tuning, you are actually updating the model weights to incorporate the info (which will be faster as an approach, but takes the effort and skill to actually do the fine-tuning).

    • @Vman-j5u
      @Vman-j5u 9 месяцев назад

      Thank you!@@TrelisResearch

  • @sergei202
    @sergei202 10 месяцев назад

    As always, great content! But why is the video quality limited to 720p?

    • @TrelisResearch
      @TrelisResearch  10 месяцев назад +1

      hmm, thanks, I'm going to check that going forward and aim to upload higher.

    • @TrelisResearch
      @TrelisResearch  9 месяцев назад +2

      ok, yeah, thanks, I realised my computer camera is 720p, I'm going to shoot with a better camera from now on.

    • @eric-theodore-cartman6151
      @eric-theodore-cartman6151 6 месяцев назад +1

      ​@@TrelisResearch The camera quality might be 720p but the content quality is 4k!

  • @dontworry2605
    @dontworry2605 6 месяцев назад

    Hello, I was manually putting chat_template for Llama3 myself before I watched this video. I try messages format now storeing all messages as a string in huggingface dataset but my model dosen't learn well that way. It outputs system roles Instruction sometimes and mostly it converse with it self it thinks all roles is its role. How can I fix this if you can you recommend something I will be appriciate it thx for the video btw.

    • @TrelisResearch
      @TrelisResearch  6 месяцев назад

      howdy, yeah I'd recommend starting off with a really simple example with just a few rows of data and trying that on a small model. you can also check out the livestream videos on this channel, there is one where I cover chat templates

  • @divyagarh
    @divyagarh 10 месяцев назад

    Can I use this fine-tuning script for Llam2 models?

  • @aasembakhshi
    @aasembakhshi 10 месяцев назад

    Great stuff, as always.
    How good would this approach be for text inviting higher order QA such as philosophy or sociology texts?
    Thanks.

    • @TrelisResearch
      @TrelisResearch  10 месяцев назад

      Hmm, could you reframe your question, maybe with an example - to help me better respond

    • @aasembakhshi
      @aasembakhshi 10 месяцев назад

      In all the example implementations, may it be with embeddings or fine tuning, QA is usually posed to use cases with factual data like rule book or manuals or stuff like that.
      What about very complex and multilayered texts like history or philosophy? For example if we use GPT4 to chat with a book like History of Western Philosophy, it will reply that who is the author and other factual questions but won't be able to carry out a deep discussion keeping material of the book in context.
      So can we use LLMs as memory machines of Philosophy or History tomes?

  • @adidevbhattacharya9220
    @adidevbhattacharya9220 9 месяцев назад

    Can this same strategy of synthetic data be effective for fine-tuning gpt on openai platform?
    So basically consider this:
    I have a short story(around 10k tokens long). I have divided the entire story into list of situations and incidents(around 13). For each incidents I have the original text from the story. Now I create questions from different angles for each incidents.
    When a user asks query to my system, will the fine-tuned gpt be able to identify the incident in which this question lies?
    What I think is that fine-tuning and iverfitting on rugby rules is quite easier that on some story or novel. Becasue in case of rugby rules you have one word or one-liner answer. In case of stories their is context in the first paragraph as well as the ending paragraphs too and therefore it makes it more tough imo.
    For e.g. If you had to ask about the nature of Harry Porter, there is no one line answer, the model needs to know context from various paragraphs before answering it
    Correct me if I am wrong and if possible can you try memorization of novel or a story, I think its a more intelligent system that QnA on set of rules.
    Thanks!

    • @TrelisResearch
      @TrelisResearch  9 месяцев назад

      Yes, I think the same concept can be used, and I agree you are right that it will take more (and longer) synthetic data to achieve the same effect. Starting with situations/incidents/plot-points makes good sense.

    • @adidevbhattacharya9220
      @adidevbhattacharya9220 9 месяцев назад

      Can you maybe prepare a brief guide on the steps(or a video) for giving knowledge base of some novel or story.
      Thanks@@TrelisResearch

    • @TrelisResearch
      @TrelisResearch  9 месяцев назад

      ​@@adidevbhattacharya9220 it's a good thought, but probably be a while before I come back around to the storytelling use case, as I've laid out the basic approach here and people can build on that.
      Probably it makes sense to do unsupervised fine-tuning on the novel and then additionally do this supervised fine-tuning approach with some plot points from each chapter.

  • @realshyfox5374
    @realshyfox5374 6 месяцев назад

    Hy. What about teaching the model some definitions that must be given to the user as it is without changing the answer or generalised.

    • @TrelisResearch
      @TrelisResearch  6 месяцев назад

      hmm, can you clarify your question here?

  • @EminTemiz
    @EminTemiz 10 месяцев назад

    a noob question: why are you not training on the PDF itself but converting to chat and training on the chat?

    • @TrelisResearch
      @TrelisResearch  10 месяцев назад +4

      a) The LLM needs to see the knowledge from different angles (otherwise it will only be fine-tuned on those exact phrases and won't generalise as well
      b) if you just fine-tune on the pdf, the LLM will start losing the ability to respond in chat format (because the pdf is not chat format).

  • @LairdForet
    @LairdForet 28 дней назад

    Another great video thanks: (BhamDeFiGuy)

  • @AnoniChocolateMoose
    @AnoniChocolateMoose 10 месяцев назад

    batch size 0.o