Gemma, 구글:google:이 공개한 오픈소스 경량 LLM

PyTorchKR​:fire::kr: :thinking::speech_balloon:

  • 최근 Phi와 같은 2B 규모의 경량화된 LLM들이 속속 출시되고 있는데요, 구글:google:이 새롭게 Gemma라는 모델을 공개하며 이 대열에 동참했습니다. Gemma는 2B과 7B 모델을 Gemma License로 공개하였는데, 어느 정도의 성능이고 어떠한 라이선스로 공개되었는지 함께 살펴보시죠. :smiley:
  • 이 글은 GPT 모델로 정리한 것으로, 잘못된 부분이 있을 수 있으니 글 아래쪽의 원문도 함께 참고해주세요! 읽으시면서 어색하거나 잘못된 내용을 발견하시면 덧글로 알려주시기를 부탁드립니다. :hugs:

Gemma, 구글:google:이 공개한 오픈소스 경량 LLM

Gemma 모델 소개

구글이 최첨단 오픈 소스 대규모 언어 모델(LLM) 패밀리인 Gemma를 발표했습니다. 이는 구글의 오픈소스 AI에 대한 약속을 강화하는 중요한 발걸음으로, Gemma 모델은 Hugging Face를 통해 공개적으로 접근 가능합니다. Gemma는 7B 매개변수와 2B 버전으로 제공되며, 각각 소비자 규모의 GPU 및 TPU와 CPU 및 온-디바이스 애플리케이션을 위해 최적화되어 있습니다.

Gemma는 기본(사전 훈련된) 및 지시 튜닝된 버전으로 제공되는 2B 및 7B의 두 가지 크기로 구성됩니다. 이 모델들은 8K 토큰의 컨텍스트 길이를 지원하며, 양자화 없이도 다양한 소비자 하드웨어에서 실행될 수 있습니다. 다른 LLM의 기본 모델과 마찬가지로, 각 기본(Base) 모델들에는 프롬프트 형식이 없으므로, 원하는 사용 사례에 대한 미세 조정을 위한 훌륭한 기반이 됩니다. 지시 버전은 매우 간단한 대화 구조를 가지고 있습니다:

Gemma vs. Llama-2 성능 비교

Gemma 7B 모델은 7B 가중치에서 최고의 모델과 비교할 수 있는 강력한 성능을 자랑합니다. 반면, Gemma 2B 모델은 그 크기에 비해 흥미로운 모델이지만, 비슷한 크기의 최고 모델들과 비교했을 때 리더보드에서 높은 점수를 얻지는 못합니다. 다음은 LLM Leaderboard에서의 주요 성능 측정 비교 결과입니다. (높은 숫자가 성능이 높습니다.)

Model License Commercial use? Pretraining size [tokens] Leaderboard score :arrow_down:
LLama 2 70B Chat (reference) Llama 2 license :white_check_mark: 2T 67.87
Gemma-7B Gemma license :white_check_mark: 6T 63.75
DeciLM-7B Apache 2.0 :white_check_mark: unknown 61.55
PHI-2 (2.7B) MIT :white_check_mark: 1.4T 61.33
Mistral-7B-v0.1 Apache 2.0 :white_check_mark: unknown 60.97
Llama 2 7B Llama 2 license :white_check_mark: 2T 54.32
Gemma 2B Gemma license :white_check_mark: 2T 46.51

Gemma의 핵심 혁신은 최첨단 성능과 경량 아키텍처의 결합에 있습니다. 이는 고급 기술을 통한 모델 훈련 및 최적화로 달성되며, Gemma 모델은 크기에 비해 최고 수준의 성능을 제공합니다. 이 접근 방식은 AI 개발의 진입 장벽을 낮추어 다양한 개발자가 고급 AI 애플리케이션을 실험하고 배포할 수 있게 합니다.

