GPT-3 논문을 읽으며, In-context Learning(ICL)에 대한 설명을 보며 이해가 잘 되지 않았기 때문에,
관련 서베이 논문을 리뷰하며 ICL에 대한 이해를 해보려고 한다.
https://arxiv.org/abs/2301.00234
A Survey on In-context Learning
With the increasing capabilities of large language models (LLMs), in-context learning (ICL) has emerged as a new paradigm for natural language processing (NLP), where LLMs make predictions based on contexts augmented with a few examples. It has been a sign
arxiv.org
1. Introduction
In-Context Learning(ICL)은 NLP에서 LLM이 몇가지 예제를 통해 작업을 학습하는 새로운 능력을 보여준다.
ICL은 직역한 그대로, context 내에 있는 몇개의 예제로부터 학습하는 것이다.
핵심 아이디어는 analogy(유추)를 통해 학습하는 것이다.

논문에서 소개한 ICL의 예시이다.
- k Demonstration Examples: 여러개의 예시가 주어진다. 각 예시는 review와 해당 review의 (Positive or Negative) Sentiment(감정)가 포함되어 있다. ex) "Delicious food!" -> Positive(1) "The food is awful." -> Negative(0)
- Template: input이 template으로 정의되어 있다. New Query와 함께 사용되는 template도 있다.
ex) "Review: [Text] Sentiment: [Label]" - Query: New review가 입력된다. ex) "Review: Good meal!"
- Large Language Model(LLM): Template과 input data를 바탕으로 model이 판단하여 output을 생성한다.
이때, 보이는 것처럼 Parameter Freeze, 즉 매개변수 학습이 이루어지지 않는다. - 최종 흐름은 다음과 같다.
i. Demonstration Examples가 제공된다.
ii. New Query가 입력된다.
iii. LLM이 주어진 Example 및 Template를 이용해 output를 도출한다.