[GenAI] L2-P2-2. Parameter Efficient Fine-Tuning(2)

Prompt Tuning

NOT prompt engineering!

W2_page-0105

  • 단점
    • context window 제한
    • task에 맞는 성능을 달성하지 못할 수 있음(구조적 한계로)

Prompt tuning with soft prompts

W2_page-0106

  • Process
    • prompt + additional trainable tokens = Soft prompt
    • supervised learning process에 맡김
    • optimal values 찾아 줌
      • it gets prepended to embedding vectors that represent input text
  • soft prompt vector
    • language token의 embedding vector와 동일한 length
    • 20 ~ 100 virtual tokens : sufficient for good performance

W2_page-0107

W2_page-0108

  • 어떠한 값도 될 수 있는 virtual token
    • within the continous multidimensional embedding space
    • 지도학습을 통해 이 token 들이 perfomance 에 최적화되도록 학습 됨

Full fine-tuning vs. prompt tuning

W2_page-0110

  • Full fine-tuning
    • training dataset = input prompt + output completions (=labels)
    • weight updated by supervised learning
  • Prompt-tuning
    • LLM의 weight 들은 frozen 됨
    • soft prompt의 embedding vectors들이 update 됨
      • prompt에 대한 model의 completion을 최적화시킴

Prompt tuning for multiple tasks

W2_page-0111

  • set of soft prompt를 다양한 task 별로 학습 시킴
  • Inferecne 할 때 soft prompt (learned tokens) + input prompt 합쳐서 사용

  • 결론
    • 다양한 task에 동일한 LLM 사용가능
    • Inference time에 task에 따라 soft prompt를 바꾸기

Performance of prompt tuning

W2_page-0112

  • 해석
    • 작은 LLM (10^8 ~ 10^9) 에서는 Full Fine-tuning > Promt tuning
    • 10B (10^10) 에서는 Full Fine-tuning ~= Promt tuning
      • prompt-engineering 보다 훨씬 향상된 성능 보임

Interpretability

W2_page-0113

  • train token (soft prompt)은 LLM의 vocabulary의 어떤 값과도 같지 않음

W2_page-0114

  • 최근접이웃 토큰들을 분석하면 정보 알 수 있다
    • soft prompt location shows that they form tight semantic clusters
    • soft prompt 가장 가까운 단어들은 서로 비슷한 의미를 지님
  • The word identified usually have some meaning related to the task
    • suggesting that the prompt are learning word like representations

Summary

W2_page-0115

Week 2 Resources

Below you’ll find links to the research papers discussed in this weeks videos. You don’t need to understand all the technical details discussed in these papers - you have already seen the most important points you’ll need to answer the quizzes in the lecture videos.

However, if you’d like to take a closer look at the original research, you can read the papers and articles via the links below.

Multi-task, instruction fine-tuning

Model Evaluation Metrics

Parameter- efficient fine tuning (PEFT)

LoRA

Prompt tuning with soft prompts