-
Couldn't load subscription status.
- Fork 1.6k
๐ [i18n-KO] Translated bonus unit1/fine-tuning.mdx to Korean
#605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -41,4 +41,8 @@ | |||||
| - title: Bonus Unit 1. Fine-tuning an LLM for Function-calling | ||||||
| sections: | ||||||
| - local: bonus-unit1/introduction | ||||||
| title: Introduction | ||||||
| title: Introduction | ||||||
| - local: bonus-unit1/what-is-function-calling | ||||||
| title: What is Function Calling? | ||||||
| - local: bonus-unit1/what-is-function-calling | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| title: fine-tuning | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,49 @@ | ||||||
| # ํจ์ ํธ์ถ(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) ๋ชจ๋ธ**์ ๋๋ค. | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| 2. ์ฑํ ํ๊ฒฝ์์ ์ ์ฉํ๊ฒ ์ฌ์ฉ๋๊ธฐ ์ํด์๋ ๋ชจ๋ธ์ด **๋ช ๋ น์ด๋ฅผ ๋ฐ๋ฅด๋๋ก(fine-tuning)** ์ถ๊ฐ ํ์ต์ด ํ์ํฉ๋๋ค. ์ด ๋จ๊ณ๋ ๋ชจ๋ธ ๊ฐ๋ฐ์, ์คํ์์ค ์ปค๋ฎค๋ํฐ, ๋๋ ์ฌ๋ฌ๋ถ์ด ์ง์ ์ํํ ์ ์์ต๋๋ค. ์๋ฅผ ๋ค์ด [google/gemma-2-2b-it](https://huggingface.co/google/gemma-2-2b-it)์ Google์ Gemma ํ๋ก์ ํธ ํ์ด **์ง์๋ฌธ ๊ธฐ๋ฐ ๋ฏธ์ธ ์กฐ์ (instruction-tuning)** ์ ๊ฑฐ์น ๋ชจ๋ธ์ ๋๋ค. | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| 3. ์ดํ ๋ชจ๋ธ์ ๊ฐ๋ฐ์์ ์ ํธ๋์ ๋ง๊ฒ **์กฐ์ (alignment)** ๋ ์ ์์ต๋๋ค. ์๋ฅผ ๋ค์ด ๊ณ ๊ฐ ์๋์ฉ ์ฑ๋ด ๋ชจ๋ธ์ ์ด๋ค ์ํฉ์์๋ ๊ณ ๊ฐ์๊ฒ ๋ฌด๋กํ๊ฒ ์๋ตํ์ง ์๋๋ก ์กฐ์ ๋์ด์ผ ํฉ๋๋ค. | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| ์ผ๋ฐ์ ์ผ๋ก 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)์ ์ฌ์ฉํ๋ ์ด์ ๋, ํด๋น ๋ชจ๋ธ์ด ์ฐ๋ฆฌ์ ์ฌ์ฉ ๋ชฉ์ ์ ๋ ์ต์ ํ๋์ด ์๊ธฐ ๋๋ฌธ์ ๋๋ค. | ||||||
|
|
||||||
| ์ฌ์ ํ์ต๋ ๋ชจ๋ธ๋ก๋ถํฐ ์์ํ๋ค๋ฉด, **๋ช ๋ น์ด ์ํ, ๋ํ, ํจ์ ํธ์ถ์ ํ์ตํ๊ธฐ ์ํด ํจ์ฌ ๋ ๋ง์ ํ๋ จ์ด ํ์**ํฉ๋๋ค. | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| ๋ฐ๋ฉด, ์ง์๋ฌธ์ ๊ธฐ๋ฐ์ผ๋ก ๋ฏธ์ธ ์กฐ์ ๋ ๋ชจ๋ธ์์ ์์ํ๋ฉด **๋ชจ๋ธ์ด ์๋กญ๊ฒ ํ์ตํด์ผ ํ ์ ๋ณด์ ์์ ์ต์ํ**ํ ์ ์์ต๋๋ค. | ||||||
|
|
||||||
|
|
||||||
| ## LoRA (๋๊ท๋ชจ ์ธ์ด ๋ชจ๋ธ์ ์ ์ฐจ์ ์ ์ ๊ธฐ๋ฒ) [[lora-low-rank-adaptation-of-large-language-models]] | ||||||
|
|
||||||
| LoRA๋ ํ๋ จํด์ผ ํ๋ **ํ๋ผ๋ฏธํฐ ์๋ฅผ ํ๊ธฐ์ ์ผ๋ก ์ค์ฌ์ฃผ๋**, ๋๋ฆฌ ์ฌ์ฉ๋๋ ๊ฒฝ๋ ํ์ต ๊ธฐ๋ฒ์ ๋๋ค. | ||||||
|
|
||||||
| ์ด ๊ธฐ๋ฒ์ ๋ชจ๋ธ ๋ด๋ถ์ **์๋์ ์๋ก์ด ๊ฐ์ค์น๋ฅผ ์ด๋ํฐ ํํ๋ก ์ฝ์ ํด ํ์ต**ํ๋๋ก ํฉ๋๋ค. ์ด๋ฅผ ํตํด LoRA ํ์ต์ ํจ์ฌ ๋น ๋ฅด๊ณ , ๋ฉ๋ชจ๋ฆฌ ํจ์จ์ ์ด๋ฉฐ, ์๋ฐฑ MB ์์ค์ **์๊ณ ๊ฐ๋ฒผ์ด ๊ฐ์ค์น ํ์ผ**์ ์์ฑํ์ฌ ์ ์ฅ ๋ฐ ๊ณต์ ๊ฐ ์ฉ์ดํฉ๋๋ค. | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| <img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit1/blog_multi-lora-serving_LoRA.gif" alt="LoRA inference" width="50%"/> | ||||||
|
|
||||||
| LoRA๋ Transformer์ ์ ํ ๊ณ์ธต(linear layer)์ **๋ญํฌ ๋ถํด(rank decomposition) ํ๋ ฌ ์์ ์ถ๊ฐ**ํ๋ ๋ฐฉ์์ผ๋ก ๋์ํฉ๋๋ค. ํ์ต ์ค์ ๋๋จธ์ง ๋ชจ๋ธ์ โ๊ณ ์ (freeze)โํ๊ณ , ์๋ก ์ถ๊ฐ๋ ์ด๋ํฐ์ ๊ฐ์ค์น๋ง ์ ๋ฐ์ดํธํฉ๋๋ค. | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| ์ด๋ ๊ฒ ํ๋ฉด **ํ๋ จํด์ผ ํ ํ๋ผ๋ฏธํฐ์ ์๊ฐ ํฌ๊ฒ ๊ฐ์**ํ๋ฉฐ, ์ด๋ํฐ ๊ฐ์ค์น๋ง ์ ๋ฐ์ดํธํ๋ฉด ๋ฉ๋๋ค. | ||||||
|
|
||||||
| ์ถ๋ก ๋จ๊ณ์์๋ ์ ๋ ฅ์ด ์ด๋ํฐ์ ๊ธฐ๋ณธ ๋ชจ๋ธ ๋ชจ๋๋ฅผ ํต๊ณผํ๊ฑฐ๋, ์ด๋ํฐ ๊ฐ์ค์น๊ฐ ๊ธฐ๋ณธ ๋ชจ๋ธ์ ๋ณํฉ๋์ด ์ฌ์ฉ๋ฉ๋๋ค. ์ด ๋ฐฉ์์ **์ถ๊ฐ์ ์ธ ์ง์ฐ(latency)** ์ ๋ฐ์์ํค์ง ์์ต๋๋ค. | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| 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 ๋ ธํธ๋ถ์์ ์ง์ ์คํํ ์ ์์ต๋๋ค. | ||||||
| [](https://colab.research.google.com/#fileId=https://huggingface.co/agents-course/notebooks/blob/main/bonus-unit1/bonus-unit1.ipynb) | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ด ๋ถ๋ถ์ด ํ์ฌ PR์ ๊ฐ์ด ๋ค์ด๊ฐ๋ฉด ์๋ ๊ฒ ๊ฐ์ต๋๋ค!
What is Function Calling? ์ด ๋ฌธ์๊ฐ merge๋๊ณ ๋์ conflict๋ฅผ ํด๊ฒฐํ๋ ๋ฐฉ์์ผ๋ก ๊ฐ์ผํ ๊ฒ ๊ฐ์์ ใ ใ
๋ฒ๊ฑฐ๋กญ๊ฒ ์ง๋ง ์ญ์ ๋ถํ๋๋ฆฝ๋๋น!