Publications

Detailed Information

Leveraging Contexts for Efficient Automatic Prompt Engineering on Large-scale Language Models : 대규모 언어 모델에서 효율적인 자동화된 프롬프트 엔지니어링을 위한 맥락의 활용

Cited 0 time in Web of Science Cited 0 time in Scopus
Authors

하현민

Advisor
전병곤
Issue Date
2023
Publisher
서울대학교 대학원
Keywords
prompt tuningpromptin-context learninglanguage model
Description
학위논문(박사) -- 서울대학교대학원 : 공과대학 컴퓨터공학부, 2023. 8. 전병곤.
Abstract
프롬프팅은 대규모 언어 모델(LMs)의 적응에 효과적인 방법으로 큰 관심을 받고 있다.
프롬프트는 일반적으로 과제에 대한 설명과 예제를 포함하고, 이는 LM의 입력으로 제공된다.
LM은 프롬프트를 통해서 주어진 맥락을 통해 과제를 이해하고 실제로 풀어야 하는 문제를 처리하고, 이 방식을 인-컨텍스트 학습이라고 한다.
하지만 프롬프트는 종종 인간의 직관에 반하여 불안정한 성능을 보여주기 때문에 기존 연구들은 효과적인 프롬프트를 자동으로 찾는 방법들을 제안하게 된다.

자동 프롬프트 엔지니어링 방법은 다양한 NLP 작업에서 뛰어난 성능을 보여주지만, 특정 시나리오에서는 전체 파라미터 파인튜닝과 같은 몇 가지 LM 적응 방법에 비해 성능이 떨어진다.
최적의 성능을 보여주지 못하더라도, 간단한 디자인이나 파라미터 효율성 등 프롬프트의 특수한 장점은 프롬프트의 성능을 개선하기 위한 방법을 연구의 동기가 된다.