또한, Gemma는 책임있는 AI 개발을 강조합니다. 구글은 개발자가 안전한 AI 애플리케이션을 만들 수 있도록 지원하는 책임있는 생성 AI 툴킷(Responsible Generative AI Toolkit을 함께 출시했습니다. 이 툴킷은 AI 개발의 윤리적 고려 사항을 직접 다루며, Gemma로 구축된 애플리케이션이 공정성, 개인 정보 보호 및 보안의 높은 기준을 준수하도록 합니다.

Gemma의 아키텍처는 Google의 Gemini 기술과 인프라 구성 요소를 공유하며, 이를 통해 더 작은 규모에서도 탁월한 성능을 제공합니다. 모델은 다양한 응용 프로그램에 즉시 사용할 수 있도록 사전 훈련되고 지시 튜닝되었습니다.

Gemma는 Keras 3.0을 통해 JAX, PyTorch, TensorFlow와 같은 주요 프레임워크에서 추론 및 감독된 미세 조정을 위한 도구 체인을 포함하는 포괄적인 생태계를 제공합니다. 이는 개발자가 Gemma를 시작하는 과정을 단순화하고, 기존 워크플로우에 쉽게 통합할 수 있도록 합니다.

Gemma는 개인 컴퓨터에서 클라우드 기반 환경에 이르기까지 다양한 설정에서 업계 선도적인 성능을 제공합니다. 이러한 유연성은 AI 애플리케이션 개발에 대한 새로운 가능성을 열며, 학술 연구, 스타트업 혁신, 기업 솔루션을 위한 강력하고 접근 가능한 도구를 제공합니다.

사용법 소개 문서 및 노트북

더 읽어보기

Gemma 홈페이지

Google의 Gemma 공개 소개 글

Gemma 활용 코드 살펴보기 (feat. Kaggle:kaggle: )

Gemma 모델 가중치 내려받기

모델 이름 모델 크기 설명 다운로드
Gemma-2B 2B 기본 2B 모델(Base Model) google/gemma-2b · Hugging Face
Gemma-2B-IT 2B 지시어 파인 튜닝(Instruction Fine-tuned)된 2B 모델 google/gemma-2b-it · Hugging Face
Gemma-7B 7B 기본 7B 모델(Base Model) google/gemma-7b · Hugging Face
Gemma-7B-IT 7B 지시어 파인 튜닝(Instruction Fine-tuned)된 7B 모델 google/gemma-7b-it · Hugging Face

Hugging Face:hugs:와 Kaggle:kaggle:에서 각각 소개 글과 함께 공개되어 있습니다.

Gemma 기술문서 (Technical Report)

책임있는 생성형 AI 툴킷




:fire:파이토치 한국 사용자 모임:kr:이 정리한 이 글이 유용하셨나요? 회원으로 가입하시면 주요 글들을 이메일:love_letter:로 보내드립니다! (기본은 Weekly지만 Daily로 변경도 가능합니다.)

:gift: 아래:arrow_lower_right:쪽에 좋아요:heart:를 눌러주시면 뉴스 발행에 힘이 됩니다~ :star_struck:

내용 중에 Gemma License라고 적혀있는게 궁금해서 좀 찾아봤는데, Kaggle에서 아래와 같은 Term of Use를 발견했습니다:

전문은 아래와 같습니다.

Gemma Terms of Use

By using, reproducing, modifying, distributing, performing or displaying any portion or element of Gemma, Model Derivatives including via any Hosted Service, (each as defined below) (collectively, the “Gemma Services”) or otherwise accepting the terms of this Agreement, you agree to be bound by this Agreement.

Section 1. DEFINITIONS

  1. Definitions
    1. “Agreement” or “Gemma Terms of Use”means these terms and conditions that govern the use, reproduction, Distribution or modification of the Gemma Services and any terms and conditions incorporated by reference.
    2. “Distribution” or “Distribute”means any transmission, publication, or other sharing of Gemma or Model Derivatives to a third party, including by providing or making Gemma or its functionality available as a hosted service via API, web access, or any other electronic or remote means (“Hosted Service”).
    3. “Gemma”means the set of machine learning language models, trained model weights and parameters identified at ai.google.dev/gemma, regardless of the source that you obtained it from.
    4. “Google”means Google LLC.
    5. “Model Derivatives”means all (i) modifications to Gemma, (ii) works based on Gemma, or (iii) any other machine learning model which is created by transfer of patterns of the weights, parameters, operations, or Output of Gemma, to that model in order to cause that model to perform similarly to Gemma, including distillation methods that use intermediate data representations or methods based on the generation of synthetic data Outputs by Gemma for training that model. For clarity, Outputs are not deemed Model Derivatives.
    6. “Output”means the information content output of Gemma or a Model Derivative that results from operating or otherwise using Gemma or the Model Derivative, including via a Hosted Service.
  2. As used in this Agreement, “including” means “including without limitation”.

Section 2. ELIGIBILITY AND USAGE

  1. Eligibility.You represent and warrant that you have the legal capacity to enter into this Agreement (including being of sufficient age of consent). If you are accessing or using any of the Gemma Services for or on behalf of a legal entity, (a) you are entering into this Agreement on behalf of yourself and that legal entity, (b) you represent and warrant that you have the authority to act on behalf of and bind that entity to this Agreement and (c) references to “you” or “your” in the remainder of this Agreement refers to both you (as an individual) and that entity.
  2. Use.You may use, reproduce, modify, Distribute, perform or display any of the Gemma Services only in accordance with the terms of this Agreement, and must not violate (or encourage or permit anyone else to violate) any term of this Agreement.

Section 3. DISTRIBUTION AND RESTRICTIONS

  1. Distribution and Redistribution.You may reproduce or Distribute copies of Gemma or Model Derivatives if you meet all of the following conditions:
    1. You must include the use restrictions referenced in Section 3.2 as an enforceable provision in any agreement (e.g., license agreement, terms of use, etc.) governing the use and/or distribution of Gemma or Model Derivatives and you must provide notice to subsequent users you Distribute to that Gemma or Model Derivatives are subject to the use restrictions in Section 3.2.
    2. You must provide all third party recipients of Gemma or Model Derivatives a copy of this Agreement.
    3. You must cause any modified files to carry prominent notices stating that you modified the files.
    4. All Distributions (other than through a Hosted Service) must be accompanied by a “Notice” text file that contains the following notice: “Gemma is provided under and subject to the Gemma Terms of Use found at ai.google.dev/gemma/terms”.You may add your own intellectual property statement to your modifications and, except as set forth in this Section, may provide additional or different terms and conditions for use, reproduction, or Distribution of your modifications, or for any such Model Derivatives as a whole, provided your use, reproduction, modification, Distribution, performance, and display of Gemma otherwise complies with the terms and conditions of this Agreement. Any additional or different terms and conditions you impose must not conflict with the terms of this Agreement.
  2. Use Restrictions.You must not use any of the Gemma Services:
    1. for the restricted uses set forth in the Gemma Prohibited Use Policy at ai.google.dev/gemma/prohibited_use_policy (“Prohibited Use Policy”), which is hereby incorporated by reference into this Agreement; or
    2. in violation of applicable laws and regulations.To the maximum extent permitted by law, Google reserves the right to restrict (remotely or otherwise) usage of any of the Gemma Services that Google reasonably believes are in violation of this Agreement.
  3. Generated Output.Google claims no rights in Outputs you generate using Gemma. You and your users are solely responsible for Outputs and their subsequent uses.

Section 4. ADDITIONAL PROVISIONS

  1. Updates.Google may update Gemma from time to time, and you must make reasonable efforts to use the latest version of Gemma.
  2. Trademarks.Nothing in this Agreement grants you any rights to use Google’s trademarks, trade names, logos or to otherwise suggest endorsement or misrepresent the relationship between you and Google. Google reserves any rights not expressly granted herein.
  3. DISCLAIMER OF WARRANTY.UNLESS REQUIRED BY APPLICABLE LAW, THE GEMMA SERVICES, AND OUTPUTS, ARE PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. YOU ARE SOLELY RESPONSIBLE FOR DETERMINING THE APPROPRIATENESS OF USING, REPRODUCING, MODIFYING, PERFORMING, DISPLAYING OR OR DISTRIBUTING ANY OF THE GEMMA SERVICES OR OUTPUTS AND ASSUME ANY AND ALL RISKS ASSOCIATED WITH YOUR USE OR DISTRIBUTION OF ANY OF THE GEMMA SERVICES OR OUTPUTS AND YOUR EXERCISE OF RIGHTS AND PERMISSIONS UNDER THIS AGREEMENT.
  4. LIMITATION OF LIABILITY.TO THE FULLEST EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT AND UNDER NO LEGAL THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE), PRODUCT LIABILITY, CONTRACT, OR OTHERWISE, UNLESS REQUIRED BY APPLICABLE LAW, SHALL GOOGLE OR ITS AFFILIATES BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, EXEMPLARY, CONSEQUENTIAL, OR PUNITIVE DAMAGES, OR LOST PROFITS OF ANY KIND ARISING FROM THIS AGREEMENT OR RELATED TO, ANY OF THE GEMMA SERVICES OR OUTPUTS EVEN IF GOOGLE OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
  5. Term, Termination, and Survival.The term of this Agreement will commence upon your acceptance of this Agreement (including acceptance by your use, modification, or Distribution, reproduction, performance or display of any portion or element of the Gemma Services) and will continue in full force and effect until terminated in accordance with the terms of this Agreement. Google may terminate this Agreement if you are in breach of any term of this Agreement. Upon termination of this Agreement, you must delete and cease use and Distribution of all copies of Gemma and Model Derivatives in your possession or control. Sections 1, 2.1, 3.3, 4.2 to 4.9 shall survive the termination of this Agreement.
  6. Governing Law and Jurisdiction.This Agreement will be governed by the laws of the State of California without regard to choice of law principles. The UN Convention on Contracts for the International Sale of Goods does not apply to this Agreement. The state and federal courts of Santa Clara County, California shall have exclusive jurisdiction of any dispute arising out of this Agreement.
  7. Severability.If any provision of this Agreement is held to be invalid, illegal or unenforceable, the remaining provisions shall be unaffected thereby and remain valid as if such provision had not been set forth herein.
  8. Entire Agreement.This Agreement states all the terms agreed between the parties and supersedes all other agreements between the parties as of the date of acceptance relating to its subject matter.
  9. No Waiver.Google will not be treated as having waived any rights by not exercising (or delaying the exercise of) any rights under this Agreement.

