Skip to content

Conversation

@xhaktm00
Copy link
Contributor

What does this PR do?

Translated the fine-tuning.mdx file of the documentation to Korean.
Thank you in advance for your review.

Part of huggingface/transformers#20179

Before reviewing

  • Check for missing / redundant translations (번역 누락/중복 검사)
  • Grammar Check (맞춤법 검사)
  • Review or Add new terms to glossary (용어 확인 및 추가)
  • Check Inline TOC (e.g. [[lowercased-header]])
  • Check live-preview for gotchas (live-preview로 정상작동 확인)

Who can review? (Initial)

May you please review this PR?
-- @harheem, @nsbg, @Youngdong2, @xhaktm00, @Judy-Choi

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review? (Final)

Copy link
Contributor

@harheem harheem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'What is function calling'에 이어 'Fine-Tune' 문서까지 신속하게 번역해주셔서 감사합니다! ☺️

번역 내용에 대해 몇 가지 피드백을 드립니다. toctree 관련 제안은 꼭 반영해주시고, 나머지는 선택적으로 검토해주세요.

전체적으로 1) 문장을 조금 더 능동적인 표현으로 다듬고, 2) 기술적 배경이 깊지 않은 독자도 쉽게 이해할 수 있도록 하는 데 중점을 두었습니다. 제안드린 내용이 문서의 완성도를 높이는 데 도움이 되면 좋겠습니다.

모델 학습 과정은 세 단계로 나눌 수 있습니다.

1. **모델은 대규모 데이터로 사전 학습(pre-training)** 됩니다. 이 단계의 결과물은 **사전 학습된 모델**입니다. 예를 들어 [google/gemma-2-2b](https://huggingface.co/google/gemma-2-2b)**지시문을 따르는 능력이 강하지 않은, 다음 토큰을 예측하는 데 특화된 기본(base) 모델**입니다.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. **모델은 대규모 데이터로 사전 학습(pre-training)** 됩니다.단계의 결과물은 **사전 학습된 모델**입니다. 예를 들어 [google/gemma-2-2b](https://huggingface.co/google/gemma-2-2b)**지시문을 따르는 능력이 강하지 않은, 다음 토큰을 예측하는 데 특화된 기본(base) 모델**입니다.
1. **모델은 대규모 데이터로 사전 학습(pre-training)** 되며,단계를 통해 **사전 학습된 모델**이 만들어집니다. 예를 들어 [google/gemma-2-2b](https://huggingface.co/google/gemma-2-2b)단순히 **다음 토큰을 예측하는 데 특화된 기반 모델**로, **지시문을 따르는 능력이 강하지 않은** 상태입니다.

모델 학습 과정은 세 단계로 나눌 수 있습니다.

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)** 을 거친 모델입니다.
Copy link
Contributor

Choose a reason for hiding this comment

The 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)**거친 모델입니다.
2. 모델을 채팅 환경에서 유용하게 사용하려면, 모델이 **명령어를 따르도록(fine-tuning)** 추가 학습이 필요합니다. 이 단계는 모델 개발자, 오픈소스 커뮤니티, 또는 여러분이 직접 수행할 수 있습니다. 예를 들어 [google/gemma-2-2b-it](https://huggingface.co/google/gemma-2-2b-it)은 Google의 Gemma 프로젝트 팀이 **지시문 기반 미세 조정(instruction-tuning)**수행한 모델입니다.


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)** 될 수 있습니다. 예를 들어 고객 응대용 챗봇 모델은 어떤 상황에서도 고객에게 무례하게 응답하지 않도록 조정되어야 합니다.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
3. 이후 모델은 개발자의 선호도에 맞게 **조정(alignment)** 될 수 있습니다. 예를 들어 고객 응대용 챗봇 모델은 어떤 상황에서도 고객에게 무례하게 응답하지 않도록 조정되어야 합니다.
3. 이후 모델은 개발자의 선호도에 맞게 **조정(alignment)** 될 수 있습니다. 예를 들어 고객 응대용 챗봇 모델을 어떤 상황에서도 고객에게 무례하게 응답하지 않도록 조정할 수 있습니다.

이 튜토리얼에서는 [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)을 사용하는 이유는, 해당 모델이 우리의 사용 목적에 더 최적화되어 있기 때문입니다.

