当前位置:网站首页>Prompt 范式简述
Prompt 范式简述
2022-07-02 06:26:00 【MezereonXP】
Prompt 范式简述
Traditional Framework:
- pre-train
- fine-tune
传统的训练框架为,先在一个大规模的数据集上对模型进行预训练,然后在目标任务的数据集上进行微调。
Prompt Framework
- pre-train
- prompt
- predict
Prompt框架则是分成三个部分,预训练,Prompt生成,以及预测
Goal: Let the pertained model itself can be used to predict the desired output without any task-specific training.
Prompt 本质上是对任务数据进行变换,将原本的目标、标签,做一个转换,融入到数据之中。
For example, the emotion label of the sentence “I won the game.” is good.
We can also get a longer sentence “I won the game, so I felt good.”
上述这个例子就是,将标签 good 转换成额外的语句,加到输入后面。
这样的变换使得,我们通过自然的自监督学习,就可以实现任务所需的目标
Prompt Basics
一般来说,Prompt 包含三个步骤:
- Prompt Addition
- Answer Search
- Answer Mapping
Prompt Addition
这一步其实是将输入进行修改
比如 [X] Overall, it was a [Z] movie 这样的形式
我们将输入填到 [X] 的位置,返回一整个语句,留出 [Z] 的位置,等待答案的填充。
Answer Search
z ^ = search z ∈ Z P ( f fill ( x ′ , z ) ; θ ) \hat z = \text{search}_{z\in \mathcal{Z}}P(f_{\text{fill}}(x',z);\theta) z^=searchz∈ZP(ffill(x′,z);θ)
如上述公式所示,在这一步,我们的目的是,填充最可能的答案。
Answer Mapping
将搜索到的答案和输出值进行匹配
也就是将填充完的答案,映射到最终的输出上,可能是标签,也可能直接就是对应的句子。
边栏推荐
- Convert timestamp into milliseconds and format time in PHP
- Translation of the paper "written mathematical expression recognition with bidirectionally trained transformer"
- Implementation of yolov5 single image detection based on onnxruntime
- Implementation of yolov5 single image detection based on pytorch
- Win10 solves the problem that Internet Explorer cannot be installed
- Apple added the first iPad with lightning interface to the list of retro products
- Gensim如何冻结某些词向量进行增量训练
- Win10+vs2017+denseflow compilation
- 【Hide-and-Seek】《Hide-and-Seek: A Data Augmentation Technique for Weakly-Supervised Localization xxx》
- Embedding malware into neural networks
猜你喜欢
Eklavya -- infer the parameters of functions in binary files using neural network
【雙目視覺】雙目矯正
用MLP代替掉Self-Attention
【Programming】
【DIoU】《Distance-IoU Loss:Faster and Better Learning for Bounding Box Regression》
Deep learning classification Optimization Practice
win10+vs2017+denseflow编译
【Wing Loss】《Wing Loss for Robust Facial Landmark Localisation with Convolutional Neural Networks》
用MLP代替掉Self-Attention
iOD及Detectron2搭建过程问题记录
随机推荐
【MnasNet】《MnasNet:Platform-Aware Neural Architecture Search for Mobile》
【Cascade FPD】《Deep Convolutional Network Cascade for Facial Point Detection》
论文写作tip2
PHP returns the abbreviation of the month according to the numerical month
One book 1078: sum of fractional sequences
图片数据爬取工具Image-Downloader的安装和使用
Ppt skills
open3d学习笔记三【采样与体素化】
【AutoAugment】《AutoAugment:Learning Augmentation Policies from Data》
Mmdetection trains its own data set -- export coco format of cvat annotation file and related operations
The hystrix dashboard reported an error hystrix Stream is not in the allowed list of proxy host names solution
Hystrix dashboard cannot find hystrix Stream solution
【AutoAugment】《AutoAugment:Learning Augmentation Policies from Data》
Win10 solves the problem that Internet Explorer cannot be installed
【Cutout】《Improved Regularization of Convolutional Neural Networks with Cutout》
【雙目視覺】雙目矯正
联邦学习下的数据逆向攻击 -- GradInversion
程序的内存模型
CPU register
Faster-ILOD、maskrcnn_ Benchmark trains its own VOC data set and problem summary