๐ข ํ๋กฌํํธ ๊ณต์ํ
์ด์ ์ฐ๋ฆฌ๋ ๋ค์ํ ํ๋กฌํํธ๋ค์ ์๊ฒ ๋์๊ณ ๋ ๊ฐ๊ฐ์ ์ตํฉํ๋ ๋ฐฉ๋ฒ๋ ์๊ณ ์์ต๋๋ค. ์ด ํ์ด์ง๋ ๋ค์ํ ํ๋กฌํํธ๋ค์ ์ค๋ช ํ๊ธฐ ์ํ ๋จ์ด๋ฅผ ์ฌ๋ฌ๋ถ์๊ฒ ์ ๊ณตํ ๊ฒ์ ๋๋ค. ํ๋กฌํํธ ์์ง๋์ด๋ง ๊ณต์ํ์ ๋ํ ๋ด๋ก ์ด ๊พธ์คํ ์์์์๋ ์ด ๋ถ๋ถ์ ๊ณ์ ๋ฐ๋์ด์์ต๋๋ค. ๊ทธ๋์ ์ฐ๋ฆฌ๋ ์ฌ๋ฌ๋ถ์๊ฒ ์์ํ๊ธฐ์ ์๋ง์ ์ ๋์ ์ ๋ณด๋ง์ ์ ๊ณตํ ๊ฒ์ ๋๋ค.
ํ๋กฌํํธ์ ๊ตฌ์ฑโ
์ฌ๋ฌ๋ถ์ด ์์ผ๋ก ๊ณ์ํด์ ๋ง์ฃผํ ํ๋กฌํํธ์ ๊ตฌ์ฑ์ ๋๋ค. ๊ฐ๋จํ๊ฒ ํํํ๋ฉด:
- ์ญํ (role)
- ์ง์(instruction/task)
- ์ง๋ฌธ(question)
- ๋ฌธ๋งฅ(Context)
- ์์(few shot)
์ฐ๋ฆฌ๋ ์ด์ ํ์ด์ง๋ค์์ ์ญํ , ์ง์, ์์๋ฅผ ์ด๋ฏธ ์ดํด๋ณด์์ต๋๋ค. ์ง๋ฌธ์ ๋จ์ํ ์ง๋ฌธ์
๋๋ค!(์๋ฅผ ๋ค์ด what is the capital of France?
). ๊ทธ๋ฆฌ๊ณ ๋ฌธ๋งฅ์ AI๊ฐ ์ง๋ฌธ์ ๋ต๋ณ์ ํ ๋ ์ฐธ๊ณ ํ์ผ๋ฉด ํ๋ ๋ชจ๋ ์ ๋ณด๋ฅผ ๋งํฉ๋๋ค.
์ด ์์๋ค์ด ๋ชจ๋ ํ๋กฌํํธ์ ํญ์ ๋ค์ด๊ฐ์ง๋ ์์ง๋ง ๋๋๋ก ๋ค์ด๊ฐ๋๋ค. ๊ทธ๋ฆฌ๊ณ ์์๋ค ์ฌ์ด์ ์ ํด์ง ์์๋ ์์ต๋๋ค. ์๋ฅผ ๋ค์ด์ ์ญํ , ์ง์, ๋ฌธ๋งฅ์ด ํฌํจ๋ ์๋ ๋ ํ๋กฌํํธ๋ ์๋ก ์์๊ฐ ๋ค๋ฅด์ง๋ง ๋๊ฐ์ด ์๋ํฉ๋๋ค.
You are a doctor. Read this medical history and predict risks for the patient:
January 1, 2000: Fractured right arm playing basketball. Treated with a cast.
February 15, 2010: Diagnosed with hypertension. Prescribed lisinopril.
September 10, 2015: Developed pneumonia. Treated with antibiotics and recovered fully.
March 1, 2022: Sustained a concussion in a car accident. Admitted to the hospital and monitored for 24 hours.
January 1, 2000: Fractured right arm playing basketball. Treated with a cast.
February 15, 2010: Diagnosed with hypertension. Prescribed lisinopril.
September 10, 2015: Developed pneumonia. Treated with antibiotics and recovered fully.
March 1, 2022: Sustained a concussion in a car accident. Admitted to the hospital and monitored for 24 hours.
You are a doctor. Read this medical history and predict risks for the patient:
ํ์ง๋ง ์ง์๊ฐ ํ๋กฌํํธ์ ๋ง์ง๋ง ๋ถ๋ถ์ด๋ฏ๋ก ๋ ๋ฒ์งธ ํ๋กฌํํธ์ ํํ๊ฐ ์กฐ๊ธ ๋ ์ ํธ๋ฉ๋๋ค. LLM์ด ์ง์๋ฅผ ๋ฐ๋ฅด๋ ๊ฒ ๋์ ์ ์๋์น ์์ ๊ธ์ ์์ฑํ ๊ฐ๋ฅ์ฑ์ด ์ ์ด์ง๊ธฐ ๋๋ฌธ์ ๋ ์ข์ ๋ฐฉ๋ฒ์ด ๋ ๊ฒ์
๋๋ค. ์๋ฅผ ๋ค์ด์, ์ฒซ ๋ฒ์งธ ํ๋กฌํํธ์์ LLM์ March 15, 2022: Follow-up appointment scheduled with neurologist to assess concussion recovery progress.
๊ณผ ๊ฐ์ ์ถ๊ฐ์ ์ธ ๋ฌธ์ฅ์ ์์ฑํ ์ ๋ ์๋ค.
"ํ์ค" ํ๋กฌํํธโ
์ฐ๋ฆฌ๋ ์ง๊ธ๊น์ง ๋ช ๊ฐ์ง ๋ค์ํ ํ๋กฌํํธ ํฌ๋งท์ ๋ํด์ ์ดํด๋ณด์์ต๋๋ค. ์ฒ์์ผ๋ก ๋์๊ฐ์ "ํ์ค" ํ๋กฌํํธ๋ฅผ ์ ์ํด๋ณผ ๊ฒ์ ๋๋ค. Kojima et al์ ๋ฐ๋ผ1, ์ฐ๋ฆฌ๋ ์ง๋ฌธ์ผ๋ก๋ง ์ด๋ฃจ์ด์ง ํ๋กฌํํธ๋ฅผ "ํ์ค" ํ๋กฌํํธ๋ก ๋ฐ๊ฟ๋ณผ ๊ฒ์ ๋๋ค. ๋ํ ์ฐ๋ฆฌ๋ QA ํฌ๋งท์ผ๋ก ๋์ด์๋ ์ง๋ฌธ์ "ํ์ค" ํ๋กฌํํธ๋ก ๋ฐ๊ฟ๋ณผ ๊ฒ์ ๋๋ค.
์ ์์๋ฌ์ผ ํ ๊น?โ
์ฐ๋ฆฌ๊ฐ ์ฐธ์กฐํ๋ ๋ง์ ๋ ผ๋ฌธ๋ค์์ ์ด ์ฉ์ด๋ฅผ ์ฌ์ฉํ๋ ๊ฒ์ ๋ณผ ์ ์์์ต๋๋ค. ์์ผ๋ก ํ์ค ํ๋กฌํํธ์ ๋์กฐ๋๋ ์๋ก์ด ์ ํ์ ํ๋กฌํํธ์ ๋ํด ๋ ผ์ํ ์ ์๋๋ก ์ด๋ฅผ ๋ฏธ๋ฆฌ ์ ์ํ๊ณ ์์ต๋๋ค.
ํ์ค ํ๋กฌํํธ์ ๋ํ ๋๊ฐ์ง ์์:โ
ํ์ค ํ๋กฌํํธ
What is the capital of France?
QA ํฌ๋งท์ ํ์ค ํ๋กฌํํธ
Q: What is the capital of France?
A:
ํจ์ท(Few Shot) ํ์ค ํ๋กฌํํธ๋คโ
ํจ์ท(Few Shot) ํ์ค ํ๋กฌํํธ๋ค์2 ํ๋ณธ๋ค ์ด ํฌํจ๋ ํ์ค ํ๋กฌํํธ์ ๋๋ค. ํ๋ณธ์ ํ๋กฌํํธ๊ฐ ํด๊ฒฐํด์คฌ์ผ๋ฉด ํ๋ ์ผ๋ค์ ๋ํ ๋ช๋ช์ ์์๋ฅผ ์ฐ๋ฆฌ๊ฐ ๋ฏธ๋ฆฌ ์ ๊ณตํ๋ ๊ฒ์ ๋๋ค. ์ฐ๊ตฌ์ ๋ฐ๋ฅด๋ฉด, ํจ์ท(Few Shot) ํ์ค ํ๋กฌํํธ๋ ์ข ์ข ๊ทธ๋ฅ ํ์ค ํ๋กฌํํธ๋ก ๋ถ๋ฆฌ๊ณคํฉ๋๋ค.(์ด ๊ฐ์ด๋์์ ์ถ์ฒํ์ง ์์์๋ ๋ถ๊ตฌํ๊ณ )
ํจ์ฟ(Few Shot) ํ์ค ํ๋กฌํํธ์ ๋ํ ๋๊ฐ์ง ์์:โ
ํจ์ฟ(Few Shot) ํ์ค ํ๋กฌํํธ
What is the capital of Spain?
Madrid
What is the capital of Italy?
Rome
What is the capital of France?
QA ํฌ๋งท์ ํจ์ฟ(Few Shot) ํ์ค ํ๋กฌํํธ
Q: What is the capital of Spain?
A: Madrid
Q: What is the capital of Italy?
A: Rome
Q: What is the capital of France?
A:
ํจ์ฟ(Few Shot) ํ์ค ํ๋กฌํํธ๋ ํ๋ผ๋ฏธํฐ ์ ๋ฐ์ดํธ๋ฅผ ํ์๋ก ํ์ง ์๋ "๋ฌธ๋งฅ ์(in context)" ํ์ต์ ์ฉ์ดํ๊ฒ ํฉ๋๋ค.
- Kojima, T., Gu, S. S., Reid, M., Matsuo, Y., & Iwasawa, Y. (2022). Large Language Models are Zero-Shot Reasoners. โฉ
- Liu, P., Yuan, W., Fu, J., Jiang, Z., Hayashi, H., & Neubig, G. (2022). Pre-train, Prompt, and Predict: A Systematic Survey of Prompting Methods in Natural Language Processing. ACM Computing Surveys. https://doi.org/10.1145/3560815 โฉ