Abstract
一、研究思路:
1. 一种通用的网络模型——先预训练,再微调策略:pre-training-then-fine-tuning
2.视觉语言大模型的两种训练手段visual-language
(VL) model:masked language modeling
(MLM)
和
image-text matching (ITM)
3.
大语言模型在
VQA
任务上的应用:先用大语言模型进行预训练,再采用答案预测
loss
进行微调
其所存在的问题如下:
目标函数不一致,即预训练模型的目标函数和答案预测的目标函数不一样,导致泛化性不强;需要大量有标注的数据集进行微调the inconsistency of the ob jective forms not only severely limits the general ization of pre-trained VL models to downstream tasks, but also requires a large amount of labeled data for fine-tuning.
二、本文方法:
一种新的方法:Declaration-based Prompt Tuning, abbre
viated as DPT
1. textual adaptation, which converts the given questions into declarative sentence form for prompt-tuning (将给定的问题转换为陈述句,进行提示微调)2. task adaptation, which optimizes the objective function of VQA problem in the manner of pre-training phase (用预训练形式优化 VQA 问题的目标函数)
Introduction
![](https://i-blog.csdnimg.cn/blog_migrate/3cd82e3b34ab060c28eb14e51b445b67.png)
一、本文方法:
1.textual adaptation, which converts the given questions into
declarative sentence form for prompt-tuning
(将给定的问题转换为陈述句,进行提示微调)
2.task adaptation, which optimizes the objective function of VQA problem in the manner of
pre-training phase
(用预训练形式优化
VQA
问题的目标函数)
Related Work
一、Pre-trained Vision-language Models:
引入两个子任务:
1.mask language model (MLM) task (掩码学习任务):在多模态文本中恢复被 mask 掉的文本或者图像2.image-text matching (ITM) task (图文匹配任务 ):验证图像和给定的文本是否对齐,这里比较典型的模型就是 CLIP
为了消除预训练模型目标和下游任务视觉问答任务之间的目标函数不一致问题,本文将微调阶段的视觉问答任务也转换成了和预训练模型一样的形式。
创新点:
1.the first attempt in the prompt tuning using declaration sentences for visual question answering(第一个尝试使用陈述句进行VQA任务的);2.reformulate VQA into cloze-filling and image-text matching problems, i.e., MLM and ITM (将 VQA 任务视为填充和图文匹配任务)。
二、Cross-modal Prompt Tuning:
an innovative declaration-based prompt
model
Methodology
![](https://i-blog.csdnimg.cn/blog_migrate/2b36bb4bf913aeaa11c7e4d02925a956.png)
一、Pre-training-then-fine-tuning paradigm:
用transformer模型在大规模的图像-文本对上进行预训练,图像区域特征和问题word embedding特征级联(增加了特殊字符,Ecls和Esep)输出模态融合特征,Ecls被用来预测答案(采用多分类损失)
二、Declaration-based Prompt Tuning:
旨在解决的两个问题:
(1)不同的文本输入different forms of textual in put (question vs. declaration)(2)不同的任务目标different task objectives (MLM&ITM vs. answer classifification)
解决方法:
1.Textual Adaptation via Declaration Generation
(通过陈述句生成的文本自适应)
疑问句变成陈述句,例如“What is the red ob
ject left of the girl?
”
,可以转化为“A red [MASK] is left of the girl.
”
具体做法:(1)将该任务视为翻译任务,疑问句作为源文件,陈述句作为目标文件;(2)将GQA数据集的标注作为数据集(因为GQA数据集中包含question和其对应的full_answer, full_answer被视为陈述句,short_answer被视为[mask] token);(3)在这个数据集上采用an encoder decoder network (T5 ) 进行训练,使用 the standard auto-regressive cross-entropy loss 优化模型。
2.Task Adaptation
(任务自适应
):
(1)MLM:MLM 将带有[MASK] token 的句子作为输入,通过多分类损失来预测最终的答案,即填充被掩码掉的单词,即为该问题的答案;
问题和陈述句级联作为输入文本(其中陈述句是包含mask的),D表示陈述句,Q表示问题,此外,还包括两个特殊符号,CLS和SEP
将word embedding特征和图像的目标特征进行级联,得到融合以后的特征;再将CLS和MASK的特征级联,预测答案(这里其实不太明白为什么只需要CLS和MASK的特征)。
采用交叉熵损失来优化模型参数。
(2) ITM:ITM 将 [MASK] 用 MLM 所预测的前 K 个候选答案作为补充,得到 K 个完成的陈述句,并用二分类器来预测匹配得分。
K
个候选陈述句:
先计算图像和第k个候选答案的匹配得分
通常情况下,当预测答案和真实答案一致时,1;当预测答案不等于真实答案时,0;
Training and inference (训练和测试):
训练(总loss):
测试:
两个模型的预测概率输出进行求和,最高得分的答案被视为模型的最终预测结果。
Experiments
一、数据集:GQA(组合问答和视觉推理)和VQA2.0(每个图像平均5个问题)
二、Model training:T5-small用来生成陈述句
三、评价指标
1.陈述句生成(计算标准文本和生成文本中的单词重合得分,得分越高,说明生成质量越好):Bilin
gual Evaluation Understudy (BLEU):calculates scores based on the overlap of
words in the reference text and the generated text
一些生成的陈述句并不能完整地包含问题的所有语义,例如:
因此,我们需要保留问题的特征。
代码分析见下节。