์ฌ๋ฌ LM๋ค์ ๊ฐ๋ฐ๋ก ์ธํ์ฌ ์ฌ๋๋ค์ ์ ๋ก ์๋ ์๋ก์ด ๊ธฐ์ ๋ค์ ๋ง๋๊ณ ์๋ค. ์ด ์๊ธฐ๋ฅผ ์ฌ๋ฌ ํฌ์คํธ์์ ํ๋ ๊ฒ ๊ฐ์๋ฐ, ChatGPT๋ ์์ง๋ ๋ฌด๊ถ๋ฌด์งํ ๊ฐ๋ฅ์ฑ์ ๋ณด์ฌ์ฃผ๊ณ ์๋ค. ์ด๋ฌํ LM๋ค์ ์ฑ๋ฅ์ ํฅ์์ํค๋ ๋ฐฉ๋ฒ์ผ๋ก ๋ง์ด ์ฌ์ฉ๋๊ณ ์๋ ๋ฐฉ๋ฒ์ด Prompt Engineering์ด๋ค. ๋ณธ ๋ธ๋ก๊ทธ์์ ๋ฆฌ๋ทฐํ ์ฌ๋ฌ ๋ ผ๋ฌธ๋ค์์๋ ๋ฑ์ฅํ๋ Prompt Engineering์ ๋ํด ๋์ฑ ์์ธํ ์ดํด๊ฐ ํ์ํ ๊ฒ ๊ฐ์์ ์ด๋ ๊ฒ ํฌ์คํธ๋ฅผ ์์ฑํด๋ณธ๋ค. ๐ค
์ฐ์ Prompt Engineering์ ๋ํด์ ์์๋ณด๊ธฐ ์ ์ Prompt๊ฐ ๋ฌด์์ธ์ง ๋ถํฐ ์์๋ณด๋๋ก ํ์! ๐ฅ
Prompt๋?
Prompt๋ LLM์ผ๋ก๋ถํฐ ์๋ต์ ์์ฑํ๊ธฐ ์ํ ์ ๋ ฅ๊ฐ์ ์๋ฏธํ๋ค. ๋ค์์ ๊ทธ๋ฆผ์ด Prompt์ ์์์ด๋ค.
์๋ฅผ ๋ค์ด ์ค๋ช ํ์๋ฉด, LM์๊ฒ '๋ฉ์ผ์ ๋ด์ฉ์ ์์ฝํด์ค'์ ๊ฐ์ ์ง์๋ฅผ ํ ์ ์๋๋ฐ, ์ด ์ง์๊ฐ ๋ฐ๋ก ์๋ต์ ์ป์ด๋ด๊ธฐ ์ํ prompt์ด๋ค.
Prompt Engineering
Prompt Engineering์ LLM์ผ๋ก๋ถํฐ ๋์ ํ์ง์ ์๋ต์ ์ป์ด๋ผ ์ ์๋ prompt ์ ๋ ฅ๊ฐ๋ค์ ์กฐํฉ์ ์ฐพ๋ ์์ ์ ์๋ฏธํ๋ค. model์ ์ฌ์ฉํ prompt๋ฅผ ๋์์ธํ ๋ ๋ค์์ ๋ ์์ด๋์ด๋ฅผ ๋ช ์ฌํ๊ณ ์์ผ๋ฉด ๋๋ค.
1. Prompt๋ model์ด ์ ์ฉํ output์ ์์ฑํ๋๋ก ๊ฐ์ด๋
์๋ฅผ ๋ค์ด ๋ง์ฝ ๋ฌธ์๋ฅผ ์์ฝํด์ผ ๋ ๋, ๋ง์ ๋ฐ์ดํฐ๋ก ํ์ต๋ LM์ ๋ค์๊ณผ ๊ฐ์ ๊ฐ์ด๋๋ฅผ ํตํด ์์ฝ์ ์์ฑํ ์ ์๋ค.
2. ์ต๊ณ ์ ์์ฑ๋ฌผ์ ์ป๊ธฐ ์ํด ์ฌ๋ฌ prompt๋ฅผ ์๋
์์ฑ์ ํ ๋ ํด๊ฒฐํ๋ ค๋ ๋ฌธ์ ์ ๋ํด ๋ค์ํ prompt๋ฅผ ์๋ํด๋ณด๋ ๊ฒ์ด ์ ์ฉํ๋ค. ๋๊ฐ์ ๋ด์ฉ์ prompt์ด์ง๋ง, ๋จ์ด์ ๋ฌธ๋ฒ์ด ๋ค๋ฅด๋ฏ ์ด๋ฌํ ์ฌ์ํ ์ฐจ์ด๊ฐ ์์ฑ ๊ฒฐ๊ณผ๋ฅผ ๋ค๋ฅด๊ฒ ํ๋ค.
์๋ฅผ ๋ค์ด ์์ฝ ์์ ์์ "In summary"๋ ์ข์ ์์ฑ ๊ฒฐ๊ณผ๋ฅผ ๋ณด์ฌ์ฃผ์ง ์๋๋ฐ, "To summarize in plain language" ๋๋ "The main point to take from this article is that"๊ณผ ๊ฐ์ prompt๋ฅผ ์ฃผ๋ฉด ๋ ๋์ ๊ฒฐ๊ณผ๋ฅผ ๋ณด์ฌ์ค๋ค.
3. task์ ๊ธฐ๋ณธ์ ์ธ ์ธํ ์ ์ค๋ช
model์๊ฒ ์ถฉ๋ถํ context๋ฅผ ์ ๊ณตํด์ผ ํ๋ค. ์๋ฅผ ๋ค์ด, ๊ธฐ์ฌ ์ ์ ์์ฝ ์์ ์ ๋์ฑ ์์ธํ ์ค๋ช ํ ์ ์๋ค.
๋ชจ๋ธ์ด ํน์ ์ง๋ฌธ๊ณผ ์์ฒญ์ ์ฒ๋ฆฌํ๋ ๋ฐฉ๋ฒ์ ๋ํ ์๋ฅผ fine-tuningํ์ฌ ์ด๋ฅผ ๋์ฑ ๊ฐ์ ํ ์ ์๋ค.
4. model์๊ฒ ๋ณด๊ณ ์ ํ๋ ๊ฒ์ ์๋ ค์ฃผ๊ธฐ
์ํ๋ ์์ฑ ๊ฒฐ๊ณผ์ ๋ํ ๋ช ๊ฐ์ example์ ์ฃผ์ด์ ํ์ต์ํค๋ ๊ฒ์ few-shot learning์ด๋ผ๊ณ ํ๋ค. Few-shot generation์ larger model์์ ๋์ฑ ์ ์๋ํ๋ค. likelihood endpoint๋ฅผ ์ฌ์ฉํ์ฌ example์ ์ ๊ณต๋ ์ ๋ต์ ๋ํด ๋ชจ๋ธ์ด ์ผ๋ง๋ ๋ถํ์คํ์ง ํ์ธํ ์ ์๋ค.
p.s.
์์ง ์ ๋๋ก ์ดํดํ์ง ๋ชปํ ๋ถ๋ถ์ด ๋ง์ ์ถํ์ ๋ ํ์ต ํ ์ข ๋ ์์ ํด๋ณด๋๋ก ํ๊ฒ ๋ค.
์ถ์ฒ
https://seongjin.me/prompt-engineering-in-chatgpt/
ChatGPT๋ฅผ ๋น๋กฏํ ๋ํํ AI ์๋น์ค์์ ๋ ์ข์ ๊ฒฐ๊ณผ๋ฌผ์ ์ป๊ฒ ํด์ฃผ๋ ํ๋กฌํํธ ์์ง๋์ด๋ง (Prompt
๋ํํ ์ธ๊ณต์ง๋ฅ์ด ์์ฑํ๋ ๊ฒฐ๊ณผ๋ฌผ์ ํ์ง์ ๋์ด๋ ํ๋กฌํํธ ์์ง๋์ด๋ง(Prompt Engineering)์ ์๊ฐํ๋ค. ํ๋กฌํํธ(Prompt)๋ ๋ฌด์์ธ๊ฐ, ์ ์ด๊ฒ์ ์ฌ๋ฐ๋ฅธ ์์ง๋์ด๋ง์ด ํ์ํ๊ฐ๋ฅผ ์์๋ณด๊ณ , ChatGPT
seongjin.me
https://docs.cohere.ai/docs/prompt-engineering?ref=context-by-cohere
Prompt Engineering
Use the API to generate completions, distill text into semantically meaningful vectors, and more. Get state-of-the-art natural language processing without the need for expensive supercomputing infrastructure.
docs.cohere.ai
'Paper Reading ๐ > Deep Learning' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
Zero-shot, One-shot, Few-shot Learning์ด ๋ฌด์์ผ๊น? (2) | 2023.03.12 |
---|---|
LSTM vs GRU ๋ญ๊ฐ ๋ ๋์๊น?: Empirical Evaluation of Gated Recurrent Neural Networks on Sequence Modeling ๋ ผ๋ฌธ ๋ฆฌ๋ทฐ (1) | 2023.01.30 |
์๊ธฐ ์ฝ๊ฒ LSTM networks ์ดํดํ๊ธฐ (2) | 2023.01.27 |
Distilling the Knowledge in a Neural Network ๋ ผ๋ฌธ ๋ฆฌ๋ทฐ (0) | 2023.01.26 |
CNN network์ ์ญ์ฌ (0) | 2022.12.14 |