From a74cdb6a6a69d4902ce1c718db218b03bc068687 Mon Sep 17 00:00:00 2001 From: sujung Date: Mon, 13 Oct 2025 15:50:24 +0900 Subject: [PATCH 1/4] docs: ko: fine-tuning.mdx --- units/ko/_toctree.yml | 6 +++- units/ko/bonus-unit1/fine-tuning.mdx | 49 ++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 units/ko/bonus-unit1/fine-tuning.mdx diff --git a/units/ko/_toctree.yml b/units/ko/_toctree.yml index caefd9a8e..a4ef6553c 100644 --- a/units/ko/_toctree.yml +++ b/units/ko/_toctree.yml @@ -41,4 +41,8 @@ - title: Bonus Unit 1. Fine-tuning an LLM for Function-calling sections: - local: bonus-unit1/introduction - title: Introduction \ No newline at end of file + title: Introduction + - local: bonus-unit1/what-is-function-calling + title: What is Function Calling? + - local: bonus-unit1/what-is-function-calling + title: fine-tuning \ No newline at end of file diff --git a/units/ko/bonus-unit1/fine-tuning.mdx b/units/ko/bonus-unit1/fine-tuning.mdx new file mode 100644 index 000000000..b855d82c1 --- /dev/null +++ b/units/ko/bonus-unit1/fine-tuning.mdx @@ -0,0 +1,49 @@ +# Let's Fine-Tune Your Model for Function-Calling + +We're now ready to fine-tune our first model for function-calling ๐Ÿ”ฅ. + +## How do we train our model for function-calling? + +> Answer: We need **data** + +A model training process can be divided into 3 steps: + +1. **The model is pre-trained on a large quantity of data**. The output of that step is a **pre-trained model**. For instance, [google/gemma-2-2b](https://huggingface.co/google/gemma-2-2b). It's a base model and only knows how **to predict the next token without strong instruction following capabilities**. + +2. To be useful in a chat context, the model then needs to be **fine-tuned** to follow instructions. In this step, it can be trained by model creators, the open-source community, you, or anyone. For instance, [google/gemma-2-2b-it](https://huggingface.co/google/gemma-2-2b-it) is an instruction-tuned model by the Google Team behind the Gemma project. + +3. The model can then be **aligned** to the creator's preferences. For instance, a customer service chat model that must never be impolite to customers. + +Usually a complete product like Gemini or Mistral **will go through all 3 steps**, whereas the models you can find on Hugging Face have completed one or more steps of this training. + +In this tutorial, we will build a function-calling model based on [google/gemma-2-2b-it](https://huggingface.co/google/gemma-2-2b-it). We choose the fine-tuned model [google/gemma-2-2b-it](https://huggingface.co/google/gemma-2-2b-it) instead of the base model [google/gemma-2-2b](https://huggingface.co/google/gemma-2-2b) because the fine-tuned model has been improved for our use-case. + +Starting from the pre-trained model **would require more training in order to learn instruction following, chat AND function-calling**. + +By starting from the instruction-tuned model, **we minimize the amount of information that our model needs to learn**. + +## LoRA (Low-Rank Adaptation of Large Language Models) + +LoRA is a popular and lightweight training technique that significantly **reduces the number of trainable parameters**. + +It works by **inserting a smaller number of new weights as an adapter into the model to train**. This makes training with LoRA much faster, memory-efficient, and produces smaller model weights (a few hundred MBs), which are easier to store and share. + +LoRA inference + +LoRA works by adding pairs of rank decomposition matrices to Transformer layers, typically focusing on linear layers. During training, we will "freeze" the rest of the model and will only update the weights of those newly added adapters. + +By doing so, the number of **parameters** that we need to train drops considerably as we only need to update the adapter's weights. + +During inference, the input is passed into the adapter and the base model, or these adapter weights can be merged with the base model, resulting in no additional latency overhead. + +LoRA is particularly useful for adapting **large** language models to specific tasks or domains while keeping resource requirements manageable. This helps reduce the memory **required** to train a model. + +If you want to learn more about how LoRA works, you should check out this [tutorial](https://huggingface.co/learn/nlp-course/chapter11/4?fw=pt). + +## Fine-Tuning a Model for Function-Calling + +You can access the tutorial notebook ๐Ÿ‘‰ [here](https://huggingface.co/agents-course/notebooks/blob/main/bonus-unit1/bonus-unit1.ipynb). + +Then, click on [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/#fileId=https://huggingface.co/agents-course/notebooks/blob/main/bonus-unit1/bonus-unit1.ipynb) to be able to run it in a Colab Notebook. + + From 9d0989b8788305d9279d920909ba201bfa0c1ee2 Mon Sep 17 00:00:00 2001 From: sujung Date: Mon, 13 Oct 2025 15:53:09 +0900 Subject: [PATCH 2/4] feat: gpt draft --- units/ko/bonus-unit1/fine-tuning.mdx | 50 ++++++++++++++-------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/units/ko/bonus-unit1/fine-tuning.mdx b/units/ko/bonus-unit1/fine-tuning.mdx index b855d82c1..5cae96cfa 100644 --- a/units/ko/bonus-unit1/fine-tuning.mdx +++ b/units/ko/bonus-unit1/fine-tuning.mdx @@ -1,49 +1,49 @@ -# Let's Fine-Tune Your Model for Function-Calling +# ํ•จ์ˆ˜ ํ˜ธ์ถœ(Function-Calling)์„ ์œ„ํ•œ ๋ชจ๋ธ ๋ฏธ์„ธ์กฐ์ •[[lets-fine-tune-your-model-for-function-calling]] -We're now ready to fine-tune our first model for function-calling ๐Ÿ”ฅ. +์ด์ œ ํ•จ์ˆ˜ ํ˜ธ์ถœ์„ ์œ„ํ•œ ์ฒซ ๋ฒˆ์งธ ๋ชจ๋ธ์„ ๋ฏธ์„ธ์กฐ์ •ํ•  ์ค€๋น„๊ฐ€ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค ๐Ÿ”ฅ. -## How do we train our model for function-calling? +## ํ•จ์ˆ˜ ํ˜ธ์ถœ์šฉ ๋ชจ๋ธ์€ ์–ด๋–ป๊ฒŒ ํ•™์Šตํ•˜๋‚˜์š”?[[how-do-we-train-our-model-for-function-calling]] -> Answer: We need **data** +> ๋‹ต๋ณ€: **๋ฐ์ดํ„ฐ**๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. -A model training process can be divided into 3 steps: +๋ชจ๋ธ ํ•™์Šต ๊ณผ์ •์€ ์„ธ ๋‹จ๊ณ„๋กœ ๋‚˜๋ˆŒ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. -1. **The model is pre-trained on a large quantity of data**. The output of that step is a **pre-trained model**. For instance, [google/gemma-2-2b](https://huggingface.co/google/gemma-2-2b). It's a base model and only knows how **to predict the next token without strong instruction following capabilities**. +1. **๋ชจ๋ธ์€ ๋Œ€๊ทœ๋ชจ ๋ฐ์ดํ„ฐ๋กœ ์‚ฌ์ „ ํ•™์Šต(pre-training)** ๋ฉ๋‹ˆ๋‹ค. ์ด ๋‹จ๊ณ„์˜ ๊ฒฐ๊ณผ๋ฌผ์€ **์‚ฌ์ „ ํ•™์Šต๋œ ๋ชจ๋ธ**์ž…๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด [google/gemma-2-2b](https://huggingface.co/google/gemma-2-2b)๋Š” **๋ช…๋ น์–ด๋ฅผ ๋”ฐ๋ฅด๋Š” ๋Šฅ๋ ฅ์ด ๊ฐ•ํ•˜์ง€ ์•Š์€, ๋‹ค์Œ ํ† ํฐ์„ ์˜ˆ์ธกํ•˜๋Š” ๋ฐ ํŠนํ™”๋œ ๊ธฐ๋ณธ(base) ๋ชจ๋ธ**์ž…๋‹ˆ๋‹ค. -2. To be useful in a chat context, the model then needs to be **fine-tuned** to follow instructions. In this step, it can be trained by model creators, the open-source community, you, or anyone. For instance, [google/gemma-2-2b-it](https://huggingface.co/google/gemma-2-2b-it) is an instruction-tuned model by the Google Team behind the Gemma project. +2. ์ฑ„ํŒ… ํ™˜๊ฒฝ์—์„œ ์œ ์šฉํ•˜๊ฒŒ ์‚ฌ์šฉ๋˜๊ธฐ ์œ„ํ•ด์„œ๋Š” ๋ชจ๋ธ์ด **๋ช…๋ น์–ด๋ฅผ ๋”ฐ๋ฅด๋„๋ก(fine-tuning)** ์ถ”๊ฐ€ ํ•™์Šต์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. ์ด ๋‹จ๊ณ„๋Š” ๋ชจ๋ธ ์ œ์ž‘์ž, ์˜คํ”ˆ์†Œ์Šค ์ปค๋ฎค๋‹ˆํ‹ฐ, ๋˜๋Š” ์—ฌ๋Ÿฌ๋ถ„์ด ์ง์ ‘ ์ˆ˜ํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด [google/gemma-2-2b-it](https://huggingface.co/google/gemma-2-2b-it)์€ Google์˜ Gemma ํ”„๋กœ์ ํŠธ ํŒ€์ด **๋ช…๋ น์–ด ํŠœ๋‹(instruction-tuning)** ์„ ๊ฑฐ์นœ ๋ชจ๋ธ์ž…๋‹ˆ๋‹ค. -3. The model can then be **aligned** to the creator's preferences. For instance, a customer service chat model that must never be impolite to customers. +3. ์ดํ›„ ๋ชจ๋ธ์€ ์ œ์ž‘์ž์˜ **์„ ํ˜ธ๋„์— ๋งž๊ฒŒ ์ •๋ ฌ(alignment)** ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด ๊ณ ๊ฐ ์‘๋Œ€์šฉ ์ฑ—๋ด‡ ๋ชจ๋ธ์€ ์–ด๋–ค ์ƒํ™ฉ์—์„œ๋„ ๊ณ ๊ฐ์—๊ฒŒ ๋ฌด๋ก€ํ•˜๊ฒŒ ์‘๋‹ตํ•˜์ง€ ์•Š๋„๋ก ์กฐ์ •๋˜์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. -Usually a complete product like Gemini or Mistral **will go through all 3 steps**, whereas the models you can find on Hugging Face have completed one or more steps of this training. +์ผ๋ฐ˜์ ์œผ๋กœ Gemini๋‚˜ Mistral๊ณผ ๊ฐ™์€ ์™„์„ฑ๋œ ์ œํ’ˆ์€ **์ด ์„ธ ๋‹จ๊ณ„๋ฅผ ๋ชจ๋‘ ๊ฑฐ์น˜์ง€๋งŒ**, Hugging Face์—์„œ ์ œ๊ณตํ•˜๋Š” ๋ชจ๋ธ๋“ค์€ ์ด ์ค‘ ํ•˜๋‚˜ ์ด์ƒ์˜ ๋‹จ๊ณ„๋ฅผ ์™„๋ฃŒํ•œ ์ƒํƒœ๋กœ ๊ณต๊ฐœ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. -In this tutorial, we will build a function-calling model based on [google/gemma-2-2b-it](https://huggingface.co/google/gemma-2-2b-it). We choose the fine-tuned model [google/gemma-2-2b-it](https://huggingface.co/google/gemma-2-2b-it) instead of the base model [google/gemma-2-2b](https://huggingface.co/google/gemma-2-2b) because the fine-tuned model has been improved for our use-case. +์ด ํŠœํ† ๋ฆฌ์–ผ์—์„œ๋Š” [google/gemma-2-2b-it](https://huggingface.co/google/gemma-2-2b-it)์„ ๊ธฐ๋ฐ˜์œผ๋กœ ํ•จ์ˆ˜ ํ˜ธ์ถœ ๋ชจ๋ธ์„ ๊ตฌ์ถ•ํ•ฉ๋‹ˆ๋‹ค. +๊ธฐ๋ณธ ๋ชจ๋ธ [google/gemma-2-2b](https://huggingface.co/google/gemma-2-2b) ๋Œ€์‹  **๋ช…๋ น์–ด ํŠœ๋‹๋œ ๋ชจ๋ธ** [google/gemma-2-2b-it](https://huggingface.co/google/gemma-2-2b-it)์„ ์„ ํƒํ•œ ์ด์œ ๋Š”, ์ด ๋ชจ๋ธ์ด ์šฐ๋ฆฌ์˜ ์‚ฌ์šฉ ๋ชฉ์ ์— ๋” ์ ํ•ฉํ•˜๊ฒŒ ๊ฐœ์„ ๋˜์–ด ์žˆ๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค. -Starting from the pre-trained model **would require more training in order to learn instruction following, chat AND function-calling**. +์‚ฌ์ „ ํ•™์Šต๋œ ๋ชจ๋ธ๋กœ๋ถ€ํ„ฐ ์‹œ์ž‘ํ•œ๋‹ค๋ฉด, **๋ช…๋ น์–ด ์ˆ˜ํ–‰, ๋Œ€ํ™”, ํ•จ์ˆ˜ ํ˜ธ์ถœ์„ ํ•™์Šตํ•˜๊ธฐ ์œ„ํ•ด ํ›จ์”ฌ ๋” ๋งŽ์€ ํ›ˆ๋ จ์ด ํ•„์š”**ํ•ฉ๋‹ˆ๋‹ค. -By starting from the instruction-tuned model, **we minimize the amount of information that our model needs to learn**. +๋ฐ˜๋ฉด, ๋ช…๋ น์–ด ํŠœ๋‹๋œ ๋ชจ๋ธ์—์„œ ์‹œ์ž‘ํ•˜๋ฉด **๋ชจ๋ธ์ด ์ƒˆ๋กญ๊ฒŒ ํ•™์Šตํ•ด์•ผ ํ•  ์ •๋ณด์˜ ์–‘์„ ์ตœ์†Œํ™”**ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. -## LoRA (Low-Rank Adaptation of Large Language Models) +## LoRA (๋Œ€๊ทœ๋ชจ ์–ธ์–ด ๋ชจ๋ธ์˜ ์ €๋žญํฌ ์ ์‘ ๊ธฐ๋ฒ•) [[lora-low-rank-adaptation-of-large-language-models]] -LoRA is a popular and lightweight training technique that significantly **reduces the number of trainable parameters**. +LoRA๋Š” ํ›ˆ๋ จํ•ด์•ผ ํ•˜๋Š” **ํŒŒ๋ผ๋ฏธํ„ฐ ์ˆ˜๋ฅผ ํš๊ธฐ์ ์œผ๋กœ ์ค„์—ฌ์ฃผ๋Š”**, ๋„๋ฆฌ ์‚ฌ์šฉ๋˜๋Š” ๊ฒฝ๋Ÿ‰ ํ•™์Šต ๊ธฐ๋ฒ•์ž…๋‹ˆ๋‹ค. -It works by **inserting a smaller number of new weights as an adapter into the model to train**. This makes training with LoRA much faster, memory-efficient, and produces smaller model weights (a few hundred MBs), which are easier to store and share. +์ด ๊ธฐ๋ฒ•์€ ๋ชจ๋ธ ๋‚ด๋ถ€์— **์†Œ๋Ÿ‰์˜ ์ƒˆ๋กœ์šด ๊ฐ€์ค‘์น˜๋ฅผ ์–ด๋Œ‘ํ„ฐ ํ˜•ํƒœ๋กœ ์‚ฝ์ž…ํ•ด ํ•™์Šต**ํ•˜๋„๋ก ์ž‘๋™ํ•ฉ๋‹ˆ๋‹ค. ์ด๋ฅผ ํ†ตํ•ด LoRA ํ•™์Šต์€ ํ›จ์”ฌ ๋น ๋ฅด๊ณ , ๋ฉ”๋ชจ๋ฆฌ ํšจ์œจ์ ์ด๋ฉฐ, ์ˆ˜๋ฐฑ MB ์ˆ˜์ค€์˜ **์ž‘๊ณ  ๊ฐ€๋ฒผ์šด ๊ฐ€์ค‘์น˜ ํŒŒ์ผ**์„ ์ƒ์„ฑํ•˜์—ฌ ์ €์žฅ ๋ฐ ๊ณต์œ ๊ฐ€ ์šฉ์ดํ•ฉ๋‹ˆ๋‹ค. LoRA inference -LoRA works by adding pairs of rank decomposition matrices to Transformer layers, typically focusing on linear layers. During training, we will "freeze" the rest of the model and will only update the weights of those newly added adapters. +LoRA๋Š” Transformer์˜ ์„ ํ˜• ๊ณ„์ธต(linear layer)์— **๋žญํฌ ๋ถ„ํ•ด(rank decomposition) ํ–‰๋ ฌ ์Œ์„ ์ถ”๊ฐ€**ํ•˜๋Š” ๋ฐฉ์‹์œผ๋กœ ๋™์ž‘ํ•ฉ๋‹ˆ๋‹ค. ํ•™์Šต ์ค‘์—๋Š” ๋‚˜๋จธ์ง€ ๋ชจ๋ธ์€ โ€œ๊ณ ์ •(freeze)โ€ํ•˜๊ณ , ์ƒˆ๋กœ ์ถ”๊ฐ€๋œ ์–ด๋Œ‘ํ„ฐ์˜ ๊ฐ€์ค‘์น˜๋งŒ ์—…๋ฐ์ดํŠธํ•ฉ๋‹ˆ๋‹ค. -By doing so, the number of **parameters** that we need to train drops considerably as we only need to update the adapter's weights. +์ด๋ ‡๊ฒŒ ํ•˜๋ฉด **ํ›ˆ๋ จํ•ด์•ผ ํ•  ํŒŒ๋ผ๋ฏธํ„ฐ์˜ ์ˆ˜๊ฐ€ ํฌ๊ฒŒ ๊ฐ์†Œ**ํ•˜๋ฉฐ, ์–ด๋Œ‘ํ„ฐ ๊ฐ€์ค‘์น˜๋งŒ ์—…๋ฐ์ดํŠธํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค. -During inference, the input is passed into the adapter and the base model, or these adapter weights can be merged with the base model, resulting in no additional latency overhead. +์ถ”๋ก  ์‹œ์—๋Š” ์ž…๋ ฅ์ด ์–ด๋Œ‘ํ„ฐ์™€ ๊ธฐ๋ณธ ๋ชจ๋ธ ๋ชจ๋‘๋ฅผ ํ†ต๊ณผํ•˜๋ฉฐ, ๋˜๋Š” ์–ด๋Œ‘ํ„ฐ ๊ฐ€์ค‘์น˜๋ฅผ ๊ธฐ๋ณธ ๋ชจ๋ธ๊ณผ ๋ณ‘ํ•ฉํ•  ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด ๊ฒฝ์šฐ **์ถ”๊ฐ€์ ์ธ ์ง€์—ฐ(latency)** ์—†์ด ๋™์ž‘ํ•ฉ๋‹ˆ๋‹ค. -LoRA is particularly useful for adapting **large** language models to specific tasks or domains while keeping resource requirements manageable. This helps reduce the memory **required** to train a model. +LoRA๋Š” ํŠนํžˆ **๋Œ€๊ทœ๋ชจ ์–ธ์–ด ๋ชจ๋ธ์„ ํŠน์ • ์ž‘์—…์ด๋‚˜ ๋„๋ฉ”์ธ์— ๋งž๊ฒŒ ์กฐ์ •**ํ•  ๋•Œ ์œ ์šฉํ•ฉ๋‹ˆ๋‹ค. ์ด ์ ‘๊ทผ ๋ฐฉ์‹์€ ๋ชจ๋ธ ํ•™์Šต์— ํ•„์š”ํ•œ **๋ฉ”๋ชจ๋ฆฌ ์‚ฌ์šฉ๋Ÿ‰์„ ์ค„์ด๋Š” ๋ฐ** ๋„์›€์ด ๋ฉ๋‹ˆ๋‹ค. -If you want to learn more about how LoRA works, you should check out this [tutorial](https://huggingface.co/learn/nlp-course/chapter11/4?fw=pt). +LoRA์˜ ์ž‘๋™ ๋ฐฉ์‹์— ๋Œ€ํ•ด ๋” ์ž์„ธํžˆ ์•Œ๊ณ  ์‹ถ๋‹ค๋ฉด [์ด ํŠœํ† ๋ฆฌ์–ผ](https://huggingface.co/learn/nlp-course/chapter11/4?fw=pt)์„ ์ฐธ๊ณ ํ•˜์„ธ์š”. -## Fine-Tuning a Model for Function-Calling - -You can access the tutorial notebook ๐Ÿ‘‰ [here](https://huggingface.co/agents-course/notebooks/blob/main/bonus-unit1/bonus-unit1.ipynb). - -Then, click on [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/#fileId=https://huggingface.co/agents-course/notebooks/blob/main/bonus-unit1/bonus-unit1.ipynb) to be able to run it in a Colab Notebook. +## ํ•จ์ˆ˜ ํ˜ธ์ถœ์„ ์œ„ํ•œ ๋ชจ๋ธ ๋ฏธ์„ธ์กฐ์ •[[fine-tuning-a-model-for-function-calling]] +ํŠœํ† ๋ฆฌ์–ผ ๋…ธํŠธ๋ถ์€ ๐Ÿ‘‰ [์—ฌ๊ธฐ](https://huggingface.co/agents-course/notebooks/blob/main/bonus-unit1/bonus-unit1.ipynb)์—์„œ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. +๊ทธ๋Ÿฐ ๋‹ค์Œ ์•„๋ž˜ ๋ฐฐ์ง€๋ฅผ ํด๋ฆญํ•˜๋ฉด Colab ๋…ธํŠธ๋ถ์—์„œ ์ง์ ‘ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. +[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/#fileId=https://huggingface.co/agents-course/notebooks/blob/main/bonus-unit1/bonus-unit1.ipynb) From bca2f5436478900975a461657de579caacbd822a Mon Sep 17 00:00:00 2001 From: sujung Date: Mon, 13 Oct 2025 16:46:21 +0900 Subject: [PATCH 3/4] fix: manual edits --- units/ko/bonus-unit1/fine-tuning.mdx | 32 +++++++++++++--------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/units/ko/bonus-unit1/fine-tuning.mdx b/units/ko/bonus-unit1/fine-tuning.mdx index 5cae96cfa..e63bbed08 100644 --- a/units/ko/bonus-unit1/fine-tuning.mdx +++ b/units/ko/bonus-unit1/fine-tuning.mdx @@ -1,49 +1,47 @@ -# ํ•จ์ˆ˜ ํ˜ธ์ถœ(Function-Calling)์„ ์œ„ํ•œ ๋ชจ๋ธ ๋ฏธ์„ธ์กฐ์ •[[lets-fine-tune-your-model-for-function-calling]] - -์ด์ œ ํ•จ์ˆ˜ ํ˜ธ์ถœ์„ ์œ„ํ•œ ์ฒซ ๋ฒˆ์งธ ๋ชจ๋ธ์„ ๋ฏธ์„ธ์กฐ์ •ํ•  ์ค€๋น„๊ฐ€ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค ๐Ÿ”ฅ. +# ํ•จ์ˆ˜ ํ˜ธ์ถœ(Function-Calling)์„ ์œ„ํ•œ ๋ชจ๋ธ ๋ฏธ์„ธ ์กฐ์ •[[lets-fine-tune-your-model-for-function-calling]] +--- +์ด์ œ ํ•จ์ˆ˜ ํ˜ธ์ถœ์„ ์œ„ํ•œ ์ฒซ ๋ฒˆ์งธ ๋ชจ๋ธ์„ ๋ฏธ์„ธ ์กฐ์ •ํ•  ์ค€๋น„๊ฐ€ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค ๐Ÿ”ฅ. ## ํ•จ์ˆ˜ ํ˜ธ์ถœ์šฉ ๋ชจ๋ธ์€ ์–ด๋–ป๊ฒŒ ํ•™์Šตํ•˜๋‚˜์š”?[[how-do-we-train-our-model-for-function-calling]] - +--- > ๋‹ต๋ณ€: **๋ฐ์ดํ„ฐ**๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. ๋ชจ๋ธ ํ•™์Šต ๊ณผ์ •์€ ์„ธ ๋‹จ๊ณ„๋กœ ๋‚˜๋ˆŒ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. -1. **๋ชจ๋ธ์€ ๋Œ€๊ทœ๋ชจ ๋ฐ์ดํ„ฐ๋กœ ์‚ฌ์ „ ํ•™์Šต(pre-training)** ๋ฉ๋‹ˆ๋‹ค. ์ด ๋‹จ๊ณ„์˜ ๊ฒฐ๊ณผ๋ฌผ์€ **์‚ฌ์ „ ํ•™์Šต๋œ ๋ชจ๋ธ**์ž…๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด [google/gemma-2-2b](https://huggingface.co/google/gemma-2-2b)๋Š” **๋ช…๋ น์–ด๋ฅผ ๋”ฐ๋ฅด๋Š” ๋Šฅ๋ ฅ์ด ๊ฐ•ํ•˜์ง€ ์•Š์€, ๋‹ค์Œ ํ† ํฐ์„ ์˜ˆ์ธกํ•˜๋Š” ๋ฐ ํŠนํ™”๋œ ๊ธฐ๋ณธ(base) ๋ชจ๋ธ**์ž…๋‹ˆ๋‹ค. - -2. ์ฑ„ํŒ… ํ™˜๊ฒฝ์—์„œ ์œ ์šฉํ•˜๊ฒŒ ์‚ฌ์šฉ๋˜๊ธฐ ์œ„ํ•ด์„œ๋Š” ๋ชจ๋ธ์ด **๋ช…๋ น์–ด๋ฅผ ๋”ฐ๋ฅด๋„๋ก(fine-tuning)** ์ถ”๊ฐ€ ํ•™์Šต์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. ์ด ๋‹จ๊ณ„๋Š” ๋ชจ๋ธ ์ œ์ž‘์ž, ์˜คํ”ˆ์†Œ์Šค ์ปค๋ฎค๋‹ˆํ‹ฐ, ๋˜๋Š” ์—ฌ๋Ÿฌ๋ถ„์ด ์ง์ ‘ ์ˆ˜ํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด [google/gemma-2-2b-it](https://huggingface.co/google/gemma-2-2b-it)์€ Google์˜ Gemma ํ”„๋กœ์ ํŠธ ํŒ€์ด **๋ช…๋ น์–ด ํŠœ๋‹(instruction-tuning)** ์„ ๊ฑฐ์นœ ๋ชจ๋ธ์ž…๋‹ˆ๋‹ค. - -3. ์ดํ›„ ๋ชจ๋ธ์€ ์ œ์ž‘์ž์˜ **์„ ํ˜ธ๋„์— ๋งž๊ฒŒ ์ •๋ ฌ(alignment)** ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด ๊ณ ๊ฐ ์‘๋Œ€์šฉ ์ฑ—๋ด‡ ๋ชจ๋ธ์€ ์–ด๋–ค ์ƒํ™ฉ์—์„œ๋„ ๊ณ ๊ฐ์—๊ฒŒ ๋ฌด๋ก€ํ•˜๊ฒŒ ์‘๋‹ตํ•˜์ง€ ์•Š๋„๋ก ์กฐ์ •๋˜์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. +1. **๋ชจ๋ธ์€ ๋Œ€๊ทœ๋ชจ ๋ฐ์ดํ„ฐ๋กœ ์‚ฌ์ „ ํ•™์Šต(pre-training)** ๋ฉ๋‹ˆ๋‹ค. ์ด ๋‹จ๊ณ„์˜ ๊ฒฐ๊ณผ๋ฌผ์€ **์‚ฌ์ „ ํ•™์Šต๋œ ๋ชจ๋ธ**์ž…๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด [google/gemma-2-2b](https://huggingface.co/google/gemma-2-2b)๋Š” **์ง€์‹œ๋ฌธ์„ ๋”ฐ๋ฅด๋Š” ๋Šฅ๋ ฅ์ด ๊ฐ•ํ•˜์ง€ ์•Š์€, ๋‹ค์Œ ํ† ํฐ์„ ์˜ˆ์ธกํ•˜๋Š” ๋ฐ ํŠนํ™”๋œ ๊ธฐ๋ณธ(base) ๋ชจ๋ธ**์ž…๋‹ˆ๋‹ค. +2. ์ฑ„ํŒ… ํ™˜๊ฒฝ์—์„œ ์œ ์šฉํ•˜๊ฒŒ ์‚ฌ์šฉ๋˜๊ธฐ ์œ„ํ•ด์„œ๋Š” ๋ชจ๋ธ์ด **๋ช…๋ น์–ด๋ฅผ ๋”ฐ๋ฅด๋„๋ก(fine-tuning)** ์ถ”๊ฐ€ ํ•™์Šต์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. ์ด ๋‹จ๊ณ„๋Š” ๋ชจ๋ธ ๊ฐœ๋ฐœ์ž, ์˜คํ”ˆ์†Œ์Šค ์ปค๋ฎค๋‹ˆํ‹ฐ, ๋˜๋Š” ์—ฌ๋Ÿฌ๋ถ„์ด ์ง์ ‘ ์ˆ˜ํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด [google/gemma-2-2b-it](https://huggingface.co/google/gemma-2-2b-it)์€ Google์˜ Gemma ํ”„๋กœ์ ํŠธ ํŒ€์ด **์ง€์‹œ๋ฌธ ๊ธฐ๋ฐ˜ ๋ฏธ์„ธ ์กฐ์ •(instruction-tuning)** ์„ ๊ฑฐ์นœ ๋ชจ๋ธ์ž…๋‹ˆ๋‹ค. +3. ์ดํ›„ ๋ชจ๋ธ์€ ๊ฐœ๋ฐœ์ž์˜ ์„ ํ˜ธ๋„์— ๋งž๊ฒŒ **์กฐ์ •(alignment)** ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด ๊ณ ๊ฐ ์‘๋Œ€์šฉ ์ฑ—๋ด‡ ๋ชจ๋ธ์€ ์–ด๋–ค ์ƒํ™ฉ์—์„œ๋„ ๊ณ ๊ฐ์—๊ฒŒ ๋ฌด๋ก€ํ•˜๊ฒŒ ์‘๋‹ตํ•˜์ง€ ์•Š๋„๋ก ์กฐ์ •๋˜์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์ผ๋ฐ˜์ ์œผ๋กœ Gemini๋‚˜ Mistral๊ณผ ๊ฐ™์€ ์™„์„ฑ๋œ ์ œํ’ˆ์€ **์ด ์„ธ ๋‹จ๊ณ„๋ฅผ ๋ชจ๋‘ ๊ฑฐ์น˜์ง€๋งŒ**, Hugging Face์—์„œ ์ œ๊ณตํ•˜๋Š” ๋ชจ๋ธ๋“ค์€ ์ด ์ค‘ ํ•˜๋‚˜ ์ด์ƒ์˜ ๋‹จ๊ณ„๋ฅผ ์™„๋ฃŒํ•œ ์ƒํƒœ๋กœ ๊ณต๊ฐœ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. ์ด ํŠœํ† ๋ฆฌ์–ผ์—์„œ๋Š” [google/gemma-2-2b-it](https://huggingface.co/google/gemma-2-2b-it)์„ ๊ธฐ๋ฐ˜์œผ๋กœ ํ•จ์ˆ˜ ํ˜ธ์ถœ ๋ชจ๋ธ์„ ๊ตฌ์ถ•ํ•ฉ๋‹ˆ๋‹ค. -๊ธฐ๋ณธ ๋ชจ๋ธ [google/gemma-2-2b](https://huggingface.co/google/gemma-2-2b) ๋Œ€์‹  **๋ช…๋ น์–ด ํŠœ๋‹๋œ ๋ชจ๋ธ** [google/gemma-2-2b-it](https://huggingface.co/google/gemma-2-2b-it)์„ ์„ ํƒํ•œ ์ด์œ ๋Š”, ์ด ๋ชจ๋ธ์ด ์šฐ๋ฆฌ์˜ ์‚ฌ์šฉ ๋ชฉ์ ์— ๋” ์ ํ•ฉํ•˜๊ฒŒ ๊ฐœ์„ ๋˜์–ด ์žˆ๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค. +๊ธฐ๋ณธ ๋ชจ๋ธ [google/gemma-2-2b](https://huggingface.co/google/gemma-2-2b) ๋Œ€์‹  **์ง€์‹œ๋ฌธ์„ ๊ธฐ๋ฐ˜์œผ๋กœ ๋ฏธ์„ธ ์กฐ์ •๋œ ๋ชจ๋ธ** [google/gemma-2-2b-it](https://huggingface.co/google/gemma-2-2b-it)์„ ์‚ฌ์šฉํ•˜๋Š” ์ด์œ ๋Š”, ํ•ด๋‹น ๋ชจ๋ธ์ด ์šฐ๋ฆฌ์˜ ์‚ฌ์šฉ ๋ชฉ์ ์— ๋” ์ตœ์ ํ™”๋˜์–ด ์žˆ๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค. ์‚ฌ์ „ ํ•™์Šต๋œ ๋ชจ๋ธ๋กœ๋ถ€ํ„ฐ ์‹œ์ž‘ํ•œ๋‹ค๋ฉด, **๋ช…๋ น์–ด ์ˆ˜ํ–‰, ๋Œ€ํ™”, ํ•จ์ˆ˜ ํ˜ธ์ถœ์„ ํ•™์Šตํ•˜๊ธฐ ์œ„ํ•ด ํ›จ์”ฌ ๋” ๋งŽ์€ ํ›ˆ๋ จ์ด ํ•„์š”**ํ•ฉ๋‹ˆ๋‹ค. -๋ฐ˜๋ฉด, ๋ช…๋ น์–ด ํŠœ๋‹๋œ ๋ชจ๋ธ์—์„œ ์‹œ์ž‘ํ•˜๋ฉด **๋ชจ๋ธ์ด ์ƒˆ๋กญ๊ฒŒ ํ•™์Šตํ•ด์•ผ ํ•  ์ •๋ณด์˜ ์–‘์„ ์ตœ์†Œํ™”**ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. +๋ฐ˜๋ฉด, ์ง€์‹œ๋ฌธ์„ ๊ธฐ๋ฐ˜์œผ๋กœ ๋ฏธ์„ธ ์กฐ์ •๋œ ๋ชจ๋ธ์—์„œ ์‹œ์ž‘ํ•˜๋ฉด **๋ชจ๋ธ์ด ์ƒˆ๋กญ๊ฒŒ ํ•™์Šตํ•ด์•ผ ํ•  ์ •๋ณด์˜ ์–‘์„ ์ตœ์†Œํ™”**ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. -## LoRA (๋Œ€๊ทœ๋ชจ ์–ธ์–ด ๋ชจ๋ธ์˜ ์ €๋žญํฌ ์ ์‘ ๊ธฐ๋ฒ•) [[lora-low-rank-adaptation-of-large-language-models]] +## LoRA (๋Œ€๊ทœ๋ชจ ์–ธ์–ด ๋ชจ๋ธ์˜ ์ €์ฐจ์› ์ ์‘ ๊ธฐ๋ฒ•) [[lora-low-rank-adaptation-of-large-language-models]] LoRA๋Š” ํ›ˆ๋ จํ•ด์•ผ ํ•˜๋Š” **ํŒŒ๋ผ๋ฏธํ„ฐ ์ˆ˜๋ฅผ ํš๊ธฐ์ ์œผ๋กœ ์ค„์—ฌ์ฃผ๋Š”**, ๋„๋ฆฌ ์‚ฌ์šฉ๋˜๋Š” ๊ฒฝ๋Ÿ‰ ํ•™์Šต ๊ธฐ๋ฒ•์ž…๋‹ˆ๋‹ค. -์ด ๊ธฐ๋ฒ•์€ ๋ชจ๋ธ ๋‚ด๋ถ€์— **์†Œ๋Ÿ‰์˜ ์ƒˆ๋กœ์šด ๊ฐ€์ค‘์น˜๋ฅผ ์–ด๋Œ‘ํ„ฐ ํ˜•ํƒœ๋กœ ์‚ฝ์ž…ํ•ด ํ•™์Šต**ํ•˜๋„๋ก ์ž‘๋™ํ•ฉ๋‹ˆ๋‹ค. ์ด๋ฅผ ํ†ตํ•ด LoRA ํ•™์Šต์€ ํ›จ์”ฌ ๋น ๋ฅด๊ณ , ๋ฉ”๋ชจ๋ฆฌ ํšจ์œจ์ ์ด๋ฉฐ, ์ˆ˜๋ฐฑ MB ์ˆ˜์ค€์˜ **์ž‘๊ณ  ๊ฐ€๋ฒผ์šด ๊ฐ€์ค‘์น˜ ํŒŒ์ผ**์„ ์ƒ์„ฑํ•˜์—ฌ ์ €์žฅ ๋ฐ ๊ณต์œ ๊ฐ€ ์šฉ์ดํ•ฉ๋‹ˆ๋‹ค. +์ด ๊ธฐ๋ฒ•์€ ๋ชจ๋ธ ๋‚ด๋ถ€์— **์†Œ๋Ÿ‰์˜ ์ƒˆ๋กœ์šด ๊ฐ€์ค‘์น˜๋ฅผ ์–ด๋Œ‘ํ„ฐ ํ˜•ํƒœ๋กœ ์‚ฝ์ž…ํ•ด ํ•™์Šต**ํ•˜๋„๋ก ํ•ฉ๋‹ˆ๋‹ค. ์ด๋ฅผ ํ†ตํ•ด LoRA ํ•™์Šต์€ ํ›จ์”ฌ ๋น ๋ฅด๊ณ , ๋ฉ”๋ชจ๋ฆฌ ํšจ์œจ์ ์ด๋ฉฐ, ์ˆ˜๋ฐฑ MB ์ˆ˜์ค€์˜ **์ž‘๊ณ  ๊ฐ€๋ฒผ์šด ๊ฐ€์ค‘์น˜ ํŒŒ์ผ**์„ ์ƒ์„ฑํ•˜์—ฌ ์ €์žฅ ๋ฐ ๊ณต์œ ๊ฐ€ ์šฉ์ดํ•ฉ๋‹ˆ๋‹ค. LoRA inference -LoRA๋Š” Transformer์˜ ์„ ํ˜• ๊ณ„์ธต(linear layer)์— **๋žญํฌ ๋ถ„ํ•ด(rank decomposition) ํ–‰๋ ฌ ์Œ์„ ์ถ”๊ฐ€**ํ•˜๋Š” ๋ฐฉ์‹์œผ๋กœ ๋™์ž‘ํ•ฉ๋‹ˆ๋‹ค. ํ•™์Šต ์ค‘์—๋Š” ๋‚˜๋จธ์ง€ ๋ชจ๋ธ์€ โ€œ๊ณ ์ •(freeze)โ€ํ•˜๊ณ , ์ƒˆ๋กœ ์ถ”๊ฐ€๋œ ์–ด๋Œ‘ํ„ฐ์˜ ๊ฐ€์ค‘์น˜๋งŒ ์—…๋ฐ์ดํŠธํ•ฉ๋‹ˆ๋‹ค. +LoRA๋Š” Transformer์˜ ์„ ํ˜• ๊ณ„์ธต(linear layer)์— **๋žญํฌ ๋ถ„ํ•ด(rank decomposition) ํ–‰๋ ฌ ์Œ์„ ์ถ”๊ฐ€**ํ•˜๋Š” ๋ฐฉ์‹์œผ๋กœ ๋™์ž‘ํ•ฉ๋‹ˆ๋‹ค. ํ•™์Šต ์ค‘์— ๋‚˜๋จธ์ง€ ๋ชจ๋ธ์€ โ€œ๊ณ ์ •(freeze)โ€ํ•˜๊ณ , ์ƒˆ๋กœ ์ถ”๊ฐ€๋œ ์–ด๋Œ‘ํ„ฐ์˜ ๊ฐ€์ค‘์น˜๋งŒ ์—…๋ฐ์ดํŠธํ•ฉ๋‹ˆ๋‹ค. ์ด๋ ‡๊ฒŒ ํ•˜๋ฉด **ํ›ˆ๋ จํ•ด์•ผ ํ•  ํŒŒ๋ผ๋ฏธํ„ฐ์˜ ์ˆ˜๊ฐ€ ํฌ๊ฒŒ ๊ฐ์†Œ**ํ•˜๋ฉฐ, ์–ด๋Œ‘ํ„ฐ ๊ฐ€์ค‘์น˜๋งŒ ์—…๋ฐ์ดํŠธํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค. -์ถ”๋ก  ์‹œ์—๋Š” ์ž…๋ ฅ์ด ์–ด๋Œ‘ํ„ฐ์™€ ๊ธฐ๋ณธ ๋ชจ๋ธ ๋ชจ๋‘๋ฅผ ํ†ต๊ณผํ•˜๋ฉฐ, ๋˜๋Š” ์–ด๋Œ‘ํ„ฐ ๊ฐ€์ค‘์น˜๋ฅผ ๊ธฐ๋ณธ ๋ชจ๋ธ๊ณผ ๋ณ‘ํ•ฉํ•  ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด ๊ฒฝ์šฐ **์ถ”๊ฐ€์ ์ธ ์ง€์—ฐ(latency)** ์—†์ด ๋™์ž‘ํ•ฉ๋‹ˆ๋‹ค. +์ถ”๋ก  ๋‹จ๊ณ„์—์„œ๋Š” ์ž…๋ ฅ์ด ์–ด๋Œ‘ํ„ฐ์™€ ๊ธฐ๋ณธ ๋ชจ๋ธ ๋ชจ๋‘๋ฅผ ํ†ต๊ณผํ•˜๊ฑฐ๋‚˜, ์–ด๋Œ‘ํ„ฐ ๊ฐ€์ค‘์น˜๊ฐ€ ๊ธฐ๋ณธ ๋ชจ๋ธ์— ๋ณ‘ํ•ฉ๋˜์–ด ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. ์ด ๋ฐฉ์‹์€ **์ถ”๊ฐ€์ ์ธ ์ง€์—ฐ(latency)** ์„ ๋ฐœ์ƒ์‹œํ‚ค์ง€ ์•Š์Šต๋‹ˆ๋‹ค. LoRA๋Š” ํŠนํžˆ **๋Œ€๊ทœ๋ชจ ์–ธ์–ด ๋ชจ๋ธ์„ ํŠน์ • ์ž‘์—…์ด๋‚˜ ๋„๋ฉ”์ธ์— ๋งž๊ฒŒ ์กฐ์ •**ํ•  ๋•Œ ์œ ์šฉํ•ฉ๋‹ˆ๋‹ค. ์ด ์ ‘๊ทผ ๋ฐฉ์‹์€ ๋ชจ๋ธ ํ•™์Šต์— ํ•„์š”ํ•œ **๋ฉ”๋ชจ๋ฆฌ ์‚ฌ์šฉ๋Ÿ‰์„ ์ค„์ด๋Š” ๋ฐ** ๋„์›€์ด ๋ฉ๋‹ˆ๋‹ค. LoRA์˜ ์ž‘๋™ ๋ฐฉ์‹์— ๋Œ€ํ•ด ๋” ์ž์„ธํžˆ ์•Œ๊ณ  ์‹ถ๋‹ค๋ฉด [์ด ํŠœํ† ๋ฆฌ์–ผ](https://huggingface.co/learn/nlp-course/chapter11/4?fw=pt)์„ ์ฐธ๊ณ ํ•˜์„ธ์š”. -## ํ•จ์ˆ˜ ํ˜ธ์ถœ์„ ์œ„ํ•œ ๋ชจ๋ธ ๋ฏธ์„ธ์กฐ์ •[[fine-tuning-a-model-for-function-calling]] +## ํ•จ์ˆ˜ ํ˜ธ์ถœ์„ ์œ„ํ•œ ๋ชจ๋ธ ๋ฏธ์„ธ ์กฐ์ •[[fine-tuning-a-model-for-function-calling]] ํŠœํ† ๋ฆฌ์–ผ ๋…ธํŠธ๋ถ์€ ๐Ÿ‘‰ [์—ฌ๊ธฐ](https://huggingface.co/agents-course/notebooks/blob/main/bonus-unit1/bonus-unit1.ipynb)์—์„œ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋Ÿฐ ๋‹ค์Œ ์•„๋ž˜ ๋ฐฐ์ง€๋ฅผ ํด๋ฆญํ•˜๋ฉด Colab ๋…ธํŠธ๋ถ์—์„œ ์ง์ ‘ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. -[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/#fileId=https://huggingface.co/agents-course/notebooks/blob/main/bonus-unit1/bonus-unit1.ipynb) +[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/#fileId=https://huggingface.co/agents-course/notebooks/blob/main/bonus-unit1/bonus-unit1.ipynb) \ No newline at end of file From 1bab7fdce84f85c82df57652d6b6eda2256c47d8 Mon Sep 17 00:00:00 2001 From: Lee SuJung <153787023+xhaktm00@users.noreply.github.com> Date: Mon, 13 Oct 2025 17:18:29 +0900 Subject: [PATCH 4/4] Update fine-tuning.mdx --- units/ko/bonus-unit1/fine-tuning.mdx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/units/ko/bonus-unit1/fine-tuning.mdx b/units/ko/bonus-unit1/fine-tuning.mdx index e63bbed08..f2ddf0ade 100644 --- a/units/ko/bonus-unit1/fine-tuning.mdx +++ b/units/ko/bonus-unit1/fine-tuning.mdx @@ -1,9 +1,9 @@ # ํ•จ์ˆ˜ ํ˜ธ์ถœ(Function-Calling)์„ ์œ„ํ•œ ๋ชจ๋ธ ๋ฏธ์„ธ ์กฐ์ •[[lets-fine-tune-your-model-for-function-calling]] ---- + ์ด์ œ ํ•จ์ˆ˜ ํ˜ธ์ถœ์„ ์œ„ํ•œ ์ฒซ ๋ฒˆ์งธ ๋ชจ๋ธ์„ ๋ฏธ์„ธ ์กฐ์ •ํ•  ์ค€๋น„๊ฐ€ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค ๐Ÿ”ฅ. ## ํ•จ์ˆ˜ ํ˜ธ์ถœ์šฉ ๋ชจ๋ธ์€ ์–ด๋–ป๊ฒŒ ํ•™์Šตํ•˜๋‚˜์š”?[[how-do-we-train-our-model-for-function-calling]] ---- + > ๋‹ต๋ณ€: **๋ฐ์ดํ„ฐ**๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. ๋ชจ๋ธ ํ•™์Šต ๊ณผ์ •์€ ์„ธ ๋‹จ๊ณ„๋กœ ๋‚˜๋ˆŒ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. @@ -21,6 +21,7 @@ ๋ฐ˜๋ฉด, ์ง€์‹œ๋ฌธ์„ ๊ธฐ๋ฐ˜์œผ๋กœ ๋ฏธ์„ธ ์กฐ์ •๋œ ๋ชจ๋ธ์—์„œ ์‹œ์ž‘ํ•˜๋ฉด **๋ชจ๋ธ์ด ์ƒˆ๋กญ๊ฒŒ ํ•™์Šตํ•ด์•ผ ํ•  ์ •๋ณด์˜ ์–‘์„ ์ตœ์†Œํ™”**ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. + ## LoRA (๋Œ€๊ทœ๋ชจ ์–ธ์–ด ๋ชจ๋ธ์˜ ์ €์ฐจ์› ์ ์‘ ๊ธฐ๋ฒ•) [[lora-low-rank-adaptation-of-large-language-models]] LoRA๋Š” ํ›ˆ๋ จํ•ด์•ผ ํ•˜๋Š” **ํŒŒ๋ผ๋ฏธํ„ฐ ์ˆ˜๋ฅผ ํš๊ธฐ์ ์œผ๋กœ ์ค„์—ฌ์ฃผ๋Š”**, ๋„๋ฆฌ ์‚ฌ์šฉ๋˜๋Š” ๊ฒฝ๋Ÿ‰ ํ•™์Šต ๊ธฐ๋ฒ•์ž…๋‹ˆ๋‹ค. @@ -39,9 +40,10 @@ LoRA๋Š” ํŠนํžˆ **๋Œ€๊ทœ๋ชจ ์–ธ์–ด ๋ชจ๋ธ์„ ํŠน์ • ์ž‘์—…์ด๋‚˜ ๋„๋ฉ”์ธ์— ๋งž LoRA์˜ ์ž‘๋™ ๋ฐฉ์‹์— ๋Œ€ํ•ด ๋” ์ž์„ธํžˆ ์•Œ๊ณ  ์‹ถ๋‹ค๋ฉด [์ด ํŠœํ† ๋ฆฌ์–ผ](https://huggingface.co/learn/nlp-course/chapter11/4?fw=pt)์„ ์ฐธ๊ณ ํ•˜์„ธ์š”. + ## ํ•จ์ˆ˜ ํ˜ธ์ถœ์„ ์œ„ํ•œ ๋ชจ๋ธ ๋ฏธ์„ธ ์กฐ์ •[[fine-tuning-a-model-for-function-calling]] ํŠœํ† ๋ฆฌ์–ผ ๋…ธํŠธ๋ถ์€ ๐Ÿ‘‰ [์—ฌ๊ธฐ](https://huggingface.co/agents-course/notebooks/blob/main/bonus-unit1/bonus-unit1.ipynb)์—์„œ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋Ÿฐ ๋‹ค์Œ ์•„๋ž˜ ๋ฐฐ์ง€๋ฅผ ํด๋ฆญํ•˜๋ฉด Colab ๋…ธํŠธ๋ถ์—์„œ ์ง์ ‘ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. -[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/#fileId=https://huggingface.co/agents-course/notebooks/blob/main/bonus-unit1/bonus-unit1.ipynb) \ No newline at end of file +[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/#fileId=https://huggingface.co/agents-course/notebooks/blob/main/bonus-unit1/bonus-unit1.ipynb)