Add Batch c3df5b0e-60d5-4538-aea5-09d3ea36e7cc
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- understandingwhendynamicsinvariantdataaugmentationsbenefitmodelfreereinforcementlearningupdates/1febf459-b4de-472a-9c57-7a2c5dbb585e_content_list.json +3 -0
- understandingwhendynamicsinvariantdataaugmentationsbenefitmodelfreereinforcementlearningupdates/1febf459-b4de-472a-9c57-7a2c5dbb585e_model.json +3 -0
- understandingwhendynamicsinvariantdataaugmentationsbenefitmodelfreereinforcementlearningupdates/1febf459-b4de-472a-9c57-7a2c5dbb585e_origin.pdf +3 -0
- understandingwhendynamicsinvariantdataaugmentationsbenefitmodelfreereinforcementlearningupdates/full.md +551 -0
- understandingwhendynamicsinvariantdataaugmentationsbenefitmodelfreereinforcementlearningupdates/images.zip +3 -0
- understandingwhendynamicsinvariantdataaugmentationsbenefitmodelfreereinforcementlearningupdates/layout.json +3 -0
- uniadapterunifiedparameterefficienttransferlearningforcrossmodalmodeling/52f7b6bf-2aa8-400c-a267-19af62d77573_content_list.json +3 -0
- uniadapterunifiedparameterefficienttransferlearningforcrossmodalmodeling/52f7b6bf-2aa8-400c-a267-19af62d77573_model.json +3 -0
- uniadapterunifiedparameterefficienttransferlearningforcrossmodalmodeling/52f7b6bf-2aa8-400c-a267-19af62d77573_origin.pdf +3 -0
- uniadapterunifiedparameterefficienttransferlearningforcrossmodalmodeling/full.md +613 -0
- uniadapterunifiedparameterefficienttransferlearningforcrossmodalmodeling/images.zip +3 -0
- uniadapterunifiedparameterefficienttransferlearningforcrossmodalmodeling/layout.json +3 -0
- unifiedlanguagevisionpretraininginllmwithdynamicdiscretevisualtokenization/22e02364-6ec4-4edb-8d55-5c31483c2a1f_content_list.json +3 -0
- unifiedlanguagevisionpretraininginllmwithdynamicdiscretevisualtokenization/22e02364-6ec4-4edb-8d55-5c31483c2a1f_model.json +3 -0
- unifiedlanguagevisionpretraininginllmwithdynamicdiscretevisualtokenization/22e02364-6ec4-4edb-8d55-5c31483c2a1f_origin.pdf +3 -0
- unifiedlanguagevisionpretraininginllmwithdynamicdiscretevisualtokenization/full.md +676 -0
- unifiedlanguagevisionpretraininginllmwithdynamicdiscretevisualtokenization/images.zip +3 -0
- unifiedlanguagevisionpretraininginllmwithdynamicdiscretevisualtokenization/layout.json +3 -0
- unifiedprojectionfreealgorithmsforadversarialdrsubmodularoptimization/9ef5d652-2abd-437a-93da-3bb07e2e7482_content_list.json +3 -0
- unifiedprojectionfreealgorithmsforadversarialdrsubmodularoptimization/9ef5d652-2abd-437a-93da-3bb07e2e7482_model.json +3 -0
- unifiedprojectionfreealgorithmsforadversarialdrsubmodularoptimization/9ef5d652-2abd-437a-93da-3bb07e2e7482_origin.pdf +3 -0
- unifiedprojectionfreealgorithmsforadversarialdrsubmodularoptimization/full.md +0 -0
- unifiedprojectionfreealgorithmsforadversarialdrsubmodularoptimization/images.zip +3 -0
- unifiedprojectionfreealgorithmsforadversarialdrsubmodularoptimization/layout.json +3 -0
- unifyingfeatureandcostaggregationwithtransformersforsemanticandvisualcorrespondence/cb3ab669-8313-4e26-82ed-a443e14a633c_content_list.json +3 -0
- unifyingfeatureandcostaggregationwithtransformersforsemanticandvisualcorrespondence/cb3ab669-8313-4e26-82ed-a443e14a633c_model.json +3 -0
- unifyingfeatureandcostaggregationwithtransformersforsemanticandvisualcorrespondence/cb3ab669-8313-4e26-82ed-a443e14a633c_origin.pdf +3 -0
- unifyingfeatureandcostaggregationwithtransformersforsemanticandvisualcorrespondence/full.md +369 -0
- unifyingfeatureandcostaggregationwithtransformersforsemanticandvisualcorrespondence/images.zip +3 -0
- unifyingfeatureandcostaggregationwithtransformersforsemanticandvisualcorrespondence/layout.json +3 -0
- unio4unifyingonlineandofflinedeepreinforcementlearningwithmultisteponpolicyoptimization/37128ac2-2db2-4cbc-a55a-8aa686e6517d_content_list.json +3 -0
- unio4unifyingonlineandofflinedeepreinforcementlearningwithmultisteponpolicyoptimization/37128ac2-2db2-4cbc-a55a-8aa686e6517d_model.json +3 -0
- unio4unifyingonlineandofflinedeepreinforcementlearningwithmultisteponpolicyoptimization/37128ac2-2db2-4cbc-a55a-8aa686e6517d_origin.pdf +3 -0
- unio4unifyingonlineandofflinedeepreinforcementlearningwithmultisteponpolicyoptimization/full.md +0 -0
- unio4unifyingonlineandofflinedeepreinforcementlearningwithmultisteponpolicyoptimization/images.zip +3 -0
- unio4unifyingonlineandofflinedeepreinforcementlearningwithmultisteponpolicyoptimization/layout.json +3 -0
- unirlhfuniversalplatformandbenchmarksuiteforreinforcementlearningwithdiversehumanfeedback/6a0e17a1-2546-48c9-923d-7178fffd7f8e_content_list.json +3 -0
- unirlhfuniversalplatformandbenchmarksuiteforreinforcementlearningwithdiversehumanfeedback/6a0e17a1-2546-48c9-923d-7178fffd7f8e_model.json +3 -0
- unirlhfuniversalplatformandbenchmarksuiteforreinforcementlearningwithdiversehumanfeedback/6a0e17a1-2546-48c9-923d-7178fffd7f8e_origin.pdf +3 -0
- unirlhfuniversalplatformandbenchmarksuiteforreinforcementlearningwithdiversehumanfeedback/full.md +0 -0
- unirlhfuniversalplatformandbenchmarksuiteforreinforcementlearningwithdiversehumanfeedback/images.zip +3 -0
- unirlhfuniversalplatformandbenchmarksuiteforreinforcementlearningwithdiversehumanfeedback/layout.json +3 -0
- unitabeauniversalpretrainingprotocolfortabularfoundationmodelindatascience/a9af77ac-114a-47f9-b0a3-b26885afeb56_content_list.json +3 -0
- unitabeauniversalpretrainingprotocolfortabularfoundationmodelindatascience/a9af77ac-114a-47f9-b0a3-b26885afeb56_model.json +3 -0
- unitabeauniversalpretrainingprotocolfortabularfoundationmodelindatascience/a9af77ac-114a-47f9-b0a3-b26885afeb56_origin.pdf +3 -0
- unitabeauniversalpretrainingprotocolfortabularfoundationmodelindatascience/full.md +347 -0
- unitabeauniversalpretrainingprotocolfortabularfoundationmodelindatascience/images.zip +3 -0
- unitabeauniversalpretrainingprotocolfortabularfoundationmodelindatascience/layout.json +3 -0
- universalbackdoorattacks/ad5b07e6-8f66-4fcc-b69d-83a113ca834d_content_list.json +3 -0
- universalbackdoorattacks/ad5b07e6-8f66-4fcc-b69d-83a113ca834d_model.json +3 -0
understandingwhendynamicsinvariantdataaugmentationsbenefitmodelfreereinforcementlearningupdates/1febf459-b4de-472a-9c57-7a2c5dbb585e_content_list.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ad5acca1f9577c94a2abc1566d6fa66dfe09878ec2cf6f5d41f077ec22f1ebfb
|
| 3 |
+
size 130688
|
understandingwhendynamicsinvariantdataaugmentationsbenefitmodelfreereinforcementlearningupdates/1febf459-b4de-472a-9c57-7a2c5dbb585e_model.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:61acfab01ca0695ba22b39f934942544f4fb688395f33e6762b341450fffd0e5
|
| 3 |
+
size 170526
|
understandingwhendynamicsinvariantdataaugmentationsbenefitmodelfreereinforcementlearningupdates/1febf459-b4de-472a-9c57-7a2c5dbb585e_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a358cb91a459379cd0ddeb00d21a5838535cc245af093a8ba330a472daad9960
|
| 3 |
+
size 13869287
|
understandingwhendynamicsinvariantdataaugmentationsbenefitmodelfreereinforcementlearningupdates/full.md
ADDED
|
@@ -0,0 +1,551 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# UNDERSTANDING WHEN DYNAMICS-INVARIANT DATA AUGMENTATIONS BENEFIT MODEL-FREE REINFORCEMENT LEARNING UPDATES
|
| 2 |
+
|
| 3 |
+
Nicholas E. Corrado
|
| 4 |
+
|
| 5 |
+
Department of Computer Sciences
|
| 6 |
+
University of Wisconsin - Madison
|
| 7 |
+
ncorrado@wisc.edu
|
| 8 |
+
|
| 9 |
+
Josiah P. Hanna
|
| 10 |
+
|
| 11 |
+
Department of Computer Sciences
|
| 12 |
+
University of Wisconsin - Madison
|
| 13 |
+
jphanna@cs.wisc.edu
|
| 14 |
+
|
| 15 |
+
# ABSTRACT
|
| 16 |
+
|
| 17 |
+
Recently, data augmentation (DA) has emerged as a method for leveraging domain knowledge to inexpensively generate additional data in reinforcement learning (RL) tasks, often yielding substantial improvements in data efficiency. While prior work has demonstrated the utility of incorporating augmented data directly into model-free RL updates, it is not well-understood when a particular DA strategy will improve data efficiency. In this paper, we seek to identify general aspects of DA responsible for observed learning improvements. Our study focuses on sparse-reward tasks with dynamics-invariant data augmentation functions, serving as an initial step towards a more general understanding of DA and its integration into RL training. Experimentally, we isolate three relevant aspects of DA: state-action coverage, reward density, and the number of augmented transitions generated per update (the augmented replay ratio). From our experiments, we draw two conclusions: (1) increasing state-action coverage often has a much greater impact on data efficiency than increasing reward density, and (2) decreasing the augmented replay ratio substantially improves data efficiency. In fact, certain tasks in our empirical study are solvable only when the replay ratio is sufficiently low.
|
| 18 |
+
|
| 19 |
+
# 1 INTRODUCTION
|
| 20 |
+
|
| 21 |
+
Reinforcement learning (RL) algorithms are often data inefficient and often produce policies that fail to generalize outside of a narrow state distribution. Recently, a number of RL algorithms and applications have been published that leverage data augmentation to enhance convergence and generalization (Mitrano and Berenson, 2022; Pitis et al., 2020; Qiao et al., 2021). Data augmentation (DA) is a technique in which agents generate additional synthetic experience by applying transformations to their observed experience. Since augmented data can be generated without the expense of additional interaction with the environment, it is an attractive technique for improving the data efficiency of RL algorithms (i.e., the number of environment interactions needed to solve a task).
|
| 22 |
+
|
| 23 |
+
Much of the prior work in DA for RL (Hansen and Wang, 2021; Laskin et al., 2020; Raileanu et al., 2021; Wang et al., 2020; Yarats et al., 2020; 2021) builds off of DA techniques used in computer vision (Chen et al., 2020). Other works have used domain-dependent DA strategies for non-visual tasks (Abdolhosseini et al., 2019; Mikhail Pavlov and Plis, 2018), including DeepMind's AlphaTensor (Fawzi et al., 2022) which uses RL to discover more efficient matrix multiplications. These works introduce methods for generating augmented data and frameworks for integrating it into RL that demonstrably improve training performance. To the best of our knowledge, most prior work on DA has focused on introducing new types of data augmentation functions and demonstrating that they can boost the data efficiency of RL. What is missing from the literature is a clear understanding of which aspects of DA yield improvements. Rather than adding to existing work by introducing new DA strategies, our main contribution is an investigation into the following question:
|
| 24 |
+
|
| 25 |
+
When and why does data augmentation improve data efficiency in reinforcement learning?
|
| 26 |
+
|
| 27 |
+
As a motivating example, consider using an off-policy RL algorithm to solve a 2D navigation task in which an agent must reach a random goal position (Fig. 1a). In this task, transitions observed by the agent can be augmented through either random translations of the agent (Fig. 1b) or random rotations of the agent and goal (Fig. 1c). As shown in Fig. 1d, if we double the agent's learning data via DA and double the batch size used for updates, we achieve significant improvements in data efficiency compared to learning without DA. Furthermore, agents that learn from extra augmented data even surpass the performance of agents that learn from an equal amount of extra real data collected through additional environment interactions. More concretely, we double the amount of policy data collected between updates and double the batch size used for updates so that non-augmented agents learn from the same amount of data and perform the same number of updates as the augmented agents. As shown in Fig. 1d, additional augmented data leads to faster learning than simply collecting an equal amount of additional data from the agent's policy. In fact, doubling the learning data via the translation augmentation is nearly as good as learning from 8 times as much policy-generated data. Thus, these augmentations must offer benefits beyond what additional policy-generated data can offer. An understanding of which aspects of DA yield these benefits will serve as an initial step towards guiding practitioners on how to more effectively incorporate DA into RL.
|
| 28 |
+
|
| 29 |
+
DA has taken many forms in the RL literature (Andrychowicz et al., 2017; Hansen and Wang, 2021; Laskin et al., 2020; Pitis et al., 2020; Qiao et al., 2021), and a comprehensive analysis of different DA frameworks, tasks, and data augmentation functions is beyond the scope of a single study. Thus, in this work, we instead aim to better
|
| 30 |
+
|
| 31 |
+
understand the benefits of integrating dynamics-invariant augmented data directly into model-free off-policy RL updates. With this focus in mind, we must leave studies on DA frameworks with auxiliary tasks (Hansen and Wang, 2021; Hansen et al., 2021; Raileanu et al., 2021; Wang et al., 2020), and studies on data augmentation functions that generate unrealistic data – such as visual data augmentations (Laskin et al., 2020) – for future work.
|
| 32 |
+
|
| 33 |
+
Our investigation focuses on three aspects of DA that we hypothesize influence learning in sparse-reward tasks: an increase in state-action coverage via DA, the amount of additional reward signal generated via DA (reward density), and the number of augmented transitions generated per update (the augmented replay ratio). State-action coverage and reward density relate to how DA affects the agent's distribution of learning data, whereas the augmented replay ratio relates to how augmented data is incorporated into RL training. We empirically ablate the effects of these factors using a simple and controllable DA framework similar to frameworks found in existing work (Laskin et al., 2020; Pitis et al., 2020). In summary, our contributions are:
|
| 34 |
+
|
| 35 |
+
1. We introduce a framework for studying DA in RL that is amenable to analysis.
|
| 36 |
+
2. While it is widely understood that high state-action coverage and discovery of reward signal are critical to data efficient RL, our experiments show that increasing state-action coverage via DA often has a much greater impact on data efficiency than increasing reward density.
|
| 37 |
+
3. We show that the success of DA depends strongly on the augmented replay ratio. In fact, certain tasks in our empirical study are solvable only when the augmented replay ratio is sufficiently low.
|
| 38 |
+
|
| 39 |
+

|
| 40 |
+
(b) Translate
|
| 41 |
+
|
| 42 |
+

|
| 43 |
+
(c) Rotate
|
| 44 |
+
|
| 45 |
+

|
| 46 |
+
(a) Observed
|
| 47 |
+
(d) Training curves
|
| 48 |
+
Figure 1: Visualizations of two augmentations - translation (1b) and rotation (1c) - for a 2D navigation task in which an agent (black dot) must reach a goal (gold star). In 1d, "xN policy data" corresponds to collecting $N$ times as many transitions with the agent's current policy between updates, and "x2 via rotate/translate" corresponds to generating one augmented transition per observed transition. We increase the batch size and replay buffer sizes proportionally to the amount of extra data to keep the replay ratio and replay age fixed across all experiments. We plot the interquartile mean success rate over 50 seeds with $95\%$ bootstrap confidence belts.
|
| 49 |
+
|
| 50 |
+
understand the benefits of integrating dynamics-invariant augmented data directly into model-free off-policy RL updates. With this focus in mind, we must leave studies on DA frameworks with auxiliary tasks (Hansen and Wang, 2021; Hansen et al., 2021; Raileanu et al., 2021; Wang et al., 2020), and studies on data augmentation functions that generate unrealistic data – such as visual data augmentations (Laskin et al., 2020) – for future work.
|
| 51 |
+
|
| 52 |
+
# 2 RELATED WORK
|
| 53 |
+
|
| 54 |
+
In this section, we provide an overview of data augmentation techniques and applications in RL.
|
| 55 |
+
|
| 56 |
+
Dynamics-based Augmentation: Several prior works use data augmentation functions that affect the agent's current state, action, and next state. Pitis et al. (2020; 2022) stitch together locally independent features of different transitions to generate additional data and provides a method for identifying local independence. Many model-based algorithms learn from synthetic data generated by a learned dynamics model and can be viewed as DA methods (Gu et al., 2016; Racanière et al., 2017; Sutton, 1990; Venkatraman et al., 2016).
|
| 57 |
+
|
| 58 |
+
Hindsight Experience Replay: In goal-conditioned RL, Hindsight Experience Replay (HER) (Andrychowicz et al., 2017; Fang et al., 2018; Liu et al., 2019; Rauber et al., 2017) counterfactually relabels the goal of a trajectory to generate additional data. This technique can be applied when transition dynamics are independent of the agent's goal, as is often the case. Follow-up work on HER has demonstrated that hindsight bias caused by changing the distribution of observed goals many hinder learning (Lanka and Wu, 2018; Li et al., 2020).
|
| 59 |
+
|
| 60 |
+
Applications of Domain-Specific Data Augmentation: Several recent works have leveraged domain-knowledge to create new data augmentation functions. Mikhail Pavlov and Plis (2018) and Abdolhosseini et al. (2019) apply DA to locomotion problems in which an optimal policy has a symmetric gait, and Mitrano and Berenson (2022) focus on augmenting trajectories of poses and movable objects relevant in robot manipulation. Qiao et al. (2021) consider DA in the context of differentiable simulation to generate additional approximately correct transitions (a method they refer to as sample enhancement). DeepMind's AlphaTensor (Fawzi et al., 2022) exploits two invariances: tensor decompositions are commutative, and tensor rank is invariant to the ordering of rows and columns. They exploit commutativity by generating additional augmented transitions and rank invariance using a network that disregards the row and column ordering of input tensors.
|
| 61 |
+
|
| 62 |
+
State-based Augmentation: Much of the prior work in DA for RL focuses on augmenting visual observations (Guan et al., 2021; Wang et al., 2020; Yarats et al., 2021). Laskin et al. (2020) train RL agents on multiple views of visual states (crops, recolorations, rotations, etc.). Raileanu et al. (2021) introduce regularizers to ensure an agent's policy and value function are both invariant under augmentation. Sinha et al. (2022) ensure small perturbations of non-visual states state have similar state-action values. Hansen and Wang (2021) learn a state representation that is invariant under augmentation rather than directly using the augmented data for policy optimization. Hansen et al. (2021) identify sources of instability when performing visual DA. This line of work relates to domain randomization (Peng et al., 2018; Tobin et al., 2017), as agents are trained to be robust to randomized augmentations of observations. Visual augmentations are beyond the scope of our study; we focus on integrating augmented data that respects the environment's dynamics into model-free updates, but visual augmentations generate unrealistic data and are typically used for auxiliary representation learning tasks. We provide further discussion on visual augmentations in Appendix A.
|
| 63 |
+
|
| 64 |
+
Invariant Model Architectures: DA often – though not always – exploits known invariances within the environment's state space and/or dynamics. In this case, an alternative to DA is to simply hardcode these invariances into the agent's policy model (van der Pol et al., 2020; 2021; Wang et al., 2022). Residual Pathway Priors (RPPs) (Finzi et al., 2021) capture invariances using a soft prior, biasing agents toward invariant policies without constraining them.
|
| 65 |
+
|
| 66 |
+
While these prior works focus on developing data augmentation functions or methods for incorporating augmented data into RL training, our work introduces a framework to investigate when and why DA improves learning.
|
| 67 |
+
|
| 68 |
+
# 3 PRELIMINARIES
|
| 69 |
+
|
| 70 |
+
In this section, we formalize the RL setting and the class of data augmentation functions we use.
|
| 71 |
+
|
| 72 |
+
# 3.1 REINFORCEMENT LEARNING
|
| 73 |
+
|
| 74 |
+
We consider finite horizon Markov decision processes (MDPs) (Puterman, 2014) defined by $(S, \mathcal{A}, p, r, d_0, \gamma)$ where $S$ and $\mathcal{A}$ denote the state and action space, respectively, $p(s' \mid s, a)$ denotes
|
| 75 |
+
|
| 76 |
+
the probability density of the next state $s'$ after taking action $\mathbf{a}$ in state $s$ , and $r(s, \mathbf{a})$ denotes the reward for taking action $\mathbf{a}$ in state $s$ . We write $d_0$ as the initial state distribution, $\gamma \in [0,1)$ as the discount factor, and $H$ the length of an episode. We consider stochastic policies $\pi_\theta : S \times \mathcal{A} \to [0,1]$ parameterized by $\theta$ . The RL objective is to find a policy that maximizes the expected sum of discounted rewards $J(\theta) = \mathbb{E}_{\pi_\theta, s_0 \sim d_0} \left[ \sum_{t=0}^{H} \gamma^t r(\mathbf{s}_t, \mathbf{a}_t) \right]$ .
|
| 77 |
+
|
| 78 |
+
# 3.2 DATA AUGMENTATION FUNCTIONS
|
| 79 |
+
|
| 80 |
+
In the literature, data augmentation functions (DAFs) have taken different forms and served different purposes. We introduce a few important definitions to help classify the DAFs we focus on.
|
| 81 |
+
|
| 82 |
+
Definition 1. A transition $(s, a, r, s')$ is valid if it is possible under the transition dynamics and reward function, i.e. $p(s' \mid s, a) > 0$ , and $r = r(s, a)$ .
|
| 83 |
+
|
| 84 |
+
Definition 2. Let $\mathcal{T} \subset S \times \mathcal{A} \times \mathbb{R} \times S$ denote the set of possible transitions and let $\Delta(\mathcal{T})$ denote the set of distributions over $\mathcal{T}$ . A data augmentation function (DAF) is a stochastic function $f: \mathcal{T} \to \Delta(\mathcal{T})$ mapping a transition $(s, a, r, s')$ to an augmented transition $(\tilde{s}, \tilde{a}, \tilde{r}, \tilde{s}')$ .
|
| 85 |
+
|
| 86 |
+
Definition 3. A DAF is dynamics-invariant if it is closed under valid transitions.
|
| 87 |
+
|
| 88 |
+
We focus on dynamics-invariant DAFs so that augmented data agrees with the underlying MDP, since learning from data that does not match the MDP's dynamics can harm learning (Moerland et al., 2023). This focus includes methods such as HER (Andrychowicz et al., 2017) and CoDA (Pitis et al., 2020) which provide domain-independent DAFs. However, we do not restrict ourselves to domain-independent DAFs as, in practice, domain-experts may be able to produce dynamics-invariant DAFs even though they cannot identify an optimal domain policy (Abdolhosseini et al., 2019; Fawzi et al., 2022; Mikhail Pavlov and Plis, 2018). Our focus does exclude some recent works on DA - especially those focusing on visual augmentations (Laskin et al., 2020; Raileanu et al., 2021) - that produce augmented states that would never be observed in simulation such that $p(\tilde{s}'|\tilde{s},\tilde{a}) = 0$ , since these augmentations do not satisfy our definition of valid. We note that dynamics-invariant DAFs will not necessarily preserve transition probabilities in tasks with stochastic dynamics. We elaborate on the widespread applicability of dynamics-invariant DAFs in Appendix A.
|
| 89 |
+
|
| 90 |
+
# 4 A FRAMEWORK FOR STUDYING DATA AUGMENTATION IN RL
|
| 91 |
+
|
| 92 |
+
Algorithm 1 Off-Policy RL with Data Augmentation Inputs: Data augmentation function $f$ augmentation ratio $m$ update ratio $\alpha$ batch size $b$ Initialize policy $\pi_{\theta}$ replay buffer $\mathcal{R}$ and augmented replay buffer $\widetilde{\mathcal{R}}$ for $t = 1,2,\ldots$ do Collect transition $(s_t,a_t,r_t,s_{t + 1})$ using $\pi_{\theta}$ Append $(s_t,a_t,r_t,s_{t + 1})$ to $\mathcal{R}$ for $i = 1,\dots ,m$ do $(\tilde{s}_t,\tilde{a}_t,\tilde{r},\tilde{s}_{t + 1})\sim f(s_t,a_t,r_t,s_{t + 1})$ Append $f(\tilde{s}_t,\tilde{a}_t,\tilde{r}_t,\tilde{s}_{t + 1})$ to $\widetilde{\mathcal{R}}$ if update then Sample mini-batch $\mathcal{D}$ of $b$ transitions from $\mathcal{R}$ Sample mini-batch $\widetilde{\mathcal{D}}$ of $b\alpha$ transitions from $\widetilde{\mathcal{R}}$ Update policy and/or value function using $\mathcal{D}\cup \widetilde{\mathcal{D}}$
|
| 93 |
+
|
| 94 |
+
Prior work on DA in RL not only considers different DAFs but also various methods for integrating the augmented data into RL algorithms. To focus our study, we introduce a specific framework (Algorithm 1) for incorporating augmented data into the training loop of any off-policy RL algorithm. An off-policy algorithm is essential, as augmented data may not be distributed according to the state-action distribution of the current policy. We focus on the effects integrating augmented data directly into policy and/or value function updates.
|
| 95 |
+
|
| 96 |
+
Within our framework, the agent observes a transition, applies a given DAF $f$ to that transition to generate some number of augmented transitions, and then stores the ob
|
| 97 |
+
|
| 98 |
+
served and augmented transitions in separate replay buffers – the observed and augmented replay buffers, respectively. When performing policy and/or value function updates, the agent samples data from both buffers and combines the data for the updates. To control how much augmented data we generate and use in each update, we introduce a few parameters into the framework.
|
| 99 |
+
|
| 100 |
+
The augmentation ratio, $m$ , specifies the number of augmented transitions generated per observed transition. Some DAFs, such as the translation augmentation in Fig. 1b, can produce multiple unique augmentations from the same input transition. Each time the agent observes one real transition,
|
| 101 |
+
|
| 102 |
+
$m$ augmented transitions are sampled from the DAF. We use this parameter to study whether it is beneficial to produce multiple augmentations to diversify the augmented replay buffer. When the augmentation ratio is increased, we increase the augmented replay buffer size proportionally such that the age of the oldest observed and augmented transitions remain equal.2
|
| 103 |
+
|
| 104 |
+
The update ratio, $\alpha$ , denotes the ratio of augmented to observed data used for updates, e.g., $\alpha = 1$ denotes that half of the data used for each update is augmented data. With access to large amounts of augmented data, it may be beneficial to increase the amount of augmented data used in updates. However, a large update ratio may exacerbate the tandem effect (Ostrovski et al., 2021), a decrease in performance when learning predominantly from data not collected by the agent.
|
| 105 |
+
|
| 106 |
+
The augmentation ratio modulates a third relevant quantity: the number of updates per augmented transition generated, or augmented replay ratio. In the absence of DA, Fedus et al. (2020) found that found that decreasing the replay ratio of observed data (the observed replay ratio) can improve data efficiency, though other works have improved data efficiency by developing techniques that enable learning with large replay ratios (Chen et al., 2021; D'Oro et al., 2023; Nikishin et al., 2022; Scheller et al., 2020). One can decrease the augmented replay ratio by increasing the augmentation ratio $(m)$ while keeping the frequency of policy and/or value function updates fixed.
|
| 107 |
+
|
| 108 |
+
Though a variety of methods exist for incorporating augmented data into RL, our framework offers several core benefits for our study:
|
| 109 |
+
|
| 110 |
+
1. Control: One can easily control the replay ratio and update ratio. Having control over the update ratio is especially important to ensure the agent uses a sufficient amount of observed data in each update to mitigate the tandem effect. Moreover, since augmented data is stored in a replay buffer and not sampled online, it is possible to keep the replay ratio of the augmented data equal to that of the observed data.
|
| 111 |
+
2. Lower Systematic Variance: Each update uses the same ratio of augmented to observed data (i.e. update ratio), and the same number of augmented transitions are generated for every observed transition, eliminating a possible source of training variation.
|
| 112 |
+
3. Computational Efficiency: By storing and reusing augmented data, we improve computational efficiency. While some DAFs can produce multiple unique augmentations of the same input transition, many can only produce a single augmentation – such as a reflection – in which case it is more efficient to reuse augmented data rather than generate new samples online every update.
|
| 113 |
+
|
| 114 |
+
Our framework is similar to those used in CoDA (Pitis et al., 2020), RAD (Laskin et al., 2020), and HER (Andrychowicz et al., 2017), as all three incorporate augmented data directly into updates without auxiliary tasks. We note that RAD as well as popular implementations (Raffin et al., 2021; Weng et al., 2022) of HER generate augmented samples during updates and discard them after use, whereas we save augmented data for reuse. Since we focus on using augmented data for model-free updates, Algorithm 1 is not intended to capture methods that use augmented data for auxiliary tasks but easily extends to include such methods (Hansen and Wang, 2021; Raileanu et al., 2021).
|
| 115 |
+
|
| 116 |
+
# 5 DISENTANGLING PROPERTIES OF DATA AUGMENTATION
|
| 117 |
+
|
| 118 |
+
We identify aspects of DA that we hypothesize may impact its effectiveness within our framework.
|
| 119 |
+
|
| 120 |
+
State-Action Coverage: DAFs can generate data that the current policy otherwise might not observe, increasing state-action coverage. Greater state-action coverage via DA may aid exploration. However, it may also generate data that is very off-policy with respect to the current policy and hence increase the variance of learning due to the tandem effect (Ostrovski et al., 2021).
|
| 121 |
+
|
| 122 |
+
Reward Density: Long horizon, sparse reward tasks are notoriously difficult since an RL agent is unlikely to discover reward signal through random exploration. A DAF that can produce transitions with additional reward signal could improve data efficiency. However, it is also known that reward-generating DA strategies such as HER (Andrychowicz et al., 2017) can bias learning and lead to overestimation of state-action values (Lanka and Wu, 2018). For sparse reward tasks, we define reward density as the fraction of transition data in both observed and augmented replay buffers which successfully solve the task and thus contain reward signal.
|
| 123 |
+
|
| 124 |
+
Augmented Replay Ratio: Some DAFs (such as the translation DAF in Fig. 1b) can generate multiple augmented transitions given a single input transition, substantially increasing the amount of data available to the agent. We hypothesize that it may be beneficial to generate as many augmented transitions as possible to lower the augmented replay ratio (Fedus et al., 2020).
|
| 125 |
+
|
| 126 |
+
While it is widely understood that high coverage and discovery of reward signal are critical to solving sparse-reward RL tasks (Andrychowicz et al., 2017; Tang et al., 2017), the degree to which increasing state-action coverage and reward density via DA individually contribute to data efficient RL is less clear. These factors are be difficult to completely isolate; since the reward function $r(s, a)$ depends on $s$ and $a$ , altering reward density necessarily changes state-action coverage. In our experiments, we attempt to isolate all three aspects of DA to determine how much each affects data efficiency.
|
| 127 |
+
|
| 128 |
+
# 5.1 EXPERIMENTS
|
| 129 |
+
|
| 130 |
+
We focus our experiments on four sparse-reward, continuous action panda-gym tasks (Gallouédec et al., 2021): PandaPush-v3, PandaSlide-v3, PandaPickAndPlace-v3, and PandaFlip-v3 (Fig. 2), which we henceforth refer to as the Push, Slide, PickAndPlace, and Flip tasks, respectively. We consider two DAFs:
|
| 131 |
+
|
| 132 |
+

|
| 133 |
+
Figure 2: PandaPushv3. A robotic arm must push a block to a goal location.
|
| 134 |
+
|
| 135 |
+
1. TRANSLATEGOAL: Relabel the goal with a new goal sampled uniformly at random from the goal distribution.
|
| 136 |
+
2. TRANSLATEGOALPROXIMAL $(p)$ : Relabel the goal with a new goal sampled from the goal distribution. With probability $p$ , the new goal is sufficiently close to the object to generate reward signal.
|
| 137 |
+
|
| 138 |
+
We also consider a toy 2D navigation task Goal2D-v0 (Fig. 1a) in which an agent must reach a random goal. The agent receives reward $+1$ when it is sufficiently close to the goal and reward $-0.1$ otherwise. Agent and goal positions are initialized uniformly at random. We consider three DAFs:
|
| 139 |
+
|
| 140 |
+
1. ROTATE: Rotate the agent and goal by $\theta \in \left\{\frac{\pi}{2}, \pi, \frac{3\pi}{2}\right\}$ .
|
| 141 |
+
2. TRANSLATE: Translate the agent to a random position.
|
| 142 |
+
3. TRANSLATEPROXIMAL $(p)$ : Translate the agent to a random position. With probability $p$ , the agent's new position is sufficiently close to the goal to generate reward signal.
|
| 143 |
+
|
| 144 |
+
These DAFs offer an avenue to investigate the role of reward density and state-action coverage in DA. For instance, one can modify reward density through $p$ in TRANSLATEGOALPROXIMAL( $p$ ). Moreover, these DAFs are extremely general can be applied to many tasks, e.g. most navigation tasks. We include full descriptions of each environment and DAF in Appendices B and C, respectively. We use DDPG (Lillicrap et al., 2015) for Panda tasks and TD3 (Fujimoto et al., 2018) for Goal2D. Further training details are in Appendix G. We include experiments studying how all three factors affect an agent's generalization ability in Appendix E and include experiments studying the augmented replay ratio for dense reward MuJoCo tasks (Brockman et al., 2016) in Appendix F.
|
| 145 |
+
|
| 146 |
+
# 5.1.1 BENCHMARKING DATA AUGMENTATION
|
| 147 |
+
|
| 148 |
+
We first benchmark the performance of DA against simply collecting more policy data to establish how much our chosen DAFs improve data efficiency. Prior work has demonstrated that learning with augmented data is often more data efficient than learning without it, though it is unclear how learning
|
| 149 |
+
|
| 150 |
+

|
| 151 |
+
Figure 3: "x2 policy data" agents double their learning data by collecting twice as many samples between updates, and "x2 data via TranslateGoal" agents double their learning data by generating one augmented transition per observed transition. Note that the horizontal axis shows the number of updates rather than timesteps. Each curve shows the interquartile mean over 10 seeds. Shaded regions denote $95\%$ bootstrap confidence belts.
|
| 152 |
+
|
| 153 |
+
from augmented data compares to learning from additional policy-generated data, as policy-generated data and augmented data are distributed differently in general. In these experiments, we increase the available learning data using DA or by collecting more data with the agent's current policy between updates. We label agents according to how many additional environment interactions they perform, e.g. "x2 policy data" corresponds to one extra environment interaction, and "x2 data via TRANSLATEGOAL" corresponds to generating one augmented transition per observed transition $(m = 1)$ . When collecting or generating extra data, we increase the batch size and replay buffer size proportionally so that all agents learn with the same amount of data, the same observed and augmented replay ratios, and the same replay age. Thus, augmented and observed data are treated equally in training.
|
| 154 |
+
|
| 155 |
+
From Fig. 3, we see that TRANSLATEGOAL offers significant improvement over no additional data. For instance, in Push, doubling the learning data via TRANSLATEGOAL doubles data efficiency. Though, additional policy-generated data generally yields equal or better performance. Having established that TRANSLATEGOAL improves data efficiency, in the following sections, we study the degree to which reward density and state-action coverage are responsible for these improvements.
|
| 156 |
+
|
| 157 |
+
# 5.1.2 STATE-ACTION COVERAGE
|
| 158 |
+
|
| 159 |
+
In this section, we study how increasing state-action coverage via DA affects data efficiency. Since the reward is a function of the agent's state and action, it is difficult to completely isolate the effects of increased coverage; a change in coverage affects reward density. Nevertheless, we can better understand the effect of increasing coverage by comparing agents trained using TRANSLATE and TRANSLATE-Goal with agents trained using TRANSLATEPROXIMAL(0) and TRANSLATEGOALPROXIMAL(0) - DAFs that increase state-action coverage without generating additional reward signal. Early in training when there is little to no reward signal in the observed replay buffer, TRANSLATEGOAL(0) and TRANSLATEGOALPROXIMAL(0) have little affect on reward density. As the policy learns and more reward signal is added to the observed replay buffer, the lack of reward signal in the augmented replay buffer reduces the overall reward density. Thus, we can attribute any performance boost provided by TRANSLATEPROXIMAL(0) and TRANSLATEGOALPROXIMAL(0) to an increase in state-action coverage and/or a decrease in reward density. To better separate the effects of increased coverage and decreased reward density, we double the agent's training data using different ratios of augmented data to observed data (1:5, 1:2, and 1:1). A smaller split of TRANSLATEPROXIMAL(0)/TRANSLATEGOALPROXIMAL(0) data corresponds to less coverage but also a smaller decrease in reward density. We report results for ratios yielding the largest improvements to data efficiency (i.e. ratios that best balances the increase in coverage with the decrease in reward density).
|
| 160 |
+
|
| 161 |
+
As shown in Fig. 4, TRANSLATEGOALPROXIMAL(0) in Slide, PickAndPlace, and Flip is as data efficient as TRANSLATEGOAL; increased coverage alone explains the benefits of TRANSLATEGOAL in these tasks. In Goal2D and Push, TRANSLATEPROXIMAL(0) and TRANSLATEGOALPROXIMAL(0) are more data efficient than no DA but less data efficient than TRANSLATE and TRANSLATEGOAL. Thus, although increased state-action coverage is the primary benefit in most tasks, we see that increased reward density can also play a role. In the following section, we further disentangle state-action coverage and reward density to assess how critical high reward density is for these tasks.
|
| 162 |
+
|
| 163 |
+

|
| 164 |
+
|
| 165 |
+

|
| 166 |
+
Figure 4: Learning with TRANSLATEGOAL, TRANSLATEGOALPROXIMAL(0), TRANSLATE, and TRANSLATEPROXIMAL(0). We plot the IQM success rate over 10 seeds for Panda experiments and 50 for Goal2D. Shaded regions denote $95\%$ bootstrap confidence belts.
|
| 167 |
+
Figure 5: Learning with TRANSLATEGOALPROXIMAL $(p)$ for various $p$ . Darker colors correspond to larger $p$ values. The dashed red line for PickAndPlace denotes the final IQM success rate achieved by TRANSLATEGOALPROXIMAL(0) in Fig. 4. We plot the IQM success rate over 10 seeds for Panda experiments and 50 for Goal2D. Shaded regions denote $95\%$ bootstrap confidence belts.
|
| 168 |
+
|
| 169 |
+
# 5.1.3 REWARD DENSITY
|
| 170 |
+
|
| 171 |
+
We now strive to further disentangle state-action coverage from reward density by studying how changes to reward density affect learning. In the following experiment, we modify reward density by varying the probability $p$ of generating reward signal with TRANSLATEPROXIMAL( $p$ ) and TRANSLATEGOALPROXIMAL( $p$ ) while keeping the update ratio and augmentation ratio fixed at $\alpha = 1$ and $m = 1$ , respectively. This setup does not completely isolate reward density from state-action coverage; changing reward density (increasing $p$ ) also affects state-action coverage, as it increases the amount of learning data in which the goal is near the object. Nevertheless, this experiment enables us to answer the following question: how critical is it that DA generates data with high reward density?
|
| 172 |
+
|
| 173 |
+
As shown in Fig. 5, changing $p$ has little effect on data efficiency in Slide and Flip, further supporting that increased coverage is the primary benefit of TRANSLATEGOAL in these tasks. In Push and PickAndPlace, $p = 0.05$ is most data efficient<sup>5</sup>, while in Goal2D, data efficiency increases significantly as with $p = 0.01$ , and increasing to $p = 0.1$ offers marginal additional improvement. In these three tasks, the largest $p$ values decrease data efficiency, since changes to the distribution of reward signal and can bias updates (i.e. hindsight bias (Lanka and Wu, 2018; Li et al., 2020)). Since the most data efficient learning occurs when DA contributes no reward signal or a relatively small amount, we conclude that high reward density is not critical to successful DA.
|
| 174 |
+
|
| 175 |
+
Collectively, our state-action coverage and reward density experiments suggest that increasing state-action coverage via DA often has a much greater impact on data efficiency than increasing reward density. Thus, our results suggest that RL practitioners choosing among candidate DAFs or designing new DAFs should focus on increasing state-action coverage more so than increasing reward density.
|
| 176 |
+
|
| 177 |
+
# 5.1.4 AUGMENTED REPLAY RATIO
|
| 178 |
+
|
| 179 |
+
Our previous experiments study how two properties of DAFs affect RL, though performance may be sensitive to how augmented data is incorporated into RL training. In this section, we study how the number of updates per augmented transition generated affects data efficiency.
|
| 180 |
+
|
| 181 |
+
Existing DA strategies often incorporate multiple augmentations of the same observed transition into policy optimization. For instance, HER (Andrychowicz et al., 2017) generates 4 hindsight transitions
|
| 182 |
+
|
| 183 |
+

|
| 184 |
+
Figure 6: Decreasing the augmented replay ratio with the update ratio fixed at $\alpha = 2$ markedly improves learning. Darker colors correspond to smaller replay ratios. We plot the IQM success rate over 10 seeds. Shaded regions denote $95\%$ bootstrap confidence belts.
|
| 185 |
+
|
| 186 |
+
per observed transition, and CoDA (Pitis et al., 2020) generates up to 16 augmentations per observed transition. Generating additional augmentations decreases the augmented replay ratio, the number of updates per augmented transition generated. We hypothesize that decreasing the augmented replay ratio can provide a similar benefit to decreasing the replay ratio of observed data noted by Fedus et al. (2020). Decreasing the replay ratio of observed data can be expensive – requiring more environment interactions between updates – while decreasing the augmented replay ratio is comparatively cheap.
|
| 187 |
+
|
| 188 |
+
In this experiment, we decrease the augmented replay ratio $\beta$ by generating more augmentations per observed transition (i.e., increasing $m$ ). We scale the augmented replay buffer size proportionally and keep the ratio of augmented to observed data used in updates fixed at $\alpha = 2$ . As shown in Fig. 6, a lower augmented replay ratio alone substantially improves data efficiency and overall performance across all panda tasks. Moreover, a low replay ratio is necessary to solve PickAndPlace within our training budget; $100\%$ success rate can be achieved with $\beta = 0.0625$ , while no learning occurs with $\beta = 0.5$ . A lower replay ratio also increases data efficiency in Goal2D with both TRANSLATE and ROTATE DAFs; due to space constraints, we include these figures in Appendix D.3. Decreasing the replay ratio is a preferable alternative to increasing the amount of augmented data used in updates, as the latter may exacerbate the tandem effect (Ostrovski et al., 2021) in which RL from passive data fails. We support this claim with additional experiments provided in Appendix D.1.
|
| 189 |
+
|
| 190 |
+
Empirically, we have demonstrated that a DAF's success may depend strongly on how we integrate its augmented data into training. To effectively apply DA, one must understand desirable properties of DAFs and relevant implementation details.
|
| 191 |
+
|
| 192 |
+
# 6 CONCLUSIONS, LIMITATIONS, AND FUTURE WORK
|
| 193 |
+
|
| 194 |
+
While prior work has demonstrated that incorporating augmented data in model-free off-policy reinforcement learning (RL) updates can improve the data efficiency of RL algorithms, we lack a clear understanding of which aspects of data augmentation (DA) yield such improvements. In this paper, we isolated three aspects of DA in sparse reward tasks with dynamics-invariant data augmentation functions (DAFs) – state-action coverage, reward density, and the replay ratio of augmented data (the number of augmented samples generated per timestep) – to understand how each affects performance. Empirically, we showed how increasing state-action coverage often has a much greater impact on data efficiency than increasing reward density. Moreover, we demonstrated that the decreasing the augmented replay ratio can yield dramatic improvements to data efficiency. In fact, certain tasks are unsolvable unless the replay ratio is sufficiently small.
|
| 195 |
+
|
| 196 |
+
Our work has provided an initial study analyzing the benefits of DA. To better leverage DA, further work should study (1) how other properties of DAFs influence RL training, such as relevancy (Mitrano and Berenson, 2022), (2) how hyperparameters within a DA framework affect performance, and (3) how different RL algorithms affect performance. Our analysis focused on relatively low-dimensional sparse reward tasks with continuous actions, and findings may differ for tasks with dense rewards, discrete actions, or high-dimensional visual observations. Since our DA framework only integrates augmented data into model-free updates, it would be beneficial to extend this analysis to frameworks that use augmented data for auxiliary tasks such as representation learning rather than – or in addition to – policy optimization (Hansen and Wang, 2021; Raileanu et al., 2021).
|
| 197 |
+
|
| 198 |
+
# ACKNOWLEDGMENTS
|
| 199 |
+
|
| 200 |
+
Thanks to Brahma Pavse and to the anonymous reviewers for feedback that greatly improved our work. This research is supported in part by American Family Insurance through a research partnership with the University of Wisconsin-Madison's Data Science Institute and the Office of the Vice Chancellor for Research and Graduate Education at the University of Wisconsin — Madison with funding from the Wisconsin Alumni Research Foundation."
|
| 201 |
+
|
| 202 |
+
# REFERENCES
|
| 203 |
+
|
| 204 |
+
Farzad Abdolhosseini, Hung Yu Ling, Zhaoming Xie, Xue Bin Peng, and Michiel Van de Panne. On learning symmetric locomotion. In Motion, Interaction and Games. 2019.
|
| 205 |
+
Marcin Andrychowicz, Filip Wolski, Alex Ray, Jonas Schneider, Rachel Fong, Peter Welinder, Bob McGrew, Josh Tobin, OpenAI Pieter Abbeel, and Wojciech Zaremba. Hindsight experience replay. Advances in Neural Information Processing Systems (NeurIPS), 30, 2017.
|
| 206 |
+
Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym, 2016.
|
| 207 |
+
Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In International conference on machine learning, 2020.
|
| 208 |
+
Xinyue Chen, Che Wang, Zijian Zhou, and Keith Ross. Randomized ensembled double q-learning: Learning fast without a model. arXiv preprint arXiv:2101.05982, 2021.
|
| 209 |
+
Pierluca D'Oro, Max Schwarzer, Evgenii Nikishin, Pierre-Luc Bacon, Marc G Bellemare, and Aaron Courville. Sample-efficient reinforcement learning by breaking the replay ratio barrier. In International Conference on Learning Representations, 2023.
|
| 210 |
+
Meng Fang, Cheng Zhou, Bei Shi, Boqing Gong, Jia Xu, and Tong Zhang. Dher: Hindsight experience replay for dynamic goals. In International Conference on Learning Representations, 2018.
|
| 211 |
+
Alhussein Fawzi, Matej Balog, Aja Huang, Thomas Hubert, Bernardino Romera-Paredes, Mohammadin Barekatain, Alexander Novikov, Francisco J R Ruiz, Julian Schrittwieser, Grzegorz Swirszcz, et al. Discovering faster matrix multiplication algorithms with reinforcement learning. Nature, 2022.
|
| 212 |
+
William Fedus, Prajit Ramachandran, Rishabh Agarwal, Yoshua Bengio, Hugo Larochelle, Mark Rowland, and Will Dabney. Revisiting fundamentals of experience replay. In International Conference on Machine Learning, 2020.
|
| 213 |
+
Marc Finzi, Gregory Benton, and Andrew G Wilson. Residual pathway priors for soft equivariance constraints. Advances in Neural Information Processing Systems (NeurIPS), 2021.
|
| 214 |
+
Scott Fujimoto, Herke Hoof, and David Meger. Addressing function approximation error in actor-critic methods. In International conference on machine learning, 2018.
|
| 215 |
+
Quentin Gallouédec, Nicolas Cazin, Emmanuel Dellandrea, and Liming Chen. panda-gym: Open-Source Goal-Conditioned Environments for Robotic Learning. 4th Robot Learning Workshop: Self-Supervised and Lifelong Learning at NeurIPS, 2021.
|
| 216 |
+
Shixiang Gu, Timothy Lillicrap, Ilya Sutskever, and Sergey Levine. Continuous deep q-learning with model-based acceleration. In International conference on machine learning, 2016.
|
| 217 |
+
L. Guan, Mudit Verma, Sihang Guo, Ruohan Zhang, and Subbarao Kambhampati. Widening the pipeline in human-guided reinforcement learning with explanation and context-aware data augmentation. In NeurIPS, 2021.
|
| 218 |
+
Nicklas Hansen and Xiaolong Wang. Generalization in reinforcement learning by soft data augmentation. In 2021 IEEE International Conference on Robotics and Automation (ICRA), 2021.
|
| 219 |
+
|
| 220 |
+
Nicklas Hansen, Hao Su, and Xiaolong Wang. Stabilizing deep q-learning with convnets and vision transformers under data augmentation. Advances in Neural Information Processing Systems (NeurIPS), 2021.
|
| 221 |
+
IEEE Spectrum. Kiva systems: Three engineers, hundreds of robots, one warehouse., 2008. URL https://spectrum.ieee.org/three-engineers-hundreds-of-robots-one-warehouse. [Online; accessed September 11, 2023].
|
| 222 |
+
Innovation Matrix Inc. Fetch mobile manipulator robot, 2023. URL https://innovation-matrix.com/imj FETCH-manipulator-robot-annoucement/. [Online; accessed September 11, 2023].
|
| 223 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 224 |
+
Sameera Lanka and Tianfu Wu. ARCHER: aggressive rewards to counter bias in hindsight experience replay. CoRR, 2018.
|
| 225 |
+
Misha Laskin, Kimin Lee, Adam Stooke, Lerrel Pinto, Pieter Abbeel, and Aravind Srinivas. Reinforcement learning with augmented data. Advances in Neural Information Processing Systems (NeurIPS), 2020.
|
| 226 |
+
Alexander Li, Lerrel Pinto, and Pieter Abbeel. Generalized hindsight for reinforcement learning. Advances in Neural Information Processing Systems (NeurIPS), 2020.
|
| 227 |
+
Timothy P Lillicrap, Jonathan J Hunt, Alexander Pritzel, Nicolas Heess, Tom Erez, Yuval Tassa, David Silver, and Daan Wierstra. Continuous control with deep reinforcement learning. arXiv preprint arXiv:1509.02971, 2015.
|
| 228 |
+
Hao Liu, Alexander Trott, Richard Socher, and Caiming Xiong. Competitive experience replay. arXiv preprint arXiv:1902.00528, 2019.
|
| 229 |
+
Sergey Kolesnikov Mikhail Pavlov and Sergey M. Plis. Run, skeleton, run: skeletal model in a physics-based simulation. AAAI Spring Symposium Series, 2018.
|
| 230 |
+
Peter Mitrano and Dmitry Berenson. Data augmentation for manipulation. arXiv preprint arXiv:2205.02886, 2022.
|
| 231 |
+
Thomas M Moerland, Joost Broekens, Aske Plaat, Catholijn M Jonker, et al. Model-based reinforcement learning: A survey. Foundations and Trends® in Machine Learning, 2023.
|
| 232 |
+
Evgenii Nikishin, Max Schwarzer, Pierluca D'Oro, Pierre-Luc Bacon, and Aaron Courville. The primacy bias in deep reinforcement learning. In International Conference on Machine Learning. PMLR, 2022.
|
| 233 |
+
Georg Ostrovski, Pablo Samuel Castro, and Will Dabney. The difficulty of passive learning in deep reinforcement learning. Advances in Neural Information Processing Systems (NeurIPS), 2021.
|
| 234 |
+
Xue Bin Peng, Marcin Andrychowicz, Wojciech Zaremba, and Pieter Abbeel. Sim-to-real transfer of robotic control with dynamics randomization. In 2018 IEEE international conference on robotics and automation (ICRA), 2018.
|
| 235 |
+
Silviu Pitis, Elliot Creager, and Animesh Garg. Counterfactual data augmentation using locally factored dynamics. Advances in Neural Information Processing Systems (NeurIPS), 2020.
|
| 236 |
+
Silviu Pitis, Elliot Creager, Ajay Mandlekar, and Animesh Garg. Mocoda: Model-based counterfactual data augmentation. Advances in Neural Information Processing Systems (NeurIPS), 2022.
|
| 237 |
+
Matthias Plappert, Marcin Andrychowicz, Alex Ray, Bob McGrew, Bowen Baker, Glenn Powell, Jonas Schneider, Josh Tobin, Maciek Chociej, Peter Welinder, et al. Multi-goal reinforcement learning: Challenging robotics environments and request for research. arXiv preprint arXiv:1802.09464, 2018.
|
| 238 |
+
Martin L Puterman. Markov decision processes: discrete stochastic dynamic programming. John Wiley & Sons, 2014.
|
| 239 |
+
|
| 240 |
+
Yi-Ling Qiao, Junbang Liang, Vladlen Koltun, and Ming C Lin. Efficient differentiable simulation of articulated bodies. In International Conference on Machine Learning, 2021.
|
| 241 |
+
Sebastien Racanière, Théophane Weber, David Reichert, Lars Buesing, Arthur Guez, Danilo Jimenez Rezende, Adrià Puigdomènech Badia, Oriol Vinyals, Nicolas Heess, Yujia Li, et al. Imagination-augmented agents for deep reinforcement learning. Advances in Neural Information Processing Systems (NeurIPS), 2017.
|
| 242 |
+
Antonin Raffin, Ashley Hill, Adam Gleave, Anssi Kanervisto, Maximilian Ernestus, and Noah Dormann. Stable-baselines3: Reliable reinforcement learning implementations. Journal of Machine Learning Research, 2021.
|
| 243 |
+
Roberta Raileanu, Maxwell Goldstein, Denis Yarats, Ilya Kostrikov, and Rob Fergus. Automatic data augmentation for generalization in reinforcement learning. Advances in Neural Information Processing Systems (NeurIPS), 2021.
|
| 244 |
+
Paulo Rauber, Avinash Ummadisingu, Filipe Mutz, and Juergen Schmidhuber. Hindsight policy gradients. arXiv preprint arXiv:1711.06006, 2017.
|
| 245 |
+
Christian Scheller, Yanick Schraner, and Manfred Vogel. Sample efficient reinforcement learning through learning from demonstrations in mycrafch. In NeurIPS 2019 Competition and Demonstration Track. PMLR, 2020.
|
| 246 |
+
Samarth Sinha, Ajay Mandlekar, and Animesh Garg. S4rl: Surprisingly simple self-supervision for offline reinforcement learning in robotics. In Aleksandra Faust, David Hsu, and Gerhard Neumann, editors, Proceedings of the 5th Conference on Robot Learning, Proceedings of Machine Learning Research, 2022.
|
| 247 |
+
Richard S Sutton. Integrated architectures for learning, planning, and reacting based on approximating dynamic programming. In Machine learning proceedings 1990. 1990.
|
| 248 |
+
Haoran Tang, Rein Houthooft, Davis Foote, Adam Stooke, OpenAI Xi Chen, Yan Duan, John Schulman, Filip DeTurck, and Pieter Abbeel. # exploration: A study of count-based exploration for deep reinforcement learning. Advances in Neural Information Processing Systems (NeurIPS), 2017.
|
| 249 |
+
Josh Tobin, Rachel Fong, Alex Ray, Jonas Schneider, Wojciech Zaremba, and Pieter Abbeel. Domain randomization for transferring deep neural networks from simulation to the real world. In 2017 IEEE/RSJ international conference on intelligent robots and systems (IROS). IEEE, 2017.
|
| 250 |
+
Oregon State University. Bipedal robot developed at oregon state achieves guinness world record in 100 meters, 2022. URL https://today.oregonstate.edu/news/bipedal-robot-developed-oregon-state-achieves-guinness-world-record-100-meters. [Online; accessed September 11, 2023].
|
| 251 |
+
Elise van der Pol, Daniel Worrall, Herke van Hoof, Frans Oliehoek, and Max Welling. Mdp homomorphic networks: Group symmetries in reinforcement learning. Advances in Neural Information Processing Systems (NeurIPS), 2020.
|
| 252 |
+
Elise van der Pol, Herke van Hoof, Frans A Oliehoek, and Max Welling. Multi-agent mdp homomorphic networks. arXiv preprint arXiv:2110.04495, 2021.
|
| 253 |
+
Arun Venkatraman, Roberto Capobianco, Lerrel Pinto, Martial Hebert, Daniele Nardi, and J Andrew Bagnell. Improved learning of dynamics models for control. In International Symposium on Experimental Robotics, 2016.
|
| 254 |
+
Dian Wang, Robin Walters, Xupeng Zhu, and Robert Platt. Equivariant $q$ learning in spatial action spaces. In Conference on Robot Learning, 2022.
|
| 255 |
+
Dian Wang, Jung Yeon Park, Neel Sortur, Lawson L.S. Wong, Robin Walters, and Robert Platt. The surprising effectiveness of equivariant models in domains with latent symmetry. In International Conference on Learning Representations, 2023.
|
| 256 |
+
|
| 257 |
+
Kaixin Wang, Bingyi Kang, Jie Shao, and Jiashi Feng. Improving generalization in reinforcement learning with mixture regularization. Advances in Neural Information Processing Systems (NeurIPS), 2020.
|
| 258 |
+
Jiayi Weng, Huayu Chen, Dong Yan, Kaichao You, Alexis Duburcq, Minghao Zhang, Yi Su, Hang Su, and Jun Zhu. Tianshou: A highly modularized deep reinforcement learning library. Journal of Machine Learning Research, 2022.
|
| 259 |
+
Denis Yarats, Ilya Kostrikov, and Rob Fergus. Image augmentation is all you need: Regularizing deep reinforcement learning from pixels. In International Conference on Learning Representations, 2020.
|
| 260 |
+
Denis Yarats, Rob Fergus, Alessandro Lazaric, and Lerrel Pinto. Mastering visual continuous control: Improved data-augmented reinforcement learning. arXiv preprint arXiv:2107.09645, 2021.
|
| 261 |
+
|
| 262 |
+
# Appendix
|
| 263 |
+
|
| 264 |
+
# Table of Contents
|
| 265 |
+
|
| 266 |
+
A Dynamics-Invariant Data Augmentation Functions 15
|
| 267 |
+
B Primary Environments for Our Empirical Analysis 16
|
| 268 |
+
C Data Augmentation Functions 17
|
| 269 |
+
D Additional Experiments 18
|
| 270 |
+
|
| 271 |
+
D.1 Increasing the Update Ratio 18
|
| 272 |
+
D.2 Increasing the Batch Size 18
|
| 273 |
+
D.3 Goal2D Augmented Replay Ratio 19
|
| 274 |
+
|
| 275 |
+
E Generalization Experiments 20
|
| 276 |
+
|
| 277 |
+
E.1 State-Action Coverage 20
|
| 278 |
+
E.2 Reward Density 20
|
| 279 |
+
E.3 Augmented Replay Ratio 20
|
| 280 |
+
|
| 281 |
+
F MuJoCo Experiments 22
|
| 282 |
+
|
| 283 |
+
F.1 Environment Modifications 22
|
| 284 |
+
F.2 Data Augmentation Functions 23
|
| 285 |
+
F.3 Augmented Replay Ratio 24
|
| 286 |
+
|
| 287 |
+
G Training Details 25
|
| 288 |
+
|
| 289 |
+

|
| 290 |
+
(a) Navigation
|
| 291 |
+
|
| 292 |
+

|
| 293 |
+
(b)Locomotion
|
| 294 |
+
|
| 295 |
+

|
| 296 |
+
(c) Manipulation
|
| 297 |
+
Figure 7: Common data augmentation functions. (7a, Amazon warehouse robots (2008)): If a robot is moving in free space, transition dynamics are often invariant to the agent's position. (7b, OSU's Cassie robot (2022)) Since robots are often symmetric about their sagittal axis, we can reflect the robot's left and right movements. (7c, Fetch robot (2023)) Objects move only if the agent contacts it. Thus, if the agent and object are not in contact, their dynamics are independent.
|
| 298 |
+
|
| 299 |
+
# A DYNAMICS-INVARIANT DATA AUGMENTATION FUNCTIONS
|
| 300 |
+
|
| 301 |
+
In this section, we further motivate our focus on dynamics-invariant data augmentation functions. Specifying a dynamics-invariant data augmentation function requires knowledge of domain-specific invariances or symmetries. While domain knowledge may seem like a limitation, we observe in the literature and real-world RL applications that such invariances and symmetries are incredibly common and often require very little prior knowledge to specify. We provided a few examples:
|
| 302 |
+
|
| 303 |
+
1. Transition dynamics are often independent of the agent's goal state (Andrychowicz et al., 2017).
|
| 304 |
+
2. Objects often have independent dynamics if they are physically separated (Pitis et al., 2020; 2022), which implies that objects exhibit translational invariance conditioned on physical separation.
|
| 305 |
+
3. Several works focus on rotational symmetry of 3D scenes in robotics tasks (Wang et al., 2022; 2023), and many real-world robots are symmetric in design and thus have symmetries in their transition dynamics (Abdolhosseini et al., 2019; Mikhail Pavlov and Plis, 2018).
|
| 306 |
+
|
| 307 |
+
We include real-world tasks that exhibit one or more of these invariances in Fig. 7. We choose to focus on dynamics-invariant data augmentations because they have already appeared so widely in the literature. As RL becomes an increasingly widely used tool, we anticipate that domain experts will be able to identify new domain-specific augmentations and use them to further lower the data requirements of RL. These observations underscore the importance of identifying when and why different general properties of data augmentation will benefit RL.
|
| 308 |
+
|
| 309 |
+
While visual DAFs are also commonly used in RL, a study on such DAFs is beyond the scope of this analysis. Such studies will likely need to focus on different aspects of DA than the ones we considered in our work. Visual DAFs generate augmented data with the same semantic meaning as the original data, and this point has three implications:
|
| 310 |
+
|
| 311 |
+
1. It may be imprecise to say that visual DAFs increase coverage, because the observed and augmented data have the same semantic meaning.
|
| 312 |
+
2. Because the original and augmented observation have the same semantic meaning, the augmented reward will often be the same as the original reward. Thus, the concept of "reward density" does not apply to these augmentations.
|
| 313 |
+
3. Moreover, because these DAFs produce data which could never be observed through environment interaction (e.g. an agent would never receive a cropped, recolored, and rotated image from the environment), they primarily aid representation learning. In contrast, dynamics-invariant DAFs aid exploration.
|
| 314 |
+
|
| 315 |
+

|
| 316 |
+
(a)Push
|
| 317 |
+
|
| 318 |
+

|
| 319 |
+
(b) Slide
|
| 320 |
+
Figure 8: Renderings of various Panda tasks. In PandaPush-v3 and Slide, the agent must move an object to a goal position. In PandaFlip-v3, the agent must rotate an object to a goal orientation.
|
| 321 |
+
|
| 322 |
+

|
| 323 |
+
(c) PickAndPlace
|
| 324 |
+
|
| 325 |
+

|
| 326 |
+
(d) Flip
|
| 327 |
+
|
| 328 |
+
# B PRIMARY ENVIRONMENTS FOR OUR EMPRICAL ANALYSIS
|
| 329 |
+
|
| 330 |
+
We use four tasks from panda-gym (Gallouédec et al., 2021) as the core environments in the main paper. Fig. 8 shows renderings for each task.
|
| 331 |
+
|
| 332 |
+
- PandaPush-v3 (Push): The robot must push an object to a goal location on the table. The goal and initial object positions are sampled uniformly at random from $(x, y) \in [-0.15, 0.15]^2$ , $z = 0.02$ .
|
| 333 |
+
- PandaSlide-v3 (Slide): The robot must slide a puck to a goal location on the table. The initial object position is sampled uniformly at random from $[-0.15, 0.15]^2$ , while the goal $(x, y, z)$ is sampled from $x \in [0.25, 0.55]$ , $y \in [-0.15, 0.15]$ , $z = 0.015$ .
|
| 334 |
+
- PandaPickAndPlace-v3 (PickAndPlace): The robot must pick up an object and move it to a goal location. With probability 0.3, the goal is on the table ( $z = 0.02$ ), and with probability 0.7, the goal is in the air ( $z \in (0.02, 0.2]$ ).
|
| 335 |
+
- PandaFlip-v3 (Flip): The robot must pick up an object and rotate it to a goal orientation. The initial object position is sampled uniformly at random from $[-0.15, 0.15]^2$ , while the goal is a uniformly sampled orientation expressed a quaternion.
|
| 336 |
+
|
| 337 |
+
In Push, PickAndPlace, and Flip, the object is a cube with side length 0.04. In Slide, the object is a cylindrical puck with height 0.03 and radius 0.03. The object's $z$ coordinate measures the distance between the center of the object and the table (e.g., In Push, Slide, and PickAndPlace, $z = 0.02$ means the object is on the table).
|
| 338 |
+
|
| 339 |
+
Push, Slide, and PickAndPlace share a similar sparse reward structure. The agent receives a reward of 0 if the object is within 0.05 units of the goal and a reward of $-1$ otherwise. In Flip, the agent receives a reward of 0 if the object's orientation $q$ is within 0.2 units from the goal orientation $q_{g}$ under the following angle distance metric:
|
| 340 |
+
|
| 341 |
+
$$
|
| 342 |
+
d (\boldsymbol {q}, \boldsymbol {q} _ {g}) = 1 - (\boldsymbol {q} \cdot \boldsymbol {q} _ {g}) ^ {2} = \frac {1 - \cos (\theta)}{2}
|
| 343 |
+
$$
|
| 344 |
+
|
| 345 |
+
where $\theta$ is the angle of rotation required to rotate $\mathbf{q}$ to $\mathbf{q}_g$ . Otherwise, the agent receives a reward of $-1$ .
|
| 346 |
+
|
| 347 |
+
In the toy 2D navigation task Goal2D, an agent must reach a fixed goal within 100 timesteps. The agent's state $(x,y,x_{g},y_{g})$ contains the coordinates of agent's positions $(x,y)$ and the goal's position $(x_{g},y_{g})$ . At each timestep, the agent chooses an action $(r,\theta)$ and transitions to a new position:
|
| 348 |
+
|
| 349 |
+
$$
|
| 350 |
+
x _ {t + 1} = x _ {t} + 0. 0 5 r \cos (\theta) \tag {1}
|
| 351 |
+
$$
|
| 352 |
+
|
| 353 |
+
$$
|
| 354 |
+
y _ {t + 1} = y _ {t} + 0. 0 5 r \sin (\theta)
|
| 355 |
+
$$
|
| 356 |
+
|
| 357 |
+
Thus, the agent moves at most 0.05 units in any direction. The goal position is fixed throughout an episode. The agent receives reward $+1$ when it is within 0.05 units of the goal and reward $-0.1$ otherwise. Agent and goal positions are initialized uniformly at random in $[-1, +1]^2$ .
|
| 358 |
+
|
| 359 |
+
# C DATA AUGMENTATION FUNCTIONS
|
| 360 |
+
|
| 361 |
+
In this section, we provide further details on the data augmentation functions introduced in Section 5.1.
|
| 362 |
+
|
| 363 |
+
- TRANSLATEGOAL: Goals are relabeled using a new goal sampled uniformly at random from the goal distribution. Reward signal is generated when the new goal is sufficiently close to the object's current position. To approximate the probability of this augmentation generating reward signal in each task, we sample 10M object and goal positions uniformly at random and report the empirical probability of the goal being sufficiently close to the object to generate reward signal.
|
| 364 |
+
|
| 365 |
+
- PandaPush-v3 (Push): Reward signal is generated with probability approximately 0.075.
|
| 366 |
+
- PandaSlide-v3 (Slide): The probability of generating reward signal depends on the current policy. The initial object and goal distributions are disjoint, so this augmentation can only generate reward signal if the agent pushes the object into the region $x \in [0.25, 0.55]$ , $y \in [-0.15, 0.15]$ . If the object is in this region, this augmentation will generate reward signal with probability approximately 0.075.
|
| 367 |
+
- PandaPickAndPlace-v3 (PickAndPlace): Reward signal is generated with probability approximately 0.04.
|
| 368 |
+
- PandaFlip-v3 (Flip): Reward signal is generated with probability approximately 0.04.
|
| 369 |
+
|
| 370 |
+
- TRANSLATEGALPROXIMAL $(p)$ : Goals are relabeled using a new goal sampled from the goal distribution. With probability $p$ , the new goal generates a reward signal, and with probability $1 - p$ , no reward signal is generated. When generating an augmented sample with reward signal, the goal is set equal to the object's position plus a small amount of noise. and with probability $1 - p$ , the object is moved to a random location sufficiently far from the goal that no reward signal is generated.
|
| 371 |
+
|
| 372 |
+
All Panda augmentation functions relabel the goal and reward. For Goal2D, we consider three data augmentation functions:
|
| 373 |
+
|
| 374 |
+
1. TRANSLATE: Translate the agent to a random position in $[-1, +1]^2$ . This augmentation generates reward signal with probability approximately 0.019. We obtained this approximation by sampling 10M agent and goal positions uniformly at random and then computing the empirical probability of the goal being with 0.05 units of the agent.
|
| 375 |
+
2. ROTATE: Rotate both the agent and goal by $\theta \in \{\pi / 2, \pi, 3\pi / 2\}$ . When sampling multiple augmentations of the sample observed transition, it is possible to sample duplicate augmentations.
|
| 376 |
+
3. TRANSLATEPROXIMAL $(p)$ : Translate the agent to a random position in $[-1, +1]^2$ . With probability $p$ , agent's new position is within 0.05 units of the goal and generates reward signal, and with probability $1 - p$ , agent's new position is more than 0.05 units from the goal and generates no reward signal.
|
| 377 |
+
|
| 378 |
+
All Goal2d augmentations modify the agent's state. TRANSLATE and TRANSLATEPROXIMAL $(p)$ modify the agent's position and reward but do not modify the goal. ROTATE affects the agent's position, the goal position, and agent's action, but does not change the reward.
|
| 379 |
+
|
| 380 |
+

|
| 381 |
+
Figure 9: Increasing the update ratio while keeping the augmented replay ratio fixed at $\beta = 1$ may harm performance. We plot the mean over 10 seeds expect for agents that use very large batch sizes: "x9 data" and "x17 data" curves show 5 seeds; "x17 data" for PickAndPlace shows 3 seeds. Shaded regions are $95\%$ confidence belts. These agents are trained using the same hyperparameters as those used in Fig. 6, though the hyperparameters are slightly different than those used in other figures. See Appendix G for further details.
|
| 382 |
+
|
| 383 |
+

|
| 384 |
+
(a)Push
|
| 385 |
+
|
| 386 |
+

|
| 387 |
+
(b) Slide
|
| 388 |
+
|
| 389 |
+

|
| 390 |
+
(c) PickAndPlace
|
| 391 |
+
Figure 10: Increasing the batch size without increasing the amount of learning data available to the agent harms performance. We train agents using the hyperparameters listed in Table 2 with various batch sizes, e.g., "x2 batch size" corresponds to learning with a batch size twice as large the batch size listed in Table 2.
|
| 392 |
+
|
| 393 |
+

|
| 394 |
+
(d) Flip
|
| 395 |
+
|
| 396 |
+
# D ADDITIONAL EXPERIMENTS
|
| 397 |
+
|
| 398 |
+
In this appendix, we provide additional experiments supporting the core claims in the main paper.
|
| 399 |
+
|
| 400 |
+
# D.1 INCREASING THE UPDATE RATIO
|
| 401 |
+
|
| 402 |
+
In Section 5.1.4, we demonstrate that generating more augmented data to decrease the augmented replay ratio can drastically improve data efficiency. If we generated more augmented data by increasing the augmentation ratio, we could alternatively incorporate the additional augmented data by using more augmented data in each update (i.e., increasing the update ratio). Fig. 9 shows agent performance as the augmentation ratio and update ratio increase proportionally. We additionally keep the replay age fixed by increasing the augmented buffer size proportionally. Learning is generally more data efficient with a larger update ratio, though it may harm performance as seen in Slide. Notably, the improvements in data efficiency from decreasing the replay ratio (Fig. 6) are similar or better than those produced from an increased update ratio and can be achieved at a much lower computational cost per update.
|
| 403 |
+
|
| 404 |
+
# D.2 INCREASING THE BATCH SIZE
|
| 405 |
+
|
| 406 |
+
In Fig. 3, agents with more training data available to them use larger batch sizes for updates, giving these agents a seemingly unfair advantage over agents that learn from less data. However, Fig. 10 shows that increasing the batch size without increasing the amount of data available to the agent
|
| 407 |
+
|
| 408 |
+

|
| 409 |
+
(a) Goal2D: TRANSLATE
|
| 410 |
+
|
| 411 |
+

|
| 412 |
+
(b) Goal2D: ROTATE
|
| 413 |
+
Figure 11: (50 seeds) Decreasing the replay ratio while keeping the update ratio fixed at $\alpha = 1$ improves data efficiency.
|
| 414 |
+
|
| 415 |
+
harm performance, due to an increase in the expected number of times a transition is sampled for a gradient update (Fedus et al., 2020). By scaling the batch size with the amount of available learning data in Fig. 3, we keep the expected number of gradient updates per observed/augmented transition fixed across all experiments, providing a fairer comparison.
|
| 416 |
+
|
| 417 |
+
# D.3 GOAL2D AUGMENTED REPLAY RATIO
|
| 418 |
+
|
| 419 |
+
As in Section 5.1.4, we decrease the augmented replay ratio $\beta$ by generating more augmentations per observed transition. We scale the augmented replay buffer size proportionally and keep the ratio of augmented to observed data used in updates fixed at $\alpha = 1$ . As shown in Fig. 11, a lower augmentation replay ratio increases data efficiency.
|
| 420 |
+
|
| 421 |
+

|
| 422 |
+
(a)
|
| 423 |
+
|
| 424 |
+

|
| 425 |
+
(b)
|
| 426 |
+
Figure 12: Learning with various mixtures of additional policy-generated data and TRANSLATEPROXIMAL(0) or TRANSLATEGOALPROXIMAL(0) data. Each mixture doubles the agent's learning data. Solid lines denote averages over 10 seeds in Panda tasks and 50 seeds in Goal2D, and shaded regions denote $95\%$ confidence intervals. The upper legend refers to Panda tasks results. We use an update ratio of $\alpha = 1$ . Panda tasks use the same hyperapameters listed in Table 2.
|
| 427 |
+
|
| 428 |
+

|
| 429 |
+
(c)
|
| 430 |
+
|
| 431 |
+
# E GENERALIZATION EXPERIMENTS
|
| 432 |
+
|
| 433 |
+
In this section, we investigate how state-action coverage, reward density, and the augmented replay ratio affect an agent's generalization ability. For Push, Slide, and PickAndPlace, we train agents over one quadrant of the goal distribution and evaluate agents over the full distribution. For Flip, An agent that generalizes well will achieve a high success rate over the full goal distribution. In general, our observations regarding data efficiency in the main body of this work also apply to generalization.
|
| 434 |
+
|
| 435 |
+
# E.1 STATE-ACTION COVERAGE
|
| 436 |
+
|
| 437 |
+
State-action coverage results are shown in Fig. 12. An increase in state-action coverage via augmentation increases generalization. In the Panda tasks, using $50\%$ TRANSLATEGOALPROXIMAL(0) data yields similar performance compared to increased using a $50\%$ TRANSLATEGOAL data, indicating that coverage alone can largely explain the generalization improvements with TRANSLATEGOAL. In Goal2D, increased coverage yields better generalization, though a considerable gap nevertheless exists between TRANSLATEPROXIMAL(0) and TRANSLATE. Thus, reward density must play a larger role in Goal2D. We further investigate this point in the following section.
|
| 438 |
+
|
| 439 |
+
# E.2 REWARD DENSITY
|
| 440 |
+
|
| 441 |
+
Reward density results are shown in Fig. 13. In Goal2D, a relatively small increase in reward density dramatically improves generalization; TRANSLATEPROXIMAL(0) is roughly on-par with using twice as much policy-generated data, while TRANSLATEPROXIMAL(0.05) outperforms agents with x8 as much policy-generated data. In the Panda tasks, increasing reward density has little effect on data generalization. Just
|
| 442 |
+
|
| 443 |
+
# E.3 AUGMENTED REPLAY RATIO
|
| 444 |
+
|
| 445 |
+
Augmented replay ratio results are shown in Fig. 14. In Goal2D with TRANSLATE and both Panda tasks with TRANSLATEGOAL, reducing the augmented replay ratio $\beta$ improves generalization performance at convergence. ROTATE achieves $100\%$ success for all values of $\beta$ .
|
| 446 |
+
|
| 447 |
+

|
| 448 |
+
(a)
|
| 449 |
+
|
| 450 |
+

|
| 451 |
+
(b)
|
| 452 |
+
Figure 13: Learning with TRANSLATEGOALPROXIMAL $(p)$ and TRANSLATEPROXIMAL $(p)$ for various settings of $p$ . Solid lines denote averages over 10 seeds in Panda tasks and 50 seeds in Goal2D, and shaded regions denote $95\%$ confidence intervals. We use an update ratio of $\alpha = 1$ . Panda tasks use the same hyperapameters listed in Table 2.
|
| 453 |
+
|
| 454 |
+

|
| 455 |
+
(c)
|
| 456 |
+
|
| 457 |
+

|
| 458 |
+
(a)
|
| 459 |
+
|
| 460 |
+

|
| 461 |
+
(b)
|
| 462 |
+
|
| 463 |
+

|
| 464 |
+
(c)
|
| 465 |
+
|
| 466 |
+

|
| 467 |
+
(d)
|
| 468 |
+
|
| 469 |
+

|
| 470 |
+
(e)
|
| 471 |
+
Figure 14: Decreasing the augmented replay ratio with various augmentations. Solid lines denote averages over 10 seeds in Panda tasks and 50 seeds in Goal2D, and shaded regions denote $95\%$ confidence intervals. We use an update ratio of $\alpha = 1$ for Goal2D and $\alpha = 2$ for Panda tasks. Panda tasks use the same hyperapameters used to in Fig. 6.
|
| 472 |
+
|
| 473 |
+
<table><tr><td>Environment</td><td>Modifications</td></tr><tr><td>InvertedPendulum,
|
| 474 |
+
InvertedDoublePendulum</td><td>cpole from_to changed from
|
| 475 |
+
(0,0,0,0.001,0,0.6) to (0,0,0,0,0,0.6).</td></tr><tr><td>Walker2d</td><td>foot_left_geom_friction changed from 1.9 to 0.9
|
| 476 |
+
so that it matches the foot_right_geom_friction.</td></tr><tr><td>Humanoid</td><td>right_hip_y armature changed from 0.0080 to 0.010
|
| 477 |
+
so that it matches left_hip_y armature.
|
| 478 |
+
Specify right_knee stiffness of 1
|
| 479 |
+
so that it matches left_knee stiffness.
|
| 480 |
+
Change solver from PGS to Newton.</td></tr></table>
|
| 481 |
+
|
| 482 |
+
Table 1: Modifications to MuJoCo environments to ensure intuitive symmetries. We include modifications to InvertedPendulum tasks even though we do not consider them in our experiments. We leave them here as a reference for future work in data augmentation that may require symmetric InvertedPendulum dynamics.
|
| 483 |
+
|
| 484 |
+
# F MUJOCO EXPERIMENTS
|
| 485 |
+
|
| 486 |
+
In this appendix, we include additional experiments on the following dense reward, continuous state and action MuJoCo environments: Swimmer-v4, Walker2d-v4, Ant-v4, and Humanoid-v4. These experiments focus on the augmented replay ratio; the state-action coverage and reward density analysis provided in the main paper is tailored toward sparse reward tasks. With dense reward tasks, we may need to consider the full distribution of rewards in the replay buffer, not just the average.
|
| 487 |
+
|
| 488 |
+
# F.1 ENVIRONMENT MODIFICATIONS
|
| 489 |
+
|
| 490 |
+
Some of the common MuJoCo environments do not exhibit symmetries that should exist intuitively (e.g. reflection symmetry, gait symmetry, etc.). We found two causes:
|
| 491 |
+
|
| 492 |
+
1. Asymmetric physics are explicitly hard-coded in the robot descriptor files. We believe these to be typos, and simply update values such that intuitive symmetries exist.
|
| 493 |
+
2. Symmetry-breaking numerical optimization algorithms are sometimes used to compute constraint forces and constrained accelerations. In particular, some environments use the Projected Gauss-Seidel (PGS) algorithm which performs sequential updates and therefore breaks symmetries where physics should be symmetric. To address this issue, we use Newton's method, which performs parallel updates and therefore preserves symmetric physics. We note that while Newton's method is MuJoCo's default algorithm, some robot descriptor files originally specify the use of PGS.
|
| 494 |
+
|
| 495 |
+
Table 1 describes all modifications made to environments to ensure intuitive symmetry. To simplify the creation of augmentation functions, we additionally exclude constraint forces and center-of-mass quantities from the agent's observations, since their interpretations are not well-documented and difficult to ascertain.
|
| 496 |
+
|
| 497 |
+

|
| 498 |
+
|
| 499 |
+

|
| 500 |
+
|
| 501 |
+

|
| 502 |
+
|
| 503 |
+

|
| 504 |
+
(a) Ant-v4: ROTATE
|
| 505 |
+
(c) Humanoid-v4: ROTATE
|
| 506 |
+
Figure 15: Visualizations of some augmentations in MuJoCo environments.
|
| 507 |
+
|
| 508 |
+

|
| 509 |
+
(b) Ant-v4: REFLECT
|
| 510 |
+
|
| 511 |
+
# F.2 DATA AUGMENTATION FUNCTIONS
|
| 512 |
+
|
| 513 |
+
We consider the following dynamics-invariant augmentations:
|
| 514 |
+
|
| 515 |
+
- Swimmer-v4
|
| 516 |
+
- REFLECT: Reflect joint angles and velocities about the agent's central axis. The reward is unchanged.
|
| 517 |
+
- Walker2d-v4
|
| 518 |
+
- REFLECT: Swap the observations dimensions of the left and right legs. The reward is unchanged.
|
| 519 |
+
Ant-v4
|
| 520 |
+
- REFLECT: Swap the observations dimensions of the front and back legs. Unlike the other reflections, this augmentation affects the reward. In particular, if the observed transition moves forward with velocity $\mathbf{v}$ , the reflected transition will move backwards with velocity $-\mathbf{v}$ . Thus, this reflection flips the sign of the "forward progress" reward term in the reward function.
|
| 521 |
+
- ROTATE: Rotate the agent's orientation by $\theta$ sampled uniformly at random from $[- \pi / 6, \pi / 6]$ .
|
| 522 |
+
Humanoid-v4
|
| 523 |
+
- REFLECT: Swap the observations dimensions of the left and right arms/legs, and reflect torso joint angles, velocities, and orientation about the agent's central axis. The reward is unchanged.
|
| 524 |
+
- ROTATE: Rotate the agent's orientation by $\theta$ sampled uniformly at random from $[- \pi / 3, \pi / 3]$ .
|
| 525 |
+
|
| 526 |
+

|
| 527 |
+
Figure 16: Lowering the augmented replay ratio for the REFLECT augmentation. Solid lines denote averages over 10 seeds, and shaded regions denote $95\%$ confidence intervals.
|
| 528 |
+
|
| 529 |
+

|
| 530 |
+
Figure 17: Lowering the augmented replay ratio for the TRANSLATE and ROTATE augmentations. Solid lines denote averages over 10 seeds, and shaded regions denote $95\%$ confidence intervals.
|
| 531 |
+
|
| 532 |
+
# F.3 AUGMENTED REPLAY RATIO
|
| 533 |
+
|
| 534 |
+
We repeat the same augmented replay ratio experiments detailed in Section 5.1.4 for MuJoCo tasks. We decrease the replay ratio $\beta$ by generating more augmentations per observed transition while keeping the amount of augmented data used in policy/value function updates fixed, i.e., we increase the augmentation ratio $m$ while fixing the update ratio $\alpha$ . We consider all augmentations listed in Appendix F.2.
|
| 535 |
+
|
| 536 |
+
For the ROTATE augmentation, we fix the update ratio at $\alpha = 1$ and generate $m = 1,2,4$ augmented transitions per observed transition, corresponding to augmented replay ratios $\beta = 1,0.5,0.25$ , respectively. Even though REFLECT can only generate a single augmented transition per observed transition, we can nevertheless study the augmented replay ratio as follows. Rather than generating an augmenting every observed transition, we instead augment transitions with some probability $p$ such that the augmented replay ratio is $1 / p$ in expectation. We can think of $p$ as a fractional augmentation ratio. We fix the update ratio at $\alpha = 0.25$ and consider $p = 0.25,0.5,1$ , again corresponding to augmented replay ratios $\beta = 1,0.5,0.25$ , respectively.
|
| 537 |
+
|
| 538 |
+
Results are shown in Fig. 16 and 17. A lower augmented replay ratio with REFLECT yields slight improvements in data efficiency for all environments except Humanoid-b4, where performance is largely unchanged. We observe much larger improvements with a lower augmented replay ratio in our core sparse reward tasks (Section 5.1.4).
|
| 539 |
+
|
| 540 |
+
<table><tr><td>Episode length</td><td>at most 50 timesteps</td></tr><tr><td>Evaluation frequency</td><td>10,000 timesteps</td></tr><tr><td>Number of evaluation episodes</td><td>80</td></tr><tr><td>Number of environment interactions</td><td>600K (Push), 1M (Slide, Flip), 1.5M (PickAndPlace)</td></tr><tr><td>Random action probability</td><td>0.3</td></tr><tr><td>Gaussian action noise scale</td><td>0.2</td></tr><tr><td># of random actions before learning</td><td>1000</td></tr><tr><td>Observed replay buffer size (default)</td><td>1 · 106</td></tr><tr><td>Augmented replay buffer size (default)</td><td>1 · 106</td></tr><tr><td>Batch size (default)</td><td>256 (Push, Slide), 512 (Flip, PickAndPlace)</td></tr><tr><td>Update frequency</td><td>Every 2 timesteps (observed replay ratio of 0.5)</td></tr><tr><td>Network</td><td>Multi-layer perceptron with hidden layers (256, 256, 256)</td></tr><tr><td>Optimizer</td><td>Adam (Kingma and Ba, 2014)</td></tr><tr><td>Learning rate</td><td>0.001</td></tr><tr><td>Polyak averaging coefficient (τ)</td><td>0.95</td></tr></table>
|
| 541 |
+
|
| 542 |
+
Table 2: Default hyperparameters used in all Panda tasks.
|
| 543 |
+
|
| 544 |
+
# G TRAINING DETAILS
|
| 545 |
+
|
| 546 |
+
We use the Stable Baselines3 (Raffin et al., 2021) implementation of DDPG (Lillicrap et al., 2015) and TD3 (Fujimoto et al., 2018) with modifications to incorporate augmentation into the RL training loop. In Panda tasks, we use DDPG since we found that it performs substantially better than TD3. This observation was also made by Gallouédec et al. (2021). All Panda experiments use the default hyperparameters presented in Table 2. These parameters are nearly identical to the those used by Plappert et al. (2018) and Gallouédec et al. (2021). The augmented replay ratio experiments in Fig. 6 and update ratio experiments in Fig. D.1 use different values for two hyperparameters specified below:
|
| 547 |
+
|
| 548 |
+
- Random action probability: 0
|
| 549 |
+
- Update frequency: Every timestep (observed replay ratio of 1)
|
| 550 |
+
|
| 551 |
+
We ran all experiments on a compute cluster using a mix of CPU-only and GPU jobs. This cluster contains a mix of Tesla P100-PCIE, GeForce RTX 2080 Ti, and A100-SXM4 GPUs. Due to limited GPU access, we only used GPUs for the augmented replay ratio experiments in Section 5.1.4, since these were our most computationally demanding experiments. We ran state-coverage, reward density, and generalization experiments on CPU only. CPU jobs took 12-36 hours each depending on the training budget, and GPU jobs took up to 16 hours each.
|
understandingwhendynamicsinvariantdataaugmentationsbenefitmodelfreereinforcementlearningupdates/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:939aa1b0a3372fd283ea650b545eeb88550104d55a1346d56f6b898cace51042
|
| 3 |
+
size 954102
|
understandingwhendynamicsinvariantdataaugmentationsbenefitmodelfreereinforcementlearningupdates/layout.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9f554aecbcfa6a01539a275fa5b6b58dca6ca477f47fe90dd836ac7ad864b609
|
| 3 |
+
size 767302
|
uniadapterunifiedparameterefficienttransferlearningforcrossmodalmodeling/52f7b6bf-2aa8-400c-a267-19af62d77573_content_list.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ba86894ad32561dafea50578aae43eacb5d22026b9e8a656cc2bccac3f74fa4c
|
| 3 |
+
size 141872
|
uniadapterunifiedparameterefficienttransferlearningforcrossmodalmodeling/52f7b6bf-2aa8-400c-a267-19af62d77573_model.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fc9719441182b4f4d4615b90aa362390a10bf9b811870bc09dfb03da07a7d0e8
|
| 3 |
+
size 160023
|
uniadapterunifiedparameterefficienttransferlearningforcrossmodalmodeling/52f7b6bf-2aa8-400c-a267-19af62d77573_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:aa665d295041c8124a85d78a29a2e4bed2e4cf33e130cb2fc690e5d433b3fad4
|
| 3 |
+
size 5796234
|
uniadapterunifiedparameterefficienttransferlearningforcrossmodalmodeling/full.md
ADDED
|
@@ -0,0 +1,613 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# UNIADAPTER: UNIFIED PARAMETER-EFFICIENT TRANSFER LEARNING FOR CROSS-MODAL MODELING
|
| 2 |
+
|
| 3 |
+
Haoyu Lu<sup>1</sup> Yuqi Huo<sup>3</sup> Guoxing Yang<sup>1</sup> Zhiwu Lu<sup>1,*</sup> Wei Zhan<sup>2</sup> Masayoshi Tomizuka<sup>2</sup> Mingyu Ding<sup>2,*</sup>
|
| 4 |
+
|
| 5 |
+
<sup>1</sup>Gaoling School of Artificial Intelligence, Renmin University of China, Beijing, China
|
| 6 |
+
$^{2}$ University of California, Berkeley, United States
|
| 7 |
+
$^{3}$ Baichuan Inc.
|
| 8 |
+
|
| 9 |
+
{lhy1998, luzhiwu}@ruc.edu.cn myding@berkeley.edu
|
| 10 |
+
|
| 11 |
+
# ABSTRACT
|
| 12 |
+
|
| 13 |
+
Large-scale vision-language pre-trained models have shown promising transferability to various downstream tasks. As the size of these foundation models and the number of downstream tasks grow, the conventional full fine-tuning paradigm becomes impractical due to heavy computational and storage costs. This paper proposes UniAdapter, which unifies unimodal and multimodal adapters for parameter-efficient cross-modal adaptation on pre-trained vision-language models. Specifically, adapters are distributed to different modalities and their interactions, with the total number of tunable parameters reduced by partial weight sharing. The unified and knowledge-sharing design enables efficient adaptation to various downstream tasks with powerful cross-modal representations, requiring only $1.0\% - 2.0\%$ tunable parameters of the pre-trained model. Extensive experiments on 7 cross-modal downstream benchmarks (including video-text retrieval, image-text retrieval, VideoQA, VQA and caption) show that in most cases, UniAdapter not only outperforms the state-of-the-arts, but even surpasses the full fine-tuning strategy. Notably, on the MSRVTT retrieval task, UniAdapter achieves $49.7\%$ recall@1 with only $2.2\%$ tunable model parameters, outperforming the latest competitors by $2.0\%$ . The code and models are available at https://github.com/ERV/UniAdapter.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
The pretrain-finetune paradigm has achieved great success in natural language processing (NLP) (Devlin et al., 2019; Ding et al., 2023), computer vision (CV) (Wang et al., 2022c), and multimodal modeling (Radford et al., 2021; Jia et al., 2021), where models are first pre-trained with large-scale data, and then fully fine-tuned for each downstream task. Recent research further finds that finetuning/adapting a foundation model to a new modality by introducing additional trainable modules significantly outperforms previous works, such as temporal modeling modules (Gao et al., 2021; Ju et al., 2022; Lu et al., 2022) for image-to-video transferring (see Figure 1 (a)).
|
| 18 |
+
|
| 19 |
+
However, as foundation models become increasingly large (Alayrac et al., 2022; Touvron et al., 2023; OpenAI, 2023; Anil et al., 2023; Chen et al., 2023) and the number of downstream tasks increases, particularly in multimodal scenarios, the traditional method of full fine-tuning becomes impractical due to the significant computational and storage requirements that it entails. Finding new ways to efficiently transfer foundation models to downstream tasks without incurring excessive costs, becomes an important challenge in the field.
|
| 20 |
+
|
| 21 |
+
Alternative approaches have been explored to address the above challenge. A straightforward approach is the use of Linear Probe, which freezes almost the entire model and only tunes a lightweight head for each task. It is only sub-optimal since the representation and the feature space are fixed. Another line of research alleviates the problem by few-shot learning with very large extra modules added to the foundation models (e.g., Flamingo (Alayrac et al., 2022)), which is still far from the full fine-tuning strategy. Recently, parameter-efficient adapters show remarkable results to generalize foundation models in many research fields. In NLP and CV, tunable efficient adapters (Houlsby et al., 2019; Hu et al., 2022b) and tunable prompt vectors (Li & Liang, 2021) are applied with a frozen backbone during transfer learning (Houlsby et al., 2019; Hu et al., 2022b). They also show great potential for cross-modal modeling (Ju et al., 2022; Sung et al., 2022; Pan et al., 2022; Gao et al., 2023), as
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
Figure 1: (a) Comparison between standard vision-language full fine-tuning paradigm (for image-text and video-text downstream tasks) and our parameter-efficient approach for various downstream tasks. (b) Performance comparison on cross-modal retrieval (horizontal axis) and visual question answering (VQA, vertical axis) tasks. The bubble size denotes the total tunable parameters. On either dataset, our UniAdapter achieves competitive performance on both two tasks while enjoying significantly fewer tunable parameters. N/A: several works focus on either VQA or cross-modal retrieval, and we set N/A for the non-report results.
|
| 25 |
+
|
| 26 |
+

|
| 27 |
+
(a)
|
| 28 |
+
|
| 29 |
+

|
| 30 |
+
|
| 31 |
+

|
| 32 |
+
|
| 33 |
+

|
| 34 |
+
(b)
|
| 35 |
+
|
| 36 |
+
they enable the transfer of pre-trained foundation models from cross-modal to single-modal (e.g., video classification (Pan et al., 2022; Gao et al., 2023)) or other downstream tasks (e.g., image-text reasoning (Sung et al., 2022)). However, the above works typically consider either a single modality or a single downstream task, without the support of single-/cross-modal and different downstream tasks. Considering various downstream tasks in multimodal modeling (e.g., video-text retrieval, image-text retrieval, video and visual question answering), a unified representation of adapters applicable to different multimodal downstream tasks is crucial. Meanwhile, previous approaches typically apply adapters without considering cross-modal interaction and knowledge sharing between them, which is the key to cross-modal modeling.
|
| 37 |
+
|
| 38 |
+
Motivated by the above observations, in this work, we investigate a critical problem of efficiently transferring a vision-language model to unified cross-modal modeling, which aims to enable a vision-language pre-training model to adapt to unified modalities (e.g., image and video) as well as unified cross-modal downstream tasks (e.g., retrieval and reasoning) in a parameter-efficient principle. We propose UniAdapter, which unifies adapters for multimodal modeling and distributes them to each modality and cross-modal interaction. UniAdapter has several appealing benefits that previous works do not have: 1) To model the cross-modal interactions, we introduce a knowledge-sharing scheme, where the down-projection layer in all adapters is shared while the up-projection can learn modality-specific knowledge. 2) To preserve the integrity of language queries during the cross-attention process in multimodal models, we incorporate residual learning for language queries. 3) We propose parameter-free frame-aware attention to unify the video and image modalities with no cost, not only making our approach applicable to more downstream tasks, but also alleviating the noise issue in videos. With these design considerations, our UniAdapter capitalizes a pre-trained vision-language model for unified cross-modal downstream tasks by introducing a few tunable parameters.
|
| 39 |
+
|
| 40 |
+
Our contribution is threefold: 1) We investigate the problem of unified parameter-efficient cross-modal transfer learning, which allows for the efficient utilization of a pre-trained vision-language model for a range of cross-modal downstream tasks. 2) We propose UniAdapter, a simple, efficient, yet effective framework with carefully considered designs, such as knowledge sharing and query residuals. To our best knowledge, we are the first adapter-based work that is applicable to various downstream tasks (including retrieval and reasoning) from both image-language and video-language domains. 3) Extensive evaluations on six cross-modal downstream benchmarks show that our UniAdapter generally outperforms previous arts with fewer parameters, especially in the video domain.
|
| 41 |
+
|
| 42 |
+
# 2 RELATED WORK
|
| 43 |
+
|
| 44 |
+
Parameter-efficient Transfer Learning. Parameter-efficient Transfer Learning technologies (Houlsby et al., 2019; Hu et al., 2022b; Ding et al., 2023) are first proposed in the NLP domain to alleviate the heavy training and storage cost in the full fine-tuning process facing the increasing foundation model size. These approaches aim to adapt a frozen large-scale model to downstream tasks by introducing small updating parameters. Recent works (Pan et al., 2022; Chen et al., 2022) also validate its effectiveness in the CV domain. Nevertheless, cross-modal parameter-efficient transfer learning is still not well explored. Although several pioneer works (Pan et al., 2022; Sung et al., 2022; Gao et al., 2023) are proposed for efficient cross-modal modeling, these works
|
| 45 |
+
|
| 46 |
+

|
| 47 |
+
Figure 2: (a) Semantic illustration of our overall parameter-efficient transfer learning framework. UniAdapters with the same color share the same weight. (b) Detailed design of our UniAdapter. Each modality shares a unified down-projection layer. The cross-modal up-projection branch considers utilizing knowledge from the textual up-projection layer to better learn the fusion information.
|
| 48 |
+
|
| 49 |
+
typically directly apply standard adapter or prompt approaches and focus on either single-modality tasks (e.g., visual classification (Gao et al., 2023)) or single-type downstream tasks (e.g., image-text reasoning (Sung et al., 2022)). In this work, our proposed UniAdapter is different and more general, which unifies unimodal and multimodal adapters for parameter-efficient cross-modal modeling, and can cope with unified modalities and various downstream tasks.
|
| 50 |
+
|
| 51 |
+
Vision-language Modeling. Video-language models can be roughly divided into two-stream models (e.g., CLIP (Radford et al., 2021), ALIGN (Jia et al., 2021)) and single-stream models (e.g., SimVLM (Wang et al., 2022d), OSCAR (Li et al., 2020)). Recently methods (e.g., ALBEF (Li et al., 2021), BLIP (Li et al., 2022), BLIP2 (Li et al., 2023a), BEIT 3 (Wang et al., 2023)) combine the advantages of both encoder-based and decoder-based methods, thus can support both cross-modal alignment tasks and multimodal generation tasks in one foundation model. While these image-text foundation models are extendable to various downstream tasks, the growing size of backbones (such as Flamingo (Alayrac et al., 2022), Qwen-VL (Bai et al., 2023), PaLI-X (Chen et al., 2023)) increases the burden of training and storage requirements.
|
| 52 |
+
|
| 53 |
+
# 3 METHODOLOGY
|
| 54 |
+
|
| 55 |
+
In this section, we first briefly describe the vision-language framework and the standard adapter. We then introduce our UniAdapter with query-based residual learning and frame-aware attention, to show how we capitalize a large-scale vision-language model for a wide range of downstream tasks from both image-language and video-language domains. The overall architecture is illustrated in Figure 2.
|
| 56 |
+
|
| 57 |
+
# 3.1 PRELIMINARY
|
| 58 |
+
|
| 59 |
+
Vision-language Framework. We utilize a hybrid-stream architecture as our frozen backbone for it combines the advantages of both two-stream and single-stream methods with superior performance and relatively high inference speed, which consists of a visual encoder (ViT (Dosovitskiy et al., 2021)), a language encoder (BERT (Devlin et al., 2019), and a multimodal encoder as shown in Figure 2.
|
| 60 |
+
|
| 61 |
+
Given an image/video-text pair, our model first utilizes the unimodal encoders to extract the visual features $\mathbf{f}^v = \{f_{\mathrm{CLS}}^v, f_0^v, f_1^v, \ldots\}$ and the textual features $\mathbf{f}^t = \{f_{\mathrm{CLS}}^t, f_0^t, f_1^t, \ldots\}$ , where $f_{\mathrm{CLS}}^v$ and $f_{\mathrm{CLS}}^t$ are [CLS] tokens. The cross-modal contrastive objectives are then applied for instance-level alignment on [CLS] tokens. The extracted visual features $\mathbf{f}^v$ and textual features $\mathbf{f}^t$ are then fed into the multimodal encoder for cross-modal token-level modeling. Specifically, the multimodal encoder takes text features as input and the visual features are inserted into each cross-attention layer for injecting the visual features. For video-language domain tasks, we first utilize the visual encoder to
|
| 62 |
+
|
| 63 |
+
extract each frame feature $\mathbf{f}^e = \{f_{\mathrm{CLS}}^e, f_0^e, f_1^e, \ldots\}$ . Then we concatenate the frame features as the visual input for each cross-attention layer.
|
| 64 |
+
|
| 65 |
+
Adapter. Adapter (Houlsby et al., 2019) is proposed for parameter-efficient transfer learning in the NLP domain, which freezes the pre-trained parameters and inserts small tunable modules between each layer. Each adapter consists of a down-projection layer ${W}_{down} \in {\mathcal{R}}^{\left( d \times r\right) }$ ,a nonlinear activation function $\sigma$ and an up-projection layer ${W}_{up} \in {\mathcal{R}}^{\left( r \times d\right) }$ ,where $d$ (or $r$ ) is the input (or bottleneck) dimension. Given an input feature $x \in {\mathcal{R}}^{d}$ ,the computation process can be given in a residual from:
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\operatorname {A d a p t e r} (x) = x + s \cdot \sigma \left(x W _ {\text {d o w n}}\right) W _ {u p}, \tag {1}
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
where $s$ is the scaling factor.
|
| 72 |
+
|
| 73 |
+
# 3.2 OVERALL ARCHITECTURE
|
| 74 |
+
|
| 75 |
+
UniAdapter aims to enable a pre-trained vision-language model for unified cross-modal downstream tasks in a parameter-efficient principle. Apart from that we evenly insert uniadapters into each transformer layer of textual, visual, and multimodal encoders as shown in Figure 2(a), our framework has three unique designs for cross-modal transfer learning: (1) To preserve the integrity of language queries during the cross-attention process in multimodal encoders, we incorporate residual learning for language queries. (2) We introduce unified and cross-modal knowledge-sharing designs, where the down-projection layer in all adapters is shared while the up-projection can learn modality-specific knowledge, as shown in Figure 2(b). (3) Considering the noisy issue in video frames, we propose parameter-free frame-aware attention to unify the video and image modalities with no cost and alleviate the noisy problem that exists in video-language domains. We discuss each part below.
|
| 76 |
+
|
| 77 |
+
# 3.3 RESIDUAL LEARNING FOR LANGUAGE QUERIES
|
| 78 |
+
|
| 79 |
+
The multimodal encoder is adopted for cross-modal token-level modeling, which takes text features as query input and the visual features are inserted into each cross-attention layer for injecting the visual features. Standard approaches insert adapters behind the multi-head attention in the transformer encoder architecture. Nevertheless, directly following this approach (inserting adapters behind the cross-attention layer) for the multimodal encoder is hard to deal with hybrid information, and may break the integrity of language queries during the cross-attention process in the multimodal encoder. Therefore, we introduce Residual Learning for Language Queries to address this issue.
|
| 80 |
+
|
| 81 |
+
Specifically, each multimodal encoder block consists of a multi-head self-attention (MSA), a multi-head cross-attention (MCA), and a fully connected feed-forward network (FFN). The multimodal encoder takes text features $\mathbf{f}^t$ as input and the visual features are inserted into each cross-attention layer for injecting the visual features as shown in Figure 2. Each cross-attention layer takes the self-attention output features $q$ as query $Q$ and the visual features $\mathbf{f}^v$ as key $K$ and value $V$ . The computation process of each block can be formulated as:
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
\boldsymbol {q} = \boldsymbol {l} _ {\boldsymbol {l} - 1} + \operatorname {M S A} (\boldsymbol {l} _ {\boldsymbol {l} - 1}),
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\boldsymbol {h} = \boldsymbol {q} + \operatorname {M C A} (Q = \boldsymbol {q}, K = \mathbf {f} ^ {\boldsymbol {v}}, V = \mathbf {f} ^ {\boldsymbol {v}}),
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
\boldsymbol {l} _ {l} = \boldsymbol {h} + \operatorname {F F N} (\boldsymbol {h}), \tag {2}
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
where $l_0 = \mathbf{f}^t$ , and $l_l$ denotes the output features of the $l$ -th layer. When the standard Adapter is inserted behind the cross-attention layer, Equation 2 can be rewritten as:
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
\boldsymbol {l} _ {\ell} = \operatorname {A d a p t e r} (\boldsymbol {h}) + \operatorname {F F N} (\operatorname {L N} (\boldsymbol {h})) \tag {3}
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
where LN denotes the layer norm. It can be observed from Equation 2 that, the hidden state $h$ contains both Query features as well as cross-modal fusion features. Learning such hybrid information with a single modality adapter is very hard. Moreover, the textual query information may be lost during transmission in each cross-encoder block. Therefore, we propose to capture/maintain the Query information by introducing an additional adapter in a residual form, termed Query-Residual adapter. Specifically, we insert it behind the self-attention layer and directly add the output to the feed-forward layer in a residual form, as shown in Figure 2. Equation 2 can now be rewritten as:
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\boldsymbol {l} _ {\boldsymbol {l}} = \operatorname {A d a p t e r} (\boldsymbol {q}) + \operatorname {A d a p t e r} (\boldsymbol {h}) + \operatorname {F F N} (\ln (\boldsymbol {h})). \tag {4}
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
Simply introducing the Query-residual adapter may bring extra updating parameters, which is not expected in our lightweight principle. We observe that the textual encoder also takes the textual
|
| 108 |
+
|
| 109 |
+
features as input and adds the output to the feed-forward layer. Therefore, the textual adapter knowledge can be shared with Query-Residual adapter by fully weight-sharing between the two adapters to avoid extra parameter costs. We find that this weight-sharing mechanism even brings better performance, as shown in Appendix Table 1.
|
| 110 |
+
|
| 111 |
+
# 3.4 UNIADAPTER
|
| 112 |
+
|
| 113 |
+
To transfer a vision-language model to downstream tasks, a straightforward way is to inject adapters into each modality module (visual, textual, and multimodal fusion). However, utilizing separate adapters for each modality brings relatively high parameters. Meanwhile, there are no cross-modal interactions among these adapters, leading to suboptimal performance. We propose UniAdapter to address the above issues, which unifies unimodal and multimodal adapters into one framework by partial weight sharing.
|
| 114 |
+
|
| 115 |
+
The core idea of UniAdapter is to share the knowledge from multiple modalities to enhance cross-modal interaction meanwhile reducing extra tunable parameters. As illustrated in Figure 2(b), UniAdapter consists of a unified down-projection layer $W_{down} \in \mathcal{R}^{(d \times r)}$ , a nonlinear activation function $\sigma$ , and a modality-specific up-projection layer $W_{up} \in \mathcal{R}^{(r \times d)}$ , $\mathcal{M} \in \{\mathcal{V}, \mathcal{T}, \mathcal{C}\}$ , where $d$ and $r$ are the input and bottleneck dimensions, and $\mathcal{V}, \mathcal{T}, \mathcal{C}$ denote the visual, textual and cross-modal modality, respectively. The down-projection layer in all UniAdapters is shared while the up-projection can learn modality-specific knowledge. Below we introduce UniAdapter for each modality.
|
| 116 |
+
|
| 117 |
+
Unimodal Case. Although we apply a unified down-projection for cross-modal knowledge-sharing, learning modality-specific representation is also important for the unimodal encoders. Therefore, we apply two modality-specific up-projection layers $(W_{up}^{\mathcal{V}}, W_{up}^{\mathcal{T}})$ respectively for the visual encoder and textual encoder:
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
U n i A d a p t e r \left(x ^ {\mathcal {V}}\right) = x ^ {\mathcal {V}} + s \cdot \sigma \left(x ^ {\mathcal {V}} W _ {d o w n}\right) W _ {u p} ^ {\mathcal {V}},
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
$$
|
| 124 |
+
U n i A d a p t e r \left(x ^ {\mathcal {T}}\right) = x ^ {\mathcal {T}} + s \cdot \sigma \left(x ^ {\mathcal {T}} W _ {d o w n}\right) W _ {u p} ^ {\mathcal {T}}, \tag {5}
|
| 125 |
+
$$
|
| 126 |
+
|
| 127 |
+
where $s$ denotes the scaling factor, and $x^{\nu}$ and $x^{\mathcal{T}}$ denote the visual and textual features, respectively.
|
| 128 |
+
|
| 129 |
+
The visual encoder and textual encoder take the same transformer encoder architecture and we follow MAM (He et al., 2022) to inject UniAdapter between the self-attention layer and the feed-forward layer (see Figure 2).
|
| 130 |
+
|
| 131 |
+
Cross-modal Case. We also utilize a specific up-projection layer for multimodal encoder transfer learning. However, as we mentioned in Sec. 3.3, the input features consist of the Query features as well as cross-modal fusion features. Learning such hybrid information with a single adapter is very hard. Following the design of Sec. 3.3, we consider reusing the textual up-projection layer $W_{up}^T$ into UniAdapter for capturing the textual information. In this way, the cross-modal up-projection layer $W_{up}^C$ can cope with the cross-modal information more easily. The UniAdapter on the cross-modal modality can be expressed as:
|
| 132 |
+
|
| 133 |
+
$$
|
| 134 |
+
U n i A d a p t e r (x ^ {\mathcal {C}}) = x ^ {\mathcal {C}} + s \cdot \left[ \sigma (x ^ {\mathcal {C}} W _ {d o w n}) W _ {u p} ^ {\mathcal {T}} + \sigma (x ^ {\mathcal {C}} W _ {d o w n}) W _ {u p} ^ {\mathcal {C}} \right],
|
| 135 |
+
$$
|
| 136 |
+
|
| 137 |
+
where $s$ denotes the scaling factor (as in the unimodal case), and $x^C$ denotes the cross-modal features.
|
| 138 |
+
|
| 139 |
+
For multimodal encoder, we insert UniAdapter between cross-attention and feed-forward layer. We additionally consider Query-residual Adaption introduced in Sec. 3.3. Equation 2 can be rewritten as:
|
| 140 |
+
|
| 141 |
+
$$
|
| 142 |
+
\boldsymbol {l} _ {l} = \operatorname {U n i A d p a t e r} (\boldsymbol {q}) + \operatorname {U n i A d p a t e r} (\boldsymbol {h}) + \operatorname {F F N} (\operatorname {L N} (\boldsymbol {h})). \tag {6}
|
| 143 |
+
$$
|
| 144 |
+
|
| 145 |
+
# 3.5 PARAMETER-FREE FRAME-AWARE ATTENTION
|
| 146 |
+
|
| 147 |
+
For video downstream tasks, we concatenate the frame features extracted from the visual encoder as the visual input for video-level cross-modal alignment. However, this approach considers all frames with equal weight and ignores the noise and misalignment problem in videos. Inspired by LGDN (Lu et al., 2022), we propose Parameter-free Frame-aware Attention (PFA) for video-text retrieval, which highlights the tokens in salient frames and while suppressing tokens in noisy or irrelevant frames during the cross-attention process, without introducing extra parameters.
|
| 148 |
+
|
| 149 |
+
Formally, given a video-text pair with the extracted frame features $\{f_{\mathrm{CLS},i}^{e}, f_{i,j}^{e} | i = 1, \dots, n, j = 1, \dots, m\}$ , where $n$ is the length of the video and $m$ is the length of the token sequence, we first
|
| 150 |
+
|
| 151 |
+
identify the attention weight $A_{i}$ of the $i$ -th frame by computing the dot-product of the frame features and the paired text [CLS] token features $f_{\mathrm{CLS}}^{t}$ :
|
| 152 |
+
|
| 153 |
+
$$
|
| 154 |
+
A _ {i} = \frac {\exp \left(f _ {\mathrm {C L S} , i} ^ {e} \cdot f _ {\mathrm {C L S}} ^ {t}\right)}{\sum_ {i} \exp \left(f _ {\mathrm {C L S} , i} ^ {e} \cdot f _ {\mathrm {C L S}} ^ {t}\right)}, \tag {7}
|
| 155 |
+
$$
|
| 156 |
+
|
| 157 |
+
Then we apply the PFA attention weight for each frame feature $\mathbf{f}^e$ to formulate the final input visual features, which can be formulated as:
|
| 158 |
+
|
| 159 |
+
$$
|
| 160 |
+
P F A \left(\mathbf {f} _ {i} ^ {e}\right) = \left\{f _ {\mathrm {C L S}, i} ^ {e}, A _ {i} * f _ {i, j} ^ {e} \mid 1 \leq i \leq n, 1 \leq j \leq m \right\}. \tag {8}
|
| 161 |
+
$$
|
| 162 |
+
|
| 163 |
+
# 4 EXPERIMENT
|
| 164 |
+
|
| 165 |
+
# 4.1 DATASETS AND SETTINGS
|
| 166 |
+
|
| 167 |
+
Downstream Datasets. We evaluate our proposed UniAdapter on 7 downstream datasets, including video-text retrieval datasets: MSR-VTT (Xu et al., 2016) and DiDeMo (Hendricks et al., 2017); image-text retrieval datasets: MSCOCO (Lin et al., 2014) and Flickr30K (Plummer et al., 2015); video question answering dataset: MSRVTT-QA (Xu et al., 2017); visual question answering dataset: VQAv2 (Goyal et al., 2017); and Caption dataset: MSCOCO (Lin et al., 2014). We present the details of the downstream datasets as well as the evaluation metrics in Appendix Section 4 & 5.
|
| 168 |
+
|
| 169 |
+
Implementation Details. We apply BLIP-base (Li et al., 2022) as our vision-language backbone for both image-text and video-text downstream tasks (also explore larger and other backbones in Appendix A). The parameters of the BLIP model are kept frozen during the fine-tuning process. We set the UniAdapter hyperparameters uniformly for all modalities as: input/output dimension $d =$
|
| 170 |
+
|
| 171 |
+
Table 1: Inserting Adapter (r=512) into different modalities (Visual $\mathcal{V}$ , Textual $\mathcal{T}$ and Cross-modal $\mathcal{C}$ ) on Didemo. # Tunable: the number of tunable parameters.
|
| 172 |
+
|
| 173 |
+
<table><tr><td>V</td><td>T</td><td>C</td><td># Tunable</td><td>R@1</td><td>R@5</td><td>R@10</td><td>R@Mean</td><td>MedR</td></tr><tr><td>✓</td><td></td><td></td><td>9.5M</td><td>42.6</td><td>70.9</td><td>79.4</td><td>64.3</td><td>2.0</td></tr><tr><td></td><td>✓</td><td></td><td>9.5M</td><td>40.0</td><td>64.6</td><td>74.7</td><td>59.8</td><td>2.0</td></tr><tr><td>✓</td><td>✓</td><td></td><td>19.0M</td><td>44.5</td><td>73.1</td><td>80.9</td><td>66.2</td><td>2.0</td></tr><tr><td></td><td></td><td>✓</td><td>9.5M</td><td>47.7</td><td>73.4</td><td>82.8</td><td>68.0</td><td>2.0</td></tr><tr><td>✓</td><td>✓</td><td>✓</td><td>28.4M</td><td>49.9</td><td>76.2</td><td>83.0</td><td>69.7</td><td>2.0</td></tr></table>
|
| 174 |
+
|
| 175 |
+
768, bottleneck dimension $r = 128$ (4.8M) or $r = 512$ (19.0M), and scaling factor $s = 0.1$ . Following previous works, we initialize the weights of down-projection layers for UniAdapter with Kaiming Normal (He et al., 2015) and configure the weights of the up-projection layers with zero initialization.
|
| 176 |
+
|
| 177 |
+
For video-text downstream tasks, we uniformly sample $N = 8$ frames per video during training, $N = 16$ frames per video during inference (but $N = 8$ for ablation study). All experiments are conducted on 8x NVIDIA 3090Ti (24G) GPUs. More details are given in Appendix.
|
| 178 |
+
|
| 179 |
+
# 4.2 ABLATION STUDY AND ANALYSIS
|
| 180 |
+
|
| 181 |
+
In this subsection, we conduct comprehensive ablation studies to reveal how to successfully build a parameter-efficient transfer learning framework for cross-modal modeling and investigate the contributions of different components of our UniAdapter. If not specifically indicated, we set bottleneck dimension $r = 512$ for Adapter/UniAdapter, inference frames $N = 8$ as the default setting in the ablation study.
|
| 182 |
+
|
| 183 |
+
Where to Insert Adapter. Prior approaches (Houlsby et al., 2019; Chen et al., 2022) have successfully applied adapters in single-modality domains. To replicate the success, we choose to first identify which modality module is more crucial for cross-modal transfer learning. Specifically, we first apply adapters for different modality encoders as shown in Table 1. It can be observed that: (1) Inserting adapter into multimodal encoder significantly outperforms visual or textual modality (and even both visual and textual modality), suggesting that multimodal adaption should be paid more attention to. (2) Inserting adapters for all modality encoders achieves the best performance, and hence we adopt adapters for all modality modules as our default setting.
|
| 184 |
+
|
| 185 |
+
Effectiveness of Each Component. We compare our UniAdapter with three baselines (Linear Probe, Full fine-tuning, and Adapter) and demonstrate the contribution of each component of our UniAdapter in Table 2. Note that we start with the standard Adapter, which evenly inserts adapters into all
|
| 186 |
+
|
| 187 |
+
Table 2: Ablation study results for the proposed components on the Didemo test set and MSRVTT-QA valid set. # Tunable: the number of tunable parameters. PFA: Parameter-free Frame-aware Attention. The second best result is marked by underline.
|
| 188 |
+
|
| 189 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2"># Tunable</td><td colspan="2">Didemo</td><td colspan="2">Text-to-Video Retrieval</td><td rowspan="2">MDR</td><td rowspan="2">MSRVTT-QA Val Acc</td></tr><tr><td>R@1</td><td>R@5</td><td>R@10</td><td>R@Mean</td></tr><tr><td>Linear Probe</td><td>0.4M</td><td>39.7</td><td>64.6</td><td>74.9</td><td>59.7</td><td>2.0</td><td>-</td></tr><tr><td>Full fine-tuning</td><td>223 / 337M</td><td>51.3</td><td>79.1</td><td>85.7</td><td>72.0</td><td>1.0</td><td>43.0</td></tr><tr><td>Adapter (r=128)</td><td>7.1 / 4.8M</td><td>47.4</td><td>73.5</td><td>81.4</td><td>67.4</td><td>2.0</td><td>41.5</td></tr><tr><td>Adapter (r=512)</td><td>28.4 / 19.0M</td><td>49.6</td><td>75.9</td><td>82.8</td><td>69.4</td><td>2.0</td><td>42.8</td></tr><tr><td>UniAdapter (r=128)</td><td>4.8M</td><td>49.0</td><td>75.5</td><td>83.3</td><td>69.3</td><td>2.0</td><td>43.6</td></tr><tr><td>-Weight-sharing</td><td>7.1M</td><td>49.7</td><td>75.5</td><td>83.4</td><td>69.5</td><td>2.0</td><td>42.1</td></tr><tr><td>-Query-residual Adaption</td><td>7.1 / 4.8M</td><td>48.1</td><td>74.2</td><td>82.4</td><td>68.2</td><td>2.0</td><td>41.5</td></tr><tr><td>-PFA</td><td>7.1 / 4.8M</td><td>47.4</td><td>73.5</td><td>81.4</td><td>67.4</td><td>2.0</td><td>-</td></tr><tr><td>UniAdapter (r=256)</td><td>19.0M</td><td>52.1</td><td>77.3</td><td>85.2</td><td>71.5</td><td>1.0</td><td>44.5</td></tr><tr><td>-Weight-sharing</td><td>28.4M</td><td>51.3</td><td>76.5</td><td>84.2</td><td>70.7</td><td>1.0</td><td>43.7</td></tr><tr><td>-Query-residual Adaption</td><td>28.4 / 19.0M</td><td>50.1</td><td>76.1</td><td>83.5</td><td>69.9</td><td>1.0</td><td>42.8</td></tr><tr><td>-PFA</td><td>28.4 / 19.0M</td><td>49.6</td><td>75.9</td><td>82.8</td><td>69.7</td><td>2.0</td><td>-</td></tr></table>
|
| 190 |
+
|
| 191 |
+
Table 3: Comparative results obtained by different weight-sharing strategies used for UniAdapter on the Didemo test set and MSRVTT-QA valid set. # Tunable: the number of tunable parameters. The second best result is marked by underline.
|
| 192 |
+
|
| 193 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2"># Tunable</td><td rowspan="2">R@1</td><td colspan="4">Didemo Text-to-Video Retrieval</td><td rowspan="2">MSRVTT-QA Val Acc</td></tr><tr><td>R@5</td><td>R@10</td><td>R@Mean</td><td>MdR</td></tr><tr><td>w/o Share (r=512)</td><td>28.4M</td><td>52.4</td><td>77.6</td><td>84.2</td><td>71.4</td><td>1.0</td><td>43.6</td></tr><tr><td>Share Down</td><td>19.0M</td><td>52.1</td><td>77.3</td><td>85.2</td><td>71.5</td><td>1.0</td><td>44.5</td></tr><tr><td>Share Up</td><td>19.0M</td><td>50.1</td><td>76.6</td><td>84.2</td><td>70.3</td><td>1.0</td><td>43.1</td></tr><tr><td>Share Up & Down</td><td>9.5M</td><td>50.8</td><td>77.1</td><td>84.3</td><td>70.7</td><td>1.0</td><td>43.4</td></tr></table>
|
| 194 |
+
|
| 195 |
+
modality encoders. We can see that: (1) Query-residual Adaption leads to a noticeable improvement, suggesting that maintaining query information is vital for cross-modal transfer learning. (2) PFA brings certain performance improvements without introducing extra parameters. (3) The weight-sharing scheme leads to competitive performance but with significantly fewer tunable parameters. (4) With these design considerations, our UniAdapter largely outperforms the standard Adapter, and reaches comparable or even better performance compared with Full fine-tuning for both retrieval tasks and reasoning tasks. This clearly shows the effectiveness and efficiency of our UniAdapter.
|
| 196 |
+
|
| 197 |
+
Different Wight-sharing Strategies for UniAdapter. Our UniAdapter shares a unified down-projection layer to enhance the cross-modal interaction and meanwhile reduce the tunable parameters. In Table 3, we make performance evaluation over our UniAdapter with different weight-sharing strategies. We observe that all sharing strategies achieve comparable performance but with $50\% -70\%$ fewer parameters compared with non-sharing (w/o Share), which demonstrates the effectiveness of the knowledge-sharing scheme. Among them, Share Down outperforms all the other strategies, indicating that modality-specific Up-projection layers are essential for cross-modal transfer learning. Considering both effectiveness and efficiency, we thus deploy Share Down as our weight-sharing strategy. We also provide a detailed analysis of the weight-sharing design in Appendix B.
|
| 198 |
+
|
| 199 |
+
Comparisons with other parameter-efficient transfer learning methods. We evaluated other parameter-efficient approaches in Table 4. We used the same hidden state $r = 512$ for all methods. For
|
| 200 |
+
|
| 201 |
+
Table 4: Comparisons between UniAdapter and other parameter-efficient transfer learning methods.
|
| 202 |
+
|
| 203 |
+
<table><tr><td>Method</td><td>#Tunable</td><td>R@1</td><td>R@5</td><td>R@10</td><td>MedR</td><td>R@Mean</td></tr><tr><td>LoRA (Hu et al., 2022a)</td><td>56.6M</td><td>43.3</td><td>70.6</td><td>79.7</td><td>2.0</td><td>64.5</td></tr><tr><td>Adapter (Houlsby et al., 2019)</td><td>28.4M</td><td>49.6</td><td>75.9</td><td>82.8</td><td>2.0</td><td>69.4</td></tr><tr><td>ST Adapter (Pan et al., 2022)</td><td>42.5M</td><td>49.9</td><td>75.6</td><td>83.2</td><td>2.0</td><td>69.6</td></tr><tr><td>Parallel Adapter (He et al., 2022)</td><td>28.4M</td><td>49.9</td><td>76.2</td><td>83.0</td><td>2.0</td><td>69.7</td></tr><tr><td>MAM Adapter (He et al., 2022)</td><td>33.0M</td><td>50.2</td><td>76.6</td><td>83.2</td><td>2.0</td><td>70.0</td></tr><tr><td>UniAdapter (r=512)</td><td>19.0M</td><td>52.1</td><td>77.3</td><td>85.2</td><td>1.0</td><td>71.6</td></tr></table>
|
| 204 |
+
|
| 205 |
+
ST Adapter, which was designed for the visual encoder, we applied Parallel Adapter to the textual encoder as well as the multimodal encoder. Our UniAdapter achieved the best performance with the least number of tunable parameters, as can be observed from the results.
|
| 206 |
+
|
| 207 |
+
Table 5: Comparison to state-of-the-arts for video-text retrieval on MSR-VTT and Didemo. Input: the number $\times$ shape of inference frames. # Pretrain: the number of pre-training video/image-text pairs. The second best result is marked by underline.
|
| 208 |
+
|
| 209 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2">Input</td><td rowspan="2"># Tunable</td><td colspan="4">MSR-VTT</td><td rowspan="2">MdR</td><td rowspan="2">R@1</td><td colspan="3">Didemo</td></tr><tr><td>R@1</td><td>R@5</td><td>R@10</td><td>MdR</td><td>R@5</td><td>R@10</td><td>MdR</td></tr><tr><td colspan="12">Full fine-tuning:</td></tr><tr><td>VIOLET (Fu et al., 2021)</td><td>5×224</td><td>306M</td><td>34.5</td><td>63.0</td><td>73.4</td><td>-</td><td>32.6</td><td>62.8</td><td>74.7</td><td>-</td><td></td></tr><tr><td>All-in-one (Wang et al., 2022a)</td><td>9×224</td><td>110M</td><td>37.9</td><td>68.1</td><td>77.1</td><td>-</td><td>32.7</td><td>61.4</td><td>73.5</td><td>3.0</td><td></td></tr><tr><td>CLIP-Hhiker (Bain et al., 2022)</td><td>120×224</td><td>124M</td><td>47.7</td><td>74.1</td><td>82.9</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td></td></tr><tr><td>OmniVL (Wang et al., 2022b)</td><td>8×384</td><td>317M</td><td>47.8</td><td>74.2</td><td>83.8</td><td>-</td><td>52.4</td><td>79.5</td><td>85.4</td><td>-</td><td></td></tr><tr><td>LAVENDER (Li et al., 2023b)</td><td>32×224</td><td>308M</td><td>40.7</td><td>66.9</td><td>77.6</td><td>-</td><td>53.4</td><td>78.6</td><td>85.3</td><td>-</td><td></td></tr><tr><td>SINGULARITY (Lei et al., 2023)</td><td>16×224</td><td>209M</td><td>41.5</td><td>68.7</td><td>77.0</td><td>-</td><td>53.9</td><td>79.4</td><td>86.9</td><td>-</td><td></td></tr><tr><td colspan="12">Frozen backbone:</td></tr><tr><td>CLIP-Prompt (Ju et al., 2022)</td><td>16×224</td><td>6.4M</td><td>36.7</td><td>64.6</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td></td></tr><tr><td>UniAdapter (ours, r=128)</td><td>8×224</td><td>4.8M</td><td>49.7</td><td>71.9</td><td>81.5</td><td>2.0</td><td>49.0</td><td>75.5</td><td>83.3</td><td>2.0</td><td></td></tr><tr><td>UniAdapter (ours, r=512)</td><td>8×224</td><td>19.0M</td><td>50.6</td><td>73.4</td><td>81.6</td><td>1.0</td><td>52.1</td><td>77.3</td><td>85.2</td><td>1.0</td><td></td></tr><tr><td>UniAdapter (ours, r=512)</td><td>16×224</td><td>19.0M</td><td>50.5</td><td>73.9</td><td>81.7</td><td>1.0</td><td>53.7</td><td>78.3</td><td>87.2</td><td>1.0</td><td></td></tr></table>
|
| 210 |
+
|
| 211 |
+
Table 6: Comparison to the state-of-the-arts for the VideoQA task. # Tunable: the number of tunable parameters.
|
| 212 |
+
Table 7: Comparison to the state-of-the-arts for the VQA task. # Tunable: the number of tunable parameters. *our implementation.
|
| 213 |
+
|
| 214 |
+
<table><tr><td>Method</td><td># Tunable</td><td>MSRVTT-QA Test Acc</td></tr><tr><td colspan="3">Full fine-tuning:</td></tr><tr><td>MERLOT (Zellers et al., 2021)</td><td>233M</td><td>43.1</td></tr><tr><td>All-in-one (Wang et al., 2022a)</td><td>110M</td><td>44.3</td></tr><tr><td>SINGULARITY (Lei et al., 2023)</td><td>209M</td><td>43.5</td></tr><tr><td>VIOLETv2 (Fu et al., 2023)</td><td>308M</td><td>44.5</td></tr><tr><td>VINDLU (Cheng et al., 2023)</td><td>201M</td><td>44.6</td></tr><tr><td>LAVENDER (Li et al., 2023b)</td><td>308M</td><td>45.0</td></tr><tr><td colspan="3">Frozen backbone:</td></tr><tr><td>UniAdapter (ours, r=128)</td><td>4.8M</td><td>44.2</td></tr><tr><td>UniAdapter (ours, r=512)</td><td>19.0M</td><td>44.7</td></tr></table>
|
| 215 |
+
|
| 216 |
+
<table><tr><td>Method</td><td># Tunable</td><td>VQATest-dev</td><td>test-standard</td></tr><tr><td colspan="4">Fine-tuning with huge backbone:</td></tr><tr><td>Flamingo (Alayrac et al., 2022)</td><td>10.6B</td><td>82.1</td><td>82.0</td></tr><tr><td>BLIP-2 (Li et al., 2023a)</td><td>1.2B</td><td>82.3</td><td>82.2</td></tr><tr><td colspan="4">Full fine-tuning:</td></tr><tr><td>OSCAR (Li et al., 2020)</td><td>330M</td><td>73.61</td><td>73.82</td></tr><tr><td>ALBEF (Li et al., 2021)</td><td>266M</td><td>75.84</td><td>76.04</td></tr><tr><td>BLIP* (Li et al., 2022)</td><td>337M</td><td>77.44</td><td>77.48</td></tr><tr><td colspan="4">Frozen backbone:</td></tr><tr><td>UniAdapter (ours, r=128)</td><td>4.8M</td><td>73.72</td><td>73.71</td></tr><tr><td>UniAdapter (ours, r=512)</td><td>19.0M</td><td>75.44</td><td>75.56</td></tr></table>
|
| 217 |
+
|
| 218 |
+
# 4.3 COMPARISON TO THE STATE-OF-THE-ARTS
|
| 219 |
+
|
| 220 |
+
In this subsection, we compare our proposed UniAdapter to the recent state-of-the-art methods on a wide range of vision-language downstream tasks. Below we briefly introduce each downstream task and the corresponding tuning strategy (see more details in Appendix Section 4).
|
| 221 |
+
|
| 222 |
+
Video-text Retrieval. We first evaluate UniAdapter for video-text retrieval on MSR-VTT and Didemo in Table 5. We froze the pre-trained backbone, and fine-tune the tunable parameters (UniAdapter) following BLIP (Li et al., 2022). It can be observed that UniAdapter (4.8M) significantly outperforms the latest parameter-efficient method CLIP-Prompt (Ju et al., 2022) (49.7 vs. 36.7 for Text-to-Video R@1 on the MSR-VTT 1k-A test set) but with fewer tunable parameters (4.8M vs. 6.4M) and less input $(8\times 224$ vs. $16\times 224)$ . UniAdapter even outperforms those full fine-tuning methods specially designed for video-text retrieval on both MSR-VTT and Didemo with significantly fewer tunable parameters. When trained with more tunable parameters (19.0M, still largely fewer than full fine-tuning), UniAdapter could further boost the performance.
|
| 223 |
+
|
| 224 |
+
Video Question Answering. To further export the potentiality of our UniAdapter, we evaluate it for the VideoQA task on the MSRVTT-QA dataset. Different from retrieval tasks, VideoQA requires the model to predict an answer given a video and a question. We follow (Li et al., 2022) to utilize an additional cross-modal decoder to generate answers. To reduce the tunable parameters, we share UniAdapter for both the multimodal encoder and multimodal decoder (see more details in Appendix Section 3). As shown in Table 6, even without utilizing large-scale video datasets devoted to the VideoQA task and fine-tuning on full parameters, our UniAdapter
|
| 225 |
+
|
| 226 |
+
Table 8: Comparison on the caption task. # Tunable: the number of tunable parameters.
|
| 227 |
+
|
| 228 |
+
<table><tr><td>Method</td><td># Tunable</td><td>COCO
|
| 229 |
+
CIDER</td><td>Caption
|
| 230 |
+
B@4</td></tr><tr><td colspan="4">Fine-tuning with huge backbone:</td></tr><tr><td>SimVLM (Wang et al., 2022d)</td><td>1.4B</td><td>40.6</td><td>143.3</td></tr><tr><td>BLIP-2 (Li et al., 2023a)</td><td>1.1B</td><td>42.4</td><td>144.5</td></tr><tr><td>Flamingo (Alayrac et al., 2022)</td><td>10.6B</td><td>42.4</td><td>138.1</td></tr><tr><td colspan="4">Full fine-tuning:</td></tr><tr><td>VL-T5/BART (Cho et al., 2021)</td><td>165M</td><td>-</td><td>71.30</td></tr><tr><td>OSCAR (Li et al., 2020)</td><td>345M</td><td>37.4</td><td>127.8</td></tr><tr><td>VinVL (Chen et al., 2020)</td><td>345M</td><td>38.2</td><td>129.3</td></tr><tr><td>BLIP* (Li et al., 2022)</td><td>337M</td><td>39.7</td><td>133.3</td></tr><tr><td colspan="4">Frozen backbone:</td></tr><tr><td>UniAdapter (ours, r=512)</td><td>19.0M</td><td>40.0</td><td>133.5</td></tr></table>
|
| 231 |
+
|
| 232 |
+
Table 9: Comparison to the state-of-the-arts for image-text retrieval on MSCOCO (5K) and Flickr30K. # Tunable: the number of tunable parameters. The second best result is marked by underline.
|
| 233 |
+
|
| 234 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2"># Tunable</td><td colspan="3">MSCOCO TR</td><td colspan="3">MSCOCO IR</td><td colspan="3">Flcikr TR</td><td colspan="3">Flcikr IR</td></tr><tr><td>R@1</td><td>R@5</td><td>R@10</td><td>R@1</td><td>R@5</td><td>R@10</td><td>R@1</td><td>R@5</td><td>R@10</td><td>R@1</td><td>R@5</td><td>R@10</td></tr><tr><td colspan="14">Fine-tuning with huge backbone:</td></tr><tr><td>BEIT-3 (Wang et al., 2023)</td><td>1.9B</td><td>84.8</td><td>96.5</td><td>98.3</td><td>67.2</td><td>87.7</td><td>92.8</td><td>98.0</td><td>100.0</td><td>100.0</td><td>90.3</td><td>98.7</td><td>99.5</td></tr><tr><td>BLIP-2 (Li et al., 2023a)</td><td>1.2B</td><td>85.4</td><td>97.0</td><td>98.5</td><td>68.3</td><td>87.7</td><td>92.6</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td colspan="14">Full fine-tuning:</td></tr><tr><td>UNITER (Chen et al., 2020)</td><td>330M</td><td>65.7</td><td>88.6</td><td>93.8</td><td>52.9</td><td>79.9</td><td>88.0</td><td>87.3</td><td>98.0</td><td>99.2</td><td>75.6</td><td>94.1</td><td>96.8</td></tr><tr><td>OSCAR (Li et al., 2020)</td><td>330M</td><td>73.5</td><td>92.2</td><td>96.0</td><td>57.5</td><td>82.8</td><td>89.8</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>ALBEF (Li et al., 2021)</td><td>210M</td><td>77.6</td><td>94.3</td><td>97.2</td><td>60.7</td><td>84.3</td><td>90.5</td><td>95.9</td><td>99.8</td><td>100.0</td><td>85.6</td><td>97.5</td><td>98.9</td></tr><tr><td>BLIP (Li et al., 2022)</td><td>223M</td><td>81.9</td><td>95.4</td><td>97.8</td><td>64.3</td><td>85.7</td><td>91.5</td><td>97.3</td><td>99.9</td><td>100.0</td><td>87.3</td><td>97.6</td><td>98.9</td></tr><tr><td colspan="14">Frozen backbone:</td></tr><tr><td>UniAdapter (ours, r=128)</td><td>4.8M</td><td>79.8</td><td>94.2</td><td>97.5</td><td>62.3</td><td>84.5</td><td>90.8</td><td>97.1</td><td>100.0</td><td>100.0</td><td>86.5</td><td>97.4</td><td>98.8</td></tr><tr><td>UniAdapter (ours, r=512)</td><td>19.0M</td><td>80.1</td><td>94.6</td><td>97.4</td><td>62.6</td><td>84.6</td><td>90.9</td><td>97.1</td><td>99.9</td><td>100.0</td><td>86.4</td><td>97.4</td><td>98.9</td></tr></table>
|
| 235 |
+
|
| 236 |
+
outperforms most full fine-tuning competitors. These results suggest that parameter-efficient transfer learning may be a more effective paradigm for the VideoQA task.
|
| 237 |
+
|
| 238 |
+
Image-text Modeling. We also evaluate UniAdapter for image-language domains, including visual language reasoning tasks (VQAv2, in Table 7), and image-text retrieval tasks (MSCOCO and Flickr30K, in Table 9) and image caption task (MSCOCO, in Table 8).
|
| 239 |
+
|
| 240 |
+
For VQA in Table 7 and Caption in Table 8, fine-tuned on only $5\%$ parameters, our UniAdapter can achieve competitive or even better performance compared with fully fine-tuned methods. For image-text retrieval in Table 9, our UniAdapter performs comparably on MSCOCO and almost equally on Flickr30K but with only $2 - 10\%$ tunable parameters.
|
| 241 |
+
|
| 242 |
+
# 4.4 TRAINING EFFICIENCY AND STORAGE COST
|
| 243 |
+
|
| 244 |
+
The performance of parameter-efficient transfer learning methods is typically sensitive to the number of tunable parameters. We thus conduct experiments with different values of bottleneck dimension $r \in \{64, 128, 256, 512, 768\}$ in Figure 3 (a). We can observe that our UniAdapter is effective on a wide range of bottleneck dimension $r$ and achieves a slight performance improvement (or maintains the accuracy stably) when $r$ scales up. This suggests that our UniAdapter is not sensitive to the bottleneck dimension $r$ and we could select $r$ according to the practical requirements.
|
| 245 |
+
|
| 246 |
+
Compared with the standard Adapter, our UniAdapter can achieve higher performance (43.6 vs. 43.2) but with $5.9 \times$ fewer tunable parameters. When utilizing the same parameters (especially on small ones), our UniAdapter leads to further gains over the standard Adapter.
|
| 247 |
+
|
| 248 |
+
We compare training efficiency in Figure 3 (b). UniAdapter and full fine-tuning perform very comparably at the early stage. Then the full fine-tuning strategy drops quickly which may be due to the overfitting, while UniAdapter further boosts the performance. Meanwhile, UniAdapter is significantly faster than the standard Adapter (same performance with nearly $3\times$ fewer training steps). We also report the
|
| 249 |
+
|
| 250 |
+
relative training GPU hours and GPU memory cost for both retrieval and VQA tasks in Table 10, where the time (or memory) of full fine-tuning is taken as one unit.
|
| 251 |
+
|
| 252 |
+
Table 10: Comparison on the training time and GPU memory. * means that more resources required is mainly due to the additional momentum encoder applied by BLIP (Li et al., 2022) for retrieval task.
|
| 253 |
+
|
| 254 |
+
<table><tr><td></td><td>#Param</td><td>VQATime</td><td>Mem</td><td>Retrieval*Time</td><td>Mem</td></tr><tr><td>Full fine-tuning</td><td>100%</td><td>1.00</td><td>1.00</td><td>1.00</td><td>1.00</td></tr><tr><td>UniAdapter (r=128)</td><td>1.4%-2.2%</td><td>0.44</td><td>0.60</td><td>0.81</td><td>0.73</td></tr><tr><td>UniAdapter (r=512)</td><td>5.6%-8.5%</td><td>0.47</td><td>0.61</td><td>0.86</td><td>0.76</td></tr></table>
|
| 255 |
+
|
| 256 |
+
# 5 CONCLUSION
|
| 257 |
+
|
| 258 |
+
In this paper, we propose UniAdapter for parameter-efficient cross-modal adaptation. UniAdapter unifies adapters for different modalities and their interactions with a knowledge-sharing design. By incorporating a small number of tunable parameters, we capitalize a frozen vision-language model to adapt to unified modalities (e.g., image and video) as well as unified cross-modal downstream tasks (e.g., retrieval and reasoning). Extensive evaluations on six cross-modal downstream benchmarks show that UniAdapter typically outperforms previous arts and even surpasses the full fine-tuning strategy. We believe this work will inspire further research on efficient cross-modal modeling tasks.
|
| 259 |
+
|
| 260 |
+
# ACKNOWLEDGEMENTS
|
| 261 |
+
|
| 262 |
+
This work was supported by National Natural Science Foundation of China (62376274).
|
| 263 |
+
|
| 264 |
+
# REFERENCES
|
| 265 |
+
|
| 266 |
+
Jean-Baptiste Alayrac, Jeff Donahue, Pauline Luc, Antoine Miech, Iain Barr, Yana Hasson, Karel Lenc, Arthur Mensch, Katie Millican, Malcolm Reynolds, et al. Flamingo: a visual language model for few-shot learning. arXiv preprint arXiv:2204.14198, 2022.
|
| 267 |
+
Rohan Anil, Andrew M Dai, Orhan First, Melvin Johnson, Dmitry Lepikhin, Alexandre Passos, Siamak Shakeri, Emanuel Taropa, Paige Bailey, Zhifeng Chen, et al. Palm 2 technical report. arXiv preprint arXiv:2305.10403, 2023.
|
| 268 |
+
Jinze Bai, Shuai Bai, Shusheng Yang, Shijie Wang, Sinan Tan, Peng Wang, Junyang Lin, Chang Zhou, and Jingren Zhou. Qwen-vl: A frontier large vision-language model with versatile abilities. arXiv preprint arXiv:2308.12966, 2023.
|
| 269 |
+
Max Bain, Arsha Nagrani, Gül Varol, and Andrew Zisserman. Frozen in time: A joint video and image encoder for end-to-end retrieval. In ICCV, pp. 1728-1738, 2021.
|
| 270 |
+
Max Bain, Arsha Nagrani, Gül Varol, and Andrew Zisserman. A clip-hitchhiker's guide to long video retrieval. arXiv preprint arXiv:2205.08508, 2022.
|
| 271 |
+
Shoufa Chen, Chongjian Ge, Zhan Tong, Jiangliu Wang, Yibing Song, Jue Wang, and Ping Luo. Adaptformer: Adapting vision transformers for scalable visual recognition. arXiv preprint arXiv:2205.13535, 2022.
|
| 272 |
+
Xi Chen, Josip Djolonga, Piotr Padlewski, Basil Mustafa, Soravit Changpinyo, Jialin Wu, Carlos Riquelme Ruiz, Sebastian Goodman, Xiao Wang, Yi Tay, et al. Pali-x: On scaling up a multilingual vision and language model. arXiv preprint arXiv:2305.18565, 2023.
|
| 273 |
+
Yen-Chun Chen, Linjie Li, Licheng Yu, Ahmed El Kholy, Faisal Ahmed, Zhe Gan, Yu Cheng, and Jingjing Liu. UNITER: Universal image-text representation learning. In ECCV, pp. 104-120, 2020.
|
| 274 |
+
Feng Cheng, Xizi Wang, Jie Lei, David J. Crandall, Mohit Bansal, and Gedas Bertasius. Vindlu: A recipe for effective video-and-language pretraining. In CVPR, pp. 10739-10750. IEEE, 2023.
|
| 275 |
+
Jaemin Cho, Jie Lei, Hao Tan, and Mohit Bansal. Unifying vision-and-language tasks via text generation. In Marina Meila and Tong Zhang (eds.), ICML, pp. 1931-1942, 2021.
|
| 276 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In *NAACL-HLT*, pp. 4171–4186, 2019.
|
| 277 |
+
Ning Ding, Yujia Qin, Guang Yang, Fuchao Wei, Zonghan Yang, Yusheng Su, Shengding Hu, Yulin Chen, Chi-Min Chan, Weize Chen, et al. Parameter-efficient fine-tuning of large-scale pre-trained language models. Nature Machine Intelligence, 5(3):220-235, 2023.
|
| 278 |
+
Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. In ICLR, 2021. URL https://openreview.net/forum?id=YicbFdNTTy.
|
| 279 |
+
Andrea Frome, Greg S Corrado, Jonathon Shlens, Samy Bengio, Jeffrey Dean, Marc'Aurelio Ranzato, and Tomas Mikolov. DeViSE: a deep visual-semantic embedding model. In NeurIPS, pp. 2121-2129, 2013.
|
| 280 |
+
Tsu-Jui Fu, Linjie Li, Zhe Gan, Kevin Lin, William Yang Wang, Lijuan Wang, and Zicheng Liu. Violet: End-to-end video-language transformers with masked visual-token modeling. arXiv preprint arXiv:2111.12681, 2021.
|
| 281 |
+
Tsu-Jui Fu, Linjie Li, Zhe Gan, Kevin Lin, William Yang Wang, Lijuan Wang, and Zicheng Liu. An empirical study of end-to-end video-language transformers with masked visual modeling. In CVPR, pp. 22898-22909, 2023.
|
| 282 |
+
|
| 283 |
+
Peng Gao, Shijie Geng, Renrui Zhang, Teli Ma, Rongyao Fang, Yongfeng Zhang, Hongsheng Li, and Yu Qiao. Clip-adapter: Better vision-language models with feature adapters. IJCV, pp. 1-15, 2023.
|
| 284 |
+
Zijian Gao, Jingyu Liu, Sheng Chen, Dedan Chang, Hao Zhang, and Jinwei Yuan. Clip2tv: An empirical study on transformer-based methods for video-text retrieval. arXiv preprint arXiv:2111.05610, 2021.
|
| 285 |
+
Yash Goyal, Tejas Khot, Douglas Summers-Stay, Dhruv Batra, and Devi Parikh. Making the V in VQA matter: Elevating the role of image understanding in visual question answering. In CVPR, pp. 6325-6334, 2017.
|
| 286 |
+
Junxian He, Chunting Zhou, Xuezhe Ma, Taylor Berg-Kirkpatrick, and Graham Neubig. Towards a unified view of parameter-efficient transfer learning. In *ICLR*, 2022.
|
| 287 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In ICCV, pp. 1026-1034, 2015.
|
| 288 |
+
Anne Lisa Hendricks, Oliver Wang, Eli Shechtman, Josef Sivic, Trevor Darrell, and Bryan Russell. Localizing moments in video with natural language. In ICCV, pp. 5804-5813, 2017.
|
| 289 |
+
Neil Houlsby, Andrei Giurgiu, Stanislaw Jastrzebski, Bruna Morrone, Quentin de Laroussilhe, Andrea Gesmundo, Mona Attariyan, and Sylvain Gelly. Parameter-efficient transfer learning for NLP. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), ICML, pp. 2790-2799, 2019.
|
| 290 |
+
Edward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. Lora: Low-rank adaptation of large language models. In ICLR, 2022a.
|
| 291 |
+
Edward J Hu, yelong shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. LoRA: Low-rank adaptation of large language models. In ICLR, 2022b.
|
| 292 |
+
Chao Jia, Yinfei Yang, Ye Xia, Yi-Ting Chen, Zarana Parekh, Hieu Pham, Quoc V Le, Yunhsuan Sung, Zhen Li, and Tom Duerig. Scaling up visual and vision-language representation learning with noisy text supervision. In ICML, pp. 4904-4916, 2021.
|
| 293 |
+
Chen Ju, Tengda Han, Kunhao Zheng, Ya Zhang, and Weidi Xie. Prompting visual-language models for efficient video understanding. In Shai Avidan, Gabriel J. Brostow, Moustapha Cisse, Giovanni Maria Farinella, and Tal Hassner (eds.), ECCV, pp. 105-124, 2022.
|
| 294 |
+
Wonjae Kim, Bokyung Son, and Ildoo Kim. ViLT: Vision-and-language transformer without convolution or region supervision. In ICML, pp. 5583-5594, 2021.
|
| 295 |
+
Ranjay Krishna, Yuke Zhu, Oliver Groth, Justin Johnson, Kenji Hata, Joshua Kravitz, Stephanie Chen, Yannis Kalantidis, Li-Jia Li, David A Shamma, et al. Visual genome: Connecting language and vision using crowdsourced dense image annotations. IJCV, 123(1):32-73, 2017.
|
| 296 |
+
Jie Lei, Linjie Li, Luowei Zhou, Zhe Gan, Tamara L Berg, Mohit Bansal, and Jingjing Liu. Less is more: ClipBERT for video-and-language learning via sparse sampling. In CVPR, pp. 7331-7341, 2021.
|
| 297 |
+
Jie Lei, Tamara L. Berg, and Mohit Bansal. Revealing single frame bias for video-and-language learning. In Anna Rogers, Jordan L. Boyd-Graber, and Naoaki Okazaki (eds.), ACL, pp. 487-507. Association for Computational Linguistics, 2023.
|
| 298 |
+
Junnan Li, Ramprasaath Selvaraju, Akhilesh Gotmare, Shafiq Joty, Caiming Xiong, and Steven Chu Hong Hoi. Align before fuse: Vision and language representation learning with momentum distillation. In NeurIPS, pp. 9694-9705, 2021.
|
| 299 |
+
Junnan Li, Dongxu Li, Caiming Xiong, and Steven C. H. Hoi. BLIP: bootstrapping language-image pre-training for unified vision-language understanding and generation. In ICML, volume 162, pp. 12888-12900, 2022.
|
| 300 |
+
Junnan Li, Dongxu Li, Silvio Savarese, and Steven Hoi. Blip-2: Bootstrapping language-image pretraining with frozen image encoders and large language models. arXiv preprint arXiv:2301.12597, 2023a.
|
| 301 |
+
|
| 302 |
+
Linjie Li, Zhe Gan, Kevin Lin, Chung-Ching Lin, Zicheng Liu, Ce Liu, and Lijuan Wang. Lavender: Unifying video-language understanding as masked language modeling. In CVPR, pp. 23119-23129, June 2023b.
|
| 303 |
+
Xiang Lisa Li and Percy Liang. Prefix-tuning: Optimizing continuous prompts for generation. In ACL/IJCNLP, pp. 4582-4597, 2021.
|
| 304 |
+
Xiujun Li, Xi Yin, Chunyuan Li, Pengchuan Zhang, Xiaowei Hu, Lei Zhang, Lijuan Wang, Houdong Hu, Li Dong, Furu Wei, et al. Oscar: Object-semantics aligned pre-training for vision-language tasks. In ECCV, pp. 121-137, 2020.
|
| 305 |
+
Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dólar, and C. Lawrence Zitnick. Microsoft COCO: Common objects in context. In ECCV, pp. 740-755, 2014.
|
| 306 |
+
Haoyu Lu, Mingyu Ding, Nanyi Fei, Yuqi Huo, and Zhiwu Lu. LGDN: language-guided denoising network for video-language modeling. arXiv preprint arXiv:2209.11388, 2022.
|
| 307 |
+
Huaishao Luo, Lei Ji, Ming Zhong, Yang Chen, Wen Lei, Nan Duan, and Tianrui Li. CLIP4Clip: An empirical study of clip for end to end video clip retrieval. arXiv preprint arXiv:2104.08860, 2021.
|
| 308 |
+
OpenAI. Gpt-4 technical report, 2023.
|
| 309 |
+
Junting Pan, Ziyi Lin, Xiatian Zhu, Jing Shao, and Hongsheng Li. St-adapter: Parameter-efficient image-to-video transfer learning for action recognition. arXiv preprint arXiv:2206.13559, 2022.
|
| 310 |
+
Bryan A. Plummer, Liwei Wang, Chris M. Cervantes, Juan C. Caicedo, Julia Hockenmaier, and Svetlana Lazebnik. Flickr30k entities: Collecting region-to-phrase correspondences for richer image-to-sentence models. In ICCV, pp. 2641-2649, 2015.
|
| 311 |
+
Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, and Ilya Sutskever. Learning transferable visual models from natural language supervision. In ICML, pp. 8748-8763, 2021.
|
| 312 |
+
Yi-Lin Sung, Jaemin Cho, and Mohit Bansal. VL-ADAPTER: parameter-efficient transfer learning for vision-and-language tasks. In CVPR, pp. 5217-5227, 2022.
|
| 313 |
+
Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almahairi, Yasmine Babaei, Nikolay Bashlykov, Soumya Batra, Prajjwal Bhargava, Shruti Bhosale, et al. Llama 2: Open foundation and fine-tuned chat models. arXiv preprint arXiv:2307.09288, 2023.
|
| 314 |
+
Alex Jinpeng Wang, Yixiao Ge, Rui Yan, Yuying Ge, Xudong Lin, Guanyu Cai, Jianping Wu, Ying Shan, Xiaohu Qie, and Mike Zheng Shou. All in one: Exploring unified video-language pre-training. arXiv preprint arXiv:2203.07303, 2022a.
|
| 315 |
+
Junke Wang, Dongdong Chen, Zuxuan Wu, Chong Luo, Luowei Zhou, Yucheng Zhao, Yujia Xie, Ce Liu, Yu-Gang Jiang, and Lu Yuan. Omnivl: One foundation model for image-language and video-language tasks. arXiv preprint arXiv:2209.07526, 2022b.
|
| 316 |
+
Wenhui Wang, Hangbo Bao, Li Dong, Johan Bjorck, Zhiliang Peng, Qiang Liu, Kriti Aggarwal, Owais Khan Mohammed, Saksham Singhal, Subhojit Som, et al. Image as a foreign language: Beit pretraining for all vision and vision-language tasks. arXiv preprint arXiv:2208.10442, 2022c.
|
| 317 |
+
Wenhui Wang, Hangbo Bao, Li Dong, Johan Bjorck, Zhiliang Peng, Qiang Liu, Kriti Aggarwal, Owais Khan Mohammed, Saksham Singhal, Subhojit Som, and Furu Wei. Image as a foreign language: Beit pretraining for vision and vision-language tasks. In CVPR, pp. 19175-19186, June 2023.
|
| 318 |
+
Zirui Wang, Jiahui Yu, Adams Wei Yu, Zihang Dai, Yulia Tsvetkov, and Yuan Cao. Simvlm: Simple visual language model pretraining with weak supervision. In ICLR, 2022d.
|
| 319 |
+
Dejing Xu, Zhou Zhao, Jun Xiao, Fei Wu, Hanwang Zhang, Xiangnan He, and Yueting Zhuang. Video question answering via gradually refined attention over appearance and motion. In ACMMM, pp. 1645-1653, 2017.
|
| 320 |
+
|
| 321 |
+
Jun Xu, Tao Mei, Ting Yao, and Yong Rui. MSR-VTT: A large video description dataset for bridging video and language. In CVPR, pp. 5288-5296, 2016.
|
| 322 |
+
Rowan Zellers, Ximing Lu, Jack Hessel, Youngjae Yu, Jae Sung Park, Jize Cao, Ali Farhadi, and Yejin Choi. Merlot: Multimodal neural script knowledge models. NeurIPS, 34:23634-23651, 2021.
|
| 323 |
+
|
| 324 |
+
Table 11: Applying UniAdapter on different backbones, evaluated on Flickr image-text retrieval task.
|
| 325 |
+
|
| 326 |
+
<table><tr><td rowspan="2">Method</td><td colspan="3">Flcikr TR</td><td colspan="3">Flcikr IR</td></tr><tr><td>R@1</td><td>R@5</td><td>R@10</td><td>R@1</td><td>R@5</td><td>R@10</td></tr><tr><td>ALBEF (Full finetuning)</td><td>95.9</td><td>99.8</td><td>100.0</td><td>85.6</td><td>97.5</td><td>98.9</td></tr><tr><td>UniAdapter (Frozen backbone)</td><td>95.6</td><td>99.9</td><td>100.0</td><td>84.6</td><td>97.3</td><td>98.6</td></tr><tr><td>BLIP-Large (Full finetuning)</td><td>97.4</td><td>99.8</td><td>99.9</td><td>87.6</td><td>97.7</td><td>99.0</td></tr><tr><td>UniAdapter (Frozen backbone)</td><td>96.9</td><td>99.9</td><td>100.0</td><td>87.5</td><td>97.9</td><td>99.1</td></tr><tr><td>BEIT 3-Large (Full finetuning)</td><td>97.1</td><td>100.0</td><td>100.0</td><td>87.5</td><td>97.9</td><td>99.1</td></tr><tr><td>UniAdapter (Frozen backbone)</td><td>96.3</td><td>99.9</td><td>100.0</td><td>87.6</td><td>97.9</td><td>99.2</td></tr></table>
|
| 327 |
+
|
| 328 |
+

|
| 329 |
+
Figure 3: (a) Parameter efficiency comparison with standard Adapter and full fine-tuning. (b) Training efficiency comparison. We adopt the bottleneck dimension $r = 512$ for Adapter / UniAdapter.
|
| 330 |
+
|
| 331 |
+

|
| 332 |
+
|
| 333 |
+
# A GENERALIZATION OF UNIADAPTER
|
| 334 |
+
|
| 335 |
+
We also experimented with the application of our UniAdapter to various backbone architectures, and the corresponding results are presented in Table 11. It is evident that our model achieves performance levels that are either comparable or even superior to full fine-tuning on ALBEF. Furthermore, we extended our investigation by applying our UniAdapter to larger backbones (BLIP-Large and BEIT 3-Large). Our UniAdapter consistently demonstrates either comparable or superior performance when compared to full fine-tuning. This observation underscores the potential advantages of our approach, particularly for larger models.
|
| 336 |
+
|
| 337 |
+
# B DETAIL ANALYSIS FOR WEIGHT-SHARING STRATEGY
|
| 338 |
+
|
| 339 |
+
Comparisons for different layers of the modality sharing. We investigate the sharing layer for modality sharing in Table 12. Our findings indicate that sharing only 9-12 layers leads to a slight performance degradation, as shown in line 2 compared to line 1. However, when additionally sharing layers 5-8, it achieves higher performance with fewer tunable parameters than the non-sharing results. This sug
|
| 340 |
+
|
| 341 |
+
Table 12: Comparisons for different layers of the modality sharing. # Tunable: the number of tunable parameters. The bottleneck dimension $r$ is set to $r = {512}$ for Adapter.
|
| 342 |
+
|
| 343 |
+
<table><tr><td>Layer</td><td>Layer</td><td>Layer</td><td>ShareAll</td><td>ShareDown</td><td>ShareUp</td></tr><tr><td>1-4</td><td>5-8</td><td>9-12</td><td>R@Mean</td><td>R@Mean</td><td>R@Mean</td></tr><tr><td></td><td></td><td>✓</td><td>70.2</td><td>71.1</td><td>70.0</td></tr><tr><td></td><td>✓</td><td>✓</td><td>70.5</td><td>71.6</td><td>70.2</td></tr><tr><td>✓</td><td></td><td>✓</td><td>70.1</td><td>70.9</td><td>70.0</td></tr><tr><td>✓</td><td>✓</td><td>✓</td><td>70.7</td><td>71.5</td><td>70.3</td></tr></table>
|
| 344 |
+
|
| 345 |
+
gests that middle-layer modality-sharing is crucial for optimal performance. These findings are also consistent with the layer location for injecting UniAdapter, as shown in Table 15. Direct sharing for each layer could achieve optimal performance with the least number of parameters, as shown by the comparison between line 2 and line 4.
|
| 346 |
+
|
| 347 |
+
Weight-sharing for Query-residual Adaption. In cross-modal adaption (see Sec.3.3 of the main paper), the Query-residual Adaption shares weights with the textual adapter to avoid additional parameters. We compare it with utilizing an additional adapter as Query-residual adapter in Table 13.
|
| 348 |
+
|
| 349 |
+

|
| 350 |
+
Figure 4: t-SNE and PCA visualizations of input representations of UniAdapter at the 12th layer from different modality models. Experimental data is derived from 128 randomly chosen images from Flickr30K. The inputs to the UniAdapter from various modalities exhibit similar spatial distributions, suggesting that they reside within the same space (or sharing several spaces across each distribution).
|
| 351 |
+
|
| 352 |
+

|
| 353 |
+
Figure 5: t-SNE and PCA visualizations of input representations of UniAdapter at the 12th layer from different modality models. Experimental data is derived from 128 randomly chosen images from Flickr30K. The inputs to the down projection layer of UniAdapter from various sharing-strategy exhibit similar spatial distributions. This finding suggests that these representations reside within a shared space or have overlapped distributions across different modalities. Different modalities' data distributions occupy distinct spaces when it comes to the up-projection layer. This finding validates that sharing the up-projection layer negatively impacts the model's performance, as it appears to interfere with the distinct representation spaces required for different modalities.
|
| 354 |
+
|
| 355 |
+
We find that sharing weight with the textual adapter leads to better performance but with fewer tunable parameters.
|
| 356 |
+
|
| 357 |
+
Query9354: A red truck is burning while three men talk about a car.
|
| 358 |
+
|
| 359 |
+

|
| 360 |
+
|
| 361 |
+

|
| 362 |
+
|
| 363 |
+
Query8069: An astronaut is looking at a flag.
|
| 364 |
+
|
| 365 |
+

|
| 366 |
+
|
| 367 |
+

|
| 368 |
+
Figure 6: Visualization results for PFA mechanism (color bar below represents the weights assigned to various tokens). Tokens that exhibit a close relationship with the text query are assigned higher weights. On the other hand, noise tokens, which bear little relevance or contribute insignificantly to the text query, are assigned lower weights, effectively reducing their influence.
|
| 369 |
+
|
| 370 |
+
Table 13: Weight-sharing for Query-residual Adaption on Didemo. # Tunable: the number of tunable parameters. The bottleneck dimension $r$ is set to $r = {512}$ for Adapter.
|
| 371 |
+
|
| 372 |
+
<table><tr><td>Method</td><td># Tunable</td><td>R@1</td><td>R@5</td><td>R@10</td><td>R@Mean</td><td>MedR</td></tr><tr><td>Adapter</td><td>28.4M</td><td>49.9</td><td>76.2</td><td>83.0</td><td>69.7</td><td>2.0</td></tr><tr><td>+Q w/o share</td><td>37.8M</td><td>50.9</td><td>77.1</td><td>83.3</td><td>70.4</td><td>1.0</td></tr><tr><td>+Q w/ share</td><td>28.4M</td><td>51.1</td><td>77.2</td><td>84.1</td><td>70.8</td><td>1.0</td></tr></table>
|
| 373 |
+
|
| 374 |
+
We conduct further visualizations on the 12th layer inputs from different modality modules in our UniAdapter in Figure 4. Using joint t-SNE and PCA, we found: Inputs representations to the UniAdapter from various modalities exhibit similar spatial distributions, suggesting that they reside within a shared space (or overlapped spaces across distributions). This supports the effectiveness of our down-projection sharing strategies.
|
| 375 |
+
|
| 376 |
+
Table 14: Query-residual mechanism for UniAdapter on cross-modal modality. # Tunable: the number of tunable parameters. The bottleneck dimension $r$ is set to $r = {512}$ for UniAdapter.
|
| 377 |
+
|
| 378 |
+
<table><tr><td>Method</td><td># Tunable</td><td>R@1</td><td>R@5</td><td>R@10</td><td>R@Mean</td><td>MedR</td></tr><tr><td>UniAdapter</td><td>19.0M</td><td>51.6</td><td>76.5</td><td>83.6</td><td>70.6</td><td>1.0</td></tr><tr><td>+Q</td><td>19.0M</td><td>52.1</td><td>77.3</td><td>85.2</td><td>71.5</td><td>1.0</td></tr></table>
|
| 379 |
+
|
| 380 |
+
We also follow this effective and efficient strategy to design UniAdapter, where the cross-modal up-projection branch utilizes a Query-residual up-projection layer (shared knowledge with textual up-projection layer as shown in Figure 2 (b) in the main paper). We can see from Table 14 that this strategy leads to better performance without introducing extra parameters.
|
| 381 |
+
|
| 382 |
+
# C THE GLOBAL POSITION FOR INJECTING UNIADAPTER.
|
| 383 |
+
|
| 384 |
+
We investigated the effects of adding adapters to certain layers in our approach as below (Table B), and the results reveal two key findings.
|
| 385 |
+
|
| 386 |
+
First, we found that adding an adapter to layers 5-8 achieved the highest performance, which is interesting because traditional single modality parameter-efficient approaches typically perform best when an adapter is added to higher layers. This result may suggest that cross-modal fusion occurs more frequently in the middle layers rather than the higher layers. Second, we found that adding adapters to layers 5-12 achieved comparable performance to adding them to all layers, indicating that the earlier layers tend to learn more general features that are task-irrelevant. This finding has important implications for the design of parameter-efficient transfer learning models, as it suggests that adding adapters to all layers may not always be necessary for achieving optimal performance.
|
| 387 |
+
|
| 388 |
+
Table 15: The global position for injecting UniAdapter. # Tunable: the number of tunable parameters. The bottleneck dimension $r$ is set to $r = {512}$ for Adapter.
|
| 389 |
+
|
| 390 |
+
<table><tr><td colspan="3">Layer Position</td><td>#Tunable</td><td colspan="5">Didemo</td></tr><tr><td>1-4</td><td>5-8</td><td>9-12</td><td></td><td>R@1</td><td>R@5</td><td>R@10</td><td>MedR</td><td>R@Mean</td></tr><tr><td>✓</td><td></td><td></td><td>6.3M</td><td>45.8</td><td>74.3</td><td>82.6</td><td>2.0</td><td>67.5</td></tr><tr><td></td><td>✓</td><td></td><td>6.3M</td><td>51.1</td><td>76.5</td><td>83.5</td><td>1.0</td><td>70.4</td></tr><tr><td></td><td></td><td>✓</td><td>6.3M</td><td>48.8</td><td>74.9</td><td>82.2</td><td>1.0</td><td>68.6</td></tr><tr><td></td><td>✓</td><td>✓</td><td>12.7M</td><td>52.0</td><td>77.4</td><td>84.0</td><td>1.0</td><td>71.2</td></tr><tr><td>✓</td><td>✓</td><td>✓</td><td>19.0M</td><td>52.1</td><td>77.3</td><td>85.2</td><td>1.0</td><td>71.6</td></tr></table>
|
| 391 |
+
|
| 392 |
+
# D UNIADAPTER FOR VQA TASKS
|
| 393 |
+
|
| 394 |
+
Hybrid-stream vision-language models (Li et al., 2021; Bain et al., 2022) consider visual question answering as an answer generation task. As shown in Figure 7, an image/video-question is first encoded into multimodal embeddings and then inputted into an additional multimodal decoder during fine-tuning. However, the additional answer decoder leads to heavier tunable parameters. Instead of introducing additional UniAdapter specially designed for the multimodal decoder, we choose to directly share the weight with the UniAdapter adopted in the multimodal encoder. This choice is simple yet effective, and can avoid the additional parameter cost.
|
| 395 |
+
|
| 396 |
+
# E DETAILS OF DOWNSTREAM TASKS
|
| 397 |
+
|
| 398 |
+
# E.1 HYPERPARAMETER SETTING
|
| 399 |
+
|
| 400 |
+
We list hyperparameters for downstream tasks in Table 16. For image-text downstream tasks, we directly use hyperparameters applied in BLIP (Li et al., 2022) without modifying. For video-text downstream task, we follow previous works (Lei et al., 2021; Ju et al., 2022) to uniformly sample $N = 8$ frames for training and $N = 16$ frames for inference.
|
| 401 |
+
|
| 402 |
+
# E.2 VIDEO-TEXT RETRIEVAL
|
| 403 |
+
|
| 404 |
+
MSR-VTT (Xu et al., 2016) is a popular video-text retrieval dataset. We follow recent works (Lei et al., 2021; Luo et al., 2021) to adopt the 1k-A split (with 9,000/1,000 videos) for training/testing. DiDeMo (Hendricks et al., 2017) consists of 10K videos and 40K sentences. Each sentence includes the temporal localization information. Following Frozen in Time (Bain et al., 2021), we conduct the paragraph-to-video retrieval task, where all descriptions in the same video are concatenated into a single description (i.e., one paragraph).
|
| 405 |
+
|
| 406 |
+

|
| 407 |
+
Figure 7: A semantic illustration of the proposed UniAdapter for the VQA tasks. We adopt a single UniAdapter for the multimodal encoder as well as multimodal decoder.
|
| 408 |
+
|
| 409 |
+
Table 16: Parameter-efficient fine-tuning hyperparameters for each task.
|
| 410 |
+
|
| 411 |
+
<table><tr><td rowspan="2">Config</td><td colspan="2">Video-text Retrieval</td><td colspan="2">Image-text Retrieval</td><td colspan="2">VQA</td></tr><tr><td>MSR-VTT</td><td>Dideomo</td><td>MSCOCO</td><td>Flickr30K</td><td>MSRVTT-QA</td><td>VQAv2</td></tr><tr><td>optimizer</td><td>AdamW</td><td>AdamW</td><td>AdamW</td><td>AdamW</td><td>AdamW</td><td>AdamW</td></tr><tr><td>learning rate</td><td>1e-5</td><td>1e-5</td><td>1e-5</td><td>1e-5</td><td>2e-5</td><td>2e-5</td></tr><tr><td>schedule</td><td>cosine decay</td><td>cosine decay</td><td>cosine decay</td><td>cosine decay</td><td>cosine decay</td><td>cosine decay</td></tr><tr><td>batch size</td><td>64</td><td>64</td><td>256</td><td>256</td><td>24</td><td>128</td></tr><tr><td>epochs</td><td>5</td><td>10</td><td>5</td><td>6</td><td>10</td><td>10</td></tr><tr><td>training input</td><td>8x224</td><td>8x224</td><td>384</td><td>384</td><td>8x384</td><td>480</td></tr><tr><td>inference input</td><td>16x224</td><td>16x224</td><td>384</td><td>384</td><td>16x384</td><td>480</td></tr></table>
|
| 412 |
+
|
| 413 |
+
# E.3 IMAGE-TEXT RETRIEVAL
|
| 414 |
+
|
| 415 |
+
MSCOCO (Lin et al., 2014) is a large image-text dataset of 123,287 images, where each image is annotated with 5 captions. As in (Kim et al., 2021), we adopt the Karpathy split of MSCOCO: 5,000 images for testing, another 5,000 for validation, and the rest 113,287 images for training. Flickr30K (Plummer et al., 2015) contains 31,000 images and 158,915 captions totally. Each image is often annotated with 5 captions. Following the split in (Frome et al., 2013), we use 1,000 images for testing, another 1,000 for validation, and the rest for training.
|
| 416 |
+
|
| 417 |
+
# E.4 VISUAL QUESTION ANSWERING
|
| 418 |
+
|
| 419 |
+
MSRVTT-QA (Xu et al., 2017) is a popular video-question answering dataset. We employ the standard split as in ClipBERT (Lei et al., 2021), which contains 244K open-ended questions on 10K MSRVTT videos. VQAv2 (Goyal et al., 2017) is a visual question answering dataset constructed from COCO, which has 83k/41k/81k images for training/validation/testing. Following previous works (Li et al., 2021; 2022), we utilize both training and validation sets of VQAv2, question-answer pairs from Visual Genome (Krishna et al., 2017) for training. We report the results on the test-dev and test-standard splits.
|
| 420 |
+
|
| 421 |
+
# E.5 CAPTION
|
| 422 |
+
|
| 423 |
+
We utilize COCO's Karpathy split following previous work (Li et al., 2021). During inference, we use beam search (beam size of 3), and the maximum generation length of 20.
|
| 424 |
+
|
| 425 |
+
# F EVALUATION METRICS
|
| 426 |
+
|
| 427 |
+
We adopt two widely-used metrics in cross-modal retrieval: Recall at K (R@K, $\mathrm{K} = 1,5,10$ ), and Median Rank (MdR). R@K means the percentage of correct matching in the K nearest points, and MdR measures the median rank of target items in the retrieved ranking list. We also report
|
| 428 |
+
|
| 429 |
+
Query8110: A computer generated cartoon figure operates a control panel while another character sleeps in the background.
|
| 430 |
+
|
| 431 |
+

|
| 432 |
+
|
| 433 |
+

|
| 434 |
+
|
| 435 |
+

|
| 436 |
+
|
| 437 |
+

|
| 438 |
+
|
| 439 |
+

|
| 440 |
+
|
| 441 |
+

|
| 442 |
+
|
| 443 |
+
Query7468: A man jumps onto a ledge of a building.
|
| 444 |
+
|
| 445 |
+

|
| 446 |
+
|
| 447 |
+

|
| 448 |
+
|
| 449 |
+

|
| 450 |
+
|
| 451 |
+

|
| 452 |
+
|
| 453 |
+

|
| 454 |
+
|
| 455 |
+

|
| 456 |
+
|
| 457 |
+
Query8069: An astronaut is looking at a flag.
|
| 458 |
+
|
| 459 |
+

|
| 460 |
+
|
| 461 |
+

|
| 462 |
+
|
| 463 |
+

|
| 464 |
+
|
| 465 |
+

|
| 466 |
+
|
| 467 |
+

|
| 468 |
+
|
| 469 |
+

|
| 470 |
+
|
| 471 |
+
Query9354: A red truck is burning while three men talk about a car.
|
| 472 |
+
|
| 473 |
+

|
| 474 |
+
|
| 475 |
+

|
| 476 |
+
|
| 477 |
+

|
| 478 |
+
|
| 479 |
+

|
| 480 |
+
|
| 481 |
+

|
| 482 |
+
|
| 483 |
+

|
| 484 |
+
|
| 485 |
+
Query7793: Flight is shaken and the pilots trying to land the flight while they opened the air.
|
| 486 |
+
|
| 487 |
+

|
| 488 |
+
|
| 489 |
+

|
| 490 |
+
|
| 491 |
+

|
| 492 |
+
|
| 493 |
+

|
| 494 |
+
|
| 495 |
+

|
| 496 |
+
|
| 497 |
+

|
| 498 |
+
|
| 499 |
+
Query9779: Fireworks are being lit and exploding in a night sky.
|
| 500 |
+
|
| 501 |
+

|
| 502 |
+
Figure 8: Text-to-video retrieval examples on the MSR-VTT test set.
|
| 503 |
+
|
| 504 |
+

|
| 505 |
+
|
| 506 |
+

|
| 507 |
+
|
| 508 |
+

|
| 509 |
+
|
| 510 |
+

|
| 511 |
+
|
| 512 |
+

|
| 513 |
+
|
| 514 |
+
additional metrics named 'R@Mean' in our ablation study, which averages all recall metrics for overall evaluation. Following previous works (Li et al., 2020; Lei et al., 2021; Li et al., 2021), we also report accuracy (Acc) in visual question answering task.
|
| 515 |
+
|
| 516 |
+
# G VISUALIZATION RESULTS
|
| 517 |
+
|
| 518 |
+
In Figures 8-9, we show the visualization results for the text-to-video retrieval task and video question answering task, respectively. Even tuning on small parameters, our UniAdapter shows strong semantic understanding/reasoning ability.
|
| 519 |
+
|
| 520 |
+
# H LIMITATION AND BROADER IMPACTS
|
| 521 |
+
|
| 522 |
+
In this paper, UniAdapter focuses on retrieval and VQA tasks in the multimodal domain. In the future, we hope to use our UniAdapter for more complex tasks such as cross-modal generation. Parameter-efficient transfer learning enables many powerful models to be used by the general public. Therefore, it is crucial to conduct a comprehensive analysis of the potential consequences and adopt responsible practices to address any negative impacts.
|
| 523 |
+
|
| 524 |
+
Query 169863: What is a table tennis match between two chinese players and the winner doing?
|
| 525 |
+
|
| 526 |
+
Target Answer: celebrate
|
| 527 |
+
|
| 528 |
+
UniAdapter Answer: celebrate
|
| 529 |
+
|
| 530 |
+

|
| 531 |
+
|
| 532 |
+

|
| 533 |
+
|
| 534 |
+

|
| 535 |
+
|
| 536 |
+

|
| 537 |
+
|
| 538 |
+

|
| 539 |
+
|
| 540 |
+

|
| 541 |
+
|
| 542 |
+
Query 168667: Who is a woman fixing?
|
| 543 |
+
|
| 544 |
+
Target Answer: stroller
|
| 545 |
+
|
| 546 |
+
UniAdapter Answer: stroller
|
| 547 |
+
|
| 548 |
+

|
| 549 |
+
|
| 550 |
+

|
| 551 |
+
|
| 552 |
+

|
| 553 |
+
|
| 554 |
+

|
| 555 |
+
|
| 556 |
+

|
| 557 |
+
|
| 558 |
+

|
| 559 |
+
|
| 560 |
+
Query 168815: What is two car crashed in doing?
|
| 561 |
+
|
| 562 |
+
Target Answer: race
|
| 563 |
+
|
| 564 |
+
UniAdapter Answer: race
|
| 565 |
+
|
| 566 |
+

|
| 567 |
+
|
| 568 |
+

|
| 569 |
+
|
| 570 |
+

|
| 571 |
+
|
| 572 |
+

|
| 573 |
+
|
| 574 |
+

|
| 575 |
+
|
| 576 |
+

|
| 577 |
+
|
| 578 |
+
Query 168971: How many cars are shown in a video game while music plays in the background?
|
| 579 |
+
|
| 580 |
+
Target Answer: three
|
| 581 |
+
|
| 582 |
+
UniAdapter Answer: three
|
| 583 |
+
|
| 584 |
+

|
| 585 |
+
|
| 586 |
+

|
| 587 |
+
|
| 588 |
+

|
| 589 |
+
|
| 590 |
+

|
| 591 |
+
|
| 592 |
+

|
| 593 |
+
|
| 594 |
+

|
| 595 |
+
|
| 596 |
+
Query 169627: What is a woman adds green vegetables to a tiny pot of doing?
|
| 597 |
+
|
| 598 |
+
Target Answer: boil
|
| 599 |
+
|
| 600 |
+
UniAdapter Answer: boil
|
| 601 |
+
|
| 602 |
+

|
| 603 |
+
Figure 9: Video question answering examples on the MSRVTT-QA test set.
|
| 604 |
+
|
| 605 |
+

|
| 606 |
+
|
| 607 |
+

|
| 608 |
+
|
| 609 |
+

|
| 610 |
+
|
| 611 |
+

|
| 612 |
+
|
| 613 |
+

|
uniadapterunifiedparameterefficienttransferlearningforcrossmodalmodeling/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1298367eb4a4da9febefd9ee4c384eab946306c79c4f6229465231a31fdd0e95
|
| 3 |
+
size 1485914
|
uniadapterunifiedparameterefficienttransferlearningforcrossmodalmodeling/layout.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:081e7ac2058958d9b0a90c3b9c075fcfead4163ddfc342eee5fe1fcca6900887
|
| 3 |
+
size 665321
|
unifiedlanguagevisionpretraininginllmwithdynamicdiscretevisualtokenization/22e02364-6ec4-4edb-8d55-5c31483c2a1f_content_list.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0b13a0bc3635347e26abc673aaa3d0b54bd2400d507d9aed15d2da00ae1dd70d
|
| 3 |
+
size 144400
|
unifiedlanguagevisionpretraininginllmwithdynamicdiscretevisualtokenization/22e02364-6ec4-4edb-8d55-5c31483c2a1f_model.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9e01b619d947f01f0b2e82b937d91150022df8866d5f10d6665ff6f41e9b90f7
|
| 3 |
+
size 173469
|
unifiedlanguagevisionpretraininginllmwithdynamicdiscretevisualtokenization/22e02364-6ec4-4edb-8d55-5c31483c2a1f_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:eea7a14dffee81c258b431341d4f4084b17467e31f5f0dbc29c3ac7363cea47f
|
| 3 |
+
size 10733191
|
unifiedlanguagevisionpretraininginllmwithdynamicdiscretevisualtokenization/full.md
ADDED
|
@@ -0,0 +1,676 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# UNIFIED LANGUAGE-VISION PRETRAINING IN LLM WITH DYNAMIC DISCRETE VISUALTOKENIZATION
|
| 2 |
+
|
| 3 |
+
Yang Jin $^{1*}$ , Kun Xu $^{2}$ , Kun Xu $^{2}$ , Liwei Chen $^{2}$ , Chao Liao $^{2}$ , Jianchao Tan $^{2}$ , Quzhe Huang $^{1}$ , Bin Chen $^{2}$ , Chenyi Lei $^{2}$ , An Liu $^{2}$ , Chengru Song $^{2}$ , Xiaoqiang Lei $^{2}$ , Di Zhang $^{2}$ , Wenwu Ou $^{2}$ , Kun Gai $^{2}$ , Yadong Mu $^{1\dagger}$ $^{1}$ Peking University $^{2}$ Kuaishou Technology
|
| 4 |
+
y@stu.pku.edu.cn, {xukunxxkx, syxu828}@gmail.com, myd@pu.edu.cn
|
| 5 |
+
|
| 6 |
+
# ABSTRACT
|
| 7 |
+
|
| 8 |
+
Recently, the remarkable advance of the Large Language Model (LLM) has inspired researchers to transfer its extraordinary reasoning capability to both vision and language data. However, the prevailing approaches primarily regard the visual input as a prompt and focus exclusively on optimizing the text generation process conditioned upon vision content by a frozen LLM. Such an inequitable treatment of vision and language heavily constrains the model's potential. In this paper, we break through this limitation by representing both vision and language in a unified form. Specifically, we introduce a well-designed visual tokenizer to translate the non-linguistic image into a sequence of discrete tokens like a foreign language that LLM can read. The resulting visual tokens encompass high-level semantics worthy of a word and also support dynamic sequence length varying from the image. Coped with this tokenizer, the presented foundation model called LaVIT can handle both image and text indiscriminately under the same generative learning paradigm. This unification empowers LaVIT to serve as an impressive generalist interface to understand and generate multi-modal content simultaneously. Extensive experiments further showcase that it outperforms the existing models by a large margin on massive vision-language tasks. Our code and models are available at https://github.com/jy0205/LaVIT.
|
| 9 |
+
|
| 10 |
+
# 1 INTRODUCTION
|
| 11 |
+
|
| 12 |
+
The large language models (LLMs) (Brown et al., 2020; Touvron et al., 2023) nowadays have demonstrated impressive advances in various linguistic applications. Profiting from the knowledge in the massive text corpus, they possess exceptional understanding capabilities and serve as a general-purpose interface to complete a wide range of real-world tasks. Such success has motivated researchers to investigate the Multi-modal Large Language Models (MLLMs), which aim at extending the powerful pure-text LLMs to process multi-modality inputs. As shown in Figure 1-(a), the prevalent approaches mostly leverage an adapter architecture (e.g., the Resampler (Alayrac et al., 2022), linear projection (Liu et al., 2023), or Q-Former (Li et al., 2023)) to map the visual features encoded by a pre-trained vision backbone (Radford et al., 2021) to the semantic space of LLM.
|
| 13 |
+
|
| 14 |
+
Despite achieving preliminary results in zero-shot multi-modal understanding, they still suffer from inherent design deficiencies. The training objective of prior methodologies (Li et al., 2023; Huang et al., 2023; Zhu et al., 2023) is centered on predicting textual descriptions dependent on visual content, where the visual parts are merely regarded as prompts without any supervision. The inequitable treatment of different modal inputs severely constrains the model's potential, limiting them to only performing comprehension tasks like generating text based on images. Moreover, most of these methods completely delegate the responsibility of vision-language alignment to the newly added adapter with limited trainable parameters, which fails to leverage the remarkable reasoning capabilities of LLM to learn the interaction across different modalities. Although the recent concurrent work
|
| 15 |
+
|
| 16 |
+

|
| 17 |
+
(a) Adapter-Style
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
(b) Emu
|
| 21 |
+
Figure 1: The comparisons between different MLLMs. (a) The adapter-style methods rely on an adapter network to project visual features into the semantic space of LLM. During training, visual tokens are merely treated as the prompt to guide text generation. (b) The concurrent work Emu adopts the regression loss for visual features and jointly trains with textual tokens. (c) We craft a visual tokenizer to represent images in the same discrete format as text so as to indiscriminately optimize them under a unified generative objective.
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
(c) Ours
|
| 25 |
+
|
| 26 |
+
Emu (Sun et al., 2023) proposes to unlock the text-pretrained LLM by regressing the next visual embedding during pre-training (Figure 1-(b)), the inconsistent optimization objectives for image and text are not conducive to unified multi-modal modeling.
|
| 27 |
+
|
| 28 |
+
In this work, we introduce LaVIT (Language-Vision Transformer), a novel general-purpose multimodal foundation model that inherits the successful learning paradigm of LLM: predicting the next image/text token in an auto-regressive manner. Our insight is that by employing a unified objective to indiscriminately treat tokens from different modalities, the model can seamlessly achieve "any-to-any" multi-modal comprehension and generation. However, the original LLM is specifically crafted to process discrete textual tokens. When dealing with physical signal inputs, such as images, it becomes imperative to embrace a representation seamlessly compatible with text tokens. Therefore, we propose to translate the image into a sequence of tokens like a foreign language that LLM can comprehend, so that both images and texts can be handled simultaneously under the unified generative objective without any specific architectural modification, as shown in Figure 1-(c).
|
| 29 |
+
|
| 30 |
+
To achieve this goal, a crucial element lies in the development of an efficient visual tokenizer for encoding images, which we contend should adhere to the following principles: (i) discrete visual token: While language models rely on text tokens defined by a dictionary, prior visual tokens, like those derived from ViT, consist of continuous feature vectors encoding a patch. In approaches such as masked image modeling (He et al., 2022) or masked feature prediction (Wei et al., 2022), regressive objectives on continuous features or raw visual pixels are employed for self-supervised pretraining. Here, we advocate for quantizing the visual tokens into a discrete form, aligning them with the next-token prediction objective in language models. This form is particularly advantageous when the target distribution for the next token is multi-mode. (ii) dynamic token allocation. Given the varying semantic complexity of different images, employing a fixed length of tokens to encode all images is compute-unequomical. Moreover, as a key difference from textual tokens, visual patches exhibit a notable interdependence, making it considerably more straightforward to deduce one token from others. This renders the next-token paradigm less effective in learning visual knowledge through self-supervision. Thus we argue for the token-merging to ensure the least redundancy among visual patches, thereby rendering a dynamic token number for different images.
|
| 31 |
+
|
| 32 |
+
Following the aforementioned two crucial fundamentals, LaVIT introduces a novel dynamic visual tokenization mechanism consisting of a selector and a merger to process images. The token selector first decides which visual patches carry informative semantics and are necessary to be selected to encode the whole image. In order to maximally preserve the image details, the token merger further compresses the unselected patches onto the retained ones according to their feature similarity. Such a design enables each retained visual token to contain high-level semantics from multiple similar patches and thus reduce the redundancy among tokens. This selecting and merging strategy will produce a dynamic sequence length varying from the image content itself. The retained visual tokens are further quantized into discrete codes by a learnable codebook (Esser et al., 2021), which will serve as the supervision signals for visual tokens during pre-training. Empowered by this visual tokenizer, our LaVIT can be trained with a simple yet unified objective: predicting the next image/text token in the multi-modal sequence. After pre-training, LaVIT can serve as a multi-modal generalist to perform both multi-modal comprehension and generation without further fine-tuning (See Figure 2). The key contributions of this work are summarized as:
|
| 33 |
+
|
| 34 |
+

|
| 35 |
+
Figure 2: Given an image-text pair, the image is tokenized into discrete tokens and concatenated with text tokens to form a multi-modal sequence. Then, LaVIT is optimized under a unified generative objective. After training, it can achieve both zero-shot multi-modal comprehension and generation.
|
| 36 |
+
|
| 37 |
+
- We introduce LaVIT, a new effective, general-purpose multi-modal foundation model that goes beyond the traditional adapter-based architectures. By transforming images into a sequence of discrete tokens like a foreign language that LLM can comprehend and generate, both modalities can be associated indiscriminately under a unified generative training paradigm.
|
| 38 |
+
- The developed visual tokenizer can produce discrete visual tokens with dynamic length to reduce the interdependence among visual patches, which enhances the representation compatibility of image and text in LLM and improves computational efficiency.
|
| 39 |
+
- Our LaVIT showcases the extraordinary multi-modal understanding and generation potential. It can take any modality combinations as input and perform impressive in-context generation of both images and text. As demonstrated by extensive experiments, LaVIT achieves state-of-the-art zero-shot performance on a wide range of vision-language tasks.
|
| 40 |
+
|
| 41 |
+
# 2 RELATED WORK
|
| 42 |
+
|
| 43 |
+
Vision-Language Pre-training. Researchers have extensively investigated vision-language pretraining (VLP). The pioneer works (Radford et al., 2021; Jia et al., 2021) primarily employ dual-encoder with contrastive objectives to learn the generic cross-modal aligned representations. Recently, the rapid progress of large language models (Chowdhery et al., 2022; Touvron et al., 2023) has motivated researchers to delve into the exploration of augmenting LLM towards vision language tasks. The majority of these works adopt an adapter-style network (Zhang et al., 2023) that serves as an intermediate bridge connecting the pre-trained vision encoder and frozen language model. For instance, Flamingo (Alayrac et al., 2022) develops a Perceiver Resampler to generate text-aligned visual representations. Follow-up methods (Li et al., 2023; Zhu et al., 2023) mainly adopt the Q-Former to project the visual semantics to the LLM's input space. However, visual inputs in these methods (Huang et al., 2023; Alayrac et al., 2022) are only considered as the prompt and not involved in the optimization, which heavily restricts the model potential.
|
| 44 |
+
|
| 45 |
+
Vector Quantization in Computer Vision. Vector quantization (Gray, 1984; Nasrabadi & King, 1988) is widely used in image-generative models. The VQ-VAE (Van Den Oord et al., 2017) and DALL-E (Ramesh et al., 2021) proposed to convert an image into a set of discrete codes in a learnable discrete latent space by learning to reconstruct the original image pixels. Models like VQGAN (Esser et al., 2021) and ViT-VQGAN (Yu et al., 2021) leverage adversarial and perceptual objectives to further enhance the image generation quality. The BEIT series of works also adopts the quantized visual codes as the supervision in mask image modeling (Peng et al., 2022; Wang et al., 2023). However, most of these methods tokenize the image into a token sequence with a fixed length (e.g., 512 or 1024). Such a long sequence will invariably result in an excessive computational burden. On the contrary, our proposed visual tokenizer reduces the redundancy among image patches and supports dynamic token length, thus enabling efficient multi-modal inference.
|
| 46 |
+
|
| 47 |
+

|
| 48 |
+
(a) Dynamic Visual Tokenizer
|
| 49 |
+
|
| 50 |
+

|
| 51 |
+
(b) The Token Merger
|
| 52 |
+
Figure 3: (a) The pipeline of the proposed dynamic visual tokenizer. It employs a token selector to select the most informative patches and a token merger to compress the information of discarded patches onto the retained ones. The whole tokenizer is trained by maximally reconstructing the semantics of the input image. (b) The detailed architecture of token merger.
|
| 53 |
+
|
| 54 |
+
# 3 METHOD
|
| 55 |
+
|
| 56 |
+
This work proposes to leverage the extraordinary reasoning potential of the large language model to facilitate the modeling of both vision and language modalities. In pursuit of this goal, the key component is to represent these two modalities in a uniform form, so as to exploit LLM's successful learning recipe (i.e., next-token prediction). As shown in Figure 2, we develop a visual tokenizer (Section 3.1) to convert the non-linguistic image to the input that LLMs can comprehend. It receives the vision features from a pre-trained vision encoder and outputs a sequence of discrete visual tokens possessing word-like high-level semantics. Coped with the crafted tokenizer, the visual input can be integrated with textual tokens to compose a multi-modal sequence, which is subsequently fed into large language models under a unified auto-regressive training objective (Section 3.2).
|
| 57 |
+
|
| 58 |
+
# 3.1 STAGE-1: DYNAMIC VISUALTOKENIZER
|
| 59 |
+
|
| 60 |
+
Given an image $x \in \mathcal{R}^{H \times W \times C}$ , it is first partitioned into $N = HW / P^2$ non-overlapping patches, where $P$ is the patch size. These patches are fed into a pre-trained ViT encoder (Fang et al., 2023) to produce a sequence of the patch features $X = \{x_1, \dots, x_N\}$ . Then, a straightforward way to encode images is to directly quantize the $N$ patch-level embeddings into discrete tokens as the input to LLMs. This will result in a long visual sequence and bring superfluous computational burden since many visual patches may contain repetitive and trivial background semantics. These redundant patches demonstrate a discernible interdependence, thereby diminishing the efficacy of the next-token paradigm in learning visual knowledge via self-supervision. Consequently, the proposed tokenizer aims to produce visual tokens with a dynamic length according to the complexity of the image content itself. As illustrated in Figure 3, it comprises a token selector and a token merger.
|
| 61 |
+
|
| 62 |
+
Token Selector The token selector takes the $N$ patch-level features $X$ as input. It aims to estimate the importance of each image patch and selects the most informative ones that are competent enough to represent the semantics of the whole image. Inspired by (Rao et al., 2021), it is implemented as a lightweight module consisting of several MLP layers to predict a distribution $\pi \in \mathcal{R}^{N\times 2}$ , where $\pi_{i} = \mathrm{MLP}(x_{i})$ . By sampling from the distribution $\pi$ , a binary decision mask $M\in \{0,1\}^N$ can be generated, which indicates whether to remain the corresponding image patch. To relax the sampling to be differentiable, the Gumbel-Softmax trick (Maddison et al., 2016) is applied to $\pi$ :
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\hat {\pi_ {i , j}} = \frac {\exp \left(\left(\log \pi_ {i , j} + G _ {i , j}\right) / \tau\right)}{\sum_ {r = 1} ^ {2} \exp \left(\left(\log \pi_ {i , r} + G _ {i , r}\right) / \tau\right)}. \tag {1}
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
where $G_{i,j}$ is the noise sampled from a Gumbel distribution, $\tau$ is the temperature to control smoothness. Then, the binary decision mask $M$ can be sampled from $\hat{\pi}$ for end-to-end training.
|
| 69 |
+
|
| 70 |
+
Token Merger According to the generated decision mask, total $N$ image patches can be partitioned into retained and dropped groups, with $T$ and $N - T$ patches respectively, denoted as $X_{r} = \{x_{i}\}_{i = 1}^{T}$ and $X_{d} = \{x_{j}\}_{j = 1}^{N - T}$ . Instead of directly discarding $X_{d}$ , we develop a token merger to deal with it to maximally preserve the detailed semantics of the input image. As shown in the right of Figure 3, the token merger will progressively compress the information of discarded $X_{d}$ onto the retained $X_{r}$ according to their semantic similarity. Concretely, it consists of $L$ stacked blocks, each of which has a causal self-attention layer, a cross-attention layer, and a feed-forward layer. In the causal self-attention layer, each token in $X_{r}$ attends to its previous tokens with a causal mask. This helps to convert 2D raster-ordered features from the ViT encoder into a sequence with causal dependency, thus ensuring consistency with textual tokens in LLMs. We found this strategy can result in better performance than bi-directional self-attention. The cross-attention layer treats the retained tokens $X_{r}$ as the query and merges tokens in $X_{d}$ based on their similarity in the embedding space. Formally, this layer calculates an update of $X_{r}$ by:
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\Delta X _ {r} = \operatorname {s o f t m a x} \left(Q K ^ {\top} / \sqrt {D}\right) V, \tag {2}
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
where $D$ denotes the dimension of hidden state, $Q = W_{Q}X_{r}\in \mathcal{R}^{T\times D}$ , $K = W_{K}X_{d}\in \mathcal{R}^{(N - T)\times D}$ and $V = W_{V}X_{d}\in \mathcal{R}^{(N - T)\times D}$ . To parallelize the computation, we adopt the predicted decision mask $M$ to control the cross-attention scope between tokens without directly partitioning them into two groups. After $L$ successive token merger blocks, we can obtain the final merged visual tokens $\hat{X}_r = \{\hat{x}_i\}_{i = 1}^T$ . Each token implicitly encodes high-level semantics from several image patches possessing similar visual patterns, which we refer to as visual part features $\hat{X}_r$ . The token selector and merger work together to dynamically adjust the visual token sequence length to accommodate images with different content complexity.
|
| 77 |
+
|
| 78 |
+
Vector Quantization and Training The generated visual part features $\hat{X}_r$ are then passed into a quantizer. It tokenizes $\hat{X}_r$ to a sequence of discrete visual codes $V = \{v_i\}_{i=1}^T$ by looking up a learnable codebook $\mathcal{C} = \{c_k\}_{k=1}^K$ , where $K$ is codebook size. To be specific, the $i_{th}$ visual code is calculated by assigning $\hat{x}_i$ in $\hat{X}_r$ to its closest neighbourhood code in $\mathcal{C}$ :
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
v _ {i} = \arg \min _ {j} \| l _ {2} \left(\hat {x} _ {i}\right) - l _ {2} \left(c _ {j}\right) \| _ {2}, \quad v _ {i} \in [ 0, K - 1 ], \tag {3}
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
where $l_{2}$ indicates the $L_{2}$ norm. Based on the indexing visual codes, we can obtain the quantized embeddings $\{c_{v_i}\}_{i = 1}^T$ , which is fed into a decoder to reconstruct the original visual semantic features $X = \{x_{i}\}_{i = 1}^{N}$ . The insight behind this design is that the reconstruction quality of the image semantics depends on selecting the most informative patches (token selector), along with maximally preserving the visual details only through the remained tokens (token merger). Thus, both token selector and merger can be effectively updated by encouraging a higher semantic reconstruction quality. The final training objective of the visual tokenizer is defined as:
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\mathcal {L} _ {\text {t o k e n i z e r}} = \frac {1}{N} \sum_ {i = 1} ^ {N} \left(1 - \cos \left(x _ {i}, x _ {i} ^ {\text {r e c}}\right)\right) + \lambda \left(\rho - \frac {1}{N} \sum_ {i = 1} ^ {N} M _ {i}\right) ^ {2}, \tag {4}
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
where $\cos (x_i,x_i^{\mathrm{rec}})$ calculates the cosine similarity between the reconstructed and real visual embeddings, $\rho$ is a pre-defined rate that controls the target mean percentage of the retained visual tokens and $\lambda$ is set to be 2. Finally, the tokenized discrete codes $\{v_{i}\}_{i = 1}^{T}$ will serve as the supervision signals for visual tokens in the following pre-training.
|
| 91 |
+
|
| 92 |
+
Decoding to Pixels The proposed visual tokenizer is capable of reconstructing visual features of input images that contain high-level semantics to represent the image content but lose the pixel-level details. To recover the original pixel space, we employ a conditional de-noising U-Net $\epsilon_{\theta}$ (Rombach et al., 2022) to infill the visual details after training the visual tokenizer. Specifically, it takes the reconstructed $x_{\mathrm{rec}}$ as the condition to progressively recover image $x$ from a Gaussian noise. Following Rombach et al. (2022), the parameters $\theta$ of this U-Net are optimized by $\epsilon$ prediction:
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\mathcal {L} _ {\theta} = \mathbb {E} _ {z, \epsilon \sim \mathcal {N} (0, 1), t} [ | | \epsilon - \epsilon_ {\theta} (z _ {t}, t, x _ {\text {r e c}}) | | ], \tag {5}
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
where $z_{t}$ is the latent state of image $x$ in the diffusion process. We present some pixel decoding results by the trained denoising U-Net in Figure 7 of the appendix. During inference, the generated visual tokens from LaVIT can be decoded into realistic images by this U-Net.
|
| 99 |
+
|
| 100 |
+
# 3.2 STAGE-2: UNIFIED GENERATIVE MODELING
|
| 101 |
+
|
| 102 |
+
Given an image-text pair, the 2D image can be tokenized into a 1D sequence with causal dependency and then concatenated with text tokens to form a multi-modal sequence $y = (y_{1},y_{2},\dots,y_{S})$ . For differentiating between two modalities, two special tokens [IMG] and [/IMG] are inserted into the beginning and end of the image token sequence respectively, indicating the start and end of image content. To empower LaVIT with the capability to generate both text and images, we employ two different concatenation forms, i.e., [image, text] and [text; image]. When the image is used as a condition (on the left) to generate text, we use the continuous visual features $\hat{X}_r$ from the token merger instead of quantized visual embeddings as the input to LLMs. Such a design mitigates the loss of detailed information caused by vector quantization, which is crucial for fine-grained multimodal understanding tasks like visual question answering. Our LaVIT adopts the general Language Modeling (LM) objective to directly maximize the likelihood of each multi-modal sequence in an auto-regressive manner:
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
p (y) = \sum_ {y \in \mathcal {D}} \sum_ {i = 1} ^ {S} \log P _ {\theta} \left(y _ {i} \mid y _ {< i}\right). \tag {6}
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
Since both image and text are already represented as discrete token IDs, we can use the cross-entropy to supervise the token prediction at each location for both two modalities with a shared prediction head. The complete unification in representation spaces and the training paradigms can help LLMs better learn multi-modal interaction and alignment. When LaVIT is pre-trained, it possesses the capacity to perceive images akin to a foreign language, comprehending and producing them like text. Nevertheless, most of the existing works merely regard images as prompts to guide the generation of text with no supervision, restricting them to solely performing image-to-text tasks.
|
| 109 |
+
|
| 110 |
+
# 3.3 MODEL PRE-TRAINING
|
| 111 |
+
|
| 112 |
+
The LaVIT undergoes a two-stage pre-training procedure on web-scale multi-modal corpora.
|
| 113 |
+
|
| 114 |
+
Stage-1: Tokenizer Training. Following the existing MLLMs, the ViT-G/14 of EVA-CLIP (Fang et al., 2023) is employed as the visual encoder. The visual codebook size is empirically set to $K = 16384$ . We adopt $L = 12$ transformer blocks for both token merger and decoder in our tokenizer. During training, this encoder is kept frozen and only the parameters of the selector, merger, and codebook are updated. It is trained for 50K steps on about 100M images from LAION-400M (Schuhmann et al., 2021) with the batch size of 2048 and $\rho = 1 / 3$ . After training the tokenizer, the conditional U-Net for pixel decoding is initialized from the Stable Diffusion v1.5 (Rombach et al., 2022) and finetuned 20k steps on the same dataset. The whole stage-1 training only requires pure image data without corresponding captions.
|
| 115 |
+
|
| 116 |
+
Stage-2: Unified Vision-Language Pre-training. Based on the trained visual tokenizer, all the images can be tokenized into discrete codes that are amenable to the next token prediction. We utilize the raw 7B version of LLaMA (Touvron et al., 2023) as the default LLM. For image-to-text comprehension (i.e., [image, text]), we employ about 93M samples from Conceptual Caption (Sharma et al., 2018; Changpinyo et al., 2021), SBU (Ordonez et al., 2011), and BLIP-Capfilt (Li et al., 2022). For the text-to-image synthesis (i.e., [text, image]), an additional 100M image-text pairs from the LAION-Aesthetics (A high-aesthetics image subset of LAION-5B (Schuhmann et al., 2022)) are used following Stable Diffusion. Moreover, to reduce catastrophic forgetting of the reasoning capacity in training LLM, we employ the English text corpus from Redpajama (Computer, 2023) dataset and mix it with the above image-text pairs to form the multi-modal input sequence.
|
| 117 |
+
|
| 118 |
+
# 4 EXPERIMENTS
|
| 119 |
+
|
| 120 |
+
In this section, comprehensive experiments are conducted to systematically validate the effectiveness of LaVIT on a wide range of vision-language tasks. Specifically, we mainly evaluate the model's zero-shot multi-modal understanding and generation capacity.
|
| 121 |
+
|
| 122 |
+
# 4.1 ZERO-SHOT MULTIMODAL UNDERSTANDING
|
| 123 |
+
|
| 124 |
+
We first quantitatively evaluate the zero-shot multi-modal understanding capacity of LaVIT on Image Captioning (NoCaps (Agrawal et al., 2019), Flickr30k (Plummer et al., 2015)) and Visual
|
| 125 |
+
|
| 126 |
+
<table><tr><td rowspan="2">Method</td><td colspan="2">Image Captioning</td><td colspan="4">Visual Question Answering</td></tr><tr><td>Nocaps</td><td>Flickr</td><td>VQAv2</td><td>OKVQA</td><td>GQA</td><td>VizWiz</td></tr><tr><td>Flamingo-3B (Alayrac et al., 2022)</td><td>-</td><td>60.6</td><td>49.2</td><td>41.2</td><td>-</td><td>28.9</td></tr><tr><td>Flamingo-9B (Alayrac et al., 2022)</td><td>-</td><td>61.5</td><td>51.8</td><td>44.7</td><td>-</td><td>28.8</td></tr><tr><td>OpenFlamingo-9B (Awadalla et al., 2023)</td><td>-</td><td>59.5</td><td>52.7</td><td>37.8</td><td>-</td><td>27.5</td></tr><tr><td>MetaLM (Hao et al., 2022)</td><td>-</td><td>43.4</td><td>41.1</td><td>11.4</td><td>-</td><td>-</td></tr><tr><td>Kosmos-1 (Huang et al., 2023)</td><td>-</td><td>67.1</td><td>51.0</td><td>-</td><td>-</td><td>29.2</td></tr><tr><td>Kosmos-2 (Peng et al., 2023)</td><td>-</td><td>80.5</td><td>51.1</td><td>-</td><td>-</td><td>-</td></tr><tr><td>BLIP-2 (Vicuna-7B) (Li et al., 2023)</td><td>107.5</td><td>74.9</td><td>-</td><td>-</td><td>41.3</td><td>25.3</td></tr><tr><td>BLIP-2 (Vicuna-13B) (Li et al., 2023)</td><td>103.9</td><td>71.6</td><td>-</td><td>-</td><td>32.3</td><td>19.6</td></tr><tr><td>CM3Leon-7B (Yu et al., 2023)</td><td>-</td><td>-</td><td>47.6</td><td>-</td><td>-</td><td>37.6</td></tr><tr><td>Emu (LLaMA-13B) (Sun et al., 2023)</td><td>-</td><td>-</td><td>52.0</td><td>38.2</td><td>-</td><td>34.2</td></tr><tr><td>Ours (LLaMA-7B)</td><td>114.2</td><td>83.0</td><td>66.0</td><td>54.6</td><td>46.8</td><td>38.5</td></tr></table>
|
| 127 |
+
|
| 128 |
+
Question Answering (VQAv2 (Goyal et al., 2017), OKVQA (Marino et al., 2019), GQA (Hudson & Manning, 2019), VizWiz (Gurari et al., 2018)). For visual question answering tasks, we use a simple prompt: "Question: {} Answer: {}. The widely-used CIDEr score and VQA accuracy are employed as metrics to evaluate captioning and question answering, respectively.
|
| 129 |
+
|
| 130 |
+
The detailed performance comparisons are shown in Table 1. As observed, LaVIT surpasses all the existing MLLMs by a large margin on these understanding tasks. For example, it achieves a CIDEr score of 83.0 on the Flickr30k test dataset, compared to 61.5 and 74.9 for the Flamingo-9B and BLIP-2 (Vicuna-7B) under the same scale of model size, respectively. The performance superiority on OKVQA (54.6% v.s. 44.7% of Flamingo-9B) further showcases the excellent multi-modal understanding capacity of LaVIT, since this benchmark contains questions requiring commonsense knowledge and rea
|
| 131 |
+
|
| 132 |
+
Table 1: Overview of zero-shot evaluation on multi-modal understanding tasks. Compared with previous methods, our LaVIT achieved the best performance on both benchmarks.
|
| 133 |
+
|
| 134 |
+
<table><tr><td>Method</td><td>Model Type</td><td>FID(↓)</td></tr><tr><td colspan="3">Text2Image Specialist:</td></tr><tr><td>DALL-E (Ramesh et al., 2021)</td><td>Autoregressive</td><td>28.0</td></tr><tr><td>CogView (Ding et al., 2021)</td><td>Autoregressive</td><td>27.1</td></tr><tr><td>SD (Rombach et al., 2022)</td><td>Diffusion</td><td>12.6</td></tr><tr><td>GLIDE (Nichol et al., 2021)</td><td>Diffusion</td><td>12.2</td></tr><tr><td>DALL-E2 (Ramesh et al., 2022)</td><td>Diffusion</td><td>10.4</td></tr><tr><td>Make-A-Scene (Gafni et al., 2022)</td><td>Autoregressive</td><td>11.8</td></tr><tr><td>MUSE-7.6B (Chang et al., 2023)</td><td>Non-Autoregressive</td><td>7.9</td></tr><tr><td>Imagen-3.4B (Saharia et al., 2022)</td><td>Diffusion</td><td>7.3</td></tr><tr><td>Parti-20B (Yu et al., 2022)</td><td>Autoregressive</td><td>7.2</td></tr><tr><td colspan="3">Multimodal Large Language Model:</td></tr><tr><td>GILL (OPT-6.7B) (Koh et al., 2023)</td><td>LLM</td><td>12.2</td></tr><tr><td>Emu (LLaMA-13B) (Sun et al., 2023)</td><td>LLM</td><td>11.7</td></tr><tr><td>CM3Leon-7B (Yu et al., 2023)</td><td>LLM</td><td>10.8</td></tr><tr><td>Ours (LLaMA-7B)</td><td>LLM</td><td>7.4</td></tr></table>
|
| 135 |
+
|
| 136 |
+
Table 2: The zero-shot text-to-image generation performance of different models on MS-COCO-30K evaluation benchmark.
|
| 137 |
+
|
| 138 |
+
soning about the content of images. It is worth noting that, although the concurrent method Emu (Sun et al., 2023) also leverages the LLM to jointly model the vision and language, the direct feature regression objective for visual inputs makes it incompatible with text input. Therefore, despite using more training data (2.6B image-text pairs and 3.8B web-crawled data) and larger LLM (LLaMA 13B), it still achieves inferior performance to ours on all evaluation benchmarks.
|
| 139 |
+
|
| 140 |
+
# 4.2 ZERO-SHOT MULTIMODAL GENERATION
|
| 141 |
+
|
| 142 |
+
Since the proposed visual tokenizer can represent images as discrete tokens, LaVIT possesses the capability to synthesize images by auto-regressively generating visual tokens like text. We first quantitatively evaluate the model's zero-shot text-conditional image synthesis performance on the validation set of the MS-COCO benchmark (Lin et al., 2014). The detailed image generation procedure is presented in Appendix A. Following the standard setting like previous text-to-image synthesis works, we randomly sample 30k text prompts and calculate the zero-shot FID metric between real images and generated ones. The detailed comparative results are shown in Table 2. It can be seen that LaVIT outperforms all the other multi-modal language models. Compared with the concurrent work Emu, it makes a 4.3 FID improvement with a smaller LLM model, demonstrating excellent vision-language alignment capability. In addition, LaVIT achieves comparable performance with state-of-the-art text2image specialists Parti (Yu et al., 2022), while only using much fewer training data (e.g., 0.2B v.s. 2B training image-text pairs compared to Parti).
|
| 143 |
+
|
| 144 |
+

|
| 145 |
+
Ours
|
| 146 |
+
A photo of a light bulb in outer space traveling the galaxy with a sailing boat inside the light bulb
|
| 147 |
+
|
| 148 |
+

|
| 149 |
+
Stable Diffusion v2.1
|
| 150 |
+
|
| 151 |
+

|
| 152 |
+
A television made of water that displays an image of a cityscape at night.
|
| 153 |
+
|
| 154 |
+

|
| 155 |
+
|
| 156 |
+

|
| 157 |
+
Image+ Text
|
| 158 |
+
|
| 159 |
+

|
| 160 |
+
(a) Text-to-Image Generation compared with Stable Diffusion
|
| 161 |
+
On the beach
|
| 162 |
+
On top of a wooden floor
|
| 163 |
+
|
| 164 |
+

|
| 165 |
+
|
| 166 |
+

|
| 167 |
+
In a police outfit
|
| 168 |
+
|
| 169 |
+

|
| 170 |
+
Wearing pink glasses
|
| 171 |
+
|
| 172 |
+

|
| 173 |
+
Image + Image
|
| 174 |
+
|
| 175 |
+

|
| 176 |
+
|
| 177 |
+

|
| 178 |
+
|
| 179 |
+

|
| 180 |
+
Image+ Text
|
| 181 |
+
|
| 182 |
+

|
| 183 |
+
On the beach
|
| 184 |
+
On top of a wooden floor.
|
| 185 |
+
|
| 186 |
+

|
| 187 |
+
|
| 188 |
+

|
| 189 |
+
In a police outfit
|
| 190 |
+
|
| 191 |
+

|
| 192 |
+
Wearing pink glasses
|
| 193 |
+
|
| 194 |
+

|
| 195 |
+
Image + Image
|
| 196 |
+
(b) The Image Generation with multi-modal prompts of LaVIT
|
| 197 |
+
Figure 4: The qualitative examples of multi-modal image synthesis.
|
| 198 |
+
|
| 199 |
+

|
| 200 |
+
|
| 201 |
+

|
| 202 |
+
|
| 203 |
+
Generation via Multi-modal Prompt LaVIT can seamlessly accept several modality combinations (e.g., text, image+text, image+image) as prompts to generate corresponding images without any fine-tuning. Figure 4 showcases some examples of the multi-modal image generation results. Our LaVIT can produce high-quality images that precisely reflect the style and semantics of the given multi-modal prompts, which demonstrates the strong multi-modal modeling potential of LaVIT. More interestingly, it can modify the original input image by the input multi-modal prompt (e.g., in the last example two prompt images with a dog or cat generate a dog's portrait with the cat's whisker). This capability cannot be attained by conventional image generation models like Stable Diffusion in the absence of additional fine-tuned downstream data (Ruiz et al., 2023).
|
| 204 |
+
|
| 205 |
+
# 4.3 ABLATION STUDY
|
| 206 |
+
|
| 207 |
+
In this study, we investigate the impact of various component designs in LaVIT on downstream performance. All the ablations were conducted on part of pre-training data by using the clip ViT-L/14 (Jia et al., 2021) as the visual encoder due to the costly training resources.
|
| 208 |
+
|
| 209 |
+
Token Classification or Feature Regression? When jointly training vision and language via generative training in text-oriented LLM, it is crucial to select the appropriate optimization objectives for the 2D raster-ordered visual input. When quantizing the continuous visual tokens into the discrete form, it is convenient to use the cross-entropy loss for supervising the next visual token prediction akin to textual tokens. We conjecture that such a uniform objective for both vision and language contributes to aligning them together in the LLM. To validate the superiority of the proposed visual quantization, we change the optimization objective of visual tokens to regressing the next visual embeddings by employing a regression head like Emu (Sun et al., 2023). Table 3a summarizes the results of different training objectives. As observed, adopting the regression loss for the next visual token prediction will severely degrade the model performance.
|
| 210 |
+
|
| 211 |
+

|
| 212 |
+
Token Num: 95
|
| 213 |
+
|
| 214 |
+

|
| 215 |
+
Token Num: 108
|
| 216 |
+
|
| 217 |
+

|
| 218 |
+
Code: 8892
|
| 219 |
+
|
| 220 |
+

|
| 221 |
+
Code: 4107
|
| 222 |
+
|
| 223 |
+

|
| 224 |
+
Token Num: 79
|
| 225 |
+
|
| 226 |
+

|
| 227 |
+
Token Num: 97
|
| 228 |
+
|
| 229 |
+

|
| 230 |
+
Code: 9146
|
| 231 |
+
Figure 5: The visualization for the dynamic visual tokenizer (left) and learned codebook (right). Our tokenizer can dynamically select the most informative patches based on the image content and the learned codebook can produce visual codes with high-level semantics.
|
| 232 |
+
|
| 233 |
+

|
| 234 |
+
Code: 15116
|
| 235 |
+
|
| 236 |
+
Dynamic or Fixed Token Length. Given the extracted visual features, a straightforward way is to tokenize all the patch embeddings into the visual tokens, which results in a fixed token length (i.e., 256). We compare the impact of fixed and dynamic tokenization strategies in terms of training time, computation overhead, and zero-shot performance on multi-modal understanding. As shown in Table 3b, the dynamic visual tokenizer achieves superior performance while only requiring 94 tokens on average for the input images, about $36\%$ of the fixed one. Given that the attention computation in LLM exhibits a quadratic relationship with respect to the token length, this sparsification can accelerate the training time by $40\%$ and reduce the computational cost in inference.
|
| 237 |
+
|
| 238 |
+
<table><tr><td>Setting</td><td>Flickr</td><td>VQAv2</td><td>OKVQA</td></tr><tr><td>Regression</td><td>60.4</td><td>53.6</td><td>41.9</td></tr><tr><td>Classification</td><td>73.2</td><td>57.1</td><td>47.0</td></tr></table>
|
| 239 |
+
|
| 240 |
+
(a) Ablations of different training objectives.
|
| 241 |
+
|
| 242 |
+
<table><tr><td>Setting</td><td>Num</td><td>Time</td><td>Flickr</td><td>VQAv2</td><td>OKVQA</td></tr><tr><td>Fixed</td><td>256</td><td>30h</td><td>71.1</td><td>56.5</td><td>46.4</td></tr><tr><td>Dynamic</td><td>94</td><td>18h</td><td>74.0</td><td>57.7</td><td>47.6</td></tr></table>
|
| 243 |
+
|
| 244 |
+
(b) Ablations for the effect of different tokenization strategies.
|
| 245 |
+
|
| 246 |
+
Table 3: The ablations of different optimization objectives for visual tokens and tokenization strategies. The num and time in Table 3b indicate the mean visual token number and pre-training time.
|
| 247 |
+
|
| 248 |
+
# 4.4 QUALITATIVE ANALYSIS
|
| 249 |
+
|
| 250 |
+
We visualize some examples processed by the proposed dynamic tokenizer. As shown in Figure 5, the token selector is capable of dynamically selecting the most informative image patches that are competent enough to represent the semantics of the whole image. Visual patches that contain repetitive or trivial background semantics are filtered during this procedure, thereby reducing redundant information and improving computing efficiency. We also visualize the image patches that belong to the same visual code in Figure 5. As observed, the learned discrete codes can convey explicit visual semantics and group the image patches with similar patterns together. For instance, code 4107 represents a part of a skateboard, and code 9146 indicates the texture of a giraffe, which strongly demonstrates the interpretability of the learned codebook.
|
| 251 |
+
|
| 252 |
+
# 5 CONCLUSION
|
| 253 |
+
|
| 254 |
+
This paper presents the LaVIT, a new general-purpose foundation model that is capable of simultaneously performing multi-modal understanding and generation. Beyond the previous adapter-based methods, it inherits the successful auto-regressive generative learning paradigm of LLMs by representing both vision and language in a unified discrete token representation via a dynamic visual tokenizer. Through optimization under the unified generative objective, LaVIT can treat images as a foreign language, comprehending and generating them like text. Extensive experimental results further demonstrate the LaVIT's superior capability to serve as a multi-modal generalist.
|
| 255 |
+
|
| 256 |
+
Acknowledgement: This research work is supported by National Key R&D Program of China (2022ZD0160305).
|
| 257 |
+
|
| 258 |
+
# REFERENCES
|
| 259 |
+
|
| 260 |
+
Harsh Agrawal, Karan Desai, Yufei Wang, Xinlei Chen, Rishabh Jain, Mark Johnson, Dhruv Batra, Devi Parikh, Stefan Lee, and Peter Anderson. Nocaps: Novel object captioning at scale. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 8948-8957, 2019.
|
| 261 |
+
Jean-Baptiste Alayrac, Jeff Donahue, Pauline Luc, Antoine Miech, Iain Barr, Yana Hasson, Karel Lenc, Arthur Mensch, Katherine Millican, Malcolm Reynolds, et al. Flamingo: a visual language model for few-shot learning. Advances in Neural Information Processing Systems, 35:23716-23736, 2022.
|
| 262 |
+
Anas Awadalla, Irena Gao, Josh Gardner, Jack Hessel, Yusuf Hanafy, Wanrong Zhu, Kalyani Marathe, Yonatan Bitton, Samir Gadre, Shiori Sagawa, et al. Openflamingo: An open-source framework for training large autoregressive vision-language models. arXiv preprint arXiv:2308.01390, 2023.
|
| 263 |
+
Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. Advances in neural information processing systems, 33:1877-1901, 2020.
|
| 264 |
+
Huiwen Chang, Han Zhang, Jarred Barber, AJ Maschinot, Jose Lezama, Lu Jiang, Ming-Hsuan Yang, Kevin Murphy, William T Freeman, Michael Rubinstein, et al. Muse: Text-to-image generation via masked generative transformers. arXiv preprint arXiv:2301.00704, 2023.
|
| 265 |
+
Soravit Changpinyo, Piyush Sharma, Nan Ding, and Radu Soricut. Conceptual 12m: Pushing web-scale image-text pre-training to recognize long-tail visual concepts. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 3558-3568, 2021.
|
| 266 |
+
Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam Roberts, Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, et al. Palm: Scaling language modeling with pathways. arXiv preprint arXiv:2204.02311, 2022.
|
| 267 |
+
Together Computer. Redpajama: An open source recipe to reproduce llama training dataset, 2023. URL https://github.com/togethercomputer/RedPajama-Data.
|
| 268 |
+
Ming Ding, Zhuoyi Yang, Wenyi Hong, Wendi Zheng, Chang Zhou, Da Yin, Junyang Lin, Xu Zou, Zhou Shao, Hongxia Yang, et al. Cogview: Mastering text-to-image generation via transformers. Advances in Neural Information Processing Systems, 34:19822-19835, 2021.
|
| 269 |
+
Patrick Esser, Robin Rombach, and Bjorn Ommer. Taming transformers for high-resolution image synthesis. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 12873-12883, 2021.
|
| 270 |
+
Yuxin Fang, Wen Wang, Binhui Xie, Quan Sun, Ledell Wu, Xinggang Wang, Tiejun Huang, Xinlong Wang, and Yue Cao. Eva: Exploring the limits of masked visual representation learning at scale. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 19358-19369, 2023.
|
| 271 |
+
Oran Gafni, Adam Polyak, Oron Ashual, Shelly Sheynin, Devi Parikh, and Yaniv Taigman. Make-a-scene: Scene-based text-to-image generation with human priors. In European Conference on Computer Vision, pp. 89-106. Springer, 2022.
|
| 272 |
+
Yash Goyal, Tejas Khot, Douglas Summers-Stay, Dhruv Batra, and Devi Parikh. Making the v in vqa matter: Elevating the role of image understanding in visual question answering. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 6904-6913, 2017.
|
| 273 |
+
Robert Gray. Vector quantization. IEEE Assp Magazine, 1(2):4-29, 1984.
|
| 274 |
+
Danna Gurari, Qing Li, Abigale J Stangl, Anhong Guo, Chi Lin, Kristen Grauman, Jiebo Luo, and Jeffrey P Bigham. Vizwiz grand challenge: Answering visual questions from blind people. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 3608-3617, 2018.
|
| 275 |
+
|
| 276 |
+
Yaru Hao, Haoyu Song, Li Dong, Shaohan Huang, Zewen Chi, Wenhui Wang, Shuming Ma, and Furu Wei. Language models are general-purpose interfaces. arXiv preprint arXiv:2206.06336, 2022.
|
| 277 |
+
Kaiming He, Xinlei Chen, Saining Xie, Yanghao Li, Piotr Dólar, and Ross B. Girshick. Masked autoencoders are scalable vision learners. In IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 15979-15988, 2022.
|
| 278 |
+
Dan Hendrycks, Collin Burns, Steven Basart, Andy Zou, Mantas Mazeika, Dawn Song, and Jacob Steinhardt. Measuring massive multitask language understanding. arXiv preprint arXiv:2009.03300, 2020.
|
| 279 |
+
Jonathan Ho and Tim Salimans. Classifier-free diffusion guidance. arXiv preprint arXiv:2207.12598, 2022.
|
| 280 |
+
Shaohan Huang, Li Dong, Wenhui Wang, Yaru Hao, Saksham Singhal, Shuming Ma, Tengchao Lv, Lei Cui, Owais Khan Mohammed, Qiang Liu, et al. Language is not all you need: Aligning perception with language models. arXiv preprint arXiv:2302.14045, 2023.
|
| 281 |
+
Drew A Hudson and Christopher D Manning. Gqa: A new dataset for real-world visual reasoning and compositional question answering. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 6700-6709, 2019.
|
| 282 |
+
Chao Jia, Yinfei Yang, Ye Xia, Yi-Ting Chen, Zarana Parekh, Hieu Pham, Quoc Le, Yun-Hsuan Sung, Zhen Li, and Tom Duerig. Scaling up visual and vision-language representation learning with noisy text supervision. In International Conference on Machine Learning, pp. 4904-4916. PMLR, 2021.
|
| 283 |
+
Jing Yu Koh, Daniel Fried, and Ruslan Salakhutdinov. Generating images with multimodal language models. arXiv preprint arXiv:2305.17216, 2023.
|
| 284 |
+
Junnan Li, Dongxu Li, Caiming Xiong, and Steven Hoi. Blip: Bootstrapping language-image pretraining for unified vision-language understanding and generation. In International Conference on Machine Learning, pp. 12888-12900. PMLR, 2022.
|
| 285 |
+
Junnan Li, Dongxu Li, Silvio Savarese, and Steven Hoi. Blip-2: Bootstrapping language-image pre-training with frozen image encoders and large language models. arXiv preprint arXiv:2301.12597, 2023.
|
| 286 |
+
Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dólar, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In Computer Vision-ECCV 2014: 13th European Conference, Zurich, Switzerland, September 6-12, 2014, Proceedings, Part V 13, pp. 740-755. Springer, 2014.
|
| 287 |
+
Haotian Liu, Chunyuan Li, Qingyang Wu, and Yong Jae Lee. Visual instruction tuning. arXiv preprint arXiv:2304.08485, 2023.
|
| 288 |
+
Chris J Maddison, Andriy Mnih, and Yee Whye Teh. The concrete distribution: A continuous relaxation of discrete random variables. arXiv preprint arXiv:1611.00712, 2016.
|
| 289 |
+
Kenneth Marino, Mohammad Rastegari, Ali Farhadi, and Roozbeh Mottaghi. Ok-vqa: A visual question answering benchmark requiring external knowledge. In Proceedings of the IEEE/cvf conference on computer vision and pattern recognition, pp. 3195-3204, 2019.
|
| 290 |
+
Nasser M Nasrabadi and Robert A King. Image coding using vector quantization: A review. IEEE Transactions on communications, 36(8):957-971, 1988.
|
| 291 |
+
Alex Nichol, Prafulla Dhariwal, Aditya Ramesh, Pranav Shyam, Pamela Mishkin, Bob McGrew, Ilya Sutskever, and Mark Chen. Glide: Towards photorealistic image generation and editing with text-guided diffusion models. arXiv preprint arXiv:2112.10741, 2021.
|
| 292 |
+
Vicente Ordonez, Girish Kulkarni, and Tamara Berg. Im2text: Describing images using 1 million captioned photographs. Advances in neural information processing systems, 24, 2011.
|
| 293 |
+
|
| 294 |
+
Zhiliang Peng, Li Dong, Hangbo Bao, Qixiang Ye, and Furu Wei. Beit v2: Masked image modeling with vector-quantized visual tokenizers. arXiv preprint arXiv:2208.06366, 2022.
|
| 295 |
+
Zhiliang Peng, Wenhui Wang, Li Dong, Yaru Hao, Shaohan Huang, Shuming Ma, and Furu Wei. Kosmos-2: Grounding multimodal large language models to the world. arXiv preprint arXiv:2306.14824, 2023.
|
| 296 |
+
Bryan A Plummer, Liwei Wang, Chris M Cervantes, Juan C Caicedo, Julia Hockenmaier, and Svetlana Lazebnik. Flickr30k entities: Collecting region-to-phrase correspondences for richer image-to-sentence models. In Proceedings of the IEEE international conference on computer vision, pp. 2641-2649, 2015.
|
| 297 |
+
Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In International conference on machine learning, pp. 8748-8763. PMLR, 2021.
|
| 298 |
+
Aditya Ramesh, Mikhail Pavlov, Gabriel Goh, Scott Gray, Chelsea Voss, Alec Radford, Mark Chen, and Ilya Sutskever. Zero-shot text-to-image generation. In International Conference on Machine Learning, pp. 8821-8831. PMLR, 2021.
|
| 299 |
+
Aditya Ramesh, Prafulla Dhariwal, Alex Nichol, Casey Chu, and Mark Chen. Hierarchical text-conditional image generation with clip latents. arXiv preprint arXiv:2204.06125, 1(2):3, 2022.
|
| 300 |
+
Yongming Rao, Wenliang Zhao, Benlin Liu, Jiwen Lu, Jie Zhou, and Cho-Jui Hsieh. Dynamicvit: Efficient vision transformers with dynamic token sparsification. Advances in neural information processing systems, 34:13937-13949, 2021.
|
| 301 |
+
Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. High-resolution image synthesis with latent diffusion models. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 10684-10695, 2022.
|
| 302 |
+
Nataniel Ruiz, Yuzhen Li, Varun Jampani, Yael Pritch, Michael Rubinstein, and Kfir Aberman. Dreambooth: Fine tuning text-to-image diffusion models for subject-driven generation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 22500-22510, 2023.
|
| 303 |
+
Chitwan Sahara, William Chan, Saurabh Saxena, Lala Li, Jay Whang, Emily L Denton, Kamyar Ghasemipour, Raphael Gontijo Lopes, Burcu Karagol Ayan, Tim Salimans, et al. Photorealistic text-to-image diffusion models with deep language understanding. Advances in Neural Information Processing Systems, 35:36479-36494, 2022.
|
| 304 |
+
Christoph Schuhmann, Richard Vencu, Romain Beaumont, Robert Kaczmarczyk, Clayton Mullis, Aarush Katta, Theo Coombes, Jenia Jitsev, and Aran Komatsuzaki. Laion-400m: Open dataset of clip-filtered 400 million image-text pairs. arXiv preprint arXiv:2111.02114, 2021.
|
| 305 |
+
Christoph Schuhmann, Romain Beaumont, Richard Vencu, Cade Gordon, Ross Wightman, Mehdi Cherti, Theo Coombes, Aarush Katta, Clayton Mullis, Mitchell Wortsman, et al. Laion-5b: An open large-scale dataset for training next generation image-text models. Advances in Neural Information Processing Systems, 35:25278-25294, 2022.
|
| 306 |
+
Piyush Sharma, Nan Ding, Sebastian Goodman, and Radu Soricut. Conceptual captions: A cleaned, hypernymed, image alt-text dataset for automatic image captioning. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 2556-2565, 2018.
|
| 307 |
+
Quan Sun, Qiying Yu, Yufeng Cui, Fan Zhang, Xiaosong Zhang, Yueze Wang, Hongcheng Gao, Jingjing Liu, Tiejun Huang, and Xinlong Wang. Generative pretraining in multimodality. arXiv preprint arXiv:2307.05222, 2023.
|
| 308 |
+
Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro, Faisal Azhar, et al. Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971, 2023.
|
| 309 |
+
|
| 310 |
+
Aaron Van Den Oord, Oriol Vinyals, et al. Neural discrete representation learning. Advances in neural information processing systems, 30, 2017.
|
| 311 |
+
Wenhui Wang, Hangbo Bao, Li Dong, Johan Bjorck, Zhiliang Peng, Qiang Liu, Kriti Aggarwal, Owais Khan Mohammed, Saksham Singhal, Subhojit Som, et al. Image as a foreign language: Beit pretraining for vision and vision-language tasks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 19175-19186, 2023.
|
| 312 |
+
Chen Wei, Haoqi Fan, Saining Xie, Chao-Yuan Wu, Alan L. Yuille, and Christoph Feichtenhofer. Masked feature prediction for self-supervised visual pre-training. In IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 14648-14658, 2022.
|
| 313 |
+
Jiahui Yu, Xin Li, Jing Yu Koh, Han Zhang, Ruoming Pang, James Qin, Alexander Ku, Yuanzhong Xu, Jason Baldridge, and Yonghui Wu. Vector-quantized image modeling with improved vqgan. In International Conference on Learning Representations, 2021.
|
| 314 |
+
Jiahui Yu, Yuanzhong Xu, Jing Yu Koh, Thang Luong, Gunjan Baid, Zirui Wang, Vijay Vasudevan, Alexander Ku, Yinfei Yang, Burcu Karagol Ayan, et al. Scaling autoregressive models for content-rich text-to-image generation. arXiv preprint arXiv:2206.10789, 2(3):5, 2022.
|
| 315 |
+
Lili Yu, Bowen Shi, Ramakanth Pasunuru, Benjamin Muller, Olga Golovneva, Tianlu Wang, Arun Babu, Binh Tang, Brian Karrer, Shelly Sheynin, et al. Scaling autoregressive multi-modal models: Pretraining and instruction tuning. arXiv preprint arXiv:2309.02591, 2023.
|
| 316 |
+
Renrui Zhang, Jiaming Han, Aojun Zhou, Xiangfei Hu, Shilin Yan, Pan Lu, Hongsheng Li, Peng Gao, and Yu Qiao. Llama-adapter: Efficient fine-tuning of language models with zero-init attention. arXiv preprint arXiv:2303.16199, 2023.
|
| 317 |
+
Deyao Zhu, Jun Chen, Xiaogian Shen, Xiang Li, and Mohamed Elhoseiny. Minigpt-4: Enhancing vision-language understanding with advanced large language models. arXiv preprint arXiv:2304.10592, 2023.
|
| 318 |
+
|
| 319 |
+
# A THE DETAILS OF IMAGE SYNTHESIS
|
| 320 |
+
|
| 321 |
+
Given a multi-modal prompt (image, text, or their combinations), LaVIT first tokenizes it as a sequence of discrete tokens. By appending the special [IMG] (image start token) to the end of the prompt and feeding into the LLM, it can auto-regressively generate a sequence of visual tokens until reaches the special [/IMG] (image end). These yielded discrete visual tokens are further reconstructed into a feature map by the decoder of the proposed visual tokenizer, which reflects the high-level semantics of the synthetic image. Finally, the conditional denoising U-Net will take this feature map as the condition to progressively recover image pixels from a Gaussian noise. Taking the text prompt as an example, we illustrate the entire image synthesis procedure in Figure 6.
|
| 322 |
+
|
| 323 |
+

|
| 324 |
+
Figure 6: The detailed image synthesis process for the textual prompt by LaVIT. Generation for prompts in other modalities is similar.
|
| 325 |
+
|
| 326 |
+
During the text-to-image evaluation on MS-COCO, we use the top-k sampling to generate image tokens and set the maximum sampled tokens to $k = 300$ , and softmax temperature to 1.0. Besides, the Classifier-Free Guidance (CFG) (Ho & Salimans, 2022) strategy is also employed to enable the model to yield more prompt-aligned image tokens. Specifically, we replace the input multi-modal prompt with the [IMG] token to conduct unconditional sampling. Both conditional and prompt-conditioned visual token streams are generated in LaVIT. Hence, the real sampling logits for $t_{\mathrm{th}}$ image token $y_{t}$ in the generation is a blend of both unconditional and conditional logits:
|
| 327 |
+
|
| 328 |
+
$$
|
| 329 |
+
l \left(y _ {t}\right) = l \left(y _ {t} \mid [ \mathrm {I M G} ]\right) + \alpha_ {\mathrm {c f g}} \cdot \left(l \left(y _ {t} \mid \text {p r o m p t}\right) - l \left(y _ {t} \mid [ \mathrm {I M G} ]\right)\right) \tag {7}
|
| 330 |
+
$$
|
| 331 |
+
|
| 332 |
+
The larger $\alpha_{\mathrm{cfg}}$ will encourage the model to generate samples highly related to the input prompt while sacrificing some diversity. We set $\alpha_{\mathrm{cfg}}$ to 1.5 when evaluating the zero-shot text-to-image synthesis on MS-COCO. LaVIT generates 4 samples for each prompt and uses a CLIP-VIT/L model to select the best one according to the image-prompt matching score.
|
| 333 |
+
|
| 334 |
+
# B ADDITIONAL EXPERIMENTAL ANALYSIS
|
| 335 |
+
|
| 336 |
+
# B.1 THE IMPACT OF VISION-LANGUAGE PRE-TRAINING ON LLM
|
| 337 |
+
|
| 338 |
+
During pre-training, the weights of LLM are unlocked to jointly optimize the visual and textual tokens. Since a new modality is included in text-oriented LLM, without setting appropriate hyperparameters, its original language capability may be impaired. In this section, we discuss how to mitigate the forgetting of knowledge in LLM when undergoing the vision-language pre-training. We chose the massive multitask language understanding benchmark (MMLU) (Hendrycks et al., 2020) to quantitatively measure the model's common knowledge and reasoning ability. MMLU is a knowledge-intensive dataset covering various domains, including humanities, STEM, and social sciences. It is a commonly used benchmark in evaluating the Large Language Model. Following LLaMA (Touvron et al., 2023), we evaluate the model in the 5-shot setting. The detailed experimental results are reported in Table 4.
|
| 339 |
+
|
| 340 |
+
Through exploration, we conclude some useful strategies for conducting unified vision-language pre-training in LLM: 1) The Learning rate of the LLM part is the most important hyper-parameter.
|
| 341 |
+
|
| 342 |
+
<table><tr><td>Setting</td><td>\(LR_V\)</td><td>\(LR_L\)</td><td>Text</td><td>Multi-modal</td><td>Humanities</td><td>STEM</td><td>Social Sciences</td><td>Other</td><td>Average</td></tr><tr><td>LLaMA-7B</td><td>-</td><td>3e-4</td><td>100%</td><td>0%</td><td>34.0</td><td>30.5</td><td>38.3</td><td>38.1</td><td>35.1</td></tr><tr><td>LaVIT-7B</td><td>1.5e-4</td><td>1.5e-4</td><td>66%</td><td>33%</td><td>26.7</td><td>26.1</td><td>25.7</td><td>29.8</td><td>27.1(-8.0)</td></tr><tr><td>LaVIT-7B</td><td>1.5e-4</td><td>5e-5</td><td>50%</td><td>50%</td><td>31.4</td><td>27.2</td><td>31.8</td><td>34.5</td><td>30.9(-4.2)</td></tr><tr><td>LaVIT-7B</td><td>1.5e-4</td><td>5e-5</td><td>66%</td><td>33%</td><td>33.5</td><td>30.3</td><td>35.2</td><td>36.7</td><td>33.6(-1.5)</td></tr></table>
|
| 343 |
+
|
| 344 |
+
Table 4: The influence of learning rate and data proportion on the MMLU benchmark. Here, $LR_{V}$ and $LR_{L}$ indicate the learning rate for the visual and LLM parts in LaVIT. LaVIT learns excellent multi-modal modeling capability with only a slight drop of its original common knowledge.
|
| 345 |
+
|
| 346 |
+
<table><tr><td>Dataset</td><td>Sampling prop</td></tr><tr><td>C4</td><td>80%</td></tr><tr><td>Github</td><td>4%</td></tr><tr><td>Wikipedia</td><td>4%</td></tr><tr><td>Books</td><td>4%</td></tr><tr><td>ArXiv</td><td>4%</td></tr><tr><td>StackExchange</td><td>4%</td></tr></table>
|
| 347 |
+
|
| 348 |
+
Although using a large learning rate $(e^{-4}$ level) for tuning the LLM part will speed up its convergence on solving the vision-language task, it also speeds up the forgetting of its original learned common knowledge (8.0 performance drop compared to original LLaMA). To balance these, we suggest of learning rate of $e^{-5}$ level of LLM and $e^{-4}$ level of visual. 2) Text corpus data is also important. Lack of text data will also degrade the LLM's ability. Therefore, we suggest a proportion of 2:1 (L:VL) to maintain its original learned knowledge. In our experiments, the used English text corpus is from the Redpajama (Computer, 2023) dataset. The detailed proportion for each subset of Redpajama is presented in Table 5. Finally, we set the learning rate of LLM to $5e - 5$ and $1.5e^{-4}$ for other parts in LaVIT, which only slightly affected LLM's language ability (-1.5 on MMLU), but achieved the best results on both multimodal understanding and generation tasks.
|
| 349 |
+
|
| 350 |
+
# B.2 MORE ABLATION STUDY
|
| 351 |
+
|
| 352 |
+
Like ablations in the main text, the following experiments are conducted on part of pre-training data by using clip ViT-L/14 (Jia et al., 2021) as the visual encoder.
|
| 353 |
+
|
| 354 |
+
Bi-directional or Causal Attention? The token merger in the proposed dynamic visual tokenizer includes the self-attention layer to model the interaction among the visual tokens. To convert 2D raster-ordered visual features from the ViT encoder into a sequence with causal dependency like text, causal self-attention is utilized to enforce the restriction that each visual token can solely attend to its preceding ones. To validate the effectiveness, we replace causal attention with bi-directional attention in the token merger. As shown in Table 6, causal attention outperforms bi-directional self-attention across all multi-modal understanding tasks. We conjecture the inferior performance can be attributed to partial information leakage, as the preceding token has visibility of the subsequent one, thereby impairing the optimization of next-token prediction in LLM.
|
| 355 |
+
|
| 356 |
+
Table 5: The used English text corpus proportion of different subsets in Redpajama.
|
| 357 |
+
|
| 358 |
+
<table><tr><td>Setting</td><td>Flickr</td><td>VQAv2</td><td>OKVQA</td></tr><tr><td>Bi-directional Attention</td><td>69.9</td><td>55.6</td><td>44.1</td></tr><tr><td>Causal Attention</td><td>73.2</td><td>57.3</td><td>46.4</td></tr></table>
|
| 359 |
+
|
| 360 |
+
Table 6: The effect of different attention manners in the token merger on downstream tasks.
|
| 361 |
+
|
| 362 |
+
Type of Visual Input Embeddings. For multi-modal understanding where the image is treated as a condition on the left (i.e., [image, text]), the visual representations input to LLM can be quantized vectors from the codebook or the continuous features yielded by token merger. We investigate the impact of these two different visual input forms in Table 7a. As observed, the continuous visual features achieve better multi-modal understanding performance. This phenomenon is reasonable as quantized embeddings represent the centroid of continuous visual features, potentially leading to the loss of detailed visual content. Therefore, for input sequences with order [image, text], we utilize the
|
| 363 |
+
|
| 364 |
+

|
| 365 |
+
|
| 366 |
+

|
| 367 |
+
|
| 368 |
+

|
| 369 |
+
|
| 370 |
+

|
| 371 |
+
|
| 372 |
+

|
| 373 |
+
|
| 374 |
+

|
| 375 |
+
|
| 376 |
+

|
| 377 |
+
|
| 378 |
+

|
| 379 |
+
|
| 380 |
+

|
| 381 |
+
|
| 382 |
+

|
| 383 |
+
|
| 384 |
+

|
| 385 |
+
|
| 386 |
+

|
| 387 |
+
|
| 388 |
+

|
| 389 |
+
Original
|
| 390 |
+
|
| 391 |
+

|
| 392 |
+
Reconstruction
|
| 393 |
+
|
| 394 |
+

|
| 395 |
+
Original
|
| 396 |
+
|
| 397 |
+

|
| 398 |
+
Reconstruction
|
| 399 |
+
Figure 7: The image reconstruction results from discrete visual tokens by the denoising U-Net.
|
| 400 |
+
|
| 401 |
+

|
| 402 |
+
Original
|
| 403 |
+
|
| 404 |
+

|
| 405 |
+
Reconstruction
|
| 406 |
+
|
| 407 |
+
outputs from the token merger as input to LLM, whilst regarding the corresponding discrete visual codes as the supervision signal for predicting the next visual tokens.
|
| 408 |
+
|
| 409 |
+
<table><tr><td>Setting</td><td>Flickr</td><td>VQAv2</td><td>OKVQA</td></tr><tr><td>Quantized</td><td>70.3</td><td>53.0</td><td>44.8</td></tr><tr><td>Continuous</td><td>72.7</td><td>56.4</td><td>46.2</td></tr></table>
|
| 410 |
+
|
| 411 |
+
(a) The effect of visual input embeddings forms.
|
| 412 |
+
|
| 413 |
+
<table><tr><td>Setting</td><td>Flickr</td><td>VQAv2</td><td>OKVQA</td></tr><tr><td>Frozen LLM</td><td>63.0</td><td>52.7</td><td>44.3</td></tr><tr><td>Unlock LLM</td><td>72.1</td><td>57.1</td><td>47.9</td></tr></table>
|
| 414 |
+
|
| 415 |
+
(b) The effect of unlocking LLM in training.
|
| 416 |
+
|
| 417 |
+
Table 7: The ablation studies of visual input embeddings format and the unlock of LLM during pre-training. The performance is evaluated on the zero-shot setting.
|
| 418 |
+
|
| 419 |
+
<table><tr><td>Setting</td><td>Flickr</td><td>VQAv2</td><td>OKVQA</td></tr><tr><td>w/o Token Merger</td><td>70.8</td><td>51.9</td><td>42.1</td></tr><tr><td>w/ Token Merger</td><td>72.7</td><td>56.4</td><td>46.2</td></tr></table>
|
| 420 |
+
|
| 421 |
+
Table 8: The effect of the proposed token merger on downstream multi-modal understanding tasks.
|
| 422 |
+
|
| 423 |
+
The role of Token Merger. The token merger aims to compress the semantics of unselected visual patches onto the retained ones according to their feature similarity. Compared to directly discarding these unselected patches, this merge mechanism not only reduces the redundancy among patches but also maximally preserves the visual details. The ablation study to explore the role of our token merger is shown in Table 8. From the presented results, it can be observed a distinct performance drop in multi-modal understanding tasks when eliminating the token merger module.
|
| 424 |
+
|
| 425 |
+
The Effect of Unlock LLM. In order to ascertain the efficacy of utilizing LLM for learning the interaction between vision and language, we devise an ablation experiment wherein the entirety of LLM remains frozen while solely optimizing the parameters of the token merger during training. The detailed comparison results are shown in Table 7b. One can observe that freezing the language model will restrict its powerful multi-modal modeling potential and thus result in a noticeable performance degradation. Hence, unlocking the LLM under a unified training objective will contribute to adequately bridging the semantics between vision and language.
|
| 426 |
+
|
| 427 |
+
# C MORE VISUALIZATIONS
|
| 428 |
+
|
| 429 |
+
The quality of pixel decoding In Figure 7, we visualize some pixel decoding examples by the trained denoising U-Net. It can be seen that, given the tokenized discrete visual tokens, the original input images can be successfully recovered. The reconstructed examples exhibit a high degree of
|
| 430 |
+
|
| 431 |
+

|
| 432 |
+
Figure 8: The visualization for the leaned discrete visual codes.
|
| 433 |
+
|
| 434 |
+
<table><tr><td>Configuration</td><td>VL Pre-training</td><td>Tokenizer training</td></tr><tr><td>Visual Encoder</td><td>EVA-CLIP ViT-G/14</td><td>EVA-CLIP ViT-G/14</td></tr><tr><td>LLM init</td><td>LLaMA-1-7B</td><td>-</td></tr><tr><td>Optimizer</td><td>AdamW</td><td>AdamW</td></tr><tr><td>Optimizer Hyperparameters</td><td>β1=0.9, β2=0.95, ε=1e-6</td><td>β1=0.9, β2=0.99, ε=1e-6</td></tr><tr><td>Global batch size</td><td>2048</td><td>2048</td></tr><tr><td>Peak learning rate of LLM</td><td>5e-5</td><td>-</td></tr><tr><td>Peak learning rate of Visual Part</td><td>1.5e-4</td><td>2e-4</td></tr><tr><td>Learning rate schedule</td><td>Cosine</td><td>Cosine</td></tr><tr><td>Training Steps</td><td>20K</td><td>50K</td></tr><tr><td>Warm-up steps</td><td>2k</td><td>4K</td></tr><tr><td>Weight decay</td><td>0.1</td><td>0.01</td></tr><tr><td>Gradient clipping</td><td>1.0</td><td>1.0</td></tr><tr><td>Input image resolution</td><td>224*224</td><td>224*224</td></tr><tr><td>Input sequence to LLM</td><td>2048</td><td>-</td></tr><tr><td>Numerical precision</td><td>float16</td><td>float16</td></tr><tr><td>GPU Usage</td><td>256 NVIDIA A100</td><td>64 NVIDIA A100</td></tr><tr><td>Training Time</td><td>30h</td><td>12h</td></tr></table>
|
| 435 |
+
|
| 436 |
+
Table 9: The detailed training hyperparameters of LaVIT
|
| 437 |
+
|
| 438 |
+
semantic and general structure to the original images. This consistency validates that our dynamic tokenizer can efficiently encode visual information using generated discrete tokens.
|
| 439 |
+
|
| 440 |
+
The Learned Codebook We also provide more visualization examples for the learned codebook in Figure 8, where the image patches belonging to the same discrete visual code are arranged together. One can observe that the learned visual code can encode explicit high-level visual semantics. For example, code 13014 represents the human arm, code 7260 shows the part of the car, code 15235 represents the bus, and code 15090 indicates the donuts. The high distinctiveness of the learned codebook facilitates the unified vision-language pre-training in LLM.
|
| 441 |
+
|
| 442 |
+
Multi-Modal Image Synthesis We illustrate more image synthesis results in Figure 9, 10, 11 and 12. As presented, LaVIT produces high-quality, content-rich, and appearance-diverse image samples that precisely reflect the prompt's semantics. Importantly, LaVIT can produce images well aligned with long and more complex text descriptions, while the samples generated by stable diffusion do not reflect the subtle details in some complicated prompts. Besides, LaVIT also supports the multi-modal in-context image generation. As illustrated in Figure 9, the synthetic samples can
|
| 443 |
+
|
| 444 |
+

|
| 445 |
+
Figure 9: The examples of multi-modal in-context image synthesis.
|
| 446 |
+
|
| 447 |
+
fully reflect the semantics of input multi-modal context, which contributes to the diversified editing of the input image through the multi-modal control.
|
| 448 |
+
|
| 449 |
+
Multi-modal Understanding We also visualize some multi-modal understanding examples in Figure 13. As observed, LaVIT is capable of understanding the visual content, generating concise textual captions to depict the image, and answering diverse questions about detailed visual clues.
|
| 450 |
+
|
| 451 |
+
# D PRE-TRAINING DETAILS
|
| 452 |
+
|
| 453 |
+
The detailed training hyper-parameter settings are reported in Table 9.
|
| 454 |
+
|
| 455 |
+
# E LIMITATIONS
|
| 456 |
+
|
| 457 |
+
Since LaVIT is based on the Large Language Model, it inherits LLM's original language hallucination limitations, e.g., generating some nonexistent knowledge and making some factual errors. Besides, LaVIT is trained only on web-scale image-text pairs, wherein the text descriptions are noisy and short, thereby rendering LaVIT insufficient for effectively modeling extensive text-image correspondences. We believe this limitation can be alleviated when leveraging more high-quality and long image-text interleaved documents.
|
| 458 |
+
|
| 459 |
+

|
| 460 |
+
A small cactus wearing a straw hat and neon sunglasses in the Sahara desert.
|
| 461 |
+
|
| 462 |
+

|
| 463 |
+
|
| 464 |
+

|
| 465 |
+
|
| 466 |
+

|
| 467 |
+
|
| 468 |
+

|
| 469 |
+
A high contrast photo of panda dressed as an astronaut sits at a table in a photorealistic style
|
| 470 |
+
|
| 471 |
+

|
| 472 |
+
|
| 473 |
+

|
| 474 |
+
|
| 475 |
+

|
| 476 |
+
|
| 477 |
+

|
| 478 |
+
A lovely dog is reading a thick book
|
| 479 |
+
|
| 480 |
+

|
| 481 |
+
|
| 482 |
+

|
| 483 |
+
Downtown Shanghai at sunrise. Detailed ink wash.
|
| 484 |
+
|
| 485 |
+

|
| 486 |
+
|
| 487 |
+

|
| 488 |
+
A transparent sculpture of a duck made out of glass. The sculpture is in front of a painting of a landscape
|
| 489 |
+
|
| 490 |
+

|
| 491 |
+
|
| 492 |
+

|
| 493 |
+
|
| 494 |
+

|
| 495 |
+
|
| 496 |
+

|
| 497 |
+
A high contrast photo of an astronaut riding a horse in the forest.
|
| 498 |
+
|
| 499 |
+

|
| 500 |
+
|
| 501 |
+

|
| 502 |
+
|
| 503 |
+

|
| 504 |
+
|
| 505 |
+

|
| 506 |
+
a super math wizard cat, richly textured oil painting
|
| 507 |
+
Figure 10: The examples of text-to-image synthesis.
|
| 508 |
+
|
| 509 |
+

|
| 510 |
+
|
| 511 |
+

|
| 512 |
+
|
| 513 |
+

|
| 514 |
+
|
| 515 |
+

|
| 516 |
+
A heavy metal tiger standing on a rooftop while singing on an electric guitar under a spotlight.
|
| 517 |
+
|
| 518 |
+

|
| 519 |
+
|
| 520 |
+

|
| 521 |
+
a bird wearing headphones and speaking into a high-end microphone in a recording studio.
|
| 522 |
+
|
| 523 |
+

|
| 524 |
+
|
| 525 |
+

|
| 526 |
+
A section of the Great Wall in the mountains. detailed charcoal sketch
|
| 527 |
+
|
| 528 |
+

|
| 529 |
+
|
| 530 |
+

|
| 531 |
+
Taj Mahal with its reflection. detailed charcoal sketch.
|
| 532 |
+
|
| 533 |
+

|
| 534 |
+
|
| 535 |
+

|
| 536 |
+
A blue jay standing on a large basket of rainbow macarons.
|
| 537 |
+
|
| 538 |
+

|
| 539 |
+
|
| 540 |
+

|
| 541 |
+
a cat drinking a pint of beer, DSLR photo, art station, octane rendering
|
| 542 |
+
|
| 543 |
+

|
| 544 |
+
|
| 545 |
+

|
| 546 |
+
A richly textured oil painting of a young badger delicately sniffing a yellow rose next to a tree trunk. A small waterfall can be seen in the background.
|
| 547 |
+
|
| 548 |
+

|
| 549 |
+
|
| 550 |
+

|
| 551 |
+
|
| 552 |
+

|
| 553 |
+
|
| 554 |
+

|
| 555 |
+
a light bulb with a ballerina in it
|
| 556 |
+
|
| 557 |
+

|
| 558 |
+
Cute adorable little goat, unreal engine, cozy interior lighting, art station, detailed digital painting
|
| 559 |
+
|
| 560 |
+

|
| 561 |
+
|
| 562 |
+

|
| 563 |
+
|
| 564 |
+

|
| 565 |
+
A painting of two rabbits in the style of American Gothic, wearing the same clothes as in the original
|
| 566 |
+
Figure 11: The examples of text-to-image synthesis.
|
| 567 |
+
|
| 568 |
+

|
| 569 |
+
|
| 570 |
+

|
| 571 |
+
|
| 572 |
+

|
| 573 |
+
|
| 574 |
+

|
| 575 |
+
|
| 576 |
+

|
| 577 |
+
In the snow
|
| 578 |
+
|
| 579 |
+

|
| 580 |
+
On top of a purple rug
|
| 581 |
+
|
| 582 |
+

|
| 583 |
+
|
| 584 |
+

|
| 585 |
+
|
| 586 |
+

|
| 587 |
+
Wearing a yellow shirt
|
| 588 |
+
|
| 589 |
+

|
| 590 |
+
In a chief outfit
|
| 591 |
+
Wearing a black hat
|
| 592 |
+
|
| 593 |
+

|
| 594 |
+
Wearing a Santa hat
|
| 595 |
+
|
| 596 |
+

|
| 597 |
+
|
| 598 |
+

|
| 599 |
+
|
| 600 |
+

|
| 601 |
+
|
| 602 |
+

|
| 603 |
+
|
| 604 |
+

|
| 605 |
+
In a chief outfit
|
| 606 |
+
|
| 607 |
+

|
| 608 |
+
In the snow
|
| 609 |
+
|
| 610 |
+

|
| 611 |
+
In the snow
|
| 612 |
+
On the beach
|
| 613 |
+
|
| 614 |
+

|
| 615 |
+
On top of a purple rug
|
| 616 |
+
With a city in the background
|
| 617 |
+
|
| 618 |
+

|
| 619 |
+
On the beach
|
| 620 |
+
|
| 621 |
+

|
| 622 |
+
Holding a Santa hat
|
| 623 |
+
|
| 624 |
+

|
| 625 |
+
|
| 626 |
+

|
| 627 |
+
|
| 628 |
+

|
| 629 |
+
On top of a wooden floor On top of a purple rug
|
| 630 |
+
|
| 631 |
+
or On top of a purple rug
|
| 632 |
+
|
| 633 |
+

|
| 634 |
+
|
| 635 |
+

|
| 636 |
+
In a chief outfit
|
| 637 |
+
|
| 638 |
+

|
| 639 |
+
In a ploice outfit
|
| 640 |
+
|
| 641 |
+

|
| 642 |
+
Wearing a black hat
|
| 643 |
+
|
| 644 |
+

|
| 645 |
+
Wearing a Santa hat
|
| 646 |
+
|
| 647 |
+

|
| 648 |
+
Image caption
|
| 649 |
+
a siamese cat is playing with a banana peel
|
| 650 |
+
|
| 651 |
+

|
| 652 |
+
two boys are playingbaseball on a field
|
| 653 |
+
|
| 654 |
+

|
| 655 |
+
Figure 12: The examples of image synthesis with multi-modal prompt.
|
| 656 |
+
a woman sitting on the back of a boat in the water
|
| 657 |
+
|
| 658 |
+

|
| 659 |
+
a dog is carrying a purple frisbee in its mouth
|
| 660 |
+
|
| 661 |
+

|
| 662 |
+
Visual QA
|
| 663 |
+
Q: How many zebras in this image? A: Three
|
| 664 |
+
Figure 13: The qualitative evaluation examples on model's multi-modal understanding performance.
|
| 665 |
+
|
| 666 |
+

|
| 667 |
+
Q: What are they doing in this image?
|
| 668 |
+
A: Skiing and competing.
|
| 669 |
+
|
| 670 |
+

|
| 671 |
+
Q: Where is the car?
|
| 672 |
+
A: On the side of a road next to a sign.
|
| 673 |
+
|
| 674 |
+

|
| 675 |
+
Q: What is in the middle of the image?
|
| 676 |
+
A: Toilet
|
unifiedlanguagevisionpretraininginllmwithdynamicdiscretevisualtokenization/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5320ed65cee872a16f4799696f46f9fd1cb69c664b950859f49c27b85f67e644
|
| 3 |
+
size 1839565
|
unifiedlanguagevisionpretraininginllmwithdynamicdiscretevisualtokenization/layout.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1f852a607debc4b79ca53ed026812a8371d6f2677aad260a8818f685340a93d6
|
| 3 |
+
size 811123
|
unifiedprojectionfreealgorithmsforadversarialdrsubmodularoptimization/9ef5d652-2abd-437a-93da-3bb07e2e7482_content_list.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0508633a38ed5e6b14e0883ce3961c3de9805c6552acc54f63537174e2b131fc
|
| 3 |
+
size 224369
|
unifiedprojectionfreealgorithmsforadversarialdrsubmodularoptimization/9ef5d652-2abd-437a-93da-3bb07e2e7482_model.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d89cc93653f321dc5b60685a7968eedde88858be199255de365260972727a930
|
| 3 |
+
size 255970
|
unifiedprojectionfreealgorithmsforadversarialdrsubmodularoptimization/9ef5d652-2abd-437a-93da-3bb07e2e7482_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9859e5539e4b50b67f47508c9302fd8ce2da97903dd979aefbd24334d3076b28
|
| 3 |
+
size 945108
|
unifiedprojectionfreealgorithmsforadversarialdrsubmodularoptimization/full.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
unifiedprojectionfreealgorithmsforadversarialdrsubmodularoptimization/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2f555ad3a9e812871dc40f39fdb9326809d27174c22df46eeda0fc7393f75872
|
| 3 |
+
size 1612178
|
unifiedprojectionfreealgorithmsforadversarialdrsubmodularoptimization/layout.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2eb7ee4dc749346a7f3fe402c5cb3e535dec3b166e43378841b0cb3d2705482a
|
| 3 |
+
size 1442273
|
unifyingfeatureandcostaggregationwithtransformersforsemanticandvisualcorrespondence/cb3ab669-8313-4e26-82ed-a443e14a633c_content_list.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e1a691f02060d0379e2f0067f5d29a04e931a2bff16ab7563a82d1d47bf71350
|
| 3 |
+
size 93906
|
unifyingfeatureandcostaggregationwithtransformersforsemanticandvisualcorrespondence/cb3ab669-8313-4e26-82ed-a443e14a633c_model.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:221daf0d752e028a052796d597b562f2b133f0b51136df669d904bfa86abd7fd
|
| 3 |
+
size 118717
|
unifyingfeatureandcostaggregationwithtransformersforsemanticandvisualcorrespondence/cb3ab669-8313-4e26-82ed-a443e14a633c_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f33540095bfbee333c9819a1942492d1d8e80601d3c6f289903471170790c73b
|
| 3 |
+
size 3527371
|
unifyingfeatureandcostaggregationwithtransformersforsemanticandvisualcorrespondence/full.md
ADDED
|
@@ -0,0 +1,369 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# UNIFYING FEATURE AND COST AGGREGATION WITH TRANSFORMERS FOR SEMANTIC AND VISUAL CORRESPONDENCE
|
| 2 |
+
|
| 3 |
+
Sunghwan Hong*, Seokju Cho*, Seungryong Kim††
|
| 4 |
+
|
| 5 |
+
Korea University
|
| 6 |
+
|
| 7 |
+
{sung_hwan,seokju_cho,seungryong_kim}@korea.ac.kr
|
| 8 |
+
|
| 9 |
+
# Stephen Lin
|
| 10 |
+
|
| 11 |
+
Microsoft Research Asia
|
| 12 |
+
|
| 13 |
+
stevelin@microsoft.com
|
| 14 |
+
|
| 15 |
+
# ABSTRACT
|
| 16 |
+
|
| 17 |
+
This paper introduces a Transformer-based integrative feature and cost aggregation network designed for dense matching tasks. In the context of dense matching, many works benefit from one of two forms of aggregation: feature aggregation, which pertains to the alignment of similar features, or cost aggregation, a procedure aimed at instilling coherence in the flow estimates across neighboring pixels. In this work, we first show that feature aggregation and cost aggregation exhibit distinct characteristics and reveal the potential for substantial benefits stemming from the judicious use of both aggregation processes. We then introduce a simple yet effective architecture that harnesses self- and cross-attention mechanisms to show that our approach unifies feature aggregation and cost aggregation and effectively harnesses the strengths of both techniques. Within the proposed attention layers, the features and cost volume both complement each other, and the attention layers are interleaved through a coarse-to-fine design to further promote accurate correspondence estimation. Finally at inference, our network produces multi-scale predictions, computes their confidence scores, and selects the most confident flow for final prediction. Our framework is evaluated on standard benchmarks for semantic matching, and also applied to geometric matching, where we show that our approach achieves significant improvements compared to existing methods.
|
| 18 |
+
|
| 19 |
+
# 1 INTRODUCTION
|
| 20 |
+
|
| 21 |
+
Finding visual correspondences between images is a central problem in computer vision, with numerous applications including simultaneous localization and mapping (SLAM) (Bailey & Durrant-Whyte, 2006), augmented reality (AR) (Peebles et al., 2021), and structure from motion (SfM) (Schonberger & Frahm, 2016). Given visually or semantically similar images, sparse correspondence approaches (Lowe, 2004) first detect a set of sparse points and extract corresponding descriptors to find matches across them. In contrast, dense correspondence (Philbin et al., 2007) aims at finding matches for all pixels. Dense correspondence approaches typically follow the classical matching pipeline of feature extraction and aggregation, cost aggregation, and flow estimation (Scharstein & Szeliski, 2002; Philbin et al., 2007).
|
| 22 |
+
|
| 23 |
+
Much recent correspondence research (Sarlin et al., 2020; Sun et al., 2021; Jiang et al., 2021; Xu et al., 2021; Li et al., 2021; Cho et al., 2021; Min et al., 2021a; Huang et al., 2022b; Cho et al., 2022a) have utilized a means to benefit from either feature aggregation or cost aggregation. Feature aggregation, as illustrated in Fig. 1 (a), is a process that aims to not only integrate self-similar features within an image but also align similar features between the two images for matching. The advantages of feature aggregation have been made particularly evident in several attention- and
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
(a) Feature Aggregation
|
| 27 |
+
|
| 28 |
+

|
| 29 |
+
(b) Cost Aggregation
|
| 30 |
+
|
| 31 |
+

|
| 32 |
+
(c) Integrative Aggregation (Ours)
|
| 33 |
+
Figure 1: Intuition of the proposed method: (a) feature aggregation methods that aggregate feature descriptors, (b) cost aggregation methods that aggregate a cost volume, and (c) our integrative feature and cost aggregation method, which jointly performs both aggregations to find highly accurate correspondences.
|
| 34 |
+
|
| 35 |
+
Transformer-based matching networks (Vaswani et al., 2017; Sarlin et al., 2020; Sun et al., 2021; Xu et al., 2021; Jiang et al., 2021). Their accuracy in matching can be attributed to, as we show in Fig. 2 (e-f) and supported by previous studies (Sun et al., 2021; Amir et al., 2021), the learned position-dependent semantic features. While the visualization exhibits consistency among parts with the same semantics, dense matching often requires features with even greater discriminative power for more robust pixel-wise correspondence estimation, which is typically challenged by repetitive patterns and background clutters.
|
| 36 |
+
|
| 37 |
+
To compensate for, on the other hand, cost aggregation, as illustrated in Fig. 1 (b), has been adopted by numerous works (Rocco et al., 2018; Min et al., 2021b; Cho et al., 2021; Huang et al., 2022b; Cho et al., 2022a) for its favorable generalization ability (Song et al., 2021; Liu et al., 2022) and robustness to repetitive patterns and background clutter, which can be attributed to the matching similarities encoded in the cost volumes. These works can leverage the matching similarities to enforce smoothness and coherence in the disparity or flow estimates across neighboring pixels. However, it is important to note that, as highlighted in Fig. 3 (c-h), cost volumes often lack semantic context and exhibit relatively less consideration of spatial structure. This disparity arises due to the fact that the information encapsulated within cost volumes is established on the basis of pixel pairs, which could potentially lead to challenges in scenarios where such contextual cues play a pivotal role.
|
| 38 |
+
|
| 39 |
+
In this paper, we tackle the dense correspondence task by first performing a thorough exploration of feature aggregation and cost aggregation and their distinct characteristics. We then propose a simple yet effective architecture that can benefit from the potential advantages stemming from a more judicious use of both aggregation processes. The proposed architecture is a Transformer-based aggregation network, namely Unified Feature and Cost Aggregation Transformers (UFC), that models an integrative aggregation of feature descriptors and the cost volume, as illustrated in Fig. 1 (c).
|
| 40 |
+
|
| 41 |
+
This network consists of two stages, the first of which employs a self-attention layer to aggregate the descriptors and cost volume jointly. In this stage, the descriptors can help to disambiguate the noisy cost volume similarly to cost volume filtering (Hosni et al., 2012; Sun et al., 2018), and the cost volume can encourage the features to account for matching probabilities as an additional factor for alignment. For the subsequent step, we design a cross-attention layer that enables further aggregation aided by the outputs from earlier aggregations. This aggregated cost volume can guide the alignment with its sharpened matching distribution. These attention layers are interleaved. We further propose hierarchical processing to enhance the benefits one aggregation gains from the other. Finally, at inference time, our method estimates multi-scale predictions and their confidence scores to recover highly accurate flow.
|
| 42 |
+
|
| 43 |
+
We first evaluate the proposed method on the tasks of semantic matching and subsequently, we also substantiate that our framework achieves appreciable performance when applied to geometric matching. Our framework clearly outperforms prior works on all the major dense matching benchmarks, including HPatches (Balntas et al., 2017), ETH3D (Schops et al., 2017), SPair-71k (Min et al., 2019b), PF-PASCAL (Ham et al., 2017) and PF-WILLOW (Ham et al., 2016). We provide extensive ablation and analysis to validate our design choices.
|
| 44 |
+
|
| 45 |
+
# 2 RELATED WORK
|
| 46 |
+
|
| 47 |
+
Feature Extraction and Aggregation. Feature extraction involves detecting interest points and extracting the descriptors of the corresponding points. In traditional methods (Liu et al., 2010; Bay et al., 2006; Dalal & Triggs, 2005; Tola et al., 2009), the matching performance mostly relies on the quality of the feature detection and description methods, and outlier rejection across matched points is typically determined by RANSAC (Fischler & Bolles, 1981).
|
| 48 |
+
|
| 49 |
+
Learning-based feature extraction methods (DeTone et al., 2018; Ono et al., 2018; Dusmanu et al., 2019; Revaud et al., 2019) obtain dense deep features tailored for matching. These works have demonstrated that the quality of feature descriptors contributes substantially to matching performance. In accordance with this, recent matching networks (Sarlin et al., 2020; Min et al., 2019a; Lee et al., 2019; Hong & Kim, 2021; Min et al., 2020; Jiang et al., 2021; Sun et al., 2021; Xu et al., 2021) proposed effective means for feature aggregation. Notable sparse correspondence works include SuperGlue (Sarlin et al., 2020) and LOFTR (Sun et al., 2021), which employ graph- or Transformer-based self- and cross-attention for aggregation. Other methods are PUMP (Revaud et al., 2022) and ECO-TR (Tan et al., 2022), which are follow-up works of COTR (Jiang et al., 2021). These methods evaluate on dense correspondence benchmarks in a different way from previous works, using only the sparse and quasi-dense correspondences above certain confidence levels. We refer the readers to the supplementary material for a detailed discussion.
|
| 50 |
+
|
| 51 |
+
For dense correspondence, SFNet (Lee et al., 2019) and DMP (Hong & Kim, 2021) introduce adaptation layers after feature extraction to learn feature maps well-suited to matching and are evaluated on dense semantic and geometric matching. DKM (Edstedt et al., 2023) adopts Gaussian Processing Kernels for dense correspondence, and it demonstrates its effectiveness in pose estimation. In optical flow, GMFlow (Xu et al., 2021) leverages Transformer for feature aggregation, and its extension Xu et al. (2023) applies the method to stereo matching and depth estimation. In semantic correspondence, notable works include SCorrSAN (Huang et al., 2022a) proposes an efficient spatial context encoder to aggregate spatial context and feature descriptors, and MMNet Zhao et al. (2021) proposes a multi-scale matching network to learn discriminative pixel-level features.
|
| 52 |
+
|
| 53 |
+
Cost Aggregation. In the dense correspondence literature, many works have designed their architectures for effective cost aggregation, which brings strong generalization power (Song et al., 2021; Liu et al., 2022). Recent works (Truong et al., 2020b; Hong & Kim, 2021; Jeon et al., 2020; Truong et al., 2021) use 2D convolutions to establish correspondence while aggregating the cost volume with learnable kernels, while some works (Min et al., 2019a; 2020; Liu et al., 2020) utilize handcrafted methods, which include RHM (Cho et al., 2015) and the OT solver (Sinkhorn, 1967). NC-Net (Rocco et al., 2018) was the first to propose 4D convolutions for cost aggregation, and numerous works (Li et al., 2020; Yang & Ramanan, 2019; Huang et al., 2019; Rocco et al., 2020; Min et al., 2021a;b) leveraged or extended 4D convolutions.
|
| 54 |
+
|
| 55 |
+
Among Transformer-based networks, CATs (Cho et al., 2021) recently proposed to use Transformer (Vaswani et al., 2017) for cost aggregation, and its extension $\mathrm{CATs}++$ (Cho et al., 2022a) combined convolutions and Transformer for an enhanced cost aggregation. VAT (Hong et al., 2022a) proposed 4D convolutional Swin transformer for cost aggregation that benefits from better generalization power and showed its effectiveness for semantic correspondence. NeMF (Hong et al., 2022b) incorporates an implicit neural representation into semantic correspondence and implicitly represents the cost volume to infer correspondences defined at arbitrary resolution. FlowFormer (Huang et al., 2022b) and STTR (Li et al., 2021) are Transformer-based cost aggregation networks specifically designed for optical flow or stereo matching.
|
| 56 |
+
|
| 57 |
+
# 3 FEATURE AND COST AGGREGATION
|
| 58 |
+
|
| 59 |
+
In this section, we examine the characteristics of feature and cost aggregation, which will later be verified empirically in Section 5.3. Fig. 2 and Fig. 3 present visualizations of feature maps and cost volumes at different stages of aggregation. Although there may be different types of aggregations, throughout this work, we focus on attention-based aggregations. From the visualizations, the following observations can be made.
|
| 60 |
+
|
| 61 |
+
The information encoded by features and cost volumes differ. Feature aggregation and cost aggregation thus exploit different information, which is exemplified in Fig. 2 (c-d) and Fig. 3 (c-e).
|
| 62 |
+
|
| 63 |
+

|
| 64 |
+
|
| 65 |
+

|
| 66 |
+
(a)
|
| 67 |
+
|
| 68 |
+

|
| 69 |
+
|
| 70 |
+

|
| 71 |
+
(b)
|
| 72 |
+
|
| 73 |
+

|
| 74 |
+
|
| 75 |
+

|
| 76 |
+
(c)
|
| 77 |
+
|
| 78 |
+

|
| 79 |
+
|
| 80 |
+

|
| 81 |
+
(d)
|
| 82 |
+
Figure 2: PCA visualizations of feature maps: (a-b) source and target images. (c-d) raw feature maps. (e-f) feature maps that have undergone feature aggregation. (g-h) feature maps that have undergone integrative aggregation. Our integrative aggregation methodology enables the acquisition of more discerning feature representations while preserving both semantic and spatial structural aspects, resulting in the estimation of highly accurate correspondences.
|
| 83 |
+
|
| 84 |
+

|
| 85 |
+
|
| 86 |
+

|
| 87 |
+
(e)
|
| 88 |
+
|
| 89 |
+

|
| 90 |
+
|
| 91 |
+

|
| 92 |
+
(f)
|
| 93 |
+
|
| 94 |
+

|
| 95 |
+
|
| 96 |
+

|
| 97 |
+
(g)
|
| 98 |
+
|
| 99 |
+

|
| 100 |
+
|
| 101 |
+

|
| 102 |
+
(h)
|
| 103 |
+
|
| 104 |
+

|
| 105 |
+
|
| 106 |
+

|
| 107 |
+
(a)
|
| 108 |
+
Figure 3: Visualizations of cost volumes: (a-b) source and target images. (c-e) 2D slices of raw cost volumes at different levels $l$ . (f) cost volumes constructed using feature maps that have undergone self-attention. (g) with feature maps that have undergone both self-attention and cross-attention, and (h) the cost volume that have undergone cost aggregation. From (c-e), the noises are suppressed in (h), while (f-g) shows aggregated features help to construct less noisy cost volumes. Note that the visualizations are obtained with respect to the circled point in the target image.
|
| 109 |
+
|
| 110 |
+

|
| 111 |
+
|
| 112 |
+

|
| 113 |
+
(b)
|
| 114 |
+
|
| 115 |
+

|
| 116 |
+
|
| 117 |
+

|
| 118 |
+
(c)
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
|
| 122 |
+

|
| 123 |
+
(d)
|
| 124 |
+
|
| 125 |
+

|
| 126 |
+
|
| 127 |
+

|
| 128 |
+
(e)
|
| 129 |
+
|
| 130 |
+

|
| 131 |
+
|
| 132 |
+

|
| 133 |
+
(f)
|
| 134 |
+
|
| 135 |
+

|
| 136 |
+
|
| 137 |
+

|
| 138 |
+
(g)
|
| 139 |
+
|
| 140 |
+

|
| 141 |
+
|
| 142 |
+

|
| 143 |
+
(h)
|
| 144 |
+
|
| 145 |
+
where the spatial structure is preserved in the features while sparse spatial locations with higher similarity to the query point is highlighted in the cost volume. Due to the different information encoded in their inputs, the outputs of both aggregations have different characteristics. In Fig. 2, compared to raw features in (c-d), the feature aggregation in (e-f) makes the features of semantic parts, e.g., legs/claws and head, more consistent between the two birds. This is in agreement with observations in previous studies (Amir et al., 2021; Sun et al., 2021). On the other hand, compared to noisy cost volumes visualized in Fig. 3 (c-e), the aggregated cost volume in (h) is less noisy and more clearly highlights the most probable region for matching while less probable regions are suppressed. We additionally observe that each type of aggregation can have apparent effects on the other. Naturally, more robust descriptors can construct a less noisy cost volume as shown in Fig. 3 (f-g), and ease the subsequent cost aggregation process to promote more accurate correspondences. However, without a special model design, cost aggregation would not affect feature aggregation since it is performed after feature aggregation. Motivated by this, we proposed integrative aggregation, and its effects on feature maps are shown in Fig. 2 (g-h), where salient features become more distinguishable from each other, i.e., the left and right claws. This exemplifies that more discriminative feature representations that are more focused and that also preserve semantics and spatial structure can be learned and reveals that potential benefits from their integration can be realized.
|
| 146 |
+
|
| 147 |
+
From these observations, we propose in the following a simple yet effective architecture that makes prudent use of both feature and cost aggregation.
|
| 148 |
+
|
| 149 |
+

|
| 150 |
+
(a) Integrative self-attention
|
| 151 |
+
|
| 152 |
+

|
| 153 |
+
(b) Cross-attention with matching distribution
|
| 154 |
+
Figure 4: Illustration of the proposed self- and cross-attention: (a) joint feature aggregation and cost aggregation, and (b) cross-attention layer with matching distribution.
|
| 155 |
+
|
| 156 |
+
# 4 METHODOLOGY
|
| 157 |
+
|
| 158 |
+
# 4.1 PROBLEM FORMULATION
|
| 159 |
+
|
| 160 |
+
Let us first denote a pair of visually or semantically similar images, i.e., the source and target, as $I_{s}$ and $I_{t}$ , the feature descriptors extracted from $I_{s}$ and $I_{t}$ as $D_{s}$ and $D_{t}$ , respectively, and the cost volume computed between the feature maps as $C$ . Given $I_{s}$ and $I_{t}$ , we aim to establish a dense correspondence field $F(i)$ that is defined at all pixels $i$ and warps $I_{s}$ towards $I_{t}$ . Given features extracted from deep CNNs (He et al., 2016) or Transformers (Dosovitskiy et al., 2020), we can construct and store a cost volume that consists of all pairwise feature similarities $C \in \mathbb{R}^{h \times w \times h \times w}$ with height $h$ and width $w$ : $C(i,j) = D_s(i) \cdot D_t(j)$ , where $i$ and $j$ index the source and target features, respectively. The dense correspondence field, $F(i)$ , can then be determined from $C(i,j)$ considering all $j$ .
|
| 161 |
+
|
| 162 |
+
# 4.2 PRELIMINARIES: SELF- AND CROSS-ATTENTION
|
| 163 |
+
|
| 164 |
+
We briefly explain the attention mechanism, a core component we extend from. Given a sequence of tokens as an input, Transformer (Vaswani et al., 2017) first linearly projects tokens to obtain query, key and value embeddings. These are then fed into a scaled dot product attention layer, followed by Layer Normalization (LN) (Ba et al., 2016) and a feed-forward network or MLP, to produce an output with the same shape as the input. Each token is attended to by all the other tokens. This projections are formulated as:
|
| 165 |
+
|
| 166 |
+
$$
|
| 167 |
+
Q = \mathcal {P} _ {Q} (X), \quad K = \mathcal {P} _ {K} (X), \quad V = \mathcal {P} _ {V} (X), \tag {1}
|
| 168 |
+
$$
|
| 169 |
+
|
| 170 |
+
where $\mathcal{P}_Q, \mathcal{P}_K$ and $\mathcal{P}_V$ denote query, key and value projections, respectively, and $X$ denotes a token with a positional embedding. Subsequently, they pass through an attention layer:
|
| 171 |
+
|
| 172 |
+
$$
|
| 173 |
+
\operatorname {A t t e n t i o n} (X) = \operatorname {s o f t m a x} \left(\frac {Q K ^ {T}}{\sqrt {d _ {K}}}\right) V, \tag {2}
|
| 174 |
+
$$
|
| 175 |
+
|
| 176 |
+
where $d_{K}$ is the dimension of the key embedding. Note that the Attention(·) function can be defined in various ways (Wang et al., 2020; Liu et al., 2021; Katharopoulos et al., 2020; Lu et al., 2021; Wu et al., 2021). Self- and cross-attention are distinguished by their input to the key and value projections. Given a pair of input tokens, e.g., $X_{s}$ and $X_{t}$ , the input to the key and value projections of self-attention for $X_{s}$ is the same input, $X_{s}$ , but for cross-attention across $X_{s}$ and $X_{t}$ , the inputs to the key and value projection are $X_{t}$ .
|
| 177 |
+
|
| 178 |
+
# 4.3 UNIFIED FEATURE AND COST AGGREGATION
|
| 179 |
+
|
| 180 |
+
Integrative Self-Attention. Toward more judicious use of both aggregations, we first leverage the fact that both feature descriptors $D_{s}$ , $D_{t}$ and cost volume $C$ encode different information. To this end, in the proposed integrative self-attention layer, as shown in Fig. 4, we first obtain a feature cost volume $[D,C]$ by concatenating $D$ and $C$ , where $[\cdot ,\cdot ]$ denotes concatenation.
|
| 181 |
+
|
| 182 |
+
This concatenation brings benefits from two perspectives. From the cost aggregation point of view, the feature map of the feature cost volume can disambiguate the initial noisy cost volume by referring to semantic-aware features as demonstrated in the stereo matching literature (Yoon & Kweon, 2006; Hosni et al., 2012; He et al., 2011), i.e., cost volume filtering. From the feature aggregation point of view, the cost volume explicitly represents the similarity of features in one image with respect to the features in the other, and accounting for it drives the features in each image to become more compatible with those of the other. As the iterations unfold, this process will encourage both aggregations to benefit each other. In the end, the resultant feature representations will be more robust and discriminative as shown in Fig. 2 (g-h).
|
| 183 |
+
|
| 184 |
+
To compute self-attention, we take a different approach from other works (Sun et al., 2021; Cho et al., 2021) to define the query, key and value embeddings. Concretely, we define two independent value embeddings, specifically one for feature projection and the other for cost volume projection. Formally, we define the query, key and values as:
|
| 185 |
+
|
| 186 |
+
$$
|
| 187 |
+
\begin{array}{l} Q = \mathcal {P} _ {Q} ([ D, C ]), \quad K = \mathcal {P} _ {K} ([ D, C ]), \\ V _ {D} = \mathcal {P} _ {V _ {D}} (D), \quad V _ {C} = \mathcal {P} _ {V _ {C}} (C), \end{array} \tag {3}
|
| 188 |
+
$$
|
| 189 |
+
|
| 190 |
+
where $V_{D}$ and $V_{C}$ denote the value embeddings of feature descriptors and the cost volume, respectively. After computing an attention map by applying softmax over the query and key dot product, we use it to aggregate feature $D$ and cost volume $C$ with $V_{D}$ and $V_{C}$ using Eq. 2 as follows:
|
| 191 |
+
|
| 192 |
+
$$
|
| 193 |
+
\operatorname {A t t e n t i o n} _ {\text {s e l f - D}} (C, D) = \operatorname {s o f t m a x} \left(\frac {Q K ^ {T}}{\sqrt {d _ {K}}}\right) V _ {D}, \tag {4}
|
| 194 |
+
$$
|
| 195 |
+
|
| 196 |
+
$$
|
| 197 |
+
\mathrm {A t t e n t i o n} _ {\mathrm {s e l f - C}} (C, D) = \mathrm {s o f t m a x} (\frac {Q K ^ {T}}{\sqrt {d _ {K}}}) V _ {C}.
|
| 198 |
+
$$
|
| 199 |
+
|
| 200 |
+
Note that any type of attention computation can be utilized, i.e., additive (Bahdanau et al., 2014) or dot product (Vaswani et al., 2017), while in practice we use the linear kernel dot product with the associative property of matrix products (Katharopoulos et al., 2020). The outputs of this self-attention are denoted as $D_s', D_t'$ , and $C'$ .
|
| 201 |
+
|
| 202 |
+
Cross-Attention with Matching Distribution. In the proposed cross-attention layer, the aggregated features and cost volume are explicitly used for further aggregation, and we condition both feature descriptors on both input images via this layer. By exploiting the outputs of the self-attention layer, the cross-attention layer performs cross-attention between feature descriptors for further feature aggregation using the improved feature descriptors $D_s'$ , $D_t'$ and enhanced cost volume $C'$ from earlier aggregations.
|
| 203 |
+
|
| 204 |
+
As shown in Fig. 4, we first apply convolution to the input cost volume and treat the output as a cross-attention map, since applying a softmax function over the cost volume is tantamount to obtaining an attention map. In this way, an enhanced aggregation is enabled, as the input cost volume is transformed to represent a sharpened matching distribution. With a cross-attention map and value for the attention score defined as $QK^{T} = C'$ and $V_{D'} = \mathcal{P}_{V_D}(D')$ , respectively, the subsequent attention process for cross-attention is then defined as follows:
|
| 205 |
+
|
| 206 |
+
$$
|
| 207 |
+
\operatorname {A t t e n t i o n} _ {\text {c r o s s}} \left(C ^ {\prime}, D ^ {\prime}\right) = \operatorname {s o f t m a x} \left(\frac {C ^ {\prime}}{\sqrt {d _ {K}}}\right) V _ {D ^ {\prime}}. \tag {5}
|
| 208 |
+
$$
|
| 209 |
+
|
| 210 |
+
The outputs of this cross-attention are denoted as $D_s''$ and $D_t''$ , and $C''$ is constructed using $D_s''$ and $D_t''$ . The proposed attention layers are interleaved, and they are stacked $N$ times to facilitate the aggregations and increase the model capacity.
|
| 211 |
+
|
| 212 |
+
# 4.4 COARSE-TO-FINE FORMULATION
|
| 213 |
+
|
| 214 |
+
To improve the robustness of fine-scale estimates and enhance the benefits one aggregation gains from the other, we extend our architecture to a coarse-to-fine approach through pyramidal processing, as done in (Jeon et al., 2018; Melekhov et al., 2019; Truong et al., 2020b; Hong & Kim, 2021).
|
| 215 |
+
|
| 216 |
+

|
| 217 |
+
Figure 5: Overall architecture of the proposed method. Given feature maps $D_{s}$ and $D_{t}$ and the cost volume $C$ as inputs, our method employs self- and cross-attention specifically designed to conduct joint feature aggregation and cost aggregation in a coarse-to-fine manner.
|
| 218 |
+
|
| 219 |
+
We first use a coarse pair of refined feature maps and aggregated cost volume, and similar to (Zhao et al., 2021) that learns complementary correspondence by adding the cost volume of the previous scale, we progressively learn complementary descriptors and correspondences and encourage the coarser outputs to enhance the subsequent aggregations.
|
| 220 |
+
|
| 221 |
+
Formally, given the outputs of the attention block at each level, $D_{s}^{\prime \prime ,l}, D_{t}^{\prime \prime ,l}$ and $C^{\prime \prime ,l}$ , where $l$ denotes the $l$ -th level, we upsample the aggregated features using bilinear interpolation and add them to the raw feature descriptors extracted from $I_{s}$ and $I_{t}$ defined at the next level: $D_{s}^{l + 1} = D_{s}^{l + 1} + \mathrm{up}(D_{s}^{\prime \prime ,l})$ where $D_{t}^{l + 1}$ is defined similarly. Note that we let the output cost volumes of self- and cross-attention at each level, $C^{\prime ,l}$ and $C^{\prime \prime ,l}$ , undergo convolution and residual connections, i.e., $C^{\prime \prime ,l} = C^{\prime ,l} + \mathrm{Conv4d}(C^{\prime \prime ,l})$ , to facilitate the training process. Then, we define the next-level cost volume as $C^{l + 1} = C^{l + 1} + C^{\prime \prime ,l}$ .
|
| 222 |
+
|
| 223 |
+
Finally, given the features $D_s''$ and $D_t''$ at each level, we compute the cost volume, and the sum of all cost volumes across all levels are added up to obtain the final output $C^*$ that is used to estimate the final flow field, as shown in the bottom of Fig. 5. We empirically find that increasing $N$ and $l$ appreciably boosts correspondence performance. However, there also exists a speed-accuracy trade-off of choosing $N$ and $l$ , for which we provide an analysis in the supplementary material.
|
| 224 |
+
|
| 225 |
+
# 4.5 INFERENCE: DENSE ZOOM-IN
|
| 226 |
+
|
| 227 |
+
At the inference phase, we leverage multi-scale predictions to predict highly accurate correspondences. The goals of this approach are two-fold: to prevent a large memory increase when processing high-resolution input image pairs, e.g., HD or Full HD, and to capture possible fine-grained correspondences missed by the coarse-to-fine design.
|
| 228 |
+
|
| 229 |
+
Dense zoom-in consists of three stages. For the first stage, UFC takes an input image pair and uses the output flow to coarsely align the source image to the target image as similarly done in (Shen et al., 2020). Unlike RANSAC-Flow (Shen et al., 2020), we do not resort to finding a homography transformation, but rather rely on the output flow itself. We empirically find that for images with extreme geometric deformations, reliable homography transformations may not be found.
|
| 230 |
+
|
| 231 |
+
Subsequently, we evenly partition the coarsely aligned source image and the target image into $k \times k$ local windows, where $k$ is a hyperparameter. Each pair of partitioned local windows at the same location is then used to find more fine-grained correspondences by feeding them into UFC to obtain local flow fields. Note that in this stage, we also compute a cycle-consistency confidence score Jiang et al. (2021) that will be used in the final decision-making process. To enable multi-scale inference, we choose multiple $k$ , e.g., $k = 2$ , for which we provide an ablation study in the supplementary material. We then perform transitive composition Zhou et al. (2016) using the coarse flow and each of the multi-scale flows. Finally, using the confidence values of composited flows at each pixel, we
|
| 232 |
+
|
| 233 |
+
<table><tr><td rowspan="3">Methods</td><td rowspan="3">Train Image Reso.</td><td rowspan="3">Keypoint Annotation Reso.</td><td rowspan="3">Feat. Agg.</td><td rowspan="3">Cost Agg.</td><td colspan="5">SPair-71k</td><td colspan="3">PF-PASCAL</td><td colspan="3">PF-WILLOW</td><td></td></tr><tr><td colspan="5">PCK @ Χbox</td><td colspan="3">PCK @ Χimg</td><td colspan="3">PCK @ Χbox</td><td></td></tr><tr><td>0.01</td><td>0.03</td><td>0.05</td><td>0.1</td><td>0.15</td><td>0.05</td><td>0.1</td><td>0.15</td><td>0.05</td><td>0.1</td><td>0.05</td><td></td></tr><tr><td>DHPF</td><td>240× 240</td><td>240</td><td>-</td><td>RHM</td><td>1.74</td><td>11.0</td><td>20.9</td><td>37.3</td><td>47.5</td><td>75.7</td><td>90.7</td><td>95.0</td><td>49.5</td><td>77.6</td><td>-</td><td>71.0</td></tr><tr><td>SCOT</td><td>-</td><td>Max 300</td><td>-</td><td>OT-RHM</td><td>-</td><td>-</td><td>-</td><td>35.6</td><td>-</td><td>63.1</td><td>85.4</td><td>92.7</td><td>-</td><td>-</td><td>47.8</td><td>76.0</td></tr><tr><td>CHM</td><td>240× 240</td><td>240</td><td>2D Conv.</td><td>6D Conv.</td><td>2.25</td><td>14.9</td><td>27.2</td><td>46.3</td><td>57.5</td><td>80.1</td><td>91.6</td><td>94.9</td><td>52.7</td><td>79.4</td><td>-</td><td>69.6</td></tr><tr><td>CATs</td><td>256× 256</td><td>256</td><td>-</td><td>Trans.</td><td>1.90</td><td>13.8</td><td>27.7</td><td>49.9</td><td>61.7</td><td>75.4</td><td>92.6</td><td>96.4</td><td>50.3</td><td>79.2</td><td>40.7</td><td>69.0</td></tr><tr><td>MMNet-FCN</td><td>224× 320</td><td>224× 320</td><td>Conv. + Trans.</td><td>-</td><td>2.80</td><td>18.8</td><td>33.3</td><td>50.4</td><td>61.2</td><td>81.1</td><td>91.6</td><td>95.9</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>PWarpC-NC-Net</td><td>400× 400</td><td>Ori</td><td>-</td><td>4D Conv.</td><td>2.55</td><td>17.1</td><td>31.6</td><td>52.0</td><td>61.8</td><td>79.2</td><td>92.1</td><td>95.6</td><td>-</td><td>-</td><td>48.0</td><td>76.2</td></tr><tr><td>SCorrSAN</td><td>256× 256</td><td>256</td><td>Linear</td><td>-</td><td>-</td><td>-</td><td>-</td><td>55.3</td><td>-</td><td>81.5</td><td>93.3</td><td>96.6</td><td>54.1</td><td>80.0</td><td>-</td><td>-</td></tr><tr><td>VAT</td><td>512× 512</td><td>512</td><td>-</td><td>4D Conv. + Trans.</td><td>3.17</td><td>19.6</td><td>35.0</td><td>55.5</td><td>65.1</td><td>78.2</td><td>92.3</td><td>96.2</td><td>52.8</td><td>81.6</td><td>42.3</td><td>71.3</td></tr><tr><td>CATs++</td><td>512× 512</td><td>512</td><td>-</td><td>4D Conv. + Trans.</td><td>4.31</td><td>25.0</td><td>40.7</td><td>59.8</td><td>68.5</td><td>84.9</td><td>93.8</td><td>96.8</td><td>56.7</td><td>81.2</td><td>47.0</td><td>72.6</td></tr><tr><td>TransforMatcher</td><td>240× 240</td><td>240</td><td>-</td><td>Trans.</td><td>-</td><td>-</td><td>-</td><td>53.7</td><td>-</td><td>80.8</td><td>91.8</td><td>-</td><td>-</td><td>76.0</td><td>-</td><td>65.3</td></tr><tr><td>NeMF</td><td>512× 512</td><td>Ori</td><td>-</td><td>4D Conv. + Trans.</td><td>3.2</td><td>19.5</td><td>34.2</td><td>53.6</td><td>-</td><td>80.6</td><td>93.6</td><td>-</td><td>-</td><td>-</td><td>60.8</td><td>75.0</td></tr><tr><td>UFC</td><td>512× 512</td><td>Ori</td><td colspan="2">Integrative Transformer</td><td>8.40</td><td>34.1</td><td>48.5</td><td>64.4</td><td>72.1</td><td>88.0</td><td>94.8</td><td>97.9</td><td>58.6</td><td>81.2</td><td>50.4</td><td>74.2</td></tr></table>
|
| 234 |
+
|
| 235 |
+
Table 1: Semantic matching results.
|
| 236 |
+
|
| 237 |
+
<table><tr><td rowspan="3">Methods</td><td rowspan="3">Feat.Agg.</td><td rowspan="3">Cost.Agg.</td><td colspan="7">HPatches Original</td><td colspan="8">ETH3D</td></tr><tr><td colspan="5">AEPE ↓</td><td colspan="2">PCK ↑</td><td colspan="8">AEPE ↓</td></tr><tr><td>I</td><td>II</td><td>III</td><td>IV</td><td>V</td><td>Avg.</td><td>5px</td><td>rate=3</td><td>rate=5</td><td>rate=7</td><td>rate=9</td><td>rate=11</td><td>rate=13</td><td>rate=15</td><td>Avg.</td></tr><tr><td>COTR</td><td>Trans.</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>7.75</td><td>91.10</td><td>1.66</td><td>1.82</td><td>1.97</td><td>2.13</td><td>2.27</td><td>2.41</td><td>2.61</td><td>2.12</td></tr><tr><td>PUMP</td><td>-</td><td>4D Conv.</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>2.87</td><td>97.14</td><td>1.77</td><td>2.81</td><td>2.39</td><td>2.39</td><td>3.56</td><td>3.87</td><td>4.57</td><td>3.05</td></tr><tr><td>ECO-TR</td><td>Trans.</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>2.52</td><td>90.85</td><td>1.48</td><td>1.61</td><td>1.72</td><td>1.81</td><td>1.89</td><td>1.97</td><td>2.06</td><td>1.87</td></tr><tr><td>COTR+Interp.</td><td>Trans.</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>7.98</td><td>86.33</td><td>1.71</td><td>1.92</td><td>2.16</td><td>2.47</td><td>2.85</td><td>3.23</td><td>3.76</td><td>2.59</td></tr><tr><td>UFC + (C)</td><td colspan="2">Integrative Transformer</td><td>0.87</td><td>1.29</td><td>1.37</td><td>3.19</td><td>1.92</td><td>1.73</td><td>98.76</td><td>1.45</td><td>1.59</td><td>1.64</td><td>1.76</td><td>1.82</td><td>1.90</td><td>1.95</td><td>1.73</td></tr><tr><td>GLU-Net</td><td>-</td><td>2D Conv.</td><td>1.55</td><td>12.66</td><td>27.54</td><td>32.04</td><td>52.47</td><td>25.05</td><td>78.54</td><td>1.98</td><td>2.54</td><td>3.49</td><td>4.24</td><td>5.61</td><td>7.55</td><td>10.78</td><td>5.17</td></tr><tr><td>GLU-Net-GOCor</td><td>-</td><td>Hand-crafted</td><td>1.29</td><td>10.07</td><td>23.86</td><td>27.17</td><td>38.41</td><td>20.16</td><td>81.43</td><td>1.93</td><td>2.28</td><td>2.64</td><td>3.01</td><td>3.62</td><td>4.79</td><td>7.80</td><td>3.72</td></tr><tr><td>DMP</td><td>2D Conv.</td><td>2D Conv.</td><td>3.21</td><td>15.54</td><td>32.54</td><td>38.62</td><td>63.43</td><td>30.64</td><td>63.21</td><td>2.43</td><td>3.31</td><td>4.41</td><td>5.56</td><td>6.93</td><td>9.55</td><td>14.20</td><td>6.62</td></tr><tr><td>PDCNet (MS)</td><td>-</td><td>2D Conv.</td><td>1.15</td><td>7.43</td><td>11.64</td><td>25.00</td><td>30.49</td><td>15.14</td><td>91.41</td><td>1.60</td><td>1.79</td><td>2.00</td><td>2.26</td><td>2.57</td><td>2.90</td><td>3.56</td><td>2.38</td></tr><tr><td>GMMflow</td><td>Trans.</td><td>-</td><td>4.72</td><td>26.46</td><td>40.75</td><td>62.49</td><td>79.80</td><td>42.85</td><td>69.50</td><td>1.64</td><td>1.86</td><td>2.12</td><td>2.36</td><td>3.49</td><td>5.62</td><td>10.64</td><td>3.96</td></tr><tr><td>COTR†</td><td>Trans.</td><td>-</td><td>19.65</td><td>33.81</td><td>45.81</td><td>62.03</td><td>66.28</td><td>45.52</td><td>5.10</td><td>8.76</td><td>9.86</td><td>11.23</td><td>12.44</td><td>13.77</td><td>14.94</td><td>16.09</td><td>12.44</td></tr><tr><td>PDC-Net+(MS)</td><td>-</td><td>2D Conv.</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>1.58</td><td>1.76</td><td>1.96</td><td>2.16</td><td>2.49</td><td>2.73</td><td>3.24</td><td>2.27</td></tr><tr><td>UFC</td><td colspan="2">Integrative Transformer</td><td>1.91</td><td>6.13</td><td>5.62</td><td>6.36</td><td>19.44</td><td>7.88</td><td>89.36</td><td>1.54</td><td>1.72</td><td>1.99</td><td>2.18</td><td>2.58</td><td>2.66</td><td>3.01</td><td>2.24</td></tr></table>
|
| 238 |
+
|
| 239 |
+
Table 2: Geometric matching results. A higher scene label or rate, i.e., V or 15, consists of more difficult images with extreme geometric deformations. † : Dense evaluation without zoom-in technique and confidence thresholding. (C) : Confidence thresholding.
|
| 240 |
+
|
| 241 |
+
select the flow with the highest confidence score. This selection is performed for every pixel and results in a final dense flow map.
|
| 242 |
+
|
| 243 |
+
# 5 EXPERIMENTS
|
| 244 |
+
|
| 245 |
+
# 5.1 SEMANTIC MATCHING
|
| 246 |
+
|
| 247 |
+
We first evaluate ours on semantic matching, where large intra-class variations and background clutters pose additional challenges to matching. We use three standard benchmarks: SPair-71k (Min et al., 2019b), PF-PASCAL (Ham et al., 2017) and PF-WILLOW (Ham et al., 2016). We follow the evaluation protocol of (Cho et al., 2022b). The results are summarized in Table 1, where UFC outperforms others for all the benchmarks at almost all PCKs, showing robustness to the above challenges. While VAT (Hong et al., 2022a) and NeMF (Hong et al., 2022b) perform better at $\alpha_{\mathrm{bbox}}$ , we stress that VAT evaluates at higher resolution and NeMF specializes in fine-grained correspondences. Also, we note that our performance is slightly inferior to SCOT (Liu et al., 2020) and PWarPC (Truong et al., 2022) for $\alpha_{\mathrm{bbox - kp}} = 0.1$ , but this is compensated for by the superior performance at lower alpha, i.e., 0.05, and the fact that PF-PASCAL (Ham et al., 2017) and PF-WILLOW (Ham et al., 2016) are small-scale datasets with a limited number of image pairs. Moreover, we highlight that for SPair-71k (Min et al., 2019b), the largest dataset in semantic correspondence with extreme viewpoint and scale difference, UFC outperforms competitors at all PCKs.
|
| 248 |
+
|
| 249 |
+
# 5.2 GEOMETRIC MATCHING
|
| 250 |
+
|
| 251 |
+
We next show that our method also performs very well in geometric matching. Following the evaluation protocol of (Truong et al., 2021), we report the results on HPatches (Balntas et al., 2017) and ETH3D (Schops et al., 2017) in Table 2. From the results, our method clearly outperforms existing dense matching networks, including those that perform additional optimization (Truong et al., 2020a; Hong & Kim, 2021; Truong et al., 2021) and inference strategies (Jiang et al., 2021; Truong et al., 2021), and a representative optical flow method, GMFlow (Xu et al., 2021). Note that UFC excels at finding correspondences under extreme geometric deformations, i.e., scene IV and V. Interestingly, as UFC outperforms others at all intervals of ETH3D that consist of image sequences with varying magnitudes of geometric transformations, this indicates that it can also perform well in optical flow settings. This is supported by the results of GMFlow (Xu et al., 2021), where we consistently achieve better performance. To ensure a fair comparison to COTR (Jiang et al., 2021) and its follow-up works (Revaud et al., 2022; Tan et al., 2022), we present results from a variant of
|
| 252 |
+
|
| 253 |
+
our method, denoted as (C). Moreover, we also include $\mathrm{COTR\dagger}$ to represent a truly dense version of COTR (Jiang et al., 2021), and we observe that UFC clearly performs better.
|
| 254 |
+
|
| 255 |
+
# 5.3 QUANTITATIVE COMPARISON BETWEEN AGGREGATION STRATEGIES
|
| 256 |
+
|
| 257 |
+
Figures 2 and 3 qualitatively show that the information both aggregations exploit and the output they generate differ. Here, we empirically show that these lead to appreciable performance differences. Table 3 (I-III) compares different aggregation strategies that are trained and evaluated on both tasks. Note that for these
|
| 258 |
+
|
| 259 |
+
<table><tr><td colspan="2"></td><td>HPatches AEPE ↓</td><td>SPair-71k αbbox = 0.1 ↑</td></tr><tr><td>(I)</td><td>Feature self-att.</td><td>78.2</td><td>36.1</td></tr><tr><td>(II)</td><td>Feature self-att. and cross-att.</td><td>59.9</td><td>38.5</td></tr><tr><td>(III)</td><td>Cost self-att.</td><td>51.8</td><td>33.6</td></tr><tr><td>(IV)</td><td>Feature self-att. + cost self-att.</td><td>36.8</td><td>51.7</td></tr><tr><td>(V)</td><td>Feature self- and cross-att. + cost self-att.</td><td>26.2</td><td>56.5</td></tr></table>
|
| 260 |
+
|
| 261 |
+
variants, we do not include any module for boosting performance, e.g., coarse-to-fine, multi-level or multi-scale features, and maintain a similar number of learnable parameters. Pytorch-like pseudocodes and additional visualizations are given in the supplementary material. From the results, we find that each aggregation strategy yields apparently different results in two tasks as reported in (I-III). A particularly illustrative comparison is (I) vs. (III), where only self-attention is performed on features or the cost volume, which clearly differentiate them. As expected, we also observe that performing cross-attention improves performance.
|
| 262 |
+
|
| 263 |
+
In the last two rows, we report the results of variants that utilize both feature and cost aggregation. (V) is our integrative aggregation, and (IV) is a naive sequential aggregation where feature aggregation is followed by cost aggregation. They both achieve large performance boosts, as expected since the resultant cost volume in Fig. 3 (f) and (h) includes less noisy and more concentrated scores compared to (c-e), while integrative aggregation clearly performs better. From these quantitative comparisons, we highlight that the two types of aggregation serve different purposes that lead to apparent performance differences, and the potential benefits arising from their relationship can be further exploited with our proposed design.
|
| 264 |
+
|
| 265 |
+
# 5.4 ABLATION STUDY
|
| 266 |
+
|
| 267 |
+
In this ablation study, we verify the need for each component of our method. Table 4 presents quantitative results of each variant on both geometric and semantic matching. The baseline represents a variant equipped with self- and cross-attention on feature maps. From (II) to (VI), each proposed component is pro
|
| 268 |
+
|
| 269 |
+
Table 3: Comparison of aggregation strategies.
|
| 270 |
+
|
| 271 |
+
<table><tr><td colspan="2">Components</td><td>HPatches AEPE ↓</td><td>SPair-71k αbbox = 0.1 ↑</td></tr><tr><td>(I)</td><td>Baseline</td><td>36.8</td><td>51.7</td></tr><tr><td>(II)</td><td>Integrative self-att.</td><td>32.8</td><td>54.7</td></tr><tr><td>(III)</td><td>Integrative self- and cross-att.</td><td>22.8</td><td>58.4</td></tr><tr><td>(IV)</td><td>+ matching distribution.</td><td>18.7</td><td>59.9</td></tr><tr><td>(V)</td><td>+ hierarchical processing</td><td>10.9</td><td>64.4</td></tr><tr><td>(VI)</td><td>+ dense zoom-in</td><td>7.88</td><td>64.4</td></tr></table>
|
| 272 |
+
|
| 273 |
+
Table 4: Component ablation study.
|
| 274 |
+
|
| 275 |
+
gressively included. We control the number of learnable parameters for each variant to be similar.
|
| 276 |
+
|
| 277 |
+
Comparing (I) and (II), we find that the proposed integrative self-attention layer benefits from joint aggregation of features and cost volume, achieving improved performance on both tasks. We next find that each component clearly helps to boost performance. Interestingly, we find dramatic improvements when cross-attention is included (III), indicating that explicit conditioning between input images is helpful. This further enhanced by using the aggregated cost volume as a cross-attention map (IV). We empirically find that our dense zoom-in brings marginal gain for semantic matching. We believe the sparse keypoint evaluation metric and the relatively small resolution images of the benchmark disturb harnessing the advantages of our inference strategy.
|
| 278 |
+
|
| 279 |
+
# 6 CONCLUSION
|
| 280 |
+
|
| 281 |
+
In this paper, we introduced a simple yet effective dense matching approach, Unified Feature and Cost Aggregation with Transformers (UFC), that capitalizes on the distinct advantages of the two types of aggregation. We further devise an enhanced aggregation through cross-attention with matching distribution. This method is formulated in a coarse-to-fine manner, yielding an appreciable performance boost. We have shown that our approach exhibits high speed and efficiency and that it surpasses all other existing works on several benchmarks, establishing new state-of-the-art performance.
|
| 282 |
+
|
| 283 |
+
# ACKNOWLEDGEMENT
|
| 284 |
+
|
| 285 |
+
This research was supported by the MSIT, Korea (IITP-2024-2020-0-01819, ICT Creative Consilience Program, RS-2023-00227592, Development of 3D Object Identification Technology Robust to Viewpoint Changes), and National Research Foundation of Korea (NRF-2021R1A6A1A03045425).
|
| 286 |
+
|
| 287 |
+
# REFERENCES
|
| 288 |
+
|
| 289 |
+
Shir Amir, Yossi Gandelsman, Shai Bagon, and Tali Dekel. Deep vit features as dense visual descriptors. arXiv preprint arXiv:2112.05814, 2(3):4, 2021.
|
| 290 |
+
Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
|
| 291 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, 2014.
|
| 292 |
+
Tim Bailey and Hugh Durrant-Whyte. Simultaneous localization and mapping (slam): Part ii. IEEE robotics & automation magazine, 13(3):108-117, 2006.
|
| 293 |
+
Vassileios Balntas, Karel Lenc, Andrea Vedaldi, and Krystian Mikolajczyk. Hpatches: A benchmark and evaluation of handcrafted and learned local descriptors. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 5173-5182, 2017.
|
| 294 |
+
Herbert Bay, Tinne Tuytelaars, and Luc Van Gool. Surf: Speeded up robust features. In European conference on computer vision, pp. 404-417. Springer, 2006.
|
| 295 |
+
Minsu Cho, Suha Kwak, Cordelia Schmid, and Jean Ponce. Unsupervised object discovery and localization in the wild: Part-based matching with bottom-up region proposals. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1201-1210, 2015.
|
| 296 |
+
Seokju Cho, Sunghwan Hong, Sangryul Jeon, Yunsung Lee, Kwanghoon Sohn, and Seungryong Kim. Cats: Cost aggregation transformers for visual correspondence. In Thirty-Fifth Conference on Neural Information Processing Systems, 2021.
|
| 297 |
+
Seokju Cho, Sunghwan Hong, and Seungryong Kim. Cats++: Boosting cost aggregation with convolutions and transformers. IEEE Transactions on Pattern Analysis and Machine Intelligence, pp. 1-20, 2022a. doi: 10.1109/TPAMI.2022.3218727.
|
| 298 |
+
Seokju Cho, Sunghwan Hong, and Seungryong Kim. Cats++: Boosting cost aggregation with convolutions and transformers. arXiv preprint arXiv:2202.06817, 2022b.
|
| 299 |
+
Navneet Dalal and Bill Triggs. Histograms of oriented gradients for human detection. In CVPR Workshops), 2005.
|
| 300 |
+
Daniel DeTone, Tomasz Malisiewicz, and Andrew Rabinovich. Superpoint: Self-supervised interest point detection and description. In Proceedings of the IEEE conference on computer vision and pattern recognition workshops, pp. 224-236, 2018.
|
| 301 |
+
Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020.
|
| 302 |
+
Mihai Dusmanu, Ignacio Rocco, Tomas Pajdla, Marc Pollefeys, Josef Sivic, Akihiko Torii, and Torsten Sattler. D2-net: A trainable cnn for joint description and detection of local features. In Proceedings of the IEEE/cvf conference on computer vision and pattern recognition, pp. 8092-8101, 2019.
|
| 303 |
+
Johan Edstedt, Ioannis Athanasiadis, Måten Wadenbäck, and Michael Felsberg. Dkm: Dense kernelized feature matching for geometry estimation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 17765-17775, 2023.
|
| 304 |
+
|
| 305 |
+
Martin A Fischler and Robert C Bolles. Random sample consensus: a paradigm for model fitting with applications to image analysis and automated cartography. Communications of the ACM, 24 (6):381-395, 1981.
|
| 306 |
+
Bumsub Ham, Minsu Cho, Cordelia Schmid, and Jean Ponce. Proposal flow. In CVPR, 2016.
|
| 307 |
+
Bumsub Ham, Minsu Cho, Cordelia Schmid, and Jean Ponce. Proposal flow: Semantic correspondences from object proposals. IEEE transactions on pattern analysis and machine intelligence, 2017.
|
| 308 |
+
Kaiming He, Christoph Rhemann, Carsten Rother, Xiaou Tang, and Jian Sun. A global sampling method for alpha matting. In CVPR 2011, pp. 2049-2056. IEEE, 2011.
|
| 309 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, 2016.
|
| 310 |
+
Sunghwan Hong and Seungryong Kim. Deep matching prior: Test-time optimization for dense correspondence. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), 2021.
|
| 311 |
+
Sunghwan Hong, Seokju Cho, Jisu Nam, Stephen Lin, and Seungryong Kim. Cost aggregation with 4d convolutional swim transformer for few-shot segmentation. arXiv preprint arXiv:2207.10866, 2022a.
|
| 312 |
+
Sunghwan Hong, Jisu Nam, Seokju Cho, Susung Hong, Sangryul Jeon, Dongbo Min, and Seungryong Kim. Neural matching fields: Implicit representation of matching fields for visual correspondence. Advances in Neural Information Processing Systems, 35:13512-13526, 2022b.
|
| 313 |
+
Asmaa Hosni, Christoph Rhemann, Michael Bleyer, Carsten Rother, and Margrit Gelautz. Fast cost-volume filtering for visual correspondence and beyond. IEEE transactions on pattern analysis and machine intelligence, 35(2):504-511, 2012.
|
| 314 |
+
Shuaiyi Huang, Qiuyue Wang, Songyang Zhang, Shipeng Yan, and Xuming He. Dynamic context correspondence network for semantic alignment. In ICCV, 2019.
|
| 315 |
+
Shuaiyi Huang, Luyu Yang, Bo He, Songyang Zhang, Xuming He, and Abhinav Shrivastava. Learning semantic correspondence with sparse annotations. In Proceedings of the European Conference on Computer Vision (ECCV), 2022a.
|
| 316 |
+
Zhaoyang Huang, Xiaoyu Shi, Chao Zhang, Qiang Wang, Ka Chun Cheung, Hongwei Qin, Jifeng Dai, and Hongsheng Li. Flowformer: A transformer architecture for optical flow. arXiv preprint arXiv:2203.16194, 2022b.
|
| 317 |
+
Sangryul Jeon, Seungryong Kim, Dongbo Min, and Kwanghoon Sohn. Parn: Pyramidal affine regression networks for dense semantic correspondence. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 351-366, 2018.
|
| 318 |
+
Sangryul Jeon, Dongbo Min, Seungryong Kim, Jihwan Choe, and Kwanghoon Sohn. Guided semantic flow. In ECCV. Springer, 2020.
|
| 319 |
+
Wei Jiang, Eduard Trulls, Jan Hosang, Andrea Tagliasacchi, and Kwang Moo Yi. Cotr: Correspondence transformer for matching across images. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 6207-6217, 2021.
|
| 320 |
+
Angelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, and François Fleuret. Transformers are rnns: Fast autoregressive transformers with linear attention. In International Conference on Machine Learning, pp. 5156-5165. PMLR, 2020.
|
| 321 |
+
Junghyup Lee, Dohyung Kim, Jean Ponce, and Bumsub Ham. Sfnet: Learning object-aware semantic correspondence. In CVPR, 2019.
|
| 322 |
+
Shuda Li, Kai Han, Theo W Costain, Henry Howard-Jenkins, and Victor Prisacariu. Correspondence networks with adaptive neighbourhood consensus. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 10196-10205, 2020.
|
| 323 |
+
|
| 324 |
+
Zhaoshuo Li, Xingtong Liu, Nathan Drenkow, Andy Ding, Francis X Creighton, Russell H Taylor, and Mathias Unberath. Revisiting stereo depth estimation from a sequence-to-sequence perspective with transformers. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 6197-6206, 2021.
|
| 325 |
+
Biyang Liu, Huimin Yu, and Guodong Qi. Graftnet: Towards domain generalized stereo matching with a broad-spectrum and task-oriented feature. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 13012-13021, 2022.
|
| 326 |
+
Ce Liu, Jenny Yuen, and Antonio Torralba. Sift flow: Dense correspondence across scenes and its applications. IEEE transactions on pattern analysis and machine intelligence, 33(5):978-994, 2010.
|
| 327 |
+
Yanbin Liu, Linchao Zhu, Makoto Yamada, and Yi Yang. Semantic correspondence as an optimal transport problem. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2020.
|
| 328 |
+
Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. Swin transformer: Hierarchical vision transformer using shifted windows. arXiv preprint arXiv:2103.14030, 2021.
|
| 329 |
+
David G Lowe. Distinctive image features from scale-invariant keypoints. International journal of computer vision, 60(2):91-110, 2004.
|
| 330 |
+
Jiachen Lu, Jinghan Yao, Junge Zhang, Xiatian Zhu, Hang Xu, Weiguo Gao, Chunjing Xu, Tao Xiang, and Li Zhang. Soft: Softmax-free transformer with linear complexity. arXiv preprint arXiv:2110.11945, 2021.
|
| 331 |
+
Iaroslav Melekhov, Aleksei Tiulpin, Torsten Sattler, Marc Pollefeys, Esa Rahtu, and Juho Kannala. Dgc-net: Dense geometric correspondence network. In WACV, 2019.
|
| 332 |
+
Juhong Min, Jongmin Lee, Jean Ponce, and Minsu Cho. Hyperpixel flow: Semantic correspondence with multi-layer neural features. In Proceedings of the IEEE/CVF International Conference on Computer Vision, 2019a.
|
| 333 |
+
Juhong Min, Jongmin Lee, Jean Ponce, and Minsu Cho. Spair-71k: A large-scale benchmark for semantic correspondence. arXiv preprint arXiv:1908.10543, 2019b.
|
| 334 |
+
Juhong Min, Jongmin Lee, Jean Ponce, and Minsu Cho. Learning to compose hypercolumns for visual correspondence. In Computer Vision-ECCV 2020: 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part XV 16. Springer, 2020.
|
| 335 |
+
Juhong Min, Seungwook Kim, and Minsu Cho. Convolutional though matching networks for robust and efficient visual correspondence. arXiv preprint arXiv:2109.05221, 2021a.
|
| 336 |
+
Juhong Min, Seungwook Kim, and Minsu Cho. Convolutional though matching networks for robust and efficient visual correspondence. arXiv preprint arXiv:2109.05221, 2021b.
|
| 337 |
+
Yuki Ono, Eduard Trulls, Pascal Fua, and Kwang Moo Yi. Lf-net: Learning local features from images. Advances in neural information processing systems, 31, 2018.
|
| 338 |
+
William Peebles, Jun-Yan Zhu, Richard Zhang, Antonio Torralba, Alexei Efros, and Eli Shechtman. Gan-supervised dense visual alignment. arXiv preprint arXiv:2112.05143, 2021.
|
| 339 |
+
James Philbin, Ondrej Chum, Michael Isard, Josef Sivic, and Andrew Zisserman. Object retrieval with large vocabularies and fast spatial matching. In CVPR. IEEE, 2007.
|
| 340 |
+
Jerome Revaud, Philippe Weinzaepfel, Cesar De Souza, Noe Pion, Gabriela Csurka, Yohann Cabon, and Martin Humenberger. R2d2: repeatable and reliable detector and descriptor. arXiv preprint arXiv:1906.06195, 2019.
|
| 341 |
+
Jérôme Revaud, Vincent Leroy, Philippe Weinzaepfel, and Boris Chidlovskii. Pump: Pyramidal and uniqueness matching priors for unsupervised learning of local descriptors. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 3926-3936, 2022.
|
| 342 |
+
|
| 343 |
+
Ignacio Rocco, Mircea Cimpoi, Relja Arandjelović, Akihiko Torii, Tomas Pajdla, and Josef Sivic. Neighbourhood consensus networks. arXiv preprint arXiv:1810.10510, 2018.
|
| 344 |
+
Ignacio Rocco, Relja Arandjelović, and Josef Sivic. Efficient neighbourhood consensus networks via submanifold sparse convolutions. In ECCV, 2020.
|
| 345 |
+
Paul-Edouard Sarlin, Daniel DeTone, Tomasz Malisiewicz, and Andrew Rabinovich. Superglue: Learning feature matching with graph neural networks. In CVPR, 2020.
|
| 346 |
+
Daniel Scharstein and Richard Szeliski. A taxonomy and evaluation of dense two-frame stereo correspondence algorithms. International journal of computer vision, 2002.
|
| 347 |
+
Johannes L Schonberger and Jan-Michael Frahm. Structure-from-motion revisited. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 4104-4113, 2016.
|
| 348 |
+
Thomas Schops, Johannes L Schonberger, Silvano Galliani, Torsten Sattler, Konrad Schindler, Marc Pollefeys, and Andreas Geiger. A multi-view stereo benchmark with high-resolution images and multi-camera videos. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3260-3269, 2017.
|
| 349 |
+
Xi Shen, François Darmon, Alexei A Efros, and Mathieu Aubry. Ransac-flow: generic two-stage image alignment. In European Conference on Computer Vision, pp. 618-637. Springer, 2020.
|
| 350 |
+
Richard Sinkhorn. Diagonal equivalence to matrices with prescribed row and column sums. The American Mathematical Monthly, 1967.
|
| 351 |
+
Xiao Song, Guorun Yang, Xinge Zhu, Hui Zhou, Zhe Wang, and Jianping Shi. Adastereo: A simple and efficient approach for adaptive stereo matching. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 10328-10337, 2021.
|
| 352 |
+
Deqing Sun, Xiaodong Yang, Ming-Yu Liu, and Jan Kautz. Pwc-net: Cnns for optical flow using pyramid, warping, and cost volume. In CVPR, 2018.
|
| 353 |
+
Jiaming Sun, Zehong Shen, Yuang Wang, Hujun Bao, and Xiaowei Zhou. Loftr: Detector-free local feature matching with transformers. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 8922-8931, 2021.
|
| 354 |
+
Dongli Tan, Jiang-Jiang Liu, Xingyu Chen, Chao Chen, Ruixin Zhang, Yunhang Shen, Shouhong Ding, and Rongrong Ji. Eco-tr: Efficient correspondences finding via coarse-to-fine refinement. In European Conference on Computer Vision, pp. 317-334. Springer, 2022.
|
| 355 |
+
Engin Tola, Vincent Lepetit, and Pascal Fua. Daisy: An efficient dense descriptor applied to wide-baseline stereo. IEEE transactions on pattern analysis and machine intelligence, 32(5):815-830, 2009.
|
| 356 |
+
Prune Truong, Martin Danelljan, Luc V Gool, and Radu Timofte. Gocor: Bringing globally optimized correspondence volumes into your neural network. Advances in Neural Information Processing Systems, 33:14278-14290, 2020a.
|
| 357 |
+
Prune Truong, Martin Danelljan, and Radu Timofte. Glu-net: Global-local universal network for dense flow and correspondences. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 6258-6268, 2020b.
|
| 358 |
+
Prune Truong, Martin Danelljan, Luc Van Gool, and Radu Timofte. Learning accurate dense correspondences and when to trust them. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2021.
|
| 359 |
+
Prune Truong, Martin Danelljan, Fisher Yu, and Luc Van Gool. Probabilistic warp consistency for weakly-supervised semantic correspondences. arXiv preprint arXiv:2203.04279, 2022.
|
| 360 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems, 2017.
|
| 361 |
+
|
| 362 |
+
Sinong Wang, Belinda Z Li, Madian Khabsa, Han Fang, and Hao Ma. Linformer: Self-attention with linear complexity. arXiv preprint arXiv:2006.04768, 2020.
|
| 363 |
+
Chuhan Wu, Fangzhao Wu, Tao Qi, Yongfeng Huang, and Xing Xie. Fastformer: Additive attention can be all you need. arXiv preprint arXiv:2108.09084, 2021.
|
| 364 |
+
Haofei Xu, Jing Zhang, Jianfei Cai, Hamid Rezatofighi, and Dacheng Tao. Gmflow: Learning optical flow via global matching. arXiv preprint arXiv:2111.13680, 2021.
|
| 365 |
+
Haofei Xu, Jing Zhang, Jianfei Cai, Hamid Rezatofighi, Fisher Yu, Dacheng Tao, and Andreas Geiger. Unifying flow, stereo and depth estimation. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2023.
|
| 366 |
+
Gengshan Yang and Deva Ramanan. Volumetric correspondence networks for optical flow. Advances in neural information processing systems, 32, 2019.
|
| 367 |
+
Kuk-Jin Yoon and In So Kweon. Adaptive support-weight approach for correspondence search. IEEE transactions on pattern analysis and machine intelligence, 28(4):650-656, 2006.
|
| 368 |
+
Dongyang Zhao, Ziyang Song, Zhenghao Ji, Gangming Zhao, Weifeng Ge, and Yizhou Yu. Multiscale matching networks for semantic correspondence. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 3354-3364, 2021.
|
| 369 |
+
Tinghui Zhou, Philipp Krahenbuhl, Mathieu Aubry, Qixing Huang, and Alexei A Efros. Learning dense correspondence via 3d-guided cycle consistency. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 117-126, 2016.
|
unifyingfeatureandcostaggregationwithtransformersforsemanticandvisualcorrespondence/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:dbfe9ac9916bf62bd3e09884a2283017ea46cfe3796fb505407a6073ed4e0482
|
| 3 |
+
size 516277
|
unifyingfeatureandcostaggregationwithtransformersforsemanticandvisualcorrespondence/layout.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:87c0b64fe35ad95a4de06ba1efccc0eecbb8b19bdeb5a26e0c7e60fd217d93f2
|
| 3 |
+
size 491391
|
unio4unifyingonlineandofflinedeepreinforcementlearningwithmultisteponpolicyoptimization/37128ac2-2db2-4cbc-a55a-8aa686e6517d_content_list.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:99a2a74bbb5b92034c75c2877399abe68b0f2b1fa5a9c6258f42f431ec6f5356
|
| 3 |
+
size 205400
|
unio4unifyingonlineandofflinedeepreinforcementlearningwithmultisteponpolicyoptimization/37128ac2-2db2-4cbc-a55a-8aa686e6517d_model.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:55443f504f5188454dc1b766b090d78ed63036bc9b5aaa7a4558a1f02be70bd4
|
| 3 |
+
size 237037
|
unio4unifyingonlineandofflinedeepreinforcementlearningwithmultisteponpolicyoptimization/37128ac2-2db2-4cbc-a55a-8aa686e6517d_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d5bd63be38e6ce8406019dfdeec459f3a7394b3511a235f0356608f160cfbed7
|
| 3 |
+
size 10177988
|
unio4unifyingonlineandofflinedeepreinforcementlearningwithmultisteponpolicyoptimization/full.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
unio4unifyingonlineandofflinedeepreinforcementlearningwithmultisteponpolicyoptimization/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f3a20ee1556ab2fc3d283312a3d08479a3a33c5a0f082ad72cf21d349ae19096
|
| 3 |
+
size 2568065
|
unio4unifyingonlineandofflinedeepreinforcementlearningwithmultisteponpolicyoptimization/layout.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e3549446c9a2bf859e2be4b350f5c92a7ff9602998091d6097363de139a6c9a7
|
| 3 |
+
size 1168371
|
unirlhfuniversalplatformandbenchmarksuiteforreinforcementlearningwithdiversehumanfeedback/6a0e17a1-2546-48c9-923d-7178fffd7f8e_content_list.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:06dff1bc00ac11b1a3f4f74fa753c1332e6949218f76085e7d6e74de3927533e
|
| 3 |
+
size 207797
|
unirlhfuniversalplatformandbenchmarksuiteforreinforcementlearningwithdiversehumanfeedback/6a0e17a1-2546-48c9-923d-7178fffd7f8e_model.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bde1ecad429305e299135360835cdf49dc2e7aa1518d492c20e2b717277a1184
|
| 3 |
+
size 257403
|
unirlhfuniversalplatformandbenchmarksuiteforreinforcementlearningwithdiversehumanfeedback/6a0e17a1-2546-48c9-923d-7178fffd7f8e_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8729cd2e72f7c617b8c99079dd794810b2ac64b0e1aafd3a8e1c5da69be46e3f
|
| 3 |
+
size 3403203
|
unirlhfuniversalplatformandbenchmarksuiteforreinforcementlearningwithdiversehumanfeedback/full.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
unirlhfuniversalplatformandbenchmarksuiteforreinforcementlearningwithdiversehumanfeedback/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8b5821064e5e53461d4679cd2e7bc70de121b1fe6fb17528a890251dd08296b4
|
| 3 |
+
size 1734439
|
unirlhfuniversalplatformandbenchmarksuiteforreinforcementlearningwithdiversehumanfeedback/layout.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f27651cf6bfddcae587330313842d94fbb6603aae2c972a5a5597bf65202e7c7
|
| 3 |
+
size 959355
|
unitabeauniversalpretrainingprotocolfortabularfoundationmodelindatascience/a9af77ac-114a-47f9-b0a3-b26885afeb56_content_list.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d6ef71756ee5cfc9edd0ac8267eef6de74ede31583a4321d01ad77fa5d13b863
|
| 3 |
+
size 106752
|
unitabeauniversalpretrainingprotocolfortabularfoundationmodelindatascience/a9af77ac-114a-47f9-b0a3-b26885afeb56_model.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:26423dee064e9a94c70d7baa38cdf221f52950a80bf135c5b0908d526a6eb6bd
|
| 3 |
+
size 124365
|
unitabeauniversalpretrainingprotocolfortabularfoundationmodelindatascience/a9af77ac-114a-47f9-b0a3-b26885afeb56_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:624f2666edf2beac49748d0478131c6ae54b8198f88d29c5d2a8442cd4ba89d5
|
| 3 |
+
size 2194648
|
unitabeauniversalpretrainingprotocolfortabularfoundationmodelindatascience/full.md
ADDED
|
@@ -0,0 +1,347 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# UNITABE: A UNIVERSAL PRETRAINING PROTOCOL FOR TABULAR FOUNDATION MODEL IN DATA SCIENCE
|
| 2 |
+
|
| 3 |
+
Yazheng Yang†, YuQi Wang†, Guang Liu‡, Ledell Wu∥, Qi Liu†
|
| 4 |
+
|
| 5 |
+
The University of Hong Kong†, Beijing Academy of Artificial Intelligence‡, Creatify AI†
|
| 6 |
+
Pokfulam Road, Hong Kong, China†, Zhongguancun East Road, Beijing, China†, California, United States†
|
| 7 |
+
{yangyazh, wangyuqi}@connect.hku.hk, liuguang@baai.ac.cn, ledell@creatify.ai, liuqi@cs.hku.hk
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
Recent advancements in Natural Language Processing (NLP) have witnessed the groundbreaking impact of pretrained models, yielding impressive outcomes across various tasks. This study seeks to extend the power of pretraining methodologies to facilitating the prediction over tables in data science, a domain traditionally overlooked, yet inherently challenging due to the plethora of table schemas intrinsic to different tasks. The primary research questions underpinning this work revolve around the establishment of a universal pretraining protocol for tables with varied structures, the generalizability and transferability of learned knowledge across tasks, the adaptation to diverse downstream applications, and the incorporation of incremental columns over time. In response to these challenges, we introduce UniTabE, a straightforward yet effective method designed to process tables in a uniform manner, devoid of constraints imposed by specific table structures. UniTabE's core concept relies on representing each basic table element with a module, termed TabUnit. This is subsequently followed by a Transformer encoder to refine the representation. Moreover, our model is designed to facilitate pretraining and finetuning through the utilization of free-form prompts. In order to implement the pretraining phase, we curated an expansive tabular dataset comprising approximately 13 billion samples, meticulously gathered from the Kaggle platform. This research primarily centers on classification and regression tasks involving tabular data, and conducts rigorous experimental testing and analyses to validate the effectiveness of our methodology. The experimental results demonstrate UniTabE's superior performance against several baseline models across a multitude of benchmark datasets. This, therefore, underscores UniTabE's potential to significantly enhance the semantic representation of tabular data, thereby marking a significant stride for tabular data analysis.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Tabular data, characterized by its structured arrangement of rows and columns, represents a foundational element within the field of data science, finding extensive practical utility in diverse domains. It facilitates a spectrum of real-world applications, such as stock market prediction, real estate price forecasting, and credit level estimation, etc. In the context of data analysis, modeling, and decision-making, classification and regression, the predominant tasks of predicting over tabular data, play a central role across diverse industries, attracting considerable attention from the research community.
|
| 16 |
+
|
| 17 |
+
However, several significant challenges have been identified within this domain: 1) The prevailing focus in the literature centers on bolstering the capabilities of powerful model architectures, often at the expense of relatively simple approaches to feature processing, such as adopting textualization [Song et al., 2019; Herzig et al., 2020; Yin et al., 2020a; Huang et al., 2020; Gorishniy et al., 2021]. This approach, while effective in certain contexts, tends to overlook the intrinsic nature and numerical significance of tabular data, particularly numerical values. This omission can impede the model's capacity to extract meaningful insights from such data, highlighting a potential gap in current methodologies [Eisenschlos et al., 2021; Herzig et al., 2020]. 2) Recent approaches have turned to finetuning large language models (LLMs) pretrained on natural language processing (NLP) datasets, such as TaBERT [Yin et al., 2020a], Tapas [Herzig et al., 2020], etc. However, LLMs do not inherently excel in handling textualized tabular data, which fundamentally differs from natural
|
| 18 |
+
|
| 19 |
+
language texts. Furthermore, these methods often employ simplistic textualization techniques mentioned above that can limit their effectiveness. 3) Prior work exploring pretraining solely on large-scale tabular datasets and assessing transferability is limited. Existing attempts [Wang and Sun, 2022] have primarily focused on a relatively small number of datasets from the same domain, which may not sufficiently validate the model's adaptability across diverse contexts. 4) Existing neural network methods often fall short in performance compared to eXtreme Gradient Boosting (XGBoost) [Chen and Guestrin, 2016] in data science applications, where XGBoost's high predictive accuracy, efficiency, and flexibility have contributed to its widespread adoption in industry. 5) Many existing approaches require strict consistency in table structures between training and testing data, posing challenges when minor modifications to table structures are necessary. This limitation becomes particularly relevant when applying trained models to tables with additional columns, a common scenario in practical applications. For example, in clinical trials, incremental columns are collected across different phases.
|
| 20 |
+
|
| 21 |
+
To address these challenges, we introduce UniTabE, a straightforward yet efficient framework designed to process tables uniformly while accommodating flexible table structures. UniTabE adopts a fine-grained approach to feature engineering by processing each cell in the table individually. Motivated by the success of pretraining in NLP, we explore large-scale pretraining over tables in data science, assessing the knowledge transferability and application scalability. We have collected an expansive tabular dataset from Kaggle, comprising approximately 13 billion examples spanning diverse domains. This dataset enables our large-scale pretraining over tabular data. In order to accommodate diverse pretraining and finetuning tasks within a unified framework, we introduce a universal training protocol. This protocol involves the utilization of an auto-regressive decoder, coupled with adaptable free-form prompts. The decoder performs reasoning on the high-level semantic representation produced by the encoder, functioning as an adaptable module capable of task-specific customization through the application of task-specific prompts. To ensure the preservation of a significant portion of pretrained knowledge within the encoder that serves as the foundational module designed for tabular data, we employ a shallow decoder. This deliberate choice compels the encoder to assume the primary responsibility for absorbing the intricacies of learning during pretraining. To comprehensively evaluate the effectiveness of our method, we conduct extensive experiments under different scenarios including predictive tasks on prominent benchmark datasets, filling in missing values, zero-shot prediction, adaptation to incremental tables, and integration of the neural semantic representation with XGBoost, etc.
|
| 22 |
+
|
| 23 |
+
# Our contributions are as follow:
|
| 24 |
+
|
| 25 |
+
- We introduce an innovative architectural framework, UniTabE, specifically designed to offer meticulous feature processing tailored to tabular data. Furthermore, through the incorporation of freeform prompts into our model, we augment its scalability to an extensive array of tasks for downstream applications.
|
| 26 |
+
- We have built an extensive tabular dataset for large-scale pretraining. We introduce an efficient framework for both pretraining and finetuning, optimized to leverage the full potential of our collected dataset.
|
| 27 |
+
- With comprehensive experiments, we substantiate the feasibility of pretraining on tabular data, underscore the transferability of knowledge acquired, and highlight the substantial performance enhancements it affords in downstream tasks. Our experimental findings also elucidate the practical efficacy of our approach in scenarios such as missing value handling, zero-shot prediction, and adaptability to incremental column structures. Moreover, our method outperforms XGBoost across a wide spectrum of benchmark datasets, demonstrating its superiority.
|
| 28 |
+
|
| 29 |
+
In Sec. 2 we cover related work. Sec. 3 introduces the model architecture of our proposed UniTabE. Sec. 4 gives detailed description of our pretraining and finetuning strategies. Finally, Sec. 5 provides the results of experimental studies which verify the effectiveness of our method.
|
| 30 |
+
|
| 31 |
+
# 2 RELATED WORK
|
| 32 |
+
|
| 33 |
+
# 2.1 TABLE DATA FEATURIZATION
|
| 34 |
+
|
| 35 |
+
Tables encompass various data types, and to process this tabular data with neural models, conventional methods typically convert each data format into a continuous space using individual strategies. For instance, texts are processed with tokenization and word embedding, while images are handled using image patch
|
| 36 |
+
|
| 37 |
+

|
| 38 |
+
Figure 1: The left part delineates the operational procedure of TabUnit module in processing individual cells. The right part provides an overview of our UniTabE architecture. "n" denotes the number of cells in each example, "Q" denotes the length of prompt, while "T" here represents the length of target. A shallow decoder is applied offering adaptability to a spectrum of diverse downstream tasks.
|
| 39 |
+
|
| 40 |
+
embedding. However, prior research tends to simplify this process by treating numerical values as text and then applying the same embedding strategy, which invariably disrupts the original recording structure and numerical meanings [Eisenschlos et al., 2021; Herzig et al., 2020]. Given the prevalence of numerical values in tables, this area has garnered increasing attention [Gorishniy et al., 2022]. To enhance the representation of numerical values, MATE [Eisenschlos et al., 2021] and TaPas [Herzig et al., 2020] introduced a ranking embedding based on numeric rank, which relies on comparisons. Further, TUTA [Wang et al., 2021] applied additional numerical features, such as magnitude, precision, the first digit, and the last digit, to distinguish numbers from text. Gorishniy et al. [2022] attempted to train the embedding vector for numbers. Wang and Sun [2022] suggested categorizing tabular data into three distinct types: textual, categorical, and numerical. Their model, TransTab, concatenates columns of the same type into a text sequence, with column names, column values, and different columns separated by a space. After the concatenation, these three text sequences are fed into the embedding layer individually.
|
| 41 |
+
|
| 42 |
+
# 2.2 PRETRAINING TABLE MODELS
|
| 43 |
+
|
| 44 |
+
In recent years, the pretraining of language models (LMs) over vast text corpora has led to noteworthy enhancements in performance for a variety of downstream tasks. This success has stimulated a growing body of work that focuses on pretraining and adapting LMs specifically for tabular data. The prevailing method employed by these studies is to fine-tune LMs that have been pretrained on NLP datasets, such as BERT [Devlin et al., 2018], BART [Lewis et al., 2019], etc. Typically, this training utilizes the Masked Language Model (MLM) objective, as evidenced by models like Tabtransformer [Huang et al., 2020], TaBERT [Yin et al., 2020b], Tabnet [Arik and Pfister, 2021], Saint [Somepalli et al., 2021], and so on. Liu et al. [2022] proposed a modality transformation that converts tabular data into textual data using a basic lexicon and ordered syntax before feeding it into the pretrained LMs. They then finetuned their model using the same MLM objective. However, LMs pretrained on natural texts do not perform optimally as the textualized tabular data differs fundamentally from natural language texts. The efficacy of finetuned LMs without architectural modifications has largely been confined to text data so far. But making modifications might lead to undesired outcomes like catastrophic forgetting of knowledge learned from natural language corpora [Chen et al., 2020; Bavarian et al., 2022]. In this work, our focus lies on pretraining a large model from scratch on tabular data. In line with previous work, we construct our model upon the renowned Transformer encoder, utilizing a self-supervised objective similar to MLM, which masks parts of the model input and then predicts the masked content. Contrary to previous work, we abstain from textualizing the tabular data using a simplistic strategy. Instead, we introduce a TabUnit module designed to process the basic element of a table independently, leading to an improved modeling of tabular data.
|
| 45 |
+
|
| 46 |
+
# 3 UNITABE ARCHITECTURE
|
| 47 |
+
|
| 48 |
+
In this section, we present the architecture of our model, which is composed of three primary components: the TabUnit, the Encoding Layer, and a Shallow Decoder. Our model employs the TabUnit module serving as the foundational feature processor for varying data types before leveraging the Transformer's encoder for
|
| 49 |
+
|
| 50 |
+
further encoding. Through adopting the setting of prompts and integrating a decoder, our model becomes adaptable to a wide range of tasks.
|
| 51 |
+
|
| 52 |
+
TabUnit Module As depicted on the left side of Figure 1, we propose the use of an unified module, called TabUnit in this work, for modeling the basic element of tabular data. To mitigate the influence of table structure, we treat each cell in a table as a key-value pair representing the column name and the column value respectively. In our implementation, we concatenate the vector of column name and vectors of cell value into a sequence as the cell's representation. To get the column name vector, the tokens of the column name $X_{cn}$ are first passed into the embedding module:
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
\mathbf {x} _ {c n} = \operatorname {A v g} \left(\operatorname {E m b} \left(X _ {c n}\right)\right)
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
\mathbf {x} _ {d t} = \operatorname {A v g} \left(E m b _ {D T} \left(X _ {d t}\right)\right) \tag {1}
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
where $Emb$ represents the embeddings consisting of word embedding and positional embedding. $\mathbf{x}_{cn}$ is the vector after mean pooling across the dimension of token sequence. We map data types $X_{dt}$ into integers (e.g. numerical $\rightarrow 0$ , categorical $\rightarrow 1$ , and textual $\rightarrow 2$ ) and subsequently employ an embedding module $Emb_{DT}$ to obtain the data type embedding vector $\mathbf{x}_{dt}$ . Here, the $Emb_{DT}$ is specifically designed to help the model adeptly handle diverse data formats, particularly in instances where columns share the same/similar name but contain values in different data formats. For example, the values in the "salary" column of a table in a downstream task might be numerical, while those in the corresponding column of another table could be textual (e.g., high income, medium income, and low income, etc). In some way, such situation may cause confusion for the neural networks. In order to remedy this problem, our model integrates the data type information into $\mathbf{x}_{cn}$ via a fuse layer relied on the gate mechanism:
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
g _ {d t} = \operatorname {S i g m o i d} \left(\mathbf {v} _ {f l} \operatorname {R e L U} \left(\mathbf {w} _ {f l} ^ {\top} \mathbf {x} _ {d t} + \mathbf {b} _ {f l}\right)\right)
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
\mathbf {v} _ {c n} = f _ {f l} \left(\mathbf {x} _ {c n}, \mathbf {x} _ {d t}\right) = \left(1 - g _ {d t}\right) \mathbf {x} _ {c n} + g _ {d t} * \mathbf {x} _ {d t} \tag {2}
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
where $\mathbf{w}_{fl}$ , $\mathbf{b}_{fl}$ and $\mathbf{v}_{fl}$ are trainable parameters. Note that the ratio $g_{dt}$ is calculated only conditioning on $\mathbf{x}_{dt}$ . Theoretically, integrating an equal amount of data type information into the column name representation across columns of the same data type is reasonable, as opposed to computing the fusing ratio $g_{dt}$ based on both $\mathbf{x}_{cn}$ and $\mathbf{x}_{dt}$ that will lead to adding varied amount of data type information. Tokens in each cell are also passed into the embedding module:
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\left\{\mathbf {x} _ {c v} ^ {0}, \mathbf {x} _ {c v} ^ {1}, \mathbf {x} _ {c v} ^ {2}, \dots , \mathbf {x} _ {c v} ^ {q - 1} \right\} = E m b \left(\left\{x _ {c v} ^ {0}, x _ {c v} ^ {1}, x _ {c v} ^ {2}, \dots , x _ {c v} ^ {q - 1} \right\}\right) \tag {3}
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
Where the embedding module $Emb(.)$ is shared to carry out embedding for column names and column values, $q$ here denotes the length of the cell value. Given the orderless nature of self-attention within the Transformer encoder, it becomes challenging for the model to learn the connection between the column name and its value when all cells are concatenated into a sequence. As a result, we introduce a Linking Layer to establish the relationship within each (column name, cell value) pair. We employ a gated function to weave the information from the column name into its corresponding value. Thus guaranteeing vectors coming from the same pair have higher weights in the self-attention operation to make the model aware of the association between column name and values.
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
\alpha = \operatorname {S i g m o i d} \left(\mathbf {v} _ {l k} \operatorname {R e L U} \left(\mathbf {w} _ {l k} ^ {\top} \mathbf {v} _ {c n} + \mathbf {b} _ {l k}\right)\right)
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
\mathbf {v} _ {c v} ^ {i} = \mathbf {x} _ {c v} ^ {i} + \alpha * \mathbf {v} _ {c n} \tag {4}
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
where $\mathbf{w}_{lk}$ , $\mathbf{b}_{lk}$ and $\mathbf{v}_{lk}$ are learnable parameters. We employ $\alpha$ to ensure that an equal amount of column name information is integrated into all value vectors. This allows the model to recognize which parts of vectors are values corresponding to specific columns. To avoid having the value information overshadowed by the column name information, we only apply the multiplication operation to $\alpha$ and $\mathbf{v}_{cn}$ . Overall, the TabUnit can be briefly formulated as:
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\mathbf {X} _ {T U} = \left\{\mathbf {v} _ {c n}, \mathbf {v} _ {c v} ^ {0}, \mathbf {v} _ {c v} ^ {1}, \dots , \mathbf {v} _ {c v} ^ {q - 1} \right\} = f _ {\text {T a b U n i t}} \left(X _ {d t}, X _ {c n}, X _ {c v}\right) \tag {5}
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
where $X_{dt}$ , $X_{cn}$ and $X_{cv}$ denote the data type indicator, tokens of column name and tokens of column value, respectively. The concatenation of column name vector and value vectors is treated as the inner representation of a tabular cell. In our implementation, all cells are processed in parallel.
|
| 95 |
+
|
| 96 |
+
Encoding Layer We concatenate the representations of all cells, and attach a trainable [CLS] vector to the head of such sequence. We leverage the Transformer encoder as the encoding layer:
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\left\{\mathbf {h} _ {c l s}, \mathbf {h} ^ {0}, \mathbf {h} ^ {1}, \dots , \mathbf {h} ^ {N - 1} \right\} = f _ {E n c} \left(\mathbf {v} _ {c l s}, \mathbf {X} _ {T U} ^ {0}, \mathbf {X} _ {T U} ^ {1}, \dots , \mathbf {X} _ {T U} ^ {n - 1}\right) \tag {6}
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
where $n$ is the number of cells, and $N$ is the length after concatenating all cells' representations.
|
| 103 |
+
|
| 104 |
+
Shallow Decoder During pretraining, we want to encourage the encoder to store most of the learned knowledge. Hence, we adopt a Long Short-Term Memory network (LSTM) [Hochreiter and Schmidhuber, 1997] as the weak decoder. Specifically, the hidden state of [CLS] token and the prompt are passed to the decoder to compute the initial state of our decoder:
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
\{\mathbf {y} _ {0} ^ {P}, \mathbf {y} _ {1} ^ {P}, \dots , \mathbf {y} _ {Q - 1} ^ {P} \} = f _ {\text {a t t n}} \left(\mathbf {W} _ {1} ^ {\top} \operatorname {E m b} \left(\left\{y _ {0} ^ {P}, y _ {1} ^ {P}, \dots , y _ {Q - 1} ^ {P} \right\}\right), \mathbf {W} _ {2} ^ {\top} \left\{\mathbf {X} _ {T U} ^ {0}, \mathbf {X} _ {T U} ^ {1}, \dots , \mathbf {X} _ {T U} ^ {n - 1} \right\}\right) \tag {7}
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
\mathbf {v} _ {p} = \sum_ {i} \frac {\exp \left(\mathbf {v} _ {1} ^ {\top} \mathbf {y} _ {i} ^ {P}\right)}{\sum_ {j} \exp \left(\mathbf {v} _ {1} ^ {\top} \mathbf {y} _ {j} ^ {P}\right)} \mathbf {y} _ {i} ^ {P} \tag {8}
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
\mathbf {v} _ {\text {s t a t e}} = \mathbf {W} _ {s} ^ {\top} \left\{\mathbf {v} _ {p}, \mathbf {h} _ {\text {c l s}} \right\} + \mathbf {b} _ {s} \tag {9}
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
where the $f_{attn}$ denotes the dot product attention [Vaswani et al., 2017]. $\mathbf{W}_1, \mathbf{W}_2, \mathbf{v}_1, \mathbf{W}_s$ and $\mathbf{b}_s$ are trainable parameters. Here $\mathbf{v}_p$ represents the weighted average of attention states of the prompt. The embedding layer of decoder also share the same parameter as that one on TabUnit to further reduce parameters of the decoder. The target sequence of tokens are generated by the decoder step by step conditioned on the initial state and previously produced token.
|
| 119 |
+
|
| 120 |
+
# 4 PRETRAINING & FINETUNING
|
| 121 |
+
|
| 122 |
+
In this section, we will commence by presenting the pretraining objectives that consist of multi-cell-masking and contrastive learning, followed by an elaboration on the finetuning methodologies.
|
| 123 |
+
|
| 124 |
+
# 4.1 PRETRAINING OBJECTIVE
|
| 125 |
+
|
| 126 |
+
Multi-Cell-Masking. Previous research in NLP pretraining utilized self-supervised tasks within datasets to provide pretraining signals, such as predicting next token, generating masked spans of texts, and determining the subsequent sentence, etc. These studies have shown that unlabeled data can aid in the learning of semantic representation. In this work, we also adopt the mask-then-predict approach to facilitate self-supervised training. In practical applications, filling in the entire content of a cell is more useful than merely filling in part of the cell content. As such, we treat each cell as the basic masked unit, as opposed to the token level in NLP pretraining. We randomly replace the content of the masked cells with the special token, [MASK]. We also use [MASK] as the default content for cells whose values are missing.
|
| 127 |
+
|
| 128 |
+
For each example, we arbitrarily mask columns and train the model to predict the masked content. Often, there may be multiple missing values in downstream tasks. Therefore, we also train the model under conditions where several values are missing, to familiarize the model with such situations. The number of masked cells varies during training. The prompt template for pretraining is set to "fill in missing value, <column name> :", which specifies the precise masked column to predict. The details regarding the number of randomly masked cells and their corresponding probabilities will be elaborated in § 5.2. An illustration of the multi-cell-masking objective is presented in Figure 5. Our model is trained with the optimization objective of the maximum log likelihood estimation.
|
| 129 |
+
|
| 130 |
+
Contrastive Learning. Expect for predicting values of masked cells that focuses on the global information of the table, we can also concentrate on local properties. In various applications, table row represents a sample and its columns are features. A natural self-supervised optimization signal would be distinguishing the differences across rows. Prior work [Khosla et al., 2020; Tian et al., 2020] in computer vision treated the augment of original image as the positive sample, and augments of other images as negative ones. For instance, the augment can be a block of the original image. Inspired by prior work, we
|
| 131 |
+
|
| 132 |
+

|
| 133 |
+
Figure 2: Demonstration of contrastive learning. (B1, B2) is positive pair, while (B1, B3) and (B1, B4) are negative pairs.
|
| 134 |
+
|
| 135 |
+
regard a subset of row as the compared unit. In Figure 2, block B2 is positive example, B3 and B4 are negative examples when B1 is treated as an anchor. B3 and B4 come from different row that is not identical to the row containing the given anchor. We utilize the cosine similarity to measure the closeness between two blocks. The training objective is maximizing the similarity between anchor and positive block while
|
| 136 |
+
|
| 137 |
+
Table 1: Statistics of our pretraining dataset. "Avg# NC", "Avg# CC" and "Avg# TC" signify the average counts of numerical columns, categorical columns, and textual columns, respectively, within each table. The lower section of the table exhibits the Top-5 domains most prominently featured in our dataset.
|
| 138 |
+
|
| 139 |
+
<table><tr><td>Domains</td><td># Domains</td><td># Tables</td><td># Examples</td><td>Avg# NC</td><td>Avg# CC</td><td>Avg# TC</td></tr><tr><td>ALL</td><td>303</td><td>283K</td><td>13B</td><td>28.7</td><td>0.4</td><td>7.7</td></tr><tr><td>Investing</td><td>1</td><td>71K</td><td>1B</td><td>29.33</td><td>0.02</td><td>1.58</td></tr><tr><td>Time Series</td><td>1</td><td>65K</td><td>1B</td><td>6.47</td><td>0.02</td><td>2.27</td></tr><tr><td>Finance</td><td>1</td><td>52K</td><td>773M</td><td>37.57</td><td>0.04</td><td>1.46</td></tr><tr><td>Economics</td><td>1</td><td>47K</td><td>488M</td><td>40.34</td><td>0.01</td><td>1.27</td></tr><tr><td>Games</td><td>1</td><td>32K</td><td>430M</td><td>23.37</td><td>0.66</td><td>3.66</td></tr></table>
|
| 140 |
+
|
| 141 |
+
minimizing it between anchor and negative block. We adopt the overlap between B1 and B2 to guarantee such supervised signal will not make the optimization collapse contributing to the robustness for various tables.
|
| 142 |
+
|
| 143 |
+
# 4.2 FINETUNING FORMULATION
|
| 144 |
+
|
| 145 |
+
Filling in Missing Value as Prediction. When finetuning our model for downstream tasks, we can consider the target as an additional column of the table. The model is then tasked with predicting the masked values of this target column using the same prompt as during pretraining. Thanks to the decoder, UniTabE is capable of generating textual and numerical targets. For example, the trained model is suited for classification and regression tasks, as well as predicting missing values in tables. In our implementation, we also support constrained generation. This feature is particularly beneficial for classification tasks, as the model only needs to predict from a small subset of the vocabulary.
|
| 146 |
+
|
| 147 |
+
Finetuning with Task-specific Prompt. Apart from those tasks where we treat the target as the masked column of the table, there are tasks that require the model to perform reasoning over the table and other inputs. For instance, in table question answering (TableQA) tasks, the model needs to produce an answer conditioned on the provided table and question. The prompt used in these tasks may include the task instruction and the question, appropriately formatted.
|
| 148 |
+
|
| 149 |
+

|
| 150 |
+
(a) Domains Distribution
|
| 151 |
+
|
| 152 |
+

|
| 153 |
+
|
| 154 |
+

|
| 155 |
+
(b) Data Type Distribution
|
| 156 |
+
Figure 3: Distribution visualization. The left part (a) demonstrates the distribution of domains and the number of tables in each domain. Please magnify the figure as some captions are small. The right part shows the proportion (cell level) of different data types in train/dev/test splits.
|
| 157 |
+
|
| 158 |
+
# 5 EXPERIMENTS AND ANALYSES
|
| 159 |
+
|
| 160 |
+
In this section, we will commence by introducing the pretraining dataset collected from Kaggle. Subsequently, we will provide a detailed exposition of our implementation. Finally, we will engage in an extensive discussion of the experimental results and analyses, encompassing an assessment of performance in Kaggle benchmarks, public benchmarks, zero-shot prediction, and related aspects.
|
| 161 |
+
|
| 162 |
+
Table 2: Performance comparison in 12 Kaggle tasks coming from different domains. "UniTabE scratch" is trained from scratch without pretraining. The result of each method is the average score across five runs.
|
| 163 |
+
|
| 164 |
+
<table><tr><td rowspan="2">Method/Dataset</td><td colspan="6">Classification (AUC ↑)</td><td colspan="6">Regression (R2 ↑)</td></tr><tr><td>PID</td><td>RWQ</td><td>HFP</td><td>HIC</td><td>EPL</td><td>LDP</td><td>MIP</td><td>GPP</td><td>RSP</td><td>CCL</td><td>MMP</td><td>HPA</td></tr><tr><td>XGBoost</td><td>0.79</td><td>0.67</td><td>0.89</td><td>0.85</td><td>0.73</td><td>0.50</td><td>0.54</td><td>0.64</td><td>0.98</td><td>0.78</td><td>0.71</td><td>0.49</td></tr><tr><td>TransTab-LSTM</td><td>0.81</td><td>0.56</td><td>0.74</td><td>0.85</td><td>0.73</td><td>0.50</td><td>0.50</td><td>0.55</td><td>0.64</td><td>0.65</td><td>0.51</td><td>0.47</td></tr><tr><td>UniTabE scratch</td><td>0.76</td><td>0.57</td><td>0.61</td><td>0.85</td><td>0.73</td><td>0.52</td><td>0.53</td><td>0.76</td><td>0.99</td><td>0.72</td><td>0.82</td><td>0.54</td></tr><tr><td>UniTabE finetune</td><td>0.83</td><td>0.66</td><td>0.81</td><td>0.86</td><td>0.78</td><td>0.53</td><td>0.75</td><td>0.99</td><td>0.99</td><td>0.96</td><td>0.87</td><td>0.58</td></tr></table>
|
| 165 |
+
|
| 166 |
+
Table 3: Evaluation results with AUC on public tabular datasets. We conducted five training iterations for each method and subsequently computed the average scores across these runs.
|
| 167 |
+
|
| 168 |
+
<table><tr><td>Method/Dataset</td><td>CG</td><td>CA</td><td>DS</td><td>AD</td><td>CB</td><td>BL</td><td>IO</td><td>Avg.</td></tr><tr><td>XGBoost</td><td>0.78</td><td>0.93</td><td>0.54</td><td>0.91</td><td>0.87</td><td>0.82</td><td>0.71</td><td>0.79</td></tr><tr><td>NODE [Popov et al., 2019]</td><td>0.65</td><td>0.85</td><td>0.58</td><td>0.90</td><td>0.70</td><td>0.83</td><td>0.67</td><td>0.74</td></tr><tr><td>AutoInt [Song et al., 2019]</td><td>0.77</td><td>0.93</td><td>0.57</td><td>0.91</td><td>0.82</td><td>0.84</td><td>0.72</td><td>0.79</td></tr><tr><td>Tapas [Herzig et al., 2020]</td><td>0.77</td><td>0.92</td><td>0.63</td><td>0.91</td><td>0.87</td><td>0.84</td><td>0.70</td><td>0.81</td></tr><tr><td>TaBERT [Yin et al., 2020a]</td><td>0.72</td><td>0.88</td><td>0.54</td><td>0.90</td><td>0.71</td><td>0.82</td><td>0.66</td><td>0.75</td></tr><tr><td>TabTransformer [Huang et al., 2020]</td><td>0.76</td><td>0.92</td><td>0.56</td><td>0.91</td><td>0.82</td><td>0.82</td><td>0.71</td><td>0.79</td></tr><tr><td>FT-Transformer [Gorishniy et al., 2021]</td><td>0.77</td><td>0.93</td><td>0.58</td><td>0.91</td><td>0.85</td><td>0.84</td><td>0.71</td><td>0.80</td></tr><tr><td>TabNet [Arik and Pfister, 2021]</td><td>0.49</td><td>0.48</td><td>0.48</td><td>0.90</td><td>0.53</td><td>0.79</td><td>0.62</td><td>0.61</td></tr><tr><td>TUTA [Wang et al., 2021]</td><td>0.74</td><td>0.92</td><td>0.61</td><td>0.81</td><td>0.74</td><td>0.83</td><td>0.65</td><td>0.76</td></tr><tr><td>TransTab [Wang and Sun, 2022]</td><td>0.73</td><td>0.86</td><td>0.52</td><td>0.90</td><td>0.80</td><td>0.71</td><td>0.73</td><td>0.75</td></tr><tr><td>TransTab-LSTM</td><td>0.70</td><td>0.85</td><td>0.56</td><td>0.90</td><td>0.72</td><td>0.83</td><td>0.73</td><td>0.76</td></tr><tr><td>TabPFN [Hollmann et al., 2022]</td><td>0.79</td><td>0.93</td><td>0.62</td><td>0.88</td><td>0.78</td><td>0.81</td><td>0.70</td><td>0.79</td></tr><tr><td>GANDAIF [Joseph and Raj, 2023]</td><td>0.78</td><td>0.92</td><td>0.63</td><td>0.91</td><td>0.84</td><td>0.84</td><td>0.71</td><td>0.80</td></tr><tr><td>Llama2 13B [Touvron et al., 2023]</td><td>0.77</td><td>0.92</td><td>0.65</td><td>0.91</td><td>0.84</td><td>0.83</td><td>0.68</td><td>0.80</td></tr><tr><td>UniTabE scratch</td><td>0.76</td><td>0.93</td><td>0.62</td><td>0.91</td><td>0.85</td><td>0.84</td><td>0.74</td><td>0.81</td></tr><tr><td>UniTabE + XGBoost</td><td>0.79</td><td>0.93</td><td>0.60</td><td>0.91</td><td>0.88</td><td>0.83</td><td>0.74</td><td>0.81</td></tr><tr><td>UniTabE finetune</td><td>0.79</td><td>0.94</td><td>0.66</td><td>0.91</td><td>0.88</td><td>0.84</td><td>0.76</td><td>0.83</td></tr></table>
|
| 169 |
+
|
| 170 |
+
# 5.1 PRETRAINING DATASET
|
| 171 |
+
|
| 172 |
+
As there are no large-scale, high-quality tabular datasets available for pretraining, we have collected our own dataset by crawling from Kaggle. We downloaded CSV tables, omitting empty columns. Specifically, we constructed initial keywords for each domain and extended the set of keywords using WordNet under the same topic. We then searched and downloaded tables using these keywords. For tables originating from the same Kaggle dataset, we attempted to join tables using primary and foreign keys. This process resulted in a 7TB dataset containing 13 billion tabular examples. Statistics about the pretraining data are presented in Table 1. We also present the statistics of the Top-5 domains in this table. Figure 3 shows the distribution of domains and the proportion of cells of different data types for each split of our dataset. We tried to split our dataset in such a way as to maintain a similar distribution of data types and domains.
|
| 173 |
+
|
| 174 |
+
# 5.2 IMPLEMENTATION DETAILS
|
| 175 |
+
|
| 176 |
+
We train our UniTabE with 32 A100 GPUs in the distributed way. Our model is implemented with the PyTorch v1.12. The Transformer encoder used as the backbone of our model is borrowed from the huggingface "transformers" module. During training, the learning rate is set to be 1e-5, the batch size is 64. We use Adam [Kingma and Ba, 2015] as the optimizer with $\beta_{1} = 0.9$ , $\beta_{2} = 0.999$ and $\epsilon = 10^{-8}$ . We train three variants of our model, UniTabE<sub>base</sub>, UniTabE<sub>large</sub> and UniTabE<sub>xlarge</sub>. The hidden size and embedding size for UniTabE<sub>base</sub> are both set as 768. Its encoder is the 12 layers of self-attention stack with 12 heads. UniTabE<sub>xlarge</sub> consists of 24 layers encoder, 16 attention heads. Its hidden size and embedding size are both 1024. UniTabE<sub>xlarge</sub> is the 48 layers' version of UniTabE<sub>xlarge</sub>. More details about implementation of baselines and experimental setting, please refer to Appendix A.3.
|
| 177 |
+
|
| 178 |
+
# 5.3 RESULTS & ANALYSES
|
| 179 |
+
|
| 180 |
+
Many practical tabular tasks in the field of data science fall into the categories of classification or regression. As such, we evaluate the effectiveness of our pretrained model on these types of tasks. Details about baselines are attached in the Appendix A.1.
|
| 181 |
+
|
| 182 |
+
Kaggle Benchmarks. We selected a diverse set of tasks comprising 6 representative classification assignments and 6 regression tasks from Kaggle. To ensure a fair and unbiased evaluation, we deliberately excluded these specific tabular datasets from our pretraining corpus. This precaution was taken to prevent the pretrained model from gaining undue familiarity with the target columns, thereby avoiding any potential bias in the results. The statistical metrics pertaining to these datasets are delineated in Table 7. The comparison of results among methods is presented in Table 2. On most of datasets, we notice that our method outperforms XGBoost that is widely used in industry due to its promising performance. TransTab-LSTM is the model that we equip TransTab with the same decoder as ours. Its vital differences from ours consist of the feature processing and gate mechanism integrated with the Transformer encoder. Compared with TransTab-LSTM, our UniTabE achieves higher scores in both classification and regression tasks. It demonstrates the superiority of our table feature processor, TabUnit, as opposed to the table textualization strategy of TransTab. This is indicative of the efficacy of our model's approach to handling and understanding the nuanced structure of tabular data.
|
| 183 |
+
|
| 184 |
+
Public Benchmarks. Since those 12 tasks coming from Kaggle might have the similar domains to our pretraining data, we also use other public tabular datasets (CG, CA, DS, AD, CB, BL and IO) to further evaluate the efficacy of our method. These datasets are all binary classification tasks. The statistical data pertaining to these datasets is presented in Table 7. We compare our method against previous start-of-the-art (SOTA) methods for tabular classification on these datasets. Table 3 presents experimental results on these datasets. Similar to those results in 12 Kaggle tasks, our method also achieves impressive results indicating its superiority in learning the intrinsic semantic information of tabular data.
|
| 185 |
+
|
| 186 |
+
Table 4: The accuracy of zero-shot classification.
|
| 187 |
+
|
| 188 |
+
<table><tr><td>Method/Dataset</td><td>CG</td><td>CA</td><td>DS</td><td>AD</td><td>CB</td><td>BL</td><td>IO</td></tr><tr><td>UniTabE finetune</td><td>0.75</td><td>0.89</td><td>0.62</td><td>0.86</td><td>0.78</td><td>0.80</td><td>0.94</td></tr><tr><td>Random Initial</td><td>0.30</td><td>0.41</td><td>0.50</td><td>0.54</td><td>0.41</td><td>0.26</td><td>0.06</td></tr><tr><td>Zero-Shot</td><td>0.70</td><td>0.56</td><td>0.58</td><td>0.76</td><td>0.57</td><td>0.73</td><td>0.94</td></tr></table>
|
| 189 |
+
|
| 190 |
+
Zero-shot Prediction. Table 4 presents the results of zero-shot prediction. The "Random Initial" approach, which does not load the pretrained parameters, exhibits inferior performance. In contrast, our pretrained model demonstrates strong performance, even without fine-tuning on the target datasets, indicating its promising generalizability. These results also suggest that UniTabE acquires a certain degree of high-level reasoning capabilities through extensive large-scale pretraining, which contributes to its robust performance in zero-shot settings.
|
| 191 |
+
|
| 192 |
+
Table 5: The percentage(%) of AUC drop facing with incremental columns.
|
| 193 |
+
|
| 194 |
+
<table><tr><td>Method/Drop k</td><td>1</td><td>2</td></tr><tr><td>TransTab-LSTM</td><td>7.5</td><td>11.7</td></tr><tr><td>UniTabE scratch</td><td>5.3</td><td>8.4</td></tr><tr><td>UniTabE finetune</td><td>3.5</td><td>5.8</td></tr></table>
|
| 195 |
+
|
| 196 |
+
Adaption of Incremental Columns. We want to investigate the scalability of various models when confronted with an increasing number of columns. To simulate this scenario, we remove k columns from the original training set and train models using the modified data. Subsequently, we perform inference using the unaltered test set. We conduct a comparative analysis between our methodology and TransTabLSTM, a representative approach that necessitates congru-
|
| 197 |
+
|
| 198 |
+
ence in table structure between the training and testing data. The results of this experiment are displayed in Table 5. Thanks to the flexibility afforded by the TabUnit component of UniTabE, our model exhibits adaptability to the introduction of new columns with a relatively minor performance deterioration.
|
| 199 |
+
|
| 200 |
+

|
| 201 |
+
Figure 4: BLEU scores illustrating the generation of textual values across various model sizes and dataset sizes.
|
| 202 |
+
|
| 203 |
+
Model Size Analysis. We want to see the impact of the size of UniTabE on performance across different size of dataset. 50 tables for each dataset size are reserved and not included in the pretraining dataset. Here "small" means datasets whose example numbers do not surpass 2000, and "medium" means datasets of which the example numbers are between 2000 and 20000, while "large" denotes those datasets whose data numbers exceed 20000. The results presented in Figure 4 indicate that for larger finetuning datasets, larger models (like UniTabExlarge) tend to perform better. However, for smaller datasets, the performance of larger models tends to decrease. We notice that UniTabElarge is a balance size for different
|
| 204 |
+
|
| 205 |
+
datasets. Hence, we apply the UniTab $\text{Elarge}$ to compare the performance with baselines in subsequent experiments.
|
| 206 |
+
|
| 207 |
+
Ablation Analysis. Table 6 provides the results from various ablation studies. We notice that the omission of the fuse layer from the TabUnit module leads to a decline in performance, suggesting the significance of incorporating data type information into the cell representation. Similarly, removing the linking layer, responsible for associating column names with column values, makes the model oblivious to the distinction between vectors of column names and values. This is confirmed by a notable decrease in the AUC score, attesting to its efficacy. We further expel the contrastive learning and multi-cell masking objectives separately. A significant performance decline is observed when the former is removed, indicating its vital role in discerning the intrinsic differences within the table. The reduced performance following the removal of the multi-cell masking objective further emphasizes its importance in tabular pretraining. Upon evaluating models pretrained with varying masking ratios, a masking ratio of 0.15 yields an average AUC score of 0.83, proving better for the given tasks, while ratios of 0.2 and 0.3 appear inordinate. Excessive masking can impede accurate prediction of masked values and hinder differentiation
|
| 208 |
+
|
| 209 |
+
Table 6: Ablation studies. The average AUC score is computed across 7 datasets(CG $\sim$ IO). "MCM" and "CL" denote multi-cell masking and contrastive learning objective.
|
| 210 |
+
|
| 211 |
+
<table><tr><td>Method</td><td>Avg.</td></tr><tr><td>UniTabE</td><td>0.83</td></tr><tr><td>w/o Fuse Layer</td><td>0.77</td></tr><tr><td>w/o Linking Layer</td><td>0.75</td></tr><tr><td>w/o Fuse&Linking</td><td>0.72</td></tr><tr><td>w/o MCM</td><td>0.81</td></tr><tr><td>w/o CL</td><td>0.79</td></tr><tr><td>MCM rate: 0.3</td><td>0.81</td></tr><tr><td>MCM rate: 0.2</td><td>0.81</td></tr><tr><td>MCM rate: 0.1</td><td>0.82</td></tr><tr><td>3L Decoder</td><td>0.81</td></tr><tr><td>6L Decoder</td><td>0.79</td></tr><tr><td>12L Decoder</td><td>0.78</td></tr><tr><td>1L Transformer Decoder</td><td>0.81</td></tr></table>
|
| 212 |
+
|
| 213 |
+
between positive and negative pairs in contrastive learning. Furthermore, substituting UniTabE's 1-layer LSTM decoder with a 1-layer Transformer decoder showed the former to be more suitable for the tasks at hand. Models with an increasing number of LSTM decoder layers exhibit a declining trend in performance, suggesting a simpler decoder enables the encoder to retain more knowledge, leading to enhanced semantic representation of tabular data and superior performance. Additional exploration on the text generation capabilities of models with varying decoder layers is presented in Appendix A.5. The task involves querying the model about reasons for loan applications. The results shown in Table 9 indicate that models with additional decoder layers achieve improved BLEU scores, suggesting that more complex decoders absorb a greater portion of the pretrained knowledge, potentially detracting from the encoder. This can subsequently reduce performance in classification tasks that are reliant on the semantic representation of tabular data generated by the encoder.
|
| 214 |
+
|
| 215 |
+
Learned Feature + XGBoost. We are interested in examining the synergistic effects of combining the semantic representation derived from UniTabE with traditional machine learning algorithms, such as XGBoost. We integrate the original features with the generated representation vector, and use this composite data as input to XGBoost. The outcomes are displayed in Table 3. These results indicate that the neural feature acts as a beneficial supplement, leading to a slight performance enhancement in most instances.
|
| 216 |
+
|
| 217 |
+
Fill in Missing Value Analysis. Furthermore, we assess the efficacy of our approach concerning its capacity to fill in missing values, with the corresponding results displayed in Table 10. The improvement in performance provides additional experimental support for the effectiveness of our pretrained model in addressing missing values, thereby affirming its potential utility in applications related to data completion, data recovery and tabular data synthesis tasks.
|
| 218 |
+
|
| 219 |
+
# 6 CONCLUSIONS
|
| 220 |
+
|
| 221 |
+
In this research, we investigate the challenge of pretraining large-scale models specifically on tabular data. We demonstrate the feasibility and scalability of such pretraining. To address the inherent difficulties in pretraining over tabular data, we introduce UniTabE, a flexible approach capable of conducting fine-grained feature processing as well as adapting to different tasks with single framework. We have also collected a substantial dataset, comprising 13B examples spanning various domains, for pretraining purposes. To ascertain the effectiveness of our methodology, we carry out extensive experiments across 19 downstream tasks, with the outcomes confirming the superiority of our approach. Additionally, we explore issues related to the practical application of our method, including zero-shot prediction, adaptation to incrementally added columns, and combination of learned representation and traditional machine learning method (XGBoost).
|
| 222 |
+
|
| 223 |
+
# REFERENCES
|
| 224 |
+
|
| 225 |
+
S. Ö. Arik and T. Pfister. Tabnet: Attentive interpretable tabular learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 6679-6687, 2021.
|
| 226 |
+
M. Bavarian, H. Jun, N. Tezak, J. Schulman, C. McLeavey, J. Tworek, and M. Chen. Efficient training of language models to fill in the middle. arXiv preprint arXiv:2207.14255, 2022.
|
| 227 |
+
S. Chen, Y. Hou, Y. Cui, W. Che, T. Liu, and X. Yu. Recall and learn: Fine-tuning deep pretrained language models with less forgetting. arXiv preprint arXiv:2004.12651, 2020.
|
| 228 |
+
T. Chen and C. Guestrin. Xgboost: A scalable tree boosting system. In Proceedings of the 22nd acm SIGkdd international conference on knowledge discovery and data mining, pages 785-794, 2016.
|
| 229 |
+
J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
|
| 230 |
+
J. M. Eisenschlos, M. Gor, T. Müller, and W. W. Cohen. Mate: Multi-view attention for table transformer efficiency. arXiv preprint arXiv:2109.04312, 2021.
|
| 231 |
+
Y. Gorishniy, I. Rubachev, V. Khrulkov, and A. Babenko. Revisiting deep learning models for tabular data. Advances in Neural Information Processing Systems, 34:18932-18943, 2021.
|
| 232 |
+
Y. Gorishniy, I. Rubachev, and A. Babenko. On embeddings for numerical features in tabular deep learning. Advances in Neural Information Processing Systems, 35:24991-25004, 2022.
|
| 233 |
+
J. Herzig, P. K. Nowak, T. Müller, F. Piccinno, and J. M. Eisenschlos. Tapas: Weakly supervised table parsing via pre-training. arXiv preprint arXiv:2004.02349, 2020.
|
| 234 |
+
S. Hochreiter and J. Schmidhuber. Long short-term memory. Neural computation, 9(8):1735-1780, 1997.
|
| 235 |
+
N. Hollmann, S. Müller, K. Eggensperger, and F. Hutter. Tabpfn: A transformer that solves small tabular classification problems in a second. arXiv preprint arXiv:2207.01848, 2022.
|
| 236 |
+
X. Huang, A. Khetan, M. Cvitkovic, and Z. Karnin. Tabtransformer: Tabular data modeling using contextual embeddings. arXiv preprint arXiv:2012.06678, 2020.
|
| 237 |
+
M. Joseph and H. Raj. Gandalf: Gated adaptive network for deep automated learning of features, 2023.
|
| 238 |
+
J. Kasai, N. Pappas, H. Peng, J. Cross, and N. A. Smith. Deep encoder, shallow decoder: Reevaluating non-autoregressive machine translation. arXiv preprint arXiv:2006.10369, 2020.
|
| 239 |
+
P. Khosla, P. Teterwak, C. Wang, A. Sarna, Y. Tian, P. Isola, A. Maschinot, C. Liu, and D. Krishnan. Supervised contrastive learning. Advances in neural information processing systems, 33:18661-18673, 2020.
|
| 240 |
+
D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. In 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015. URL http://arxiv.org/abs/1412.6980.
|
| 241 |
+
X. Kong, A. Renduchintala, J. Cross, Y. Tang, J. Gu, and X. Li. Multilingual neural machine translation with deep encoder and multiple shallow decoders. arXiv preprint arXiv:2206.02079, 2022.
|
| 242 |
+
M. Lewis, Y. Liu, N. Goyal, M. Ghazvininejad, A. Mohamed, O. Levy, V. Stoyanov, and L. Zettlemoyer. Bart: Denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension. arXiv preprint arXiv:1910.13461, 2019.
|
| 243 |
+
Y. Li, Y. Lin, T. Xiao, and J. Zhu. An efficient transformer decoder with compressed sub-layers. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 13315-13323, 2021.
|
| 244 |
+
G. Liu, J. Yang, and L. Wu. Ptab: Using the pre-trained language model for modeling tabular data. arXiv preprint arXiv:2209.08060, 2022.
|
| 245 |
+
S. Popov, S. Morozov, and A. Babenko. Neural oblivious decision ensembles for deep learning on tabular data. arXiv preprint arXiv:1909.06312, 2019.
|
| 246 |
+
|
| 247 |
+
G. Somepalli, M. Goldblum, A. Schwarzschild, C. B. Bruss, and T. Goldstein. Saint: Improved neural networks for tabular data via row attention and contrastive pre-training. arXiv preprint arXiv:2106.01342, 2021.
|
| 248 |
+
W. Song, C. Shi, Z. Xiao, Z. Duan, Y. Xu, M. Zhang, and J. Tang. Autoint: Automatic feature interaction learning via self-attentive neural networks. In Proceedings of the 28th ACM international conference on information and knowledge management, pages 1161–1170, 2019.
|
| 249 |
+
X. Sun, T. Ge, F. Wei, and H. Wang. Instantaneous grammatical error correction with shallow aggressive decoding. arXiv preprint arXiv:2106.04970, 2021.
|
| 250 |
+
Y. Tian, C. Sun, B. Poole, D. Krishnan, C. Schmid, and P. Isola. What makes for good views for contrastive learning? Advances in neural information processing systems, 33:6827-6839, 2020.
|
| 251 |
+
H. Touvron, L. Martin, K. Stone, P. Albert, A. Almahairi, Y. Babaei, N. Bashlykov, S. Batra, P. Bhargava, S. Bhosale, et al. Llama 2: Open foundation and fine-tuned chat models. arXiv preprint arXiv:2307.09288, 2023.
|
| 252 |
+
A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L. Kaiser, and I. Polosukhin. Attention is all you need. Advances in neural information processing systems, 30, 2017.
|
| 253 |
+
Z. Wang and J. Sun. Transtab: Learning transferable tabular transformers across tables. arXiv preprint arXiv:2205.09328, 2022.
|
| 254 |
+
Z. Wang, H. Dong, R. Jia, J. Li, Z. Fu, S. Han, and D. Zhang. Tuta: tree-based transformers for generally structured table pre-training. In Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining, pages 1780-1790, 2021.
|
| 255 |
+
P. Yin, G. Neubig, W. tau Yih, and S. Riedel. TaBERT: Pretraining for joint understanding of textual and tabular data. In Annual Conference of the Association for Computational Linguistics (ACL), July 2020a.
|
| 256 |
+
P. Yin, G. Neubig, W.-t. Yih, and S. Riedel. Tabert: Pretraining for joint understanding of textual and tabular data. arXiv preprint arXiv:2005.08314, 2020b.
|
| 257 |
+
|
| 258 |
+
# A APPENDIX
|
| 259 |
+
|
| 260 |
+
# A.1 BASELINES
|
| 261 |
+
|
| 262 |
+
XGBoost [Chen and Guestrin, 2016] Despite a large number of proposed neural network architectures for tabular data, the performance gap between them and the "shallow" ensembles of decision trees, like XGBoost, often remains significant in industry. We use it as baseline for classification tasks. Implemented based on the XGBoost package.
|
| 263 |
+
|
| 264 |
+
TransTab [Wang and Sun, 2022] $^2$ also builds upon the Transformer encoder. It splits data into three categories: numerical, binary and categorical. Before being processed by the encoder, columns of the same data type are textualized into a text by inserting a space among columns, column names and column values. For instance, textual columns will be organized as the form: "column0_name column0_value column1_name column1_value ... columnk_name columnk_value". In addition, the numerical values are represented through multiplying with a training vector.
|
| 265 |
+
|
| 266 |
+
TransTab-LSTM In order to equip TransTab with the ability of text generation for the pretraining objective of multi-cell masking, we integrate the LSTM decoder of our model into TransTab. Thus, we compare the performance of different tabular data featuring strategies.
|
| 267 |
+
|
| 268 |
+
Linear Regress $^{3}$ is also used to compare the performance for regression tasks. We adopt the Scikit-learn implementation of linear regression in the experiments.
|
| 269 |
+
|
| 270 |
+
Tapas [Herzig et al., 2020] $^4$ extends the pretrained BERT to encompass the encoding of tabular data. This extension is realized through the joint pre-training process that encompasses both textual segments and tabular data extracted from Wikipedia. TAPAS is a method devised for addressing questions posed over tables, and notably, it operates without the generation of explicit logical forms. The training procedure for TAPAS is conducted under the paradigm of weak supervision, and its predictive mechanism involves the selection of specific cells within tables, optionally accompanied by the application of an associated aggregation operator to the chosen cell selections.
|
| 271 |
+
|
| 272 |
+
TabPFN [Hollmann et al., 2022] ${}^{5}$ TabPFN,denoting a Prior-Data Fitted Network (PFN),undergoes offline training as a one-time process, aimed at approximating Bayesian inference. This approximation is applied to synthetic datasets generated from a prior distribution that incorporates principles rooted in causal reasoning, encompassing a vast array of structural causal models, with an inherent preference for simplicity. It employs in-context learning (ICL), acquiring the capability to make predictions based on sequences of labeled examples within the input context, all while obviating the need for subsequent parameter updates. This model operates without necessitating hyperparameter tuning, while showcasing competitive performance against contemporary state-of-the-art classification methodologies.
|
| 273 |
+
|
| 274 |
+
TaBERT [Yin et al., 2020a] TaBERT is a pretrained language model designed for learning joint representations of natural language utterances and structured tables. TaBERT can be integrated as a substitute for the original encoder within a semantic parser, facilitating the computation of representations for both utterances and table columns.
|
| 275 |
+
|
| 276 |
+
Llama2 13B [Touvron et al., 2023] The recent advanced and versatile language model that offers enhanced capabilities, increased language support, and improved performance across a wide range of natural language processing tasks. This state-of-the-art model leverages the latest advancements in deep learning to provide comprehensive linguistic insights.
|
| 277 |
+
|
| 278 |
+
TabTransformer [Huang et al., 2020] The TabTransformer architecture is based on the Transformer, with its primary objective being the acquisition of effective contextual embeddings for categorical features of tabular data. Its experiments reveal the resilience of contextual embeddings derived from the TabTransformer
|
| 279 |
+
|
| 280 |
+
Table 7: Statistics of datasets in downstream tasks. "# NC", "# CC", "# TC" and "# Examples" denote the number of numerical columns, categorical columns, textual columns of the table and the total number of examples in the dataset, respectively.
|
| 281 |
+
|
| 282 |
+
<table><tr><td>Name</td><td># NC</td><td># CC</td><td># TC</td><td># Examples</td></tr><tr><td>Pima Indians Diabetes (PID) [url]</td><td>8</td><td>0</td><td>0</td><td>768</td></tr><tr><td>Red Wine Quality (RWQ) [url]</td><td>11</td><td>0</td><td>11</td><td>1599</td></tr><tr><td>Heart Failure Prediction (HFP) [url]</td><td>7</td><td>5</td><td>0</td><td>299</td></tr><tr><td>Health Insurance Cross Sell (HIC) [url]</td><td>7</td><td>0</td><td>3</td><td>381109</td></tr><tr><td>Eligibility Prediction for Loan (EPL) [url]</td><td>6</td><td>3</td><td>3</td><td>614</td></tr><tr><td>Loan Default Prediction (LDP) [url]</td><td>24</td><td>3</td><td>7</td><td>67463</td></tr><tr><td>Medical Insurance Payout (MIP) [url]</td><td>4</td><td>2</td><td>1</td><td>1338</td></tr><tr><td>Gold Price Prediction (GPP) [url]</td><td>80</td><td>0</td><td>1</td><td>1718</td></tr><tr><td>Reliance Stock Price (RSP) [url]</td><td>10</td><td>0</td><td>5</td><td>6205</td></tr><tr><td>Credit Card Limit Prediction (CCL) [url]</td><td>7</td><td>3</td><td>1</td><td>400</td></tr><tr><td>Miami Housing Prediction (MMP) [url]</td><td>14</td><td>0</td><td>3</td><td>13932</td></tr><tr><td>House Prices - Advanced (HPA) [url]</td><td>37</td><td>2</td><td>41</td><td>1460</td></tr><tr><td>Credit-G (CG) [url]</td><td>7</td><td>2</td><td>11</td><td>1000</td></tr><tr><td>Credit-Approval (CA) [url])</td><td>6</td><td>3</td><td>6</td><td>690</td></tr><tr><td>Dress-Sales (DS) [url]</td><td>1</td><td>0</td><td>11</td><td>500</td></tr><tr><td>Adult (AD) [url]</td><td>2</td><td>0</td><td>12</td><td>48842</td></tr><tr><td>Cylinder-Bands (CB) [url]</td><td>13</td><td>4</td><td>18</td><td>540</td></tr><tr><td>Blastchar (BL) [url]</td><td>3</td><td>5</td><td>11</td><td>7043</td></tr><tr><td>Insurance-co (IO) [url]</td><td>83</td><td>0</td><td>2</td><td>5822</td></tr></table>
|
| 283 |
+
|
| 284 |
+
in the face of both missing values and noisy data, thereby enhancing interpretability and demonstrating their robustness.
|
| 285 |
+
|
| 286 |
+
FT-Transformer [Gorishniy et al., 2021] An adaptation involves the incorporation of the Transformer architecture specifically tailored for tabular data processing. A distinct Feature Tokenizer is employed to transform individual columns into continuous vector spaces. Numerical values are subjected to multiplication with a training vector, while other non-numeric data is tokenized as text, utilizing word embedding techniques for further processing.
|
| 287 |
+
|
| 288 |
+
GANDALF [Joseph and Raj, 2023] $^{10}$ A deep learning framework, denoted as the Gated Adaptive Network for Deep Automated Learning of Features (GANDALF), which demonstrates its promising performance, interpretability, and computational efficiency in the context of tabular data analysis. GANDALF incorporates a special tabular processing unit characterized by a gating mechanism and integrated feature selection capabilities, termed the Gated Feature Learning Unit (GFLU), serving as a fundamental component for feature representation learning.
|
| 289 |
+
|
| 290 |
+
NODE [Popov et al., 2019] The Neural Oblivious Decision Ensembles (NODE) constitute an emerging deep learning architecture expressly engineered for heterogeneous tabular data. The NODE architecture extends the concept of ensembles composed of oblivious decision trees, harnessing the advantages inherent in both end-to-end gradient-based optimization and the potent capabilities of multi-layer hierarchical representation learning.
|
| 291 |
+
|
| 292 |
+
TabNet [Arik and Pfister, 2021] $^{12}$ TabNet represents an interpretable canonical deep learning architecture designed specifically for the representation of tabular data. Its core mechanism employs sequential attention to systematically determine the pertinent features to consider at each decision-making juncture. This strategic feature selection not only enhances interpretability but also optimizes the learning process by allocating learning capacity to the most salient features.
|
| 293 |
+
|
| 294 |
+
AutoInt [Song et al., 2019] $^{13}$ AutoInt is an automated mechanism designed for the autonomous acquisition of high-order feature interactions inherent in input attributes. It performs a joint mapping of numerical and textual features onto a shared, reduced-dimensional space. Subsequently, a multihead self-attentive
|
| 295 |
+
|
| 296 |
+
Table 8: Ablation results on public tabular datasets (CG $\sim$ IO).
|
| 297 |
+
|
| 298 |
+
<table><tr><td>Method/Dataset</td><td>CG</td><td>CA</td><td>DS</td><td>AD</td><td>CB</td><td>BL</td><td>IO</td><td>Avg.</td></tr><tr><td>UniTabE finetune</td><td>0.79</td><td>0.94</td><td>0.66</td><td>0.91</td><td>0.88</td><td>0.84</td><td>0.76</td><td>0.83</td></tr><tr><td>w/o Fuse Layer</td><td>0.74</td><td>0.84</td><td>0.60</td><td>0.90</td><td>0.80</td><td>0.83</td><td>0.69</td><td>0.77</td></tr><tr><td>w/o Linking Layer</td><td>0.69</td><td>0.84</td><td>0.61</td><td>0.90</td><td>0.72</td><td>0.81</td><td>0.69</td><td>0.75</td></tr><tr><td>w/o Fuse&Linking</td><td>0.65</td><td>0.85</td><td>0.61</td><td>0.84</td><td>0.65</td><td>0.77</td><td>0.65</td><td>0.72</td></tr><tr><td>w/o MCM</td><td>0.77</td><td>0.92</td><td>0.58</td><td>0.91</td><td>0.88</td><td>0.84</td><td>0.75</td><td>0.81</td></tr><tr><td>w/o CL</td><td>0.74</td><td>0.84</td><td>0.60</td><td>0.90</td><td>0.90</td><td>0.83</td><td>0.69</td><td>0.79</td></tr><tr><td>MCM rate: 0.3</td><td>0.79</td><td>0.92</td><td>0.65</td><td>0.90</td><td>0.84</td><td>0.83</td><td>0.75</td><td>0.81</td></tr><tr><td>MCM rate: 0.2</td><td>0.78</td><td>0.92</td><td>0.64</td><td>0.90</td><td>0.82</td><td>0.85</td><td>0.73</td><td>0.81</td></tr><tr><td>MCM rate: 0.1</td><td>0.79</td><td>0.93</td><td>0.65</td><td>0.91</td><td>0.85</td><td>0.83</td><td>0.75</td><td>0.82</td></tr><tr><td>3L Decoder</td><td>0.75</td><td>0.93</td><td>0.63</td><td>0.90</td><td>0.86</td><td>0.83</td><td>0.76</td><td>0.81</td></tr><tr><td>6L Decoder</td><td>0.74</td><td>0.90</td><td>0.62</td><td>0.89</td><td>0.84</td><td>0.83</td><td>0.73</td><td>0.79</td></tr><tr><td>12L Decoder</td><td>0.74</td><td>0.89</td><td>0.60</td><td>0.90</td><td>0.82</td><td>0.81</td><td>0.69</td><td>0.78</td></tr><tr><td>1L Transformer Decoder</td><td>0.78</td><td>0.93</td><td>0.62</td><td>0.91</td><td>0.87</td><td>0.84</td><td>0.73</td><td>0.81</td></tr><tr><td>3L Transformer Decoder</td><td>0.73</td><td>0.88</td><td>0.59</td><td>0.86</td><td>0.83</td><td>0.83</td><td>0.72</td><td>0.78</td></tr><tr><td>3L Transformer Decoder</td><td>0.72</td><td>0.86</td><td>0.68</td><td>0.85</td><td>0.77</td><td>0.82</td><td>0.69</td><td>0.77</td></tr><tr><td>12L Transformer Decoder</td><td>0.74</td><td>0.86</td><td>0.60</td><td>0.89</td><td>0.79</td><td>0.81</td><td>0.69</td><td>0.77</td></tr></table>
|
| 299 |
+
|
| 300 |
+
neural network, featuring residual connections, is employed to explicitly capture feature interactions within this low-dimensional representation. Through incorporating multiple layers of the multi-head self-attentive neural network, the model accommodates the modeling of diverse orders of feature combinations derived from the input attributes.
|
| 301 |
+
|
| 302 |
+
# A.2 DATASETS
|
| 303 |
+
|
| 304 |
+
The statistical characteristics of each dataset involved in the downstream tasks are provided in Table 7. The table includes the dataset names, along with their corresponding abbreviations, in the "Name" column. Additionally, we have included hyperlinks to access each dataset directly within the table for reference. We have deliberately selected these datasets, representing diverse domains (e.g. finance, medicine, healthcare, real estate, credit analysis, etc.), with the primary objective of conducting a comprehensive and thorough evaluation of our methodology.
|
| 305 |
+
|
| 306 |
+
# A.3 EXPERIMENTAL DETAILS
|
| 307 |
+
|
| 308 |
+
The UniTabE is pretrained with ten steps of gradient accumulation. The two pretraining objectives, multicell-masking and contrastive learning, are carried out interactively. We adopt the hyperparameter $p$ to control the overall proportion of cells to mask. The program generates random number $q \in [0,1]$ for each cell. If $q \leq p$ , then the corresponding cell will be masked. Masking single cell is used as the backup option in some cases, such as there is no any cell to mask. $p$ is set to be 0.15 in this work. We follow prior work [Wang and Sun, 2022], the overlap ratio used in this work is set to be $50\%$ while conducting contrastive learning. We skip those tables whose column numbers are less than two during training with contrastive learning objective. Furthermore, we employ a random shuffling procedure to alter the arrangement of columns within the table during the pretraining phase. The batch size is set as 8 while finetuning our model in downstream tasks. The finetune learning rate is 1e-6. We use the same optimizer settings as that used during pretraining. For compared baselines, we use the official optimal settings and train these models on different datasets. We then average scores of five runs for all model for fair comparison.
|
| 309 |
+
|
| 310 |
+
# A.4 ABLATION STUDIES
|
| 311 |
+
|
| 312 |
+
Table 8 presents the detailed ablation results on different datasets.
|
| 313 |
+
|
| 314 |
+
# A.5 TABLEQA CASE STUDY
|
| 315 |
+
|
| 316 |
+
We have observed a diminishing performance trend in classification tasks as we increase the number of decoder layers in our model. This phenomenon raises the suspicion that a strong decoder may inadvertently
|
| 317 |
+
|
| 318 |
+
Table 9: Comparison of text generation ability. The BLEU score between ground truth and generated text. The results reveal that more pretrained knowledge are stored in decoder as its layer number grows.
|
| 319 |
+
|
| 320 |
+
<table><tr><td># Layers/Decoder</td><td>LSTM</td><td>Transformer</td></tr><tr><td>1L</td><td>24.72</td><td>24.91</td></tr><tr><td>3L</td><td>27.00</td><td>27.42</td></tr><tr><td>6L</td><td>28.82</td><td>29.14</td></tr><tr><td>12L</td><td>29.54</td><td>30.16</td></tr></table>
|
| 321 |
+
|
| 322 |
+
Table 10: Performance comparison in filling in missing value. "mean/mode" uses the average in numerical column as prediction, and takes the most common text as prediction for textual column.
|
| 323 |
+
|
| 324 |
+
<table><tr><td rowspan="2">Method/Dataset</td><td colspan="6">Regression (MAE ↓)</td><td colspan="6">Text Generation (BLEU ↑)</td></tr><tr><td>CG</td><td>CA</td><td>DS</td><td>AD</td><td>CB</td><td>BL</td><td>CG</td><td>CA</td><td>DS</td><td>AD</td><td>CB</td><td>BL</td></tr><tr><td>mean/mode</td><td>0.81</td><td>0.61</td><td>0.84</td><td>0.78</td><td>0.73</td><td>0.84</td><td>48</td><td>62</td><td>46</td><td>62</td><td>65</td><td>43</td></tr><tr><td>Linear Regress</td><td>0.64</td><td>0.58</td><td>0.91</td><td>0.45</td><td>0.60</td><td>0.51</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>GPT-3</td><td>0.58</td><td>0.57</td><td>0.69</td><td>0.64</td><td>0.61</td><td>0.46</td><td>48</td><td>66</td><td>39</td><td>73</td><td>71</td><td>82</td></tr><tr><td>UniTabE scratch</td><td>0.49</td><td>0.56</td><td>0.83</td><td>0.69</td><td>0.72</td><td>0.38</td><td>35</td><td>63</td><td>28</td><td>67</td><td>18</td><td>75</td></tr><tr><td>UniTabE finetune</td><td>0.40</td><td>0.51</td><td>0.61</td><td>0.43</td><td>0.51</td><td>0.22</td><td>59</td><td>76</td><td>51</td><td>80</td><td>85</td><td>92</td></tr></table>
|
| 325 |
+
|
| 326 |
+
divert some of the pretrained knowledge away from the encoder, potentially compromising the encoder's capacity for representation. In contrast, a weaker decoder places the onus of modeling knowledge on the encoder during pretraining. Consequently, an encoder trained in collaboration with shallow decoder tends to yield better semantic representations. To assess the efficacy of text generation, we constructed a table question answering (table QA) dataset based on the CG dataset. In this dataset, we omitted the "purpose" column from the original data and employed the prompt "why the person applies for the loan?" for finetuning our UniTabE model. Table A.5 presents a comparative analysis of results across varying decoder sizes. Notably, we observe that the BLEU score exhibits an ascending trend as the number of decoder layers increases. Given the observation that pretrained models equipped with a powerful decoder demonstrate marginally inferior performance in semantic representation, we have opted for the design featuring a shallow decoder, aiming to prioritize the storage of acquired knowledge within the encoder, as opposed to relying on a powerful decoder or applying the balanced encoder-decoder architecture. This phenomenon aligns with findings in prior research [Kasai et al., 2020; Sun et al., 2021; Li et al., 2021; Kong et al., 2022] which further inspired us to take such architecture. For instance, all of them adopted Transformer as backbone with shallow decoder. Extensive experiments of Kasai et al. [2020] and Kong et al. [2022] demonstrated competitive performance between the single-layer decoder integrating with strong encoder and the balanced encoder-decoder depth in Neural Machine Translation (NMT). In addition, the LSTM decoder underperforms the Transformer decoder in the generation of target text, underscoring the suitability of the LSTM decoder for deployment as a weaker component within our model.
|
| 327 |
+
|
| 328 |
+
# A.6 FILL IN MISSING VALUE ANALYSIS
|
| 329 |
+
|
| 330 |
+
We evaluate the model's capability to fill in missing values, utilizing the Mean Absolute Error (MAE) metric for numerical columns and the BLEU score for textual predictions. For comparative analysis, we also fine-tune and test the GPT-3 model. The results, outlined in Table 10, indicate a significant improvement over other baseline models. This substantial gain in performance further corroborates the efficacy of our pretrained model in handling missing values, demonstrating its potential for applications in data completion and recovery tasks.
|
| 331 |
+
|
| 332 |
+
Input:
|
| 333 |
+
|
| 334 |
+
<table><tr><td>psvolfilm</td><td>pcut</td><td>pcut</td><td>pcut</td><td>Timestamp</td><td>pcut</td><td>psvolfilm</td><td>psvolfilm</td></tr><tr><td>0.88085</td><td>-0.02716</td><td>-0.46049</td><td>906.37207</td><td>5.924</td><td>136122816.0</td><td>288624243.0</td><td>5521.72217</td></tr><tr><td>1.10703</td><td>-0.00099</td><td>0.55356</td><td>-4164.50488</td><td>[MASK]</td><td>136124253.0</td><td>288622077.0</td><td>4150.10059</td></tr><tr><td>0.97426</td><td>-0.04228</td><td>0.62234</td><td>-2770.6145</td><td>5.428</td><td>136124555.0</td><td>288621753.0</td><td>3317.0603</td></tr><tr><td>0.92573</td><td>0.04246</td><td>-0.57147</td><td>549.31641</td><td>1.912</td><td>[MASK]</td><td>288607277.0</td><td>5569.54053</td></tr><tr><td>-0.45747</td><td>136123573.0</td><td>0.01218</td><td>5521.72217</td><td>288625307.0</td><td>6749.7251</td><td>0.79271</td><td>6.116</td></tr><tr><td>4116.43945</td><td>0.648</td><td>136116864.0</td><td>0.01266</td><td>288602476.0</td><td>3050.28613</td><td>-0.08359</td><td>0.75895</td></tr><tr><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td><td>...</td></tr></table>
|
| 335 |
+
|
| 336 |
+
Prompt: fill in the missing value, Timestamp:
|
| 337 |
+
Target:5.516
|
| 338 |
+
|
| 339 |
+
Figure 5: Demonstration of multi-cell-masking.
|
| 340 |
+
|
| 341 |
+
# A.7 DEMONSTRATION OF MULTI-CELL-MASKING
|
| 342 |
+
|
| 343 |
+
Figure 5 illustrates the pretraining example of multi-cell-masking. We use the prompt template "fill in missing value, <column name>:" to specify the precise masked column to predict.
|
| 344 |
+
|
| 345 |
+
# A.8 KAGGLE DATA LICENSE AND COPYRIGHT
|
| 346 |
+
|
| 347 |
+
Our utilization of Kaggle's dataset for UniTabE pretraining adheres meticulously to Kaggle's terms of use and licensing agreements. The publicly available dataset complies with Kaggle's licensing terms, and any specific requirements imposed by dataset providers have been respected. The dataset was collected through the official Kaggle API (https://github.com/Kaggle/kaggle-api), specifying the license option as "gpl" and "odb". We exclusively collected data under licenses such as GNU General Public License (GPL) and Open Data Commons series (e.g., ODbL, PDDL, ODC-By), ensuring compatibility for open sourcing our model. For example, the "sales-from-different-stores" dataset is obtained under the ODbL license (https://opendatacommons.org/licenses/odbl/1-0/), allowing a worldwide, royalty-free, non-exclusive license for data use. Our approach aligns with copyright laws, and we uphold ethical considerations, prioritizing responsible and fair data use within permitted scope and respecting Kaggle's data privacy policies. We intend to include information on data licensing, copyright, and ethical considerations in the final version of our paper if it is accepted.
|
unitabeauniversalpretrainingprotocolfortabularfoundationmodelindatascience/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:599a417cc060281d83a6b6bbec212c84ae79e5bd3c0498b14eaf88f244a41114
|
| 3 |
+
size 804363
|
unitabeauniversalpretrainingprotocolfortabularfoundationmodelindatascience/layout.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7be790e9b3847812eace1f3fc1db2ae1385cdee10798e1dd60f2803933199550
|
| 3 |
+
size 408147
|
universalbackdoorattacks/ad5b07e6-8f66-4fcc-b69d-83a113ca834d_content_list.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b793597b719e6df12475a622a80df6fa3b9e817319abe28f79090be323fba39c
|
| 3 |
+
size 82973
|
universalbackdoorattacks/ad5b07e6-8f66-4fcc-b69d-83a113ca834d_model.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:768919ae142b30ce3f275a2394b35b67421d321fce0212cb1518cb70857af591
|
| 3 |
+
size 100354
|