davidkim205
commited on
Commit
โข
a8ba5f5
1
Parent(s):
9877db9
Update README.md
Browse files
README.md
CHANGED
@@ -1,9 +1,309 @@
|
|
1 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
library_name: peft
|
3 |
---
|
4 |
-
|
|
|
5 |
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
|
|
|
|
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
- PEFT 0.4.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
language:
|
3 |
+
- en
|
4 |
+
- ko
|
5 |
+
pipeline_tag: text-generation
|
6 |
+
inference: false
|
7 |
+
tags:
|
8 |
+
- facebook
|
9 |
+
- meta
|
10 |
+
- pytorch
|
11 |
+
- llama
|
12 |
+
- llama-2
|
13 |
+
- llama-2-chat
|
14 |
+
license: apache-2.0
|
15 |
library_name: peft
|
16 |
---
|
17 |
+
# komt-llama-2-7b-lora
|
18 |
+
This model fine-tuned the aaa model using PEFT-LoRA.
|
19 |
|
20 |
+
The "komt-llama-2-7b" model was developed using a multi-task instruction technique aimed at enhancing Korean language performance. For more details, please refer to the GitHub Repository.
|
21 |
+
Please refer below for more detailed information.
|
22 |
+
|
23 |
+
For more detailed information, please refer to the https://huggingface.co/davidkim205/komt-Llama-2-7b-chat-hf.
|
24 |
+
|
25 |
+
## Model Details
|
26 |
+
|
27 |
+
* **Model Developers** : davidkim(changyeon kim)
|
28 |
+
* **Repository** : https://github.com/davidkim205/komt
|
29 |
+
* **Lora target modules** : q_proj, o_proj, v_proj, gate_proj, down_proj, k_proj, up_proj
|
30 |
+
* **Model Size** : 80MB
|
31 |
+
* **Model Architecture** : komt-llama-2-7b is an auto-regressive language model that uses an optimized transformer architecture. The tuned versions use supervised fine-tuning by multi-task instruction
|
32 |
+
## Dataset
|
33 |
+
korean multi-task instruction dataset
|
34 |
+
|
35 |
+
## Prompt Template
|
36 |
+
```
|
37 |
+
### instruction: {prompt}
|
38 |
+
|
39 |
+
### Response:
|
40 |
+
```
|
41 |
+
Examples:
|
42 |
+
```
|
43 |
+
### instruction: ์๋์ฐจ ์ข
ํฉ(์ ๊ธฐ)๊ฒ์ฌ ์๋ฌด๊ธฐ๊ฐ์ ์ผ๋ง์ธ๊ฐ์?
|
44 |
+
|
45 |
+
### Response:
|
46 |
+
|
47 |
+
```
|
48 |
+
response:
|
49 |
+
```
|
50 |
+
### instruction: ์๋์ฐจ ์ข
ํฉ(์ ๊ธฐ)๊ฒ์ฌ ์๋ฌด๊ธฐ๊ฐ์ ์ผ๋ง์ธ๊ฐ์?
|
51 |
+
|
52 |
+
### Response: ์๋์ฐจ ์ข
ํฉ(์ ๊ธฐ)๊ฒ์ฌ ์๋ฌด๊ธฐ๊ฐ์ 2๋
์
๋๋ค. ์ด ๊ธฐ๊ฐ ๋์ ๊ฒ์ฌ๋ฅผ ๋ฐ์ง ์์ผ๋ฉด ๊ณผํ๋ฃ๊ฐ ๋ถ๊ณผ๋ฉ๋๋ค. ์๋์ฐจ ์ข
ํฉ(์ ๊ธฐ)๊ฒ์ฌ ์๋ฌด๊ธฐ๊ฐ์ 2013๋
12์ 31์ผ๋ถํฐ ์ํ๋์์ต๋๋ค
|
53 |
+
```
|
54 |
+
|
55 |
+
## Usage
|
56 |
+
|
57 |
+
After downloading from GitHub, please install as follows:
|
58 |
+
```
|
59 |
+
git clone https://github.com/davidkim205/komt
|
60 |
+
cd komt
|
61 |
+
pip install -r lora/requirements_lora.txt
|
62 |
+
|
63 |
+
```
|
64 |
+
* Requirements Python >=3.8. Linux distribution (Ubuntu, MacOS, etc.) + CUDA > 10.0.
|
65 |
+
Refer https://github.com/TimDettmers/bitsandbytes#tldr
|
66 |
+
|
67 |
+
```
|
68 |
+
import torch
|
69 |
+
|
70 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
|
71 |
+
from transformers import StoppingCriteria, StoppingCriteriaList
|
72 |
+
from transformers import TextStreamer, GenerationConfig
|
73 |
+
from peft import PeftModel, PeftConfig
|
74 |
+
|
75 |
+
class LocalStoppingCriteria(StoppingCriteria):
|
76 |
|
77 |
+
def __init__(self, tokenizer, stop_words = []):
|
78 |
+
super().__init__()
|
79 |
|
80 |
+
stops = [tokenizer(stop_word, return_tensors='pt', add_special_tokens = False)['input_ids'].squeeze() for stop_word in stop_words]
|
81 |
+
print('stop_words', stop_words)
|
82 |
+
print('stop_words_ids', stops)
|
83 |
+
self.stop_words = stop_words
|
84 |
+
self.stops = [stop.cuda() for stop in stops]
|
85 |
+
self.tokenizer = tokenizer
|
86 |
+
def _compare_token(self, input_ids):
|
87 |
+
for stop in self.stops:
|
88 |
+
if len(stop.size()) != 1:
|
89 |
+
continue
|
90 |
+
stop_len = len(stop)
|
91 |
+
if torch.all((stop == input_ids[0][-stop_len:])).item():
|
92 |
+
return True
|
93 |
+
|
94 |
+
return False
|
95 |
+
def _compare_decode(self, input_ids):
|
96 |
+
input_str = self.tokenizer.decode(input_ids[0])
|
97 |
+
for stop_word in self.stop_words:
|
98 |
+
if input_str.endswith(stop_word):
|
99 |
+
return True
|
100 |
+
return False
|
101 |
+
|
102 |
+
def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTensor):
|
103 |
+
input_str = self.tokenizer.decode(input_ids[0])
|
104 |
+
for stop_word in self.stop_words:
|
105 |
+
if input_str.endswith(stop_word):
|
106 |
+
return True
|
107 |
+
return False
|
108 |
+
|
109 |
+
#
|
110 |
+
# config
|
111 |
+
peft_model_name = 'davidkim205/komt-Llama-2-7b-chat-hf-lora'
|
112 |
+
model_name = 'davidkim205/komt-Llama-2-7b-chat-hf'
|
113 |
+
instruction_prefix = "### instruction: "
|
114 |
+
input_prefix = "### input: "
|
115 |
+
answer_prefix = "### Response: "
|
116 |
+
endoftext = "<|end|>"
|
117 |
+
stop_words = [endoftext, '<s>', '###']
|
118 |
+
generation_config = GenerationConfig(
|
119 |
+
temperature=0.9,
|
120 |
+
top_p=0.7,
|
121 |
+
top_k=100,
|
122 |
+
max_new_tokens=2048,
|
123 |
+
early_stopping=True,
|
124 |
+
do_sample=True,
|
125 |
+
)
|
126 |
+
#
|
127 |
+
# create model
|
128 |
+
config = PeftConfig.from_pretrained(peft_model_name)
|
129 |
+
bnb_config = BitsAndBytesConfig(
|
130 |
+
load_in_4bit=True,
|
131 |
+
bnb_4bit_use_double_quant=True,
|
132 |
+
bnb_4bit_quant_type="nf4",
|
133 |
+
bnb_4bit_compute_dtype=torch.bfloat16
|
134 |
+
)
|
135 |
+
model = AutoModelForCausalLM.from_pretrained(model_name, quantization_config=bnb_config,
|
136 |
+
device_map="auto")
|
137 |
+
model = PeftModel.from_pretrained(model, peft_model_name)
|
138 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
139 |
+
stopping_criteria = StoppingCriteriaList([LocalStoppingCriteria(tokenizer=tokenizer, stop_words=stop_words)])
|
140 |
+
streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
|
141 |
+
model.eval()
|
142 |
+
|
143 |
+
#
|
144 |
+
# generate
|
145 |
+
prompt = f"### instruction: ์๋์ฐจ ์ข
ํฉ(์ ๊ธฐ)๊ฒ์ฌ ์๋ฌด๊ธฐ๊ฐ์ ์ผ๋ง์ธ๊ฐ์?.\n\n### Response:"
|
146 |
+
gened = model.generate(
|
147 |
+
**tokenizer(
|
148 |
+
prompt,
|
149 |
+
return_tensors='pt',
|
150 |
+
return_token_type_ids=False
|
151 |
+
).to('cuda'),
|
152 |
+
generation_config=generation_config,
|
153 |
+
eos_token_id=model.config.eos_token_id,
|
154 |
+
stopping_criteria=stopping_criteria,
|
155 |
+
streamer=streamer
|
156 |
+
)
|
157 |
+
output_text = tokenizer.decode(gened[0], skip_special_tokens=True)
|
158 |
+
|
159 |
+
print('--------------------')
|
160 |
+
print(output_text)
|
161 |
+
|
162 |
+
```
|
163 |
+
response:
|
164 |
+
```
|
165 |
+
nlp๋ ์์ฐ์ด ์ฒ๋ฆฌ์ ์ฝ์๋ก, ์์ฐ์ด๋ฅผ ์ฌ์ฉํ์ฌ ์ธ๊ฐ๊ณผ ์ปดํจํฐ ๊ฐ์ ์ํธ ์์ฉ์ ๋ค๋ฃจ๋ ๋ถ์ผ์
๋๋ค. ์ปดํจํฐ์ ์ธ๊ฐ์ด ์๋ก ์ํธ ์์ฉํ๋ ๋ฐ ์ฌ์ฉ๋๋ ์ธ์ด์ ๊ธฐ์ ์ ํฌํจํ๋ฉฐ, ์ปดํจํฐ๋ ์ธ๊ฐ์ ์ธ์ด๋ฅผ ์ฒ๋ฆฌํ๊ณ ๋ถ์ํ์ฌ ์ธ๊ฐ์ ์์
์ ๋๊ฑฐ๋ ์์
์ ์๋ํํ๋ ๋ฐ ์ฌ์ฉ๋ฉ๋๋ค. ๋ฐ๋ผ์ ์ปดํจํฐ๊ฐ ์ปดํจํฐ์์ ์์
ํ๋ ๋ฐ ์ฌ์ฉ๋๋ ์ปดํจํฐ ํ๋ก๊ทธ๋จ์ด๋ ํ๋ก๊ทธ๋จ๊ณผ ๋น์ทํ๊ฒ ์ธ๊ฐ๋ ์์ ์ ์์
์ ์ฌ์ฉ๋๋ ์ปดํจํฐ ํ๋ก๊ทธ๋จ๊ณผ ๋น์ทํ ๋ฐฉ์์ผ๋ก ์์
ํ ์ ์์ต๋๋ค.
|
166 |
+
```
|
167 |
+
## Hardware and Software
|
168 |
+
- nvidia driver : 535.54.03
|
169 |
+
- CUDA Version: 12.2
|
170 |
+
### Framework versions
|
171 |
- PEFT 0.4.0
|
172 |
+
|
173 |
+
## Training
|
174 |
+
Refer github
|
175 |
+
|
176 |
+
## Model Benchmark
|
177 |
+
- Used EleutherAI's lm-evaluation-harness https://github.com/EleutherAI/lm-evaluation-harness/tree/polyglot
|
178 |
+
|
179 |
+
### Korean Semantic Textual Similarity
|
180 |
+
| model name | Version | Metric | Value | | Stderr |
|
181 |
+
|-------------------------------| ------: | ------ |-----------:| ---- | -----: |
|
182 |
+
| meta-llama/Llama-2-7b-chat-hf | 0 | acc | 0.4817 | ยฑ | 0.0220 |
|
183 |
+
| beomi/llama-2-ko-7b | 0 | acc | 0.5029 | ยฑ | 0.0220 |
|
184 |
+
| kfkas/Llama-2-ko-7b-Chat | 0 | acc | 0.5318 | ยฑ | 0.0219 |
|
185 |
+
| **komt-llama-2-7b (ours)** | 0 | acc | **0.5530** | ยฑ | 0.0218 |
|
186 |
+
|
187 |
+
### Example Output
|
188 |
+
Please refer to the GitHub link below for performance results of each model.
|
189 |
+
https://github.com/davidkim205/komt/tree/main/eval_results
|
190 |
+
| ์ง๋ฌธ/๋ต๋ณ |
|
191 |
+
| ------------------------------------------------------------ |
|
192 |
+
| ๋์ ์ฐจ๋จ๊ธฐ๊ฐ ๋ด๋ ค๊ฐ๋ ์ด์ ๋ ๋ฌด์์
๋๊น? |
|
193 |
+
| ๋์ ์ฐจ๋จ๊ธฐ๋ ๋์ ์ ์ ๊ธฐ๋ฅผ ์ฐจ๋จํ์ฌ ํ์ฌ ์ํ์ ์ค์ด๊ธฐ ์ํด ์ค์น๋ฉ๋๋ค. ํ์ง๋ง ๋์ ์ฐจ๋จ๊ธฐ๋ ์๊ฐ์ด ์ง๋๋ฉด์ ์ค์น๋ ์ฅ์์์ ๋ฉ์ด์ง๊ฒ ๋๋ฉฐ, ์ด๋ก ์ธํด ์ค์น๋ ์ฅ์์์ ๋์ ์ฐจ๋จ๊ธฐ๊ฐ ๋จ์ด์ง๋ฉด ์์๋ ์ ์์ต๋๋ค. ๋ฐ๋ผ์ ๋์ ์ฐจ๋จ๊ธฐ๊ฐ ๋ด๋ ค๊ฐ๋ ๊ฒ์ ์ด๋ฌํ ์ด์ ๋๋ฌธ์
๋๋ค. ๋์ ์ฐจ๋จ๊ธฐ๋ ๋์ ์ ์ ๊ธฐ๋ฅผ ์ฐจ๋จํ๊ธฐ ์ํด ์ค์น๋๋ ์ฅ์น์ด๋ฏ๋ก, ์ค์น๋ ์ฅ์์์ ๋์ ์ฐจ๋จ๊ธฐ๊ฐ ๋จ์ด์ง๋ฉด ์์๋ ์ ์์ผ๋ฏ๋ก ๋์ ์ฐจ๋จ๊ธฐ๊ฐ ๋ด๋ ค๊ฐ๋ ๊ฒ์ ์ ์ ํ ๊ด๋ฆฌ๊ฐ ํ์ํฉ๋๋ค. |
|
194 |
+
| ํ๋ ฅ๊ณต์ธ์ค๊ฐ์ฌ๋ ๋ฌด์์ธ๊ฐ์? |
|
195 |
+
| ํ๋ ฅ๊ณต์ธ์ค๊ฐ์ฌ๋ ๊ฑด์ถ, ๋ฌผ๋ฅ, ํ ๋ชฉ, ๊ฑด์ค ๋ฑ ๋ค์ํ ์ฐ์
๋ถ์ผ์์ ๊ณต์ธ์ค๊ฐ์ฌ์ ํ๋ ฅํ์ฌ ๊ฑด์ถ์
์, ์์ ์ ๋ฐ ํ ์ง์ฃผ๋ฅผ ๋์ ํ์ฌ ๊ฑด์ถ ํ๋ก์ ํธ๋ฅผ ์คํํ๋ ์ ๋ฌธ๊ฐ์
๋๋ค. ์ด๋ค์ ๊ณต์ธ์ค๊ฐ์ฌ์ ํ๋ ฅํ์ฌ ๊ณต์ฌ ๊ณ์ฝ, ๋ฒ๋ฅ ์๋ฌธ, ๊ฑด์ถ ํ๊ฐ ๋ฐ ๊ฑด์ถ ๊ท์ ์ค์์ ๊ฐ์ ํ๋ก์ ํธ ์
๋ฌด๋ฅผ ์ฒ๋ฆฌํฉ๋๋ค. ํ๋ ฅ๊ณต์ธ์ค๊ฐ์ฌ๋ ๊ณต์ธ์ค๊ฐ์ฌ๊ฐ ๊ฑด์ถ ํ๋ก์ ํธ๋ฅผ ๊ด๋ฆฌํ๊ณ ๊ฑด์ถ์
์, ์์ ์ฃผ ๋ฐ ํ ์ง์ฃผ์ ๊ด๋ จ๋ ๋ค๋ฅธ ๋น์ฌ์๋ฅผ ๋์ ํ์ฌ ํ๋ ฅํ ์ ์๋๋ก ์ง์ํฉ๋๋ค. ํ๋ ฅ๊ณต์ธ์ค๊ฐ์ฌ๋ ๊ณต์ธ์ค๊ฐ์ฌ์ ํ๋ ฅํ์ฌ ํ๋ก์ ํธ๊ฐ ์ํํ๊ฒ ์งํ๋๊ณ ๊ถ๊ทน์ ์ผ๋ก ์์ ์๊ฐ ์ํ๋ ๊ฒฐ๊ณผ๋ฅผ ์ป์ ์ ์๋๋ก ์ง์ํฉ๋๋ค. |
|
196 |
+
| ์์ถ๋ฌผํ์๋ ์์ฐ์งํ์๋ฅผ ํ์ฌ์ผ ํ๋์? |
|
197 |
+
| ์ผ๋ฐ์ ์ผ๋ก ์์ถ๋ฌผํ์ ์์ฐ์งํ์๋ฅผ ํ์ง ์๋ ๊ฒ์ด ์ผ๋ฐ์ ์
๋๋ค. ๊ทธ๋ฌ๋ ์์ฐ์งํ์๋ ์์ฐ์ง๊ฐ ์๋ ์ ํ์ ์์ถํ ๊ฒฝ์ฐ์๋ ํ์์
๋๋ค. ์์ฐ์งํ์ ์ ๋๋ ์ ํ์ ์์ฐ์ง๋ฅผ ํ์ํ์ฌ ์์
์ ํ์ ์์ฐ์ง ๊ฑฐ์งํ์๋ฅผ ๋ฐฉ์งํ๊ณ ๊ตญ๋ด ์๋น์์๊ฒ ์ ํ์ ์์ฐ์ง๋ฅผ ์ ๋ขฐํ ์ ์๋๋ก ํ๊ธฐ ์ํด ์ํ๋๋ ์ ๋์
๋๋ค. ์์ฐ์งํ์๋ ํ์์๋ฌด๋์์๊ฐ ์์ฐ์งํ์ ์๋ฌด๋์์์ ๋ํ ํ์์๋ฌด๋ฅผ ์ดํํ์ง ์์ ๊ฒฝ์ฐ ์ต๋ 100๋ง์ ์ดํ์ ๊ณผํ๋ฃ๊ฐ ๋ถ๊ณผ๋ฉ๋๋ค. ํ์ง๋ง ์์ถ๋ฌผํ์๋ ์์ฐ์งํ์๋ฅผ ํ์ง ์๋ ๊ฒ์ด ์ผ๋ฐ์ ์ด๋ฉฐ, ์์
๋ฌผํ์๋ ์์ฐ์งํ์๊ฐ ์๋ฌด์ ์
๋๋ค. ๋ฐ๋ผ์ ์์ถ๋ฌผํ์ ์์ฐ์งํ์๋ฅผ ํ์ง ์๋ ๊ฒ์ ์ผ๋ฐ์ ์ด๋ฉฐ, ์์ฐ์งํ์ ์ ๋๋ ์์
๋ฌผํ์๋ง ์ ์ฉ๋ฉ๋๋ค. |
|
198 |
+
| ์๋์ฐจ ๊ณต๊ธฐ์ ๊ด๋ฆฌ๊ฐ ์ ์ค์ํ๋์? |
|
199 |
+
| ์๋์ฐจ ๊ณต๊ธฐ์ ๊ด๋ฆฌ๋ ์ฌ๋ฌ ๊ฐ์ง ์ด์ ๋ก ์ค์ํฉ๋๋ค. ์ฒซ์งธ, ์๋์ฐจ ๊ณต๊ธฐ์์ ๋
ธ๋ฉด ๋ง์ฐฐ๋ ฅ์ ๋์ฌ์ฃผ๋ ์ญํ ์ ํ๋ฉฐ, ๋
ธ๋ฉด ๋ง์ฐฐ ๊ฐ์๋ก ์ฐ๋น๋ฅผ ํฅ์์ํค๋ ํจ๊ณผ๊ฐ ์์ต๋๋ค. ๋์งธ, ๊ณต๊ธฐ์์ด ๋ฎ์ผ๋ฉด ๋
ธ๋ฉด ๋ง์ฐฐ๋ ฅ์ด ๋ฎ์์ง๋ฉฐ, ๊ฒฐ๊ตญ ์ฐจ๋ ์ ๋๋ ฅ์ด ๋จ์ด์ง๋๋ค. ๋ฐ๋ผ์ ๊ณต๊ธฐ์์ด ๋ฎ์ ๋๋ ๋
ธ๋ฉด ๋ง์ฐฐ๋ ฅ์ ๋์ฌ์ฃผ๋ ํจ๊ณผ๊ฐ ์์ผ๋ฉฐ, ๋ฐ๋๋ก ๊ณต๊ธฐ์์ด ๋์ ๋๋ ๋
ธ๋ฉด ๋ง์ฐฐ๋ ฅ์ด ๋์์ ธ ์ฐ๋น๊ฐ ์ ํ๋๊ธฐ๋ ํฉ๋๋ค. |
|
200 |
+
| ์ฃผ์ฐจ์๋ฐ์ผ๋ก ๊ณผํ๋ฃ๊ฐ ๋์๋๋ฐ ํ์ ์ฌํ์ ์ฒญ๊ตฌํ ์ ์๋์? |
|
201 |
+
| ํ์ ์ฌํ์ ์ฒญ๊ตฌํ ์ ์์ต๋๋ค. ํ์ง๋ง ํ์ ์ฌํ์ ์ฒญ๊ตฌํ๊ธฐ ์ ์ ๋ฒ์ ํ๊ฒฐ์ ํ์ธํด๋ณด๋ ๊ฒ์ด ์ข์ต๋๋ค. ํ์ ์ฌํ ์ฒญ๊ตฌ ํ ๋ฒ์ ํ๊ฒฐ์ ๋ฐ๋ผ ํ์ ์ฌํ์ ์ฒญ๊ตฌํ ์ ์์ต๋๋ค. ํ์ง๋ง ๋ฒ์ ํ๊ฒฐ์ ๋ฐ๋ผ ํ์ ์ฌํ์ ์ฒญ๊ตฌํ ์ ์์ ์๋ ์์ต๋๋ค. ํ์ ์ฌํ ์ฒญ๊ตฌ ํ ํ๊ฒฐ์ ๋ฐ๋ผ ์ฒญ๊ตฌ๋ ์ฌ์์ ๋ณ๊ฒฝํ ์ ์๋ ๊ถ๋ฆฌ๋ ์์ต๋๋ค. |
|
202 |
+
| ํ๋ฆฌ๋ ์ด๋ ๋๋ผ์ ์ ๋๋ฉ์ด์
์ด์ผ |
|
203 |
+
| ์ผ๋ณธ\nใํ๋ฆฌใ(ใใชใผ ํธ๋ฆฌ์ด)๋ ์ผ๋ณธ์ ์ ๋๋ฉ์ด์
์ํ์ด๋ค. 2003๋
4์ 10์ผ๋ถํฐ 2004๋
3์ 31์ผ๊น์ง ํ์ง TV์์ ๋ฐฉ์๋์์ผ๋ฉฐ, ๋ฐฉ์์๊ฐ์ ์ด 108ํ์ด๋ค. ๋จํ๋ณธ์ ๋ชจ๋ 6๊ถ์ด๋ฉฐ, ์ 3๊ถ ๋ณธํธ, ์ 3๊ถ ์ธ์ , ์ 1๊ถ ์์ ํ์ด ์๋ค. ใํ๋ฆฌใ๋ ์ด์ฌ ์์ ์ ๊ฟ์ ์์ด๋ฒ๋ฆฐ 20๋ ์ด๋ฐ์ ์ฒญ๋
์ด ์์ ์ ์ํ์ ๋ํ ์์ ๊ฐ์ ๊ฐ๊ณ ์๊ฐ๊ฐ ๋๊ธฐ ์ํด ๋
ธ๋ ฅํ๋ ์ด์ผ๊ธฐ๋ฅผ ๊ทธ๋ฆฐ ์ํ์ด๋ค. ๋ํ ๊ฟ์ ํฅํ ์ฒญ๋
์ ์ด์ ๊ณผ ๋
ธ๋ ฅ์ด ์ฑ๊ณต์ผ๋ก ์ด์ด์ง๋ ๊ณผ์ ์ ๊ทธ๋ฆฌ๊ณ ์๋ค. ์ํ ๋ด์์ ์๊ฐ์ ๋ชจ์ต์ด ์์ ๊ณผ ๋ฎ์๋ค๋ ์ ์์ ๋ง์ ํ์ ๊ฐ ๋์๋ค. ์ 24ํ ์ผ๊ฐ์ฟ ์นธ ๋งํ์์ ์์ํ๋ค. |
|
204 |
+
| ์ํ ํด๋ฆฌํฌํฐ ์๋ฆฌ์ฆ ๋ฐฐ๊ธ์ฌ๊ฐ ์ด๋์ผ |
|
205 |
+
| ์๋ ๋ธ๋ผ๋์ค\n๋ฐ์ด๋น๋ ์๊ธ๋ฆฌ์๋ 1990๋
๋ ์ด ์๋ฆฌ์ฆ๋ฅผ ์์ํ๋ค. ์ด ์ํ๋ค์ ์ด 8๋ถ์์ผ๋ก ๋ง๋ค์ด์ก์ผ๋ฉฐ, ์ฒซ ๋ฒ์งธ ์ํ์ ใํด๋ฆฌ ํฌํฐ์ ๋ง๋ฒ์ฌ์ ๋ใ์ด๋ค. ์๊ฐ๋ J. K. ๋กค๋ง์ด๋ฉฐ, ์ํ ์๋ฆฌ์ฆ๋ ๋ฐฐ๊ธ์ฌ์ธ ์๋ ๋ธ๋ผ๋์ค๊ฐ ๋ง๋ค์๋ค. ์ดฌ์์ 1997๋
7์ 11์ผ๋ถํฐ 12์ 22์ผ๊น์ง ๋ฐ๋์์ ์ด๋ฃจ์ด์ก๋ค. ์ดฌ์ ์ฅ์๋ก๋ ๋ฐ๋ ํฌ๋ฆญ์ค ์คํ๋์ค์ ๋ฐ๋ ์ํฐ ์คํผ์ค๊ฐ ์ฌ์ฉ๋์๋ค. ๋ฐ์ด๋น๋ ์๊ธ๋ฆฌ์๋ ํด๋ฆฌ ํฌํฐ ์ญํ ์ ๋งก์๋ค. |
|
206 |
+
| ์ ์ธ๊ณ์๊ฐ์ ๊ธฐ์ค์ด ์๊ตญ์ GMT์ธ๊ฐ์? ๊ทธ ์ด์ ๋ ๋ฌด์์ผ๊น์? |
|
207 |
+
| ์๊ตญ์ GMT๋ ์ธ๊ณ์๊ฐ์ ๊ธฐ์ค์ด ๋๋ ์๊ฐ๋์
๋๋ค. ๊ทธ๋ฌ๋ ์ด ์๊ฐ๋๋ ํ์คํ๋์ง ์์์ผ๋ฉฐ, ๋ฐ๋ผ์ ๋ค๋ฅธ ๋๋ผ์ ์๊ฐ๋์ ์ฐจ์ด๊ฐ ์์ ์ ์์ต๋๋ค. ๋ฐ๋ผ์ ์ด ์๊ฐ๋๋ฅผ ์ธ๊ณ์๊ฐ์ผ๋ก ์ฐฉ๊ฐํ๋ ์ฌ๋๋ค์ด ์์ ์ ์์ต๋๋ค. ๋ฐ๋ผ์, ์ธ๊ณ์๊ฐ์ ๊ธฐ์ค์ ํ์คํ๋ ์๊ฐ๋๋ฅผ ๋ฐ๋ฅด๋๋ก ํ๋ ๊ฒ์ด ์ค์ํฉ๋๋ค. |
|
208 |
+
|
209 |
+
|
210 |
+
|
211 |
+
------------------------------------------------
|
212 |
+
# Original model card: Meta's Llama 2 13B-chat
|
213 |
+
|
214 |
+
Meta developed and released the Llama 2 family of large language models (LLMs), a collection of pretrained and fine-tuned generative text models ranging in scale from 7 billion to 70 billion parameters. Our fine-tuned LLMs, called Llama-2-Chat, are optimized for dialogue use cases. Llama-2-Chat models outperform open-source chat models on most benchmarks we tested, and in our human evaluations for helpfulness and safety, are on par with some popular closed-source models like ChatGPT and PaLM.
|
215 |
+
|
216 |
+
**Model Developers** Meta
|
217 |
+
|
218 |
+
**Variations** Llama 2 comes in a range of parameter sizes โ 7B, 13B, and 70B โ as well as pretrained and fine-tuned variations.
|
219 |
+
|
220 |
+
**Input** Models input text only.
|
221 |
+
|
222 |
+
**Output** Models generate text only.
|
223 |
+
|
224 |
+
**Model Architecture** Llama 2 is an auto-regressive language model that uses an optimized transformer architecture. The tuned versions use supervised fine-tuning (SFT) and reinforcement learning with human feedback (RLHF) to align to human preferences for helpfulness and safety.
|
225 |
+
|
226 |
+
||Training Data|Params|Content Length|GQA|Tokens|LR|
|
227 |
+
|---|---|---|---|---|---|---|
|
228 |
+
Llama 2|*A new mix of publicly available online data*|7B|4k|✗|2.0T|3.0 x 10<sup>-4</sup>
|
229 |
+
Llama 2|*A new mix of publicly available online data*|13B|4k|✗|2.0T|3.0 x 10<sup>-4</sup>
|
230 |
+
Llama 2|*A new mix of publicly available online data*|70B|4k|✔|2.0T|1.5 x 10<sup>-4</sup>
|
231 |
+
|
232 |
+
**Llama 2 family of models.** Token counts refer to pretraining data only. All models are trained with a global batch-size of 4M tokens. The 70B version uses Grouped-Query Attention (GQA) for improved inference scalability.
|
233 |
+
|
234 |
+
**Model Dates** Llama 2 was trained between January 2023 and July 2023.
|
235 |
+
|
236 |
+
**Status** This is a static model trained on an offline dataset. Future versions of the tuned models will be released as we improve model safety with community feedback.
|
237 |
+
|
238 |
+
**License** A custom commercial license is available at: [https://ai.meta.com/resources/models-and-libraries/llama-downloads/](https://ai.meta.com/resources/models-and-libraries/llama-downloads/)
|
239 |
+
|
240 |
+
**Research Paper** More information can be found in the paper "Llama-2: Open Foundation and Fine-tuned Chat Models", available at https://ai.meta.com/research/publications/llama-2-open-foundation-and-fine-tuned-chat-models/.
|
241 |
+
|
242 |
+
**Where to send questions or comments about the model** Instructions on how to provide feedback or comments on the model can be found in the model [README](README.md).
|
243 |
+
|
244 |
+
# **Intended Use**
|
245 |
+
**Intended Use Cases** Llama 2 is intended for commercial and research use in English. Tuned models are intended for assistant-like chat, whereas pretrained models can be adapted for a variety of natural language generation tasks.
|
246 |
+
|
247 |
+
**Out-of-scope Uses** Use in any manner that violates applicable laws or regulations (including trade compliance laws). Use in languages other than English. Use in any other way that is prohibited by the Acceptable Use Policy and Licensing Agreement for Llama 2.
|
248 |
+
|
249 |
+
# **Hardware and Software**
|
250 |
+
**Training Factors** We used custom training libraries, Meta's Research Super Cluster, and production clusters for pretraining. Fine-tuning, annotation, and evaluation were also performed on third-party cloud compute.
|
251 |
+
|
252 |
+
**Carbon Footprint** Pretraining utilized a cumulative 3.3M GPU hours of computation on hardware of type A100-80GB (TDP of 350-400W). Estimated total emissions were 539 tCO2eq, 100% of which were offset by Metaโs sustainability program.
|
253 |
+
|
254 |
+
||Time (GPU hours)|Power Consumption (W)|Carbon Emitted(tCO<sub>2</sub>eq)|
|
255 |
+
|---|---|---|---|
|
256 |
+
|Llama 2 7B|184320|400|31.22|
|
257 |
+
|Llama 2 13B|368640|400|62.44|
|
258 |
+
|Llama 2 70B|1720320|400|291.42|
|
259 |
+
|Total|3311616||539.00|
|
260 |
+
|
261 |
+
**CO<sub>2</sub> emissions during pretraining.** Time: total GPU time required for training each model. Power Consumption: peak power capacity per GPU device for the GPUs used adjusted for power usage efficiency. 100% of the emissions are directly offset by Meta's sustainability program, and because we are openly releasing these models, the pretraining costs do not need to be incurred by others.
|
262 |
+
|
263 |
+
# **Training Data**
|
264 |
+
**Overview** Llama 2 was pretrained on 2 trillion tokens of data from publicly available sources. The fine-tuning data includes publicly available instruction datasets, as well as over one million new human-annotated examples. Neither the pretraining nor the fine-tuning datasets include Meta user data.
|
265 |
+
|
266 |
+
**Data Freshness** The pretraining data has a cutoff of September 2022, but some tuning data is more recent, up to July 2023.
|
267 |
+
|
268 |
+
# **Evaluation Results**
|
269 |
+
|
270 |
+
In this section, we report the results for the Llama 1 and Llama 2 models on standard academic benchmarks.
|
271 |
+
For all the evaluations, we use our internal evaluations library.
|
272 |
+
|
273 |
+
|Model|Size|Code|Commonsense Reasoning|World Knowledge|Reading Comprehension|Math|MMLU|BBH|AGI Eval|
|
274 |
+
|---|---|---|---|---|---|---|---|---|---|
|
275 |
+
|Llama 1|7B|14.1|60.8|46.2|58.5|6.95|35.1|30.3|23.9|
|
276 |
+
|Llama 1|13B|18.9|66.1|52.6|62.3|10.9|46.9|37.0|33.9|
|
277 |
+
|Llama 1|33B|26.0|70.0|58.4|67.6|21.4|57.8|39.8|41.7|
|
278 |
+
|Llama 1|65B|30.7|70.7|60.5|68.6|30.8|63.4|43.5|47.6|
|
279 |
+
|Llama 2|7B|16.8|63.9|48.9|61.3|14.6|45.3|32.6|29.3|
|
280 |
+
|Llama 2|13B|24.5|66.9|55.4|65.8|28.7|54.8|39.4|39.1|
|
281 |
+
|Llama 2|70B|**37.5**|**71.9**|**63.6**|**69.4**|**35.2**|**68.9**|**51.2**|**54.2**|
|
282 |
+
|
283 |
+
**Overall performance on grouped academic benchmarks.** *Code:* We report the average pass@1 scores of our models on HumanEval and MBPP. *Commonsense Reasoning:* We report the average of PIQA, SIQA, HellaSwag, WinoGrande, ARC easy and challenge, OpenBookQA, and CommonsenseQA. We report 7-shot results for CommonSenseQA and 0-shot results for all other benchmarks. *World Knowledge:* We evaluate the 5-shot performance on NaturalQuestions and TriviaQA and report the average. *Reading Comprehension:* For reading comprehension, we report the 0-shot average on SQuAD, QuAC, and BoolQ. *MATH:* We report the average of the GSM8K (8 shot) and MATH (4 shot) benchmarks at top 1.
|
284 |
+
|
285 |
+
|||TruthfulQA|Toxigen|
|
286 |
+
|---|---|---|---|
|
287 |
+
|Llama 1|7B|27.42|23.00|
|
288 |
+
|Llama 1|13B|41.74|23.08|
|
289 |
+
|Llama 1|33B|44.19|22.57|
|
290 |
+
|Llama 1|65B|48.71|21.77|
|
291 |
+
|Llama 2|7B|33.29|**21.25**|
|
292 |
+
|Llama 2|13B|41.86|26.10|
|
293 |
+
|Llama 2|70B|**50.18**|24.60|
|
294 |
+
|
295 |
+
**Evaluation of pretrained LLMs on automatic safety benchmarks.** For TruthfulQA, we present the percentage of generations that are both truthful and informative (the higher the better). For ToxiGen, we present the percentage of toxic generations (the smaller the better).
|
296 |
+
|
297 |
+
|
298 |
+
|||TruthfulQA|Toxigen|
|
299 |
+
|---|---|---|---|
|
300 |
+
|Llama-2-Chat|7B|57.04|**0.00**|
|
301 |
+
|Llama-2-Chat|13B|62.18|**0.00**|
|
302 |
+
|Llama-2-Chat|70B|**64.14**|0.01|
|
303 |
+
|
304 |
+
**Evaluation of fine-tuned LLMs on different safety datasets.** Same metric definitions as above.
|
305 |
+
|
306 |
+
# **Ethical Considerations and Limitations**
|
307 |
+
Llama 2 is a new technology that carries risks with use. Testing conducted to date has been in English, and has not covered, nor could it cover all scenarios. For these reasons, as with all LLMs, Llama 2โs potential outputs cannot be predicted in advance, and the model may in some instances produce inaccurate, biased or other objectionable responses to user prompts. Therefore, before deploying any applications of Llama 2, developers should perform safety testing and tuning tailored to their specific applications of the model.
|
308 |
+
|
309 |
+
Please see the Responsible Use Guide available at [https://ai.meta.com/llama/responsible-use-guide/](https://ai.meta.com/llama/responsible-use-guide/)
|