또한, 프롬프트 튜닝 방법은 LM 적응에 효과적이지만, 언어 모델 서비스 (language-model-as-a-service (LMaaS)를 지원하기 위해 설계되지 않았다.
최근 대규모 언어 모델은 주로 서비스 형태(LMaaS)로 제공된다.
LMaaS는 모델의 파라미터를 공개하지 않기 때문에, 사용자는 서비스를 사용할 때 인-컨텍스트 학습을 위해 과제별 프롬프트를 준비해야 한다.
하지만, LMaaS는 무거운 계산 비용 때문에 자동 프롬프트 튜닝 방법을 서비스 내에서 제공하지 않는다.
LMaaS 사용자는 파라미터 접근이 필요하지 않거나 서비스 제공자의 추가 지원이 필요하지 않는 여러 블랙박스 프롬프트 방법을 사용할 수 있지만, 비전문가 사용자가 본인의 장비에서 이러한 방법을 배포하고 실행하기는 매우 어렵다.

이 논문에서는 먼저 CoRe라는 새로운 정규화 방법을 제안한다.
이 방법은 gradient 기반 프롬프트 튜닝 기술에 적용되어 프롬프트가 과제에 대한 맥락을 올바르게 생성하도록 유도한다.
CoRe는 컨텍스트 어튜닝과 컨텍스트 필터링이라는 두 가지 정규화 효과를 실현하여, 과제에 대한 예시 없이 CoRe에 의해 튜닝된 프롬프트만을 사용하여 인퍼런스가 이루어지는 "제로-샷 인-컨텍스트 러닝" 환경에서 예측 성능을 향상시킨다.
컨텍스트 어튜닝은 입력과 튜닝된 프롬프트에 의해 생성된 맥락이 작업에 적합한 맥락을 담도록 유도한다.
이론적 분석을 통해 맥락의 정규화는 제로-샷 인-컨텍스트 러닝 성능을 향상시키는 데 기여한다는 것을 알 수 있다.
컨텍스트 필터링은 프롬프트가 작업과 관련된 맥락에 집중하도록 유도하여 컨텍스트 어튜닝이 올바른 작업 맥락를 생성하고 전송하는 데에만 집중하도록 합니다.
우리는 자연어 이해 데이터셋과 GPT2-XL 및 GPT-J라는 두 가지 대규모 언어 모델에서 CoRe를 평가한다.
CoRe는 제로-샷 설정에서 GPT2-XL에서 최대 11.9%의 성능 향상과 GPT-J에서 최대 6.3%의 성능 향상을 보여준다.

그리고 우리는 MetaL-Prompt라는 LMaaS를 위한 새로운 경량 프롬프트 생성 방법을 제안한다.
MetaL-Prompt는 적은 수의 데이터를 활용하여 추가적인 훈련 없이 해당 작업에 대한 프롬프트를 생성하는 프롬프트 생성 모델(PGM)을 메타러닝을 통해 학습한다.
또한, 메타러닝 도중 또는 프롬프트 생성 도중의 생성 과정으로 인한 부하를 완화하기 위해 trainable padding을 제안하고, 프롬프트 생성 모델을 사용하여 다양한 프롬프트 유형의 생성을 탐구합니다.
MetaL-Prompt는 PGM이 특정 과제에 대한 예제들의 연결로 인해 발생하는 컨텍스트에서 과제에 대한 정보를 추출하고, 이를 기반으로 단일 포워드 패스를 통해 프롬프트를 생성하기 때문에 계산 측면에서 효율적이다.
따라서, MetaL-Prompt는 LMaaS에 적용되었을 때 계산 부하가 적으며, 서비스는 자동으로 생성된 프롬프트를 사용하여 다양한 작업을 지원할 수 있다.
우리는 다양한 메타러닝 설정에서 MetaL-Prompt를 평가하였으며, 제로-샷 인-컨텍스트 러닝 환경에서 최신 베이스라인과 비교하여 QA 데이터셋에서 평균 F1 점수를 최대 19.4%까지 향상시킨다. 또한 이를 달성하는데 베이스라인에 비해 아주 적은 계산 비용이 든다.
Prompting has gained tremendous attention as an efficient method for the adaptation of large-scale language models (LMs).
A prompt typically has a task description and demonstration examples and is fed as input to an LM.
Then, the LM learns the task from the context given by the input and processes queries.
This phenomenon is called In-context Learning.
However, prompts often act against human intuition and report unstable performances, which has motivated methods that automatically find effective prompts.

Automatic prompt tuning methods have shown promising performances on various NLP tasks but still fall behind several LM adaptation methods, such as full-parameter fine-tuning, in some scenarios.
Despite the sub-optimal performances, unique capabilities of prompting, such as simplicity or parameter efficiency, encourage improving prompting methods.

Moreover, even though the prompt tuning methods are effective in LM adaptation, they are not designed to support language-model-as-a-services (LMaaS).
Recent large-scale LMs typically provide their capabilities via services.
Such Language-Model-as-a-Services (LMaaSs) have unique constraints for practical deployments compared to in-house models; the model's internal parameters are not publicly open.
This requires users to prepare task-specific prompts for in-context learning when using the service.
However, LMaaSs does not provide automatic prompt tuning methods because of their heavy computation overheads.
An LMaaSs user may use several black-box prompting methods that do not require parameter access or service providers' additional support, but it is really hard for non-expert users to deploy and execute such methods on their in-house machines.

In this thesis, we first propose a novel regularization method, CoRe, for gradient-based prompt tuning techniques, which guides a prompt to produce a task context properly.
CoRe realizes two regularization effects --- context attuning and context filtering --- that improve prediction performance in
a zero-shot in-context learning setting where a model makes inferences only with the prompt tuned by CoRe, without any demonstration examples for in-context learning.
Context attuning guides the context generated by the input and the tuned prompt toward embedding the appropriate context for the task.
In our theoretical analysis, regularizing the context extends to improving zero-shot in-context learning performance.
Context filtering steers the prompt to select only the task-related context so that context attuning solely focuses on creating and sending the right task context.
We evaluate CoRe on natural language understanding datasets and two large language models, GPT2-XL and GPT-J.
Our training scheme shows performance improvements up to 11.9% on GPT2-XL, and up to 6.3% on GPT-J in zero-shot settings.


We then propose MetaL-Prompt, a novel lightweight prompt generation method for LMaaS based on meta-learning.
MetaL-Prompt makes a prompt generation model (PGM) which generates a task-specific prompt from few-shot examples of an arbitrary user task without additional training during service.
We also suggest trainable padding to mitigate the overhead from the generation process of the meta-learning, and explore generation of diverse prompt types using the prompt generation model.
MetaL-Prompt is compute-efficient since the PGM extracts task information from the context caused by the concatenation of the few-shot examples, and generates a corresponding prompt in a single forward pass.
Therefore, MetaL-Prompt introduces negligible computation overheads when deployed on LMaaSs, and the services can support a tremendous number of various tasks with automatically generated prompts with MetaL-Prompt.
We evaluate MetaL-Prompt in diverse meta-learning settings,
and it improves the performance up to 19.4% for averaged F1 score on unseen QA datasets in a zero-shot in-context learning setting compared to the state-of-the-art baseline, even with much lower computation costs.
Language
eng
URI
https://hdl.handle.net/10371/196499

https://dcollection.snu.ac.kr/common/orgView/000000178873
Files in This Item:
Appears in Collections:

Altmetrics

Item View & Download Count

  • mendeley

Items in S-Space are protected by copyright, with all rights reserved, unless otherwise indicated.

Share