사전 학습된 모델로부터 시작한다면, **명령어 수행, 대화, 함수 호출을 학습하기 위해 훨씬 더 많은 훈련이 필요**합니다.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
사전 학습된 모델로부터 시작한다면, **명령어 수행, 대화, 함수 호출을 학습하기 위해 훨씬 더 많은 훈련이 필요**합니다.
만약 사전 학습 모델에서부터 시작한다면, **지시문 이해, 채팅, 함수 호출 기능을 모두 학습시켜야 하므로 훨씬 더 많은 훈련**이 필요합니다.


LoRA는 훈련해야 하는 **파라미터 수를 획기적으로 줄여주는**, 널리 사용되는 경량 학습 기법입니다.

이 기법은 모델 내부에 **소량의 새로운 가중치를 어댑터 형태로 삽입해 학습**하도록 합니다. 이를 통해 LoRA 학습은 훨씬 빠르고, 메모리 효율적이며, 수백 MB 수준의 **작고 가벼운 가중치 파일**을 생성하여 저장 및 공유가 용이합니다.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
이 기법은 모델 내부에 **소량의 새로운 가중치를 어댑터 형태로 삽입해 학습**하도록 합니다. 이를 통해 LoRA 학습은 훨씬 빠르고, 메모리 효율적이며, 수백 MB 수준의 **작고 가벼운 가중치 파일**을 생성하여 저장 및 공유가 용이합니다.
이 기법은 모델 내부에 **어댑터(adapter)**라 불리는 **소규모의 새로운 가중치 레이어를 추가하여, 이 부분만 집중적으로 학습**시킵니다. 이를 통해 LoRA 학습은 훨씬 빠르고, 메모리 효율적이며, **학습 결과물인 가중치 파일의 크기도 수백 MB 수준으로 작아져** 저장하고 공유하기 편리합니다.


<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)”하고, 새로 추가된 어댑터의 가중치만 업데이트합니다.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
LoRA는 Transformer의 선형 계층(linear layer)에 **랭크 분해(rank decomposition) 행렬 쌍을 추가**하는 방식으로 동작합니다. 학습 중에 나머지 모델은 고정(freeze)하고, 새로 추가된 어댑터의 가중치만 업데이트합니다.
LoRA는 Transformer의 선형 계층(linear layer)에 **랭크 분해(rank decomposition) 행렬 쌍을 추가**하는 방식으로 동작합니다. 학습 중에 나머지 모델은 "고정(freeze)"하고, 새로 추가된 어댑터의 가중치만 업데이트합니다.


이렇게 하면 **훈련해야 할 파라미터의 수가 크게 감소**하며, 어댑터 가중치만 업데이트하면 됩니다.

추론 단계에서는 입력이 어댑터와 기본 모델 모두를 통과하거나, 어댑터 가중치가 기본 모델에 병합되어 사용됩니다. 이 방식은 **추가적인 지연(latency)** 을 발생시키지 않습니다.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
추론 단계에서는 입력이 어댑터와 기본 모델 모두를 통과하거나, 어댑터 가중치가 기본 모델에 병합되어 사용됩니다. 이 방식은 **추가적인 지연(latency)** 을 발생시키지 않습니다.
추론 단계에서는 입력이 어댑터와 기본 모델 모두를 통과하거나, 어댑터 가중치가 기본 모델에 병합되어 사용되어 **추가적인 지연 시간(latency)** 없이 모델을 사용할 수 있습니다.

Comment on lines +45 to +46
- local: bonus-unit1/what-is-function-calling
title: What is Function Calling?
Copy link
Contributor

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를 해결하는 방식으로 가야할 것 같아요 ㅎㅎ
번거롭겠지만 삭제 부탁드립니당!

title: Introduction
- local: bonus-unit1/what-is-function-calling
title: What is Function Calling?
- local: bonus-unit1/what-is-function-calling
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- local: bonus-unit1/what-is-function-calling
- local: bonus-unit1/fine-tuning

- local: bonus-unit1/what-is-function-calling
title: What is Function Calling?
- local: bonus-unit1/what-is-function-calling
title: fine-tuning
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
title: fine-tuning
title: Let’s Fine-Tune Your Model for Function-Calling

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants