# PADA: Example-based Prompt Learning for on-the-fly Adaptation to Unseen Domains

PADA: 보지 못한 도메인에 즉시 적응하기 위한 예시 기반 프롬프트 학습

Eyal Ben-David, Nadav Oved, Roi Reichart · arXiv · 2021년 2월 24일

- **연구 문제** 목표 도메인을 전혀 알 수 없는 상황에서 여러 소스 도메인으로 학습한 모델이 테스트 예시마다 적응해야 하는 문제를 다룹니다.
- **연구 방법** PADA는 T5를 기반으로 테스트 예시마다 도메인 이름과 DRF로 이루어진 프롬프트를 생성한 뒤, 그 프롬프트를 조건으로 과제 레이블을 예측합니다.
- **주요 결과** Rumour Detection과 MNLI에서 PADA는 다수의 설정에서 기준 모델보다 높은 평균 성능을 보였고, Aspect Prediction의 네 설정 모두에서도 기준 모델보다 높았습니다.

## 목표 도메인을 모르는 적응 문제

기존 도메인 적응은 대개 목표 도메인의 레이블이나 비레이블 데이터가 학습 시점에 있다고 가정합니다. 이 논문이 다루는 문제는 그보다 어려운 설정입니다. 모델은 여러 소스 도메인에서 학습하지만, 테스트 시점에 등장하는 도메인은 학습 때 알 수 없으며 그 도메인의 예시나 기타 지식도 주어지지 않습니다. 저자들은 이를 any-domain adaptation이라고 부르며, 목표 도메인별로 모델을 따로 학습해야 하는 기존 방식의 비효율을 함께 지적합니다.

이 설정에서 중요한 것은 테스트 예시 하나하나를 소스 도메인들의 의미 공간에 맞추는 것입니다. PADA는 이 문제를 예시 단위의 프롬프트 생성으로 풉니다. 같은 모델을 하나만 학습하고, 테스트 예시마다 도메인 관련 특징으로 구성된 프롬프트를 만들어 과제 예측에 사용합니다.

## PADA의 프롬프트 기반 동작

PADA는 사전 학습된 T5를 기반으로 하는 예시 기반 프롬프트 학습 방법입니다. 학습 시에는 두 과제를 함께 학습합니다. 첫째는 입력 앞에 Domain: 접두어를 붙여 도메인 이름 N\_i와 DRF 집합 R\_i를 생성하는 생성 과제이고, 둘째는 N\_i와 R\_i로 이루어진 프롬프트를 조건으로 레이블 y\_i를 예측하는 분류 과제입니다. 두 과제의 예시는 확률 α에 따라 섞이며, α가 클수록 생성 과제를 더 많이 학습합니다.

추론 시에는 미지 도메인 예시가 들어오면 모델이 먼저 소스 도메인 중 가장 적절한 도메인 이름과 여러 소스의 DRF를 생성합니다. 이 생성된 프롬프트가 조건이 되어 과제 레이블을 예측합니다. 분류기는 T5 인코더 위에 올린 1D-CNN으로 구현되며, 원문은 이 구현을 원래 T5 분류 방식과 구분해 설명합니다.

