当前位置:网站首页>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
将搜索到的答案和输出值进行匹配
也就是将填充完的答案,映射到最终的输出上,可能是标签,也可能直接就是对应的句子。
边栏推荐
- Daily practice (19): print binary tree from top to bottom
- open3d学习笔记三【采样与体素化】
- CPU register
- ABM thesis translation
- 【Batch】learning notes
- 【Mixup】《Mixup:Beyond Empirical Risk Minimization》
- Conversion of numerical amount into capital figures in PHP
- 解决jetson nano安装onnx错误(ERROR: Failed building wheel for onnx)总结
- PHP returns the corresponding key value according to the value in the two-dimensional array
- Common machine learning related evaluation indicators
猜你喜欢
Regular expressions in MySQL
深度学习分类优化实战
【Cascade FPD】《Deep Convolutional Network Cascade for Facial Point Detection》
jetson nano安装tensorflow踩坑记录(scipy1.4.1)
Faster-ILOD、maskrcnn_benchmark训练coco数据集及问题汇总
[binocular vision] binocular stereo matching
【Batch】learning notes
机器学习理论学习:感知机
【Sparse-to-Dense】《Sparse-to-Dense:Depth Prediction from Sparse Depth Samples and a Single Image》
【Hide-and-Seek】《Hide-and-Seek: A Data Augmentation Technique for Weakly-Supervised Localization xxx》
随机推荐
The hystrix dashboard reported an error hystrix Stream is not in the allowed list of proxy host names solution
【Cascade FPD】《Deep Convolutional Network Cascade for Facial Point Detection》
[binocular vision] binocular correction
[learning notes] matlab self compiled image convolution function
【Cutout】《Improved Regularization of Convolutional Neural Networks with Cutout》
iOD及Detectron2搭建过程问题记录
CVPR19-Deep Stacked Hierarchical Multi-patch Network for Image Deblurring论文复现
论文tips
Faster-ILOD、maskrcnn_ Benchmark trains its own VOC data set and problem summary
Thesis writing tip2
Mmdetection trains its own data set -- export coco format of cvat annotation file and related operations
【双目视觉】双目矫正
[Sparse to Dense] Sparse to Dense: Depth Prediction from Sparse Depth samples and a Single Image
Replace convolution with full connection layer -- repmlp
《Handwritten Mathematical Expression Recognition with Bidirectionally Trained Transformer》论文翻译
【Cutout】《Improved Regularization of Convolutional Neural Networks with Cutout》
【雙目視覺】雙目矯正
The difference and understanding between generative model and discriminant model
mmdetection训练自己的数据集--CVAT标注文件导出coco格式及相关操作
联邦学习下的数据逆向攻击 -- GradInversion