Few-shot 예시를 스스로 생성하는 Synthetic prompting – 2023.2 mahler83, 2023-04-222023-04-22 Chain-of-thought prompting을 할 때 few-shot으로 제공하는 예시를 스스로 생성해서 사용하는 "Synthetic prompting"이라는 방법을 제안하는 논문 (2023 2/1) https://arxiv.org/abs/2302.00618 문제상황: 복잡하고 다양한 예시가 필요한 어려운 문제에 대한 prompting을 사람에게 시키는 것은 비용과 노력이 많이 필요함. 예시를 줄이면 성능이 저하됨. seed example이 주어지면, 두 가지 방식으로 예시를 augmentation 1) backward process: LLM이 reasoning chain을 생성한 뒤 질문을 생성함. answerable, well defined question을 얻을 수 있음 2) forward process: LLM이 질문을 생성한 뒤 여기에 대한 reasoning chain을 만들고 refine함 Agumented set에서 diversity, informativeness가 높은 예시를 선택하기 위해 clustering 후 가장 긴 것을 선택. 이 demonstration으로 prompting해서 최종적으로 주어진 test question을 해결함. numerical reasoning, algorithmic reasoning, symbolic reasoning 문제에 테스트해서 (당시의) SOTA method에 비해 최대 15.6% 성적이 향상됨 prompting technique 관련 – CoT P: Wei 2022 – Least-to-most P: Zhou 2022 – self-ask: Press 2022 – Decomposed P: Khot 2022 Demonstration 관련 – diversity: Li 2022, Ye 2022, Zhang 2022 – Complexity: Fu 2022 Similarity with test – structural: Drozdov 2022 – Semantic: Liu 2022 (헐 여기는 대부분 안 읽어본거네) Knowledge distillation: LLM에서 structured commensense knowledge 또는 task-specific example 생성하는 연구들이 있음 이 연구에서는 gold example이 적은 수로 있고, synthesized example이 추가 training 없이 성능을 향상시키는데 이용 가능한지 본 것 Example synthesis 요약: – PaL style reasoning 이용 – backward-forward process를 반복해서 seed demonstration과 같은 형태로 question-reasoning chain을 생성함 1. Backward process 다양한 분야 예시를 생성하기 위해서 topic word를 우선 생성시킴. > List 50 noun words. Each word should contain one token only. Do not repeated words already listed. 10개 이하 seed sample word 추가 이걸 반복해 1000개의 다양한 topic을 생성함. 생성시 complexity를 지정함 (예: 6-line function) topic에 대해서 주어진 복잡도의 reasoning chain을 생성하게 한 뒤, 여기에 적합한 question을 생성시킴 2. Forward process 생성된 문제에 대한 reasoning chain(RC)을 재생성시키는 과정. 원래 생성된 것보다 relevant, precise confidence를 반영하기 위해 – 문제에 대해 RC를 m개 생성시키고 과반이 나오는 answer가 있는 경우 그 중 가장 짧은 RC를 채택 – 과반선정 과정은 예시생성만, inferenece는 X 3. Inference in-cluster complexity based scheme을 이용해 서로 complementary하면서 complex한 예시를 선택함. sentenceBERT로 embedding해서 clustering 이렇게 선정된 example로 prompting해서 test question을 해결 Dataset Numerical reasoning: GSM8K, GSM-Hard, SVAMP, ASDiv, SingleOp Symbolic: Colored objects task from Big- Bench Hard Algorithmic: Repeat Copy task from Big-Bench Hard Baseline Direct P, CoT P, PaL P, Vanilla synthetic P(이 실험의 seed example의 question을 이용한 synthesis로 구성된 P) Main Results Synthetic P가 PaL에 비해 일관성 있게 성적이 좋음. Vanilla Synthetic P는 특히 repeat copy에서 성적이 안 좋은데 reasoning chain으로 conditioning한 question을 생성시키는 과정이 없어서인 것으로 생각 GSM8K와 Repeat copy에서 example을 2~8로 증가시키는 것이 효과가 없음. 추정 이유는 (1) seed가 적으면 diverse example 생성에 어려움이 있어서. (반대 아닌가?) (2) selection 전략이 별로여서 Ablation study Backward synthesis 과정에서 어느 한가지라도 없애면 성능이 떨어짐. 왜 그런가 보기 위해 분석해보니 topic을 없애면 diversity가 떨어짐 reasoning chain을 안 주고 question synthesis를 시키면 correctness가 많이 떨어짐 Schemes of demonstration selection In-cluster complexity에 비해 다른 방식은 성적이 낮아졌지만 PaL보다는 높았음. (In-cluster similarity랑 cluster centroid랑 어떻게 다른거지?) sensitivty to seed examples SP가 매번 성적이 제일 좋았다. PaL에 성적이 좋은 seed라고 SP에서도 성적이 좋지는 않았다. Comparison with selecting from training examples GSM8K의 training set에서 In-cluster complexity selecttion을 이용한 경우 77.0%가 나와 기존 실험의 75.3%보다 1.7%p 높았다. 예시가 복잡도가 높고 straightforward하지 않은 추론을 포함하고 있어 그런 듯 Quality analysis of synthetic examples SP를 Vanilla SP와 비교했을 때 복잡도가 높고(8.3 vs 5.4) error rate도 낮음 (8% vs 24%) selected demonstration의 경우 SP에서는 모두 적절하고 정답. VSP는 답할수 없는 오류가 있는 문제 1개, 추론이 틀린 문제 1개가 관찰됨. Conclusion in-context demonstration을 할 때 LLM이 예시를 스스로 생성해 정확도를 올릴 수 있음을 보였다. 유사 연구 Boosted Prompt Ensembles for LLMs 2023.4 My toughts Table 5에서 random이랑 생각보다 큰 차이가 안 나서 놀랐다.LLM에게 Topic을 만들어내라고 해서 그걸 이용해 diversity를 올리는 아이디어가 참신했다. GPT-4를 가지고 하는 놀이 중에 서로 최대한 다른 개념 16개를 생성해 토너먼트 하는 것이 생각났다.유사 연구인 Boosted prompt ensemble이랑 비교해보면 diversity를 올린 방법: Topic word를 생성 vs 못 푼 문제를 이용. 이게 제일 중요한 포인트일 것 같다. 이 연구에서도 diversity를 cosine similarity score 수치 외에 추가로 시각화해서 보여주면 좋았겠다Exemplar를 다양하게 생성/선택하는 방법을 여러가지 알아두고 상황에 맞춰 써먹을 수 있도록 공부해야겠다. Originally tweeted by 말러팔산 (@mahler83) on 2023-04-22. Share this:TwitterFacebook Large language model Reasoning
Ideas ChatGPT로 LLaMA를 의사로 파인튜닝 시키기 2023-03-282023-03-28 ChatGPT로 doctor-patient conversation을 생성해 LLaMa모델을 fine-tuning시켜 ChatDoctor 모델을 만들었는데, ChatGPT보다 성능이 좋다는 내용 (3/24) https://arxiv.org/abs/2303.14070 Methods 1. 700개의 질병에 대한 relative symptoms, medical tests, and recommended medications를 수집해서 “disease database”를 만듦. 2. 이걸 프롬프트로 줘서 ChatGPT로 doctor-patient dialogue 5K를 생성함 “InstructorDoctor-5K” 3. medical practitioner가 validation 4. InstructorDoctor-5K로 Stanford Alpaca training… Share this:TwitterFacebook Read More
Large language model GPT가 직업에 미치는 영향 – OpenAI 논문 2023-03-232023-03-23 Generative Pretrained Transformers(GPTs)는 General Purpose Technologies(GPTs)인가?라는 도발적인 질문에 답하는 논문 (3/20) 원문: https://arxiv.org/abs/2303.10130 “Our research serves to measure what is technically feasible now, but necessarily will miss the evolving impact potential of the LLMs over time.” 언어모델이 시간에 따라 인류에게 어떤 분야에서 어느 수준의 영향을 미치는지 분석/예측하는 것 자체가 하나의… Share this:TwitterFacebook Read More
hands-on OpenAI 강좌: ChatGPT API로 시스템 만들기 2023-06-012023-06-01 지난 번 prompt engineering 수업에 이어 “Building Systems with the ChatGPT API” 수업이 올라왔다. 이것도 1시간짜리 코스니까 부담없이 들어볼 수 있겠다! (라고 생각하고 시작했는데 두시간 반 걸림) https://learn.deeplearning.ai/chatgpt-building-system base LLM과 instruction-tuned LLM의 차이 우선은 수 개월 동안 강력한 하드웨어로 대량의 텍스트로 base 모델을 학습시키고 나서,– 내가 원하는 input-output pair를 제공해서… Share this:TwitterFacebook Read More