![Figure 1: Text classiﬁcation with PADA. Colored texts signify relation to a speciﬁc source domain. PADA ﬁrst generates the domain name, followed by a set of DR…](https://refivu.com/papers/1c1edf58-9646-4fc9-9631-5ddd3c11e749/figures/figure-b03cdb49db7e7a4eff14c5dca6351f28.png?thumb=512)

**Figure 1** : Text classiﬁcation with PADA. Colored texts signify relation to a speciﬁc source domain. PADA ﬁrst generates the domain name, followed by a set of DRFs related to the input example. Then it uses the prompt to predict the task label.

[원문](https://arxiv.org/abs/2102.12206v4) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Eyal Ben-David, Nadav Oved, Roi Reichart · PADA: Example-based Prompt Learning for on-the-fly Adaptation to Unseen Domains · 원문 그림 인용 · 원본 PDF 1쪽에서 그림 영역을 추출했습니다.

![Figure 5: Average ratios of number of domains in generated prompts, calculated over all develop- ment and test sets in the rumour detection task](https://refivu.com/papers/1c1edf58-9646-4fc9-9631-5ddd3c11e749/figures/figure-885f9246d477e22a5a9dc085fb9ecbbe.png?thumb=512)

**Figure 5** : Average ratios of number of domains in generated prompts, calculated over all develop- ment and test sets in the rumour detection task.

[원문](https://arxiv.org/abs/2102.12206v4) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Eyal Ben-David, Nadav Oved, Roi Reichart · PADA: Example-based Prompt Learning for on-the-fly Adaptation to Unseen Domains · 원문 그림 인용 · 원본 PDF 12쪽에서 그림 영역을 추출했습니다.

## DRF 추출과 프롬프트 주석

DRF는 특정 소스 도메인과 강하게 연관된 토큰으로, 도메인의 의미를 드러내는 특징입니다. 저자들은 여러 추출 기준을 실험했으며 상호정보량(Mutual Information)이 도메인 특화 의미를 더 잘 드러냈다고 보고합니다. 이 방법은 소스 도메인 j의 텍스트에 1, 나머지 소스 텍스트에 0을 붙인 이진 변수와 토큰 사이의 상호정보량을 계산하고, 점수가 높은 l개의 토큰을 고릅니다.

다만 상호정보량이 높은 토큰이라도 다른 소스 도메인과 더 많이 연관될 수 있으므로, 저자들은 빈도 비율 조건 C\_{S\\S\_j}(n)/C\_{S\_j}(n) ≤ ρ와 C\_{S\_j}(n) \> 0을 추가합니다. 여기서 ρ가 작을수록 그 n-gram이 해당 도메인에 더 특화되어 있습니다. 원문은 ρ를 0, 1, 10, 100으로 바꾼 예시를 보여 주며, ρ가 커지면 도메인 특화성이 약해진다고 설명합니다. 학습 예시의 프롬프트는 해당 도메인의 DRF 집합에서 T5 임베딩 사이의 유클리드 거리로 가장 관련 있는 m개 특징을 골라 만듭니다.

![Table 2: A sample of DRFs extracted for the Fer- guson domain (rumour detection) with different ρ values. Each column represents DRFs which are ﬁltered in DRF…](https://refivu.com/papers/1c1edf58-9646-4fc9-9631-5ddd3c11e749/figures/figure-2b02a6021bc4d71fe99b3d61c72194e6.png?thumb=512)

**Table 2** : A sample of DRFs extracted for the Fer- guson domain (rumour detection) with different ρ values. Each column represents DRFs which are ﬁltered in DRF sets of lower ρ value. DRFs of lowerρ values are more domain speciﬁc.

[원문](https://arxiv.org/abs/2102.12206v4) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Eyal Ben-David, Nadav Oved, Roi Reichart · PADA: Example-based Prompt Learning for on-the-fly Adaptation to Unseen Domains · 원문 그림 인용 · 원본 PDF 7쪽에서 그림 영역을 추출했습니다.

![Table 3: A sample of DRFs from four rumour de- tection domains along with their frequency for be- ing annotated in a training example’s prompt](https://refivu.com/papers/1c1edf58-9646-4fc9-9631-5ddd3c11e749/figures/figure-01e5d538fce72f109019a1f1e9949959.png?thumb=512)

**Table 3** : A sample of DRFs from four rumour de- tection domains along with their frequency for be- ing annotated in a training example’s prompt.

[원문](https://arxiv.org/abs/2102.12206v4) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Eyal Ben-David, Nadav Oved, Roi Reichart · PADA: Example-based Prompt Learning for on-the-fly Adaptation to Unseen Domains · 원문 그림 인용 · 원본 PDF 8쪽에서 그림 영역을 추출했습니다.

## 텍스트 분류와 시퀀스 태깅 결과

Rumour Detection과 MNLI에서 PADA는 평가 설정 중 다수에서 기준 모델보다 높은 평가를 받았습니다. Rumour Detection은 이진 F1, MNLI는 macro-F1으로 측정했으며, 평균 이득은 Rumour Detection에서 3.5%, MNLI에서 1.3%로 보고됩니다. 이 평균은 PADA와 최고 기준선의 차이를 설명하는 값입니다.

![Table 5: Binary-F1 scores for the Rumour Detection task and macro-F1 scores for the MNLI task](https://refivu.com/papers/1c1edf58-9646-4fc9-9631-5ddd3c11e749/figures/figure-f73bcb7d6af20596c601a59341295e67.png?thumb=512)

**Table 5** : Binary-F1 scores for the Rumour Detection task and macro-F1 scores for the MNLI task.

[원문](https://arxiv.org/abs/2102.12206v4) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Eyal Ben-David, Nadav Oved, Roi Reichart · PADA: Example-based Prompt Learning for on-the-fly Adaptation to Unseen Domains · 원문 그림 인용 · 원본 PDF 11쪽에서 그림 영역을 추출했습니다.

Aspect Prediction에서는 PADA가 네 개 설정 모두에서 비교 모델보다 높은 binary-F1을 보였습니다. 원문은 평균적으로 두 번째로 좋은 T5-IRM보다 3.5% 높다고 보고합니다. 이 결과는 PADA가 여러 과제 형식에 적용될 수 있음을 보여 주지만, 각 과제의 데이터와 기준선 조건은 서로 다릅니다.

![Table 6: Binary-F1 scores for Aspect Prediction](https://refivu.com/papers/1c1edf58-9646-4fc9-9631-5ddd3c11e749/figures/figure-5fbbd27d2a4c820128edf0b240cd9495.png?thumb=512)

**Table 6** : Binary-F1 scores for Aspect Prediction.

[원문](https://arxiv.org/abs/2102.12206v4) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Eyal Ben-David, Nadav Oved, Roi Reichart · PADA: Example-based Prompt Learning for on-the-fly Adaptation to Unseen Domains · 원문 그림 인용 · 원본 PDF 11쪽에서 그림 영역을 추출했습니다.

## 프롬프트 생성의 소스 의존성

저자들은 PADA의 프롬프트 생성이 학습에 사용한 소스 도메인 집합에 의해 제한된다고 설명합니다. 목표 도메인이 소스 도메인과 의미적으로 거의 관련이 없으면 DRF 기반 프롬프트가 적절하지 않을 수 있습니다. 이를 줄이기 위해 PADA는 DRF가 아닌 단어도 생성할 수 있지만, 프롬프트 생성 학습이 하위 예측 목표를 직접 최적화하지는 않는다는 점은 남아 있습니다.

![Table 1: Examples for DRF-based prompts gener- ated by PADA, from the Charlie-Hebdo (C) target domain, which is unknown to PADA during train- ing (source domai…](https://refivu.com/papers/1c1edf58-9646-4fc9-9631-5ddd3c11e749/figures/figure-c2b27b1122eaf977e1efbc6b07e615f4.png?thumb=512)

**Table 1** : Examples for DRF-based prompts gener- ated by PADA, from the Charlie-Hebdo (C) target domain, which is unknown to PADA during train- ing (source domains are FR, GW, OS, and S. See Table 4). PADA generates prompts which are se- mantically related to the input example by com- bining DRFs from source domains along with non- DRF yet relevant words. Moreover, it can also generate new domain names (Paris Siege).

[원문](https://arxiv.org/abs/2102.12206v4) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Eyal Ben-David, Nadav Oved, Roi Reichart · PADA: Example-based Prompt Learning for on-the-fly Adaptation to Unseen Domains · 원문 그림 인용 · 원본 PDF 6쪽에서 그림 영역을 추출했습니다.

## 논문 정보

- **저자**: Eyal Ben-David, Nadav Oved, Roi Reichart
- **학회·저널**: arXiv · 프리프린트
- **최초 공개일**: 2021년 2월 24일
- **등록일**: 2026년 11월 6일
- **수정일**: 2022년 1월 27일
- **버전**: v4
- **arXiv**: 2102.12206
- **분류**: cs.CL · cs.AI · cs.LG
- **원문 이용 조건**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **제공 범위**: 논문 정보, 해설, 허용된 원문 그림

[논문 원문 ↗](https://arxiv.org/abs/2102.12206v4) · [원문 PDF ↗](https://arxiv.org/pdf/2102.12206v4)

AI 해설은 논문 원문과 별개의 설명이며 오류가 있을 수 있습니다. 원문과 그림은 각 출처의 이용 조건과 따로 표시된 권리를 따릅니다.

## 초록

Natural Language Processing algorithms have made incredible progress, but they still struggle when applied to out-of-distribution examples. We address a challenging and underexplored version of this domain adaptation problem, where an algorithm is trained on several source domains, and then applied to examples from unseen domains that are unknown at training time. Particularly, no examples, labeled or unlabeled, or any other knowledge about the target domain are available to the algorithm at training time. We present PADA: An example-based autoregressive Prompt learning algorithm for on-the-fly Any-Domain Adaptation, based on the T5 language model. Given a test example, PADA first generates a unique prompt for it and then, conditioned on this prompt, labels the example with respect to the NLP prediction task. PADA is trained to generate a prompt which is a token sequence of unrestricted length, consisting of Domain Related Features (DRFs) that characterize each of the source domains. Intuitively, the generated prompt is a unique signature that maps the test example to a semantic space spanned by the source domains. In experiments with 3 tasks (text classification and sequence tagging), for a total of 14 multi-source adaptation scenarios, PADA substantially outperforms strong baselines.

## 원문 인용

Eyal Ben-David, Nadav Oved, Roi Reichart (2021). PADA: Example-based Prompt Learning for on-the-fly Adaptation to Unseen Domains. arXiv:2102.12206v4. https://arxiv.org/abs/2102.12206v4

**BibTeX**

```
@misc{bendavid2021pada,
  title = {{PADA: Example-based Prompt Learning for on-the-fly Adaptation to Unseen Domains}},
  author = {Eyal Ben-David and Nadav Oved and Roi Reichart},
  year = {2021},
  eprint = {2102.12206},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2102.12206v4}
}
```

## 이 논문의 용어

- [Macro-F1](https://refivu.com/terms/bac7d2670b4d-macro-f1)
- [Mutual information](https://refivu.com/terms/31de24f17a5e-mutual-information)
- [ROUGE](https://refivu.com/terms/b50ceb784ddd-rouge)
- [BertScore](https://refivu.com/terms/73f4d496fe9c-bertscore)
- [Domain Adaptation](https://refivu.com/terms/dfc6e2afbc1f-domain-adaptation)
- [T5](https://refivu.com/terms/ae2113eb6c55-t5)
- [Mixture of Experts](https://refivu.com/terms/5fa1c1ebf77b-mixture-of-experts)
- [MNLI](https://refivu.com/terms/3187e3865499-mnli)
- [unsupervised domain adaptation](https://refivu.com/terms/d063363072e6-unsupervised-domain-adaptation)
- [Diverse Beam Search](https://refivu.com/terms/0b9899c65f09-diverse-beam-search)
- [Prompt+LM Tuning](https://refivu.com/terms/1873973bb358-prompt-lm-tuning)

## 다른 논문 해설

- [A Review of the Trends and Challenges in Adopting Natural Language Processing Methods for Education Feedback Analysis](https://refivu.com/papers/3d712d32-d3ac-415c-b662-8b657081f4c6-a-review-of-the-trends-and-challenges-in.md)
- [Training Tips for the Transformer Model](https://refivu.com/papers/f2437599-de07-4bc9-b659-4823dff3be26-training-tips-for-the-transformer-model.md)
- [Artificial intelligence contribution to translation industry: looking back and forward](https://refivu.com/papers/bb8c5e97-6b4d-4494-8e95-7693f7754127-artificial-intelligence-contribution-to-translation-industry.md)
- [Kencorpus: A Kenyan Language Corpus of Swahili, Dholuo and Luhya for Natural Language Processing Tasks](https://refivu.com/papers/63ecaace-b12e-4c8f-8421-3ed079f7ba82-kencorpus-a-kenyan-language-corpus-of-swahili-dholuo.md)
- [Assessing Text Classification Methods for Cyberbullying Detection on Social Media Platforms](https://refivu.com/papers/7faefd2d-5919-41ff-8a98-9f4d1c5bfc04-assessing-text-classification-methods-for-cyberbullying.md)
- [Short text classification with machine learning in the social sciences: The case of climate change on Twitter](https://refivu.com/papers/1572ef01-e606-4f6e-a992-4b353feb817a-short-text-classification-with-machine-learning-in-the.md)
- [A Cost-Effective Person-Following System for Assistive Unmanned Vehicles with Deep Learning at the Edge](https://refivu.com/papers/0cb01695-4102-42ac-b5a9-30acfc1abc20-a-cost-effective-person-following-system-for-assistive.md)
- [Deep Learning-Enabled Semantic Communication Systems with Task-Unaware Transmitter and Dynamic Data](https://refivu.com/papers/ebc873df-6d28-4b2d-ac6c-575f5c818afc-deep-learning-enabled-semantic-communication-systems-with.md)
- [FA-GAN: Fused Attentive Generative Adversarial Networks for MRI Image Super-Resolution](https://refivu.com/papers/01d69bdf-2577-4157-bdf1-84bf1a339800-fa-gan-fused-attentive-generative-adversarial-networks-for.md)
- [DriveMLM: Aligning Multi-Modal Large Language Models with Behavioral Planning States for Autonomous Driving](https://refivu.com/papers/a8c14912-7460-43dd-9905-2047682d37fa-drivemlm-aligning-multi-modal-large-language-models-with.md)
- [Text Clustering with Large Language Model Embeddings](https://refivu.com/papers/148bc66c-4c93-44e3-b5de-3dedee58dc6e-text-clustering-with-large-language-model-embeddings.md)
- [Deep Partial Multi-View Learning](https://refivu.com/papers/b5d21a74-e2a9-402e-bdd6-20653bb21d8b-deep-partial-multi-view-learning.md)

---

AI 해설에는 오류가 있을 수 있습니다. [Refivu](https://refivu.com/papers/1c1edf58-9646-4fc9-9631-5ddd3c11e749-pada-example-based-prompt-learning-for-on-the)
