In this paper, we propose a fully differentiable quantization method for vision transformer (ViT) named as Q-ViT, in which both of the quantization scales and bit-widths are learnable parameters. Specifically, based on our observation that heads in ViT display different quantization robustness, we leverage head-wise bit-width to squeeze the size of Q-ViT while preserving performance. In addition, we propose a novel technique named switchable scale to resolve the convergence problem in the joint training of quantization scales and bit-widths. In this way, Q-ViT pushes the limits of ViT quantization to 3-bit without heavy performance drop. Moreover, we analyze the quantization robustness of every architecture component of ViT and show that the Multi-head Self-Attention (MSA) and the Gaussian Error Linear Units (GELU) are the key aspects for ViT quantization. This study provides some insights for further research about ViT quantization. Extensive experiments on different ViT models, such as DeiT and Swin Transformer show the effectiveness of our quantization method. In particular, our method outperforms the state-of-the-art uniform quantization method by 1.5% on DeiT-Tiny.


翻译:在本文中,我们提出了名为Q- ViT的视觉变压器(Vit)完全不同的量化方法,其中量化尺度和位宽都是可学习的参数。具体地说,根据我们关于ViT头显示不同量化稳健度的观察,我们利用头智能位宽度来挤压Q- ViT的大小,同时保持性能。此外,我们提出了一种新型技术,名为可切换规模,以解决在对定量尺度和位宽进行联合培训时的趋同问题。通过这种方式,Q- ViT将ViT四分化的限度推到3位,而没有大幅的性能下降。此外,我们分析了ViT的每个结构组成部分的量化稳健度,并表明多头自省(MSA)和高斯错误线单位(GELU)是ViT量化的关键方面。本研究为关于Vit四分化的进一步研究提供了一些见解。在不同的ViT模型上进行了广泛的实验,例如DetiT和Systemal-st tystal化方法。

0
下载
关闭预览

相关内容

最新《Transformers模型》教程,64页ppt
专知会员服务
289+阅读 · 2020年11月26日
专知会员服务
44+阅读 · 2020年10月31日
专知会员服务
59+阅读 · 2020年3月19日
Stabilizing Transformers for Reinforcement Learning
专知会员服务
57+阅读 · 2019年10月17日
强化学习最新教程,17页pdf
专知会员服务
171+阅读 · 2019年10月11日
强化学习三篇论文 避免遗忘等
CreateAMind
19+阅读 · 2019年5月24日
Hierarchically Structured Meta-learning
CreateAMind
23+阅读 · 2019年5月22日
Transferring Knowledge across Learning Processes
CreateAMind
26+阅读 · 2019年5月18日
无监督元学习表示学习
CreateAMind
26+阅读 · 2019年1月4日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
ResNet, AlexNet, VGG, Inception:各种卷积网络架构的理解
全球人工智能
19+阅读 · 2017年12月17日
可解释的CNN
CreateAMind
17+阅读 · 2017年10月5日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2011年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
Arxiv
0+阅读 · 2022年10月19日
Arxiv
0+阅读 · 2022年10月15日
Arxiv
17+阅读 · 2022年2月23日
Arxiv
19+阅读 · 2021年4月8日
Learning in the Frequency Domain
Arxiv
11+阅读 · 2020年3月12日
Arxiv
11+阅读 · 2019年4月15日
VIP会员
相关VIP内容
相关资讯
强化学习三篇论文 避免遗忘等
CreateAMind
19+阅读 · 2019年5月24日
Hierarchically Structured Meta-learning
CreateAMind
23+阅读 · 2019年5月22日
Transferring Knowledge across Learning Processes
CreateAMind
26+阅读 · 2019年5月18日
无监督元学习表示学习
CreateAMind
26+阅读 · 2019年1月4日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
ResNet, AlexNet, VGG, Inception:各种卷积网络架构的理解
全球人工智能
19+阅读 · 2017年12月17日
可解释的CNN
CreateAMind
17+阅读 · 2017年10月5日
相关论文
Arxiv
0+阅读 · 2022年10月19日
Arxiv
0+阅读 · 2022年10月15日
Arxiv
17+阅读 · 2022年2月23日
Arxiv
19+阅读 · 2021年4月8日
Learning in the Frequency Domain
Arxiv
11+阅读 · 2020年3月12日
Arxiv
11+阅读 · 2019年4月15日
相关基金
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2011年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
Top
微信扫码咨询专知VIP会员