검색
검색
공개 노트 검색
회원가입로그인

알파카 - 스탠포드 대학의 LLaMA 7B 파인튜닝 모델

스탠포드 대학에서 연구 개발용으로 소개한 Alpaca 7B 모델은 LLaMA의 7B 모델을 파인튜닝한 버전이다. 52,000개의 instruction-following demonstrations로 파인튜닝했다고 한다.

스탠포드 대학에 따르면 예비 데이터셋으로 측정했을 때 OpenAI의 text-davinchi-003 (GPT 3.5)와 질적으로 성능이 비슷했다고 한다. 하지만 만들 때 사용한 비용은 600달러 미만으로 저렴하다고 한다. (LLaMA를 최초 파인튜닝하는데 몇 대의 A100 80GB에서 3시간이 걸렸고 100달러 미만이 들었다고 한다.)

지침 (instruction) 예시

{
        "instruction": "Describe a time when you had to make a difficult decision.",
        "input": "",
        "output": "I had to make a difficult decision when I was working as a project manager at a construction company. I was in charge of a project that needed to be completed by a certain date in order to meet the client\u2019s expectations. However, due to unexpected delays, we were not able to meet the deadline and so I had to make a difficult decision. I decided to extend the deadline, but I had to stretch the team\u2019s resources even further and increase the budget. Although it was a risky decision, I ultimately decided to go ahead with it to ensure that the project was completed on time and that the client\u2019s expectations were met. The project was eventually successfully completed and this was seen as a testament to my leadership and decision-making abilities."
    },
    {
        "instruction": "Explain why the following fraction is equivalent to 1/4",
        "input": "4/16",
        "output": "The fraction 4/16 is equivalent to 1/4 because both numerators and denominators are divisible by 4. Dividing both the top and bottom numbers by 4 yields the fraction 1/4."
    },
...

웹 데모 : Alpaca

github : GitHub - tatsu-lab/stanford_alpaca: Code and documentation to train Stanford's Alpaca models, and generate the data.

알파카 - 스탠포드 대학의 LLaMA 7B 파인튜닝 모델  image 1

웹 데모에서 이런식으로 직접 사용해볼 수 있다.

what is apple?

Apple is a type of fruit that is cultivated for its edible sweet-tart flavor and crisp texture. It is one of the most widely grown fruit crops in the world. Apple trees are small deciduous trees that produce one or more crops of fruit each year. The species of apple used for eating is Malus pumila. Apples are a good source of fiber, vitamins and minerals, including antioxidants and phytonutrients. They are also a good source of dietary protein.

영어는 잘 인식한다. 한글 데이터는 학습이 부족한지 잘 인식이 되지 않는다.

gpt-3로 가면서 openai의 gpt가 비공개 모델로 전환됐는데 라마의 등장은 연구자들에게는 좋은 소식이었던듯 하다. 연구 목적으로 코드, 데이터셋 등은 모두 공개했다. 가중치 (model weights)는 LLaMA에서도 공개하지 않았기에 따로 공개된 것은 없다.

페이스북이 라마를 공개한지 얼마되지 않아 벌써 instruction 파인튜닝 버전까지 나오다니 놀랍다.

참고 : Stanford CRFM (공식 홈페이지)

파인튜닝 방법

Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.

Instruction:
{instruction}

Input:
{input}

Response:

하나의 작업 (task)에 input을 context로 주고 Response를 생성하게 한다.

alpaca.cpp

개인 노트북에서 돌릴 수 있도록 만들어 놓은 것. alpaca 7b q4를 사용한다. 만든 사람이 깃허브에 첨부한 영상을 보면 맥북 에어 M2 에서 꽤 빠른 속도로 작동한다. 맥과

GitHub - antimatter15/alpaca.cpp: Locally run an Instruction-Tuned Chat-Style LLM

공유하기
카카오로 공유하기
페이스북 공유하기
트위터로 공유하기
url 복사하기
조회수 : 4216
heart
T
페이지 기반 대답
AI Chat