GPT-4 모델에게 설명을 요청했더니 아래와 같이 답변을 해주네요.
:warning:주의:warning:: 아래 내용은 GPT가 생성한 것으로 틀릴 수 있고 법적으로 유효하지 않으니 참고용으로만 읽어주세요:

Gemma 모델을 사용하려는 분들을 위한 Gemma 라이선스에 대한 설명은 다음과 같습니다:

Gemma 라이선스 주요 조항

  1. 사용, 재생산, 수정, 배포, 수행 또는 표시: Gemma 서비스의 어떤 부분이든 사용, 재생산, 수정, 배포, 수행 또는 표시함으로써, 또는 이 계약의 조건을 수락함으로써, 이 계약에 구속됨에 동의합니다.
  2. 정의:
    • Gemma: ai.google.dev/gemma에서 식별된 기계 학습 언어 모델, 훈련된 모델 가중치 및 매개변수 세트를 의미합니다.
    • 모델 파생물: Gemma의 수정, Gemma를 기반으로 한 작업, 또는 Gemma의 가중치, 매개변수, 작업 또는 출력의 패턴을 전송하여 해당 모델이 Gemma와 유사하게 수행하도록 만드는 모든 기계 학습 모델을 의미합니다.
  3. 배포 및 제한:
    • Gemma 또는 모델 파생물을 배포할 수 있지만, 특정 조건을 충족해야 합니다. 예를 들어, 모든 배포에는 사용 제한을 명시하는 계약이 포함되어야 하며, 모든 수정된 파일에는 수정 사실을 명시하는 공지가 포함되어야 합니다.
    • Gemma 서비스를 사용할 때는 Gemma 금지 사용 정책에 명시된 제한된 사용 사례나 적용 가능한 법률 및 규정을 위반해서는 안 됩니다.
  4. 생성된 출력: Gemma를 사용하여 생성된 출력에 대한 권리는 주장하지 않으며, 출력과 그 후속 사용에 대한 책임은 전적으로 사용자에게 있습니다.
  5. 업데이트: Google은 Gemma를 시간에 따라 업데이트할 수 있으며, 최신 버전의 Gemma를 사용하기 위한 합리적인 노력을 기울여야 합니다.
  6. 상표: 이 계약은 Google의 상표, 상호, 로고 사용권을 부여하지 않으며, Google과의 관계를 잘못 표시하거나 승인을 암시할 수 없습니다.
  7. 보증의 부인 및 책임의 제한: Gemma 서비스와 출력은 "있는 그대로" 제공되며, 명시적이거나 묵시적인 어떠한 보증도 하지 않습니다. 사용자는 Gemma 서비스 또는 출력의 사용 및 배포와 관련된 모든 위험을 부담하며, 이 계약에 따른 권리와 허가의 행사에 대한 책임을 집니다.
  8. 계약의 기간, 종료 및 생존: 이 계약은 사용자가 이 계약을 수락하는 시점부터 시작되어 특정 조건에 따라 종료될 수 있습니다. 계약이 종료되면, Gemma 및 모델 파생물의 모든 복사본을 삭제하고 사용 및 배포를 중단해야 합니다.

요약

Gemma 라이선스는 Gemma 모델의 사용, 재생산, 수정, 배포에 대한 광범위한 권한을 제공하지만, 특정 사용 제한, 배포 조건 및 책임의 제한을 명시합니다. Gemma 또는 모델 파생물을 상업적 서비스나 제품에 통합하려는 경우, 이 계약의 모든 조건을 준수해야 하며, 특히 사용 제한 및 금지 사용 정책을 주의 깊게 검토해야 합니다.

2개의 좋아요