Datasets:
Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- parse/train/B1x1ma4tDr/B1x1ma4tDr.md +381 -0
- parse/train/B1x1ma4tDr/B1x1ma4tDr_content_list.json +0 -0
- parse/train/B1x1ma4tDr/B1x1ma4tDr_middle.json +0 -0
- parse/train/B1x1ma4tDr/B1x1ma4tDr_model.json +0 -0
- parse/train/LhY8QdUGSuw/LhY8QdUGSuw.md +526 -0
- parse/train/LhY8QdUGSuw/LhY8QdUGSuw_content_list.json +0 -0
- parse/train/LhY8QdUGSuw/LhY8QdUGSuw_middle.json +0 -0
- parse/train/LhY8QdUGSuw/LhY8QdUGSuw_model.json +0 -0
- parse/train/Lpfh1Bpqfk/Lpfh1Bpqfk.md +148 -0
- parse/train/Lpfh1Bpqfk/Lpfh1Bpqfk_content_list.json +841 -0
- parse/train/Lpfh1Bpqfk/Lpfh1Bpqfk_middle.json +0 -0
- parse/train/Lpfh1Bpqfk/Lpfh1Bpqfk_model.json +0 -0
- parse/train/PS3IMnScugk/PS3IMnScugk.md +628 -0
- parse/train/PS3IMnScugk/PS3IMnScugk_content_list.json +0 -0
- parse/train/PS3IMnScugk/PS3IMnScugk_middle.json +0 -0
- parse/train/PS3IMnScugk/PS3IMnScugk_model.json +0 -0
- parse/train/Sklsm20ctX/Sklsm20ctX.md +322 -0
- parse/train/Sklsm20ctX/Sklsm20ctX_content_list.json +1706 -0
- parse/train/Sklsm20ctX/Sklsm20ctX_middle.json +0 -0
- parse/train/Sklsm20ctX/Sklsm20ctX_model.json +0 -0
- parse/train/TScOKQW67Mj/TScOKQW67Mj.md +401 -0
- parse/train/TScOKQW67Mj/TScOKQW67Mj_content_list.json +1132 -0
- parse/train/TScOKQW67Mj/TScOKQW67Mj_middle.json +0 -0
- parse/train/TScOKQW67Mj/TScOKQW67Mj_model.json +0 -0
- parse/train/lQdXeXDoWtI/lQdXeXDoWtI.md +0 -0
- parse/train/lQdXeXDoWtI/lQdXeXDoWtI_content_list.json +0 -0
- parse/train/lQdXeXDoWtI/lQdXeXDoWtI_model.json +0 -0
- vlm/train/-xEk43f_EO6/0.png +3 -0
- vlm/train/-xEk43f_EO6/1.png +3 -0
- vlm/train/-xEk43f_EO6/10.png +3 -0
- vlm/train/-xEk43f_EO6/11.png +3 -0
- vlm/train/-xEk43f_EO6/2.png +3 -0
- vlm/train/-xEk43f_EO6/3.png +3 -0
- vlm/train/-xEk43f_EO6/4.png +3 -0
- vlm/train/-xEk43f_EO6/5.png +3 -0
- vlm/train/-xEk43f_EO6/6.png +3 -0
- vlm/train/-xEk43f_EO6/7.png +3 -0
- vlm/train/-xEk43f_EO6/8.png +3 -0
- vlm/train/-xEk43f_EO6/9.png +3 -0
- vlm/train/2-0wS9-cSL/0.png +3 -0
- vlm/train/2-0wS9-cSL/1.png +3 -0
- vlm/train/2-0wS9-cSL/10.png +3 -0
- vlm/train/2-0wS9-cSL/11.png +3 -0
- vlm/train/2-0wS9-cSL/2.png +3 -0
- vlm/train/2-0wS9-cSL/3.png +3 -0
- vlm/train/2-0wS9-cSL/4.png +3 -0
- vlm/train/2-0wS9-cSL/5.png +3 -0
- vlm/train/2-0wS9-cSL/6.png +3 -0
- vlm/train/2-0wS9-cSL/7.png +3 -0
- vlm/train/2-0wS9-cSL/8.png +3 -0
parse/train/B1x1ma4tDr/B1x1ma4tDr.md
ADDED
|
@@ -0,0 +1,381 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DDSP: DIFFERENTIABLE DIGITAL SIGNAL PROCESSING
|
| 2 |
+
|
| 3 |
+
Jesse Engel, Lamtharn Hantrakul, Chenjie Gu, & Adam Roberts
|
| 4 |
+
|
| 5 |
+
Google Research, Brain Team
|
| 6 |
+
Mountain View, CA 94043, USA
|
| 7 |
+
{jesseengel,hanoih,gcj,adarob}@google.com
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
Most generative models of audio directly generate samples in one of two domains: time or frequency. While sufficient to express any signal, these representations are inefficient, as they do not utilize existing knowledge of how sound is generated and perceived. A third approach (vocoders/synthesizers) successfully incorporates strong domain knowledge of signal processing and perception, but has been less actively researched due to limited expressivity and difficulty integrating with modern auto-differentiation-based machine learning methods. In this paper, we introduce the Differentiable Digital Signal Processing (DDSP) library, which enables direct integration of classic signal processing elements with deep learning methods. Focusing on audio synthesis, we achieve high-fidelity generation without the need for large autoregressive models or adversarial losses, demonstrating that DDSP enables utilizing strong inductive biases without losing the expressive power of neural networks. Further, we show that combining interpretable modules permits manipulation of each separate model component, with applications such as independent control of pitch and loudness, realistic extrapolation to pitches not seen during training, blind dereverberation of room acoustics, transfer of extracted room acoustics to new environments, and transformation of timbre between disparate sources. In short, DDSP enables an interpretable and modular approach to generative modeling, without sacrificing the benefits of deep learning. The library is publicly available1 and we welcome further contributions from the community and domain experts.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Neural networks are universal function approximators in the asymptotic limit (Hornik et al., 1989), but their practical success is largely due to the use of strong structural priors such as convolution (LeCun et al., 1989), recurrence (Sutskever et al., 2014; Williams & Zipser, 1990; Werbos, 1990), and self-attention (Vaswani et al., 2017). These architectural constraints promote generalization and data efficiency to the extent that they align with the data domain. From this perspective, end-to-end learning relies on structural priors to scale, but the practitioner’s toolbox is limited to functions that can be expressed differentiably. Here, we increase the size of that toolbox by introducing the Differentiable Digital Signal Processing (DDSP) library, which integrates interpretable signal processing elements into modern automatic differentiation software (TensorFlow). While this approach has broad applicability, we highlight its potential in this paper through exploring the example of audio synthesis.
|
| 16 |
+
|
| 17 |
+
Objects have a natural tendency to periodically vibrate. Small shape displacements are usually restored with elastic forces that conserve energy (similar to a canonical mass on a spring), leading to harmonic oscillation between kinetic and potential energy (Smith, 2010). Accordingly, human hearing has evolved to be highly sensitive to phase-coherent oscillation, decomposing audio into spectrotemporal responses through the resonant properties of the basilar membrane and tonotopic mappings into the auditory cortex (Moerel et al., 2012; Chi et al., 2005; Theunissen & Elie, 2014). However, neural synthesis models often do not exploit this periodic structure for generation and perception.
|
| 18 |
+
|
| 19 |
+
# 1.1 CHALLENGES OF NEURAL AUDIO SYNTHESIS
|
| 20 |
+
|
| 21 |
+
As shown in Figure 1, most neural synthesis models generate waveforms directly in the time domain, or from their corresponding Fourier coefficients in the frequency domain. While these representations are general and can represent any waveform, they are not free from bias. This is because they often apply a prior over generating audio with aligned wave packets rather than oscillations. For example, strided convolution models–such as SING (Defossez et al., 2018), MCNN (Arik et al., 2019), and WaveGAN (Donahue et al., 2019)–generate waveforms directly with overlapping frames. Since audio oscillates at many frequencies, all with different periods from the fixed frame hop size, the model must precisely align waveforms between different frames and learn filters to cover all possible phase variations. This challenge is visualized on the left of Figure 1.
|
| 22 |
+
|
| 23 |
+
Fourier-based models–such as Tacotron (Wang et al., 2017) and GANSynth (Engel et al., 2019)– also suffer from the phase-alignment problem, as the Short-time Fourier Transform (STFT) is a representation over windowed wave packets. Additionally, they must contend with spectral leakage, where sinusoids at multiple neighboring frequencies and phases must be combined to represent a single sinusoid when Fourier basis frequencies do not perfectly match the audio. This effect can be seen in the middle diagram of Figure 1.
|
| 24 |
+
|
| 25 |
+
Autoregressive waveform models–such as WaveNet (Oord et al., 2016), SampleRNN (Mehri et al., 2016), and WaveRNN (Kalchbrenner et al., 2018)–avoid these issues by generating the waveform a single sample at a time. They are not constrained by the bias over generating wave packets and can express arbitrary waveforms. However, they require larger and more data-hungry networks, as they do not take advantage of a bias over oscillation (size comparisons can be found in Table B.6). Furthermore, the use of teacher-forcing during training leads to exposure bias during generation, where errors with feedback can compound. It also makes them incompatible with perceptual losses such as spectral features (Defossez et al., 2018), pretrained models (Dosovitskiy & Brox, 2016), and discriminators (Engel et al., 2019). This adds further inefficiency to these models, as a waveform’s shape does not perfectly correspond to perception. For example, the three waveforms on the right of Figure 1 sound identical (a relative phase offset of the harmonics) but would present different losses to an autoregressive model.
|
| 26 |
+
|
| 27 |
+

|
| 28 |
+
Figure 1: Challenges of neural audio synthesis. Full description provided in Section 1.1.
|
| 29 |
+
|
| 30 |
+
# 1.2 OSCILLATOR MODELS
|
| 31 |
+
|
| 32 |
+
Rather than predicting waveforms or Fourier coefficients, a third model class directly generates audio with oscillators. Known as vocoders or synthesizers, these models are physically and perceptually motivated and have a long history of research and applications (Beauchamp, 2007; Morise et al., 2016). These “analysis/synthesis” models use expert knowledge and hand-tuned heuristics to extract synthesis parameters (analysis) that are interpretable (loudness and frequencies) and can be used by the generative algorithm (synthesis).
|
| 33 |
+
|
| 34 |
+
Neural networks have been used previously to some success in modeling pre-extracted synthesis parameters (Blaauw & Bonada, 2017; Chandna et al., 2019), but these models fall short of endto-end learning. The analysis parameters must still be tuned by hand and gradients cannot flow through the synthesis procedure. As a result, small errors in parameters can lead to large errors in the audio that cannot propagate back to the network. Crucially, the realism of vocoders is limited by the expressivity of a given analysis/synthesis pair.
|
| 35 |
+
|
| 36 |
+
# 1.3 CONTRIBUTIONS
|
| 37 |
+
|
| 38 |
+
In this paper, we overcome the limitations outlined above by using the DDSP library to implement fully differentiable synthesizers and audio effects. DDSP models combine the strengths of the above approaches, benefiting from the inductive bias of using oscillators, while retaining the expressive power of neural networks and end-to-end training.
|
| 39 |
+
|
| 40 |
+
We demonstrate that models employing DDSP components are capable of generating high-fidelity audio without autoregressive or adversarial losses. Further, we show the interpretability and modularity of these models enable:
|
| 41 |
+
|
| 42 |
+
• Independent control over pitch and loudness during synthesis.
|
| 43 |
+
• Realistic extrapolation to pitches not seen during training.
|
| 44 |
+
• Blind dereverberation of audio through seperate modelling of room acoustics.
|
| 45 |
+
• Transfer of extracted room acoustics to new environments.
|
| 46 |
+
• Timbre transfer between disparate sources, converting a singing voice into a violin.
|
| 47 |
+
• Smaller network sizes than comparable neural synthesizers.
|
| 48 |
+
|
| 49 |
+
Audio samples for all examples and figures are provided in the online supplement2. We highly encourage readers to listen to the samples as part of reading the paper.
|
| 50 |
+
|
| 51 |
+
# 2 RELATED WORK
|
| 52 |
+
|
| 53 |
+
Vocoders. Vocoders come in several varieties. Source-filter/subtractive models are inspired by the human vocal tract and dynamically filter a harmonically rich source signal (Flanagan, 2013), while sinusoidal/additive models generate sound as the combination of a set of time-varying sine waves (McAulay & Quatieri, 1986; Serra & Smith, 1990). Additive models are strictly more expressive than subtractive models but have more parameters as each sinusoid has its own time-varying loudness and frequency. This work builds a differentiable synthesizer off the Harmonic plus Noise model (Serra & Smith, 1990; Beauchamp, 2007): an additive synthesizer combines sinusoids in harmonic (integer) ratios of a fundamental frequency alongside a time-varying filtered noise signal.
|
| 54 |
+
|
| 55 |
+
Synthesizers. A separate thread of research has tried to estimate parameters for commercial synthesizers using gradient-free methods (Huang et al., 2014; Hoffman & Cook, 2006). Synthesizer outputs modeled with a variational autoencoder were recently used as a “world model” (Ha & Schmidhuber, 2018) to pass approximate gradients to a controller during learning (Esling et al., 2019). DDSP differs from black-box approaches to modeling existing synthesizers; it is a toolkit of differentiable DSP components for end-to-end learning.
|
| 56 |
+
|
| 57 |
+
Neural Source Filter (NSF). Perhaps closest to this work, promising speech synthesis results were recently achieved using a differentiable waveshaping synthesizer (Wang et al., 2019). The NSF can be seen as a specific DDSP model, that uses convolutional waveshaping of a sinusoidal oscillator to create harmonic content, rather than additive synthesis explored in this work. Both works also generate audio in the time domain and impose multi-scale spectrograms losses in the frequency domain. A key contribution of this work is to highlight how these models are part of a common family of techniques and to release a modular library that makes them accessible by leveraging automatic differentiation to easily mix and match components at a high level.
|
| 58 |
+
|
| 59 |
+
# 3 DDSP COMPONENTS
|
| 60 |
+
|
| 61 |
+
Many DSP operations can be expressed as functions in modern automatic differentiation software. We express core components as feedforward functions, allowing efficient implementation on parallel
|
| 62 |
+
|
| 63 |
+
hardware such as GPUs and TPUs, and generation of samples during training. These components include oscillators, envelopes, and filters (linear-time-varying finite-impulse-response, LTV-FIR). 3
|
| 64 |
+
|
| 65 |
+
# 3.1 SPECTRAL MODELING SYNTHESIS
|
| 66 |
+
|
| 67 |
+
Here, as an example DDSP model, we implement a differentiable version of Spectral Modeling Synthesis (SMS) Serra & Smith (1990). This model generates sound by combining an additive synthesizer (adding together many sinusoids) with a subtractive synthesizer (filtering white noise). We choose SMS because, despite being parametric, it is a highly expressive model of sound, and has found widespread adoption in tasks as diverse as spectral morphing, time stretching, pitch shifting, source separation, transcription, and even as a general purpose audio codec in MPEG-4 (Tellman et al., 1995; Klapuri et al., 2000; Purnhagen & Meine, 2000).
|
| 68 |
+
|
| 69 |
+
As we only consider monophonic sources in these experiments, we use the Harmonic plus Noise model, that further constrains sinusoids to be integer multiples of a fundamental frequency (Beauchamp, 2007). One of the reasons that SMS is more expressive than many other parametric models because it has so many more parameters. For example, in the 4 seconds of $1 6 \mathrm { k H z }$ audio in the datasets considered here, the synthesizer coefficients actually have ${ \sim } 2 . 5$ times more dimensions than the audio waveform itself ((1 amplitude $+ ~ 1 0 0$ harmonics $+ ~ 6 5$ noise band magnitudes) $\ast 1 0 0 0$ timesteps $= 1 6 5 { , } 0 0 0$ dimensions, vs. 64,000 audio samples). This makes them amenable to control by a neural network, as it would be difficult to realistically specify all these parameters by hand.
|
| 70 |
+
|
| 71 |
+
# 3.2 HARMONIC OSCILLATOR $/$ ADDITIVE SYNTHESIZER
|
| 72 |
+
|
| 73 |
+
At the heart of the synthesis techniques explored in this paper is the sinusoidal oscillator. A bank of oscillators that outputs a signal $x ( n )$ over discrete time steps, $n$ , can be expressed as:
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
x ( n ) = \sum _ { k = 1 } ^ { K } A _ { k } ( n ) \sin ( \phi _ { k } ( n ) ) ,
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
where $A _ { k } ( n )$ is the time-varying amplitude of the $k$ -th sinusoidal component and $\phi _ { k } ( n )$ is its instantaneous phase. The phase $\phi _ { k } ( n )$ is obtained by integrating the instantaneous frequency $f _ { k } ( n )$ :
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\phi _ { k } ( n ) = 2 \pi \sum _ { m = 0 } ^ { n } f _ { k } ( m ) + \phi _ { 0 , k } ,
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
where $\phi _ { 0 , k }$ is the initial phase that can be randomized, fixed, or learned.
|
| 86 |
+
|
| 87 |
+
For a harmonic oscillator, all the sinusoidal frequencies are harmonic (integer) multiples of a fundamental frequency, $f _ { 0 } ( n )$ , i.e., $f _ { k } ( n ) = k f _ { 0 } ( n )$ , Thus the output of the harmonic oscillator is entirely parameterized by the time-varying fundamental frequency $f _ { 0 } ( n )$ and harmonic amplitudes $A _ { k } ( n )$ . To aid interpretablity we further factorize the harmonic amplitudes:
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
A _ { k } ( n ) = A ( n ) c _ { k } ( n ) .
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
into a global amplitude $A ( n )$ that controls the loudness and a normalized distribution over harmonics $c ( n )$ that determines spectral variations, where $\textstyle \sum _ { k = 0 } ^ { K } c _ { k } ( n ) = 1$ and $c _ { k } ( n ) \geq 0$ . We also constrain both amplitudes and harmonic distribution components to be positive through the use of a modified sigmoid nonlinearity as described in the appendix. Figure 6 provides a graphical example of the additive synthesizer. Audio is provided in our online supplement2.
|
| 94 |
+
|
| 95 |
+
# 3.3 ENVELOPES
|
| 96 |
+
|
| 97 |
+
The oscillator formulation above requires time-varying amplitudes and frequencies at the audio sample rate, but our neural networks operate at a slower frame rate. For instantaneous frequency upsampling, we found bilinear interpolation to be adequate. However, the amplitudes and harmonic distributions of the additive synthesizer required smoothing to prevent artifacts. We are able to achieve this with a smoothed amplitude envelope by adding overlapping Hamming windows at the center of each frame and scaled by the amplitude. For these experiments we found a 4ms (64 timesteps) hop size and $8 \mathrm { m s }$ frame size ( $50 \%$ overlap) to be responsive to changes while removing artifacts.
|
| 98 |
+
|
| 99 |
+
3.4 FILTER DESIGN: FREQUENCY SAMPLING METHOD
|
| 100 |
+
|
| 101 |
+
Linear filter design is a cornerstone of many DSP techniques. Standard convolutional layers are equivalent to linear time invariant finite impulse response (LTI-FIR) filters. However, to ensure interpretability and prevent phase distortion, we employ the frequency sampling method to convert network outputs into impulse responses of linear-phase filters.
|
| 102 |
+
|
| 103 |
+
Here, we design a neural network to predict the frequency-domain transfer functions of a FIR filter for every output frame. In particular, the neural network outputs a vector $\pmb { H } _ { l }$ (and accordingly $\pmb { h } _ { l } = \mathrm { I D P T } ( \bar { \pmb { H } } _ { l } ) ;$ ) for the $l$ -th frame of the output. We interpret $\pmb { H } _ { l }$ as the frequency-domain transfer function of the corresponding FIR filter. We therefore implement a time-varying FIR filter.
|
| 104 |
+
|
| 105 |
+
To apply the time-varying FIR filter to the input, we divide the audio into non-overlapping frames $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } \mathbf { \mathcal { l } } }$ to match the impulse responses $h _ { l }$ . We then perform frame-wise convolution via multiplication of frames in the Fourier domain: $Y _ { l } = H _ { l } X _ { l }$ where $\pmb { X } _ { l } = \mathbf { D } \mathrm { F T } ( \pmb { x } _ { l } )$ and $Y _ { l } = \mathrm { D F T } ( { \pmb y } _ { l } )$ is the output. We recover the frame-wise filtered audio, ${ \pmb y } _ { l } = \mathrm { I D F T } ( { \pmb Y } _ { l } )$ , and then overlap-add the resulting frames with the same hop size and rectangular window used to originally divide the input audio. The hop size is given by dividing the audio into equally spaced frames for each frame of conditioning. For 64000 samples and 250 frames, this corresponds to a hop size of 256.
|
| 106 |
+
|
| 107 |
+
In practice, we do not use the neural network output directly as $\pmb { H } _ { l }$ . Instead, we apply a window function $W$ on the network output to compute $\pmb { H } _ { l }$ . The shape and size of the window can be decided independently to control the time-frequency resolution trade-off of the filter. In our experiments, we default to a Hann window of size 257. Without a window, the resolution implicitly defaults to a rectangular window which is not ideal for many cases. We take care to shift the IR to zero-phase (symmetric) form before applying the window and revert to causal form before applying the filter.
|
| 108 |
+
|
| 109 |
+
# 3.5 FILTERED NOISE / SUBTRACTIVE SYNTHESIZER
|
| 110 |
+
|
| 111 |
+
Natural sounds contain both harmonic and stochastic components. The Harmonic plus Noise model captures this by combining the output of an additive synthesizer with a stream of filtered noise (Serra & Smith, 1990; Beauchamp, 2007). We are able to realize a differentiable filtered noise synthesizer by simply applying the LTV-FIR filter from above to a stream of uniform noise $Y _ { l } = H _ { l } N _ { l }$ where $N _ { l }$ is the DFT of uniform noise in domain [-1, 1].
|
| 112 |
+
|
| 113 |
+
# 3.6 REVERB: LONG IMPULSE RESPONSES
|
| 114 |
+
|
| 115 |
+
Room reverbation (reverb) is an essential characteristic of realistic audio, which is usually implicitly modeled by neural synthesis algorithms. In contrast, we gain interpretability by explicitly factorizing the room acoustics into a post-synthesis convolution step. A realistic room impulse response (IR) can be as long as several seconds, corresponding to extremely long convolutional kernel sizes $( \sim 1 0 - 1 0 0 \mathrm { k }$ timesteps). Convolution via matrix multiplication scales as $\mathsf { \bar { O } } ( n ^ { 3 } )$ , which is intractable for such large kernel sizes. Instead, we implement reverb by explicitly performing convolution as multiplication in the frequency domain, which scales as $\mathcal { O } ( n \overset { \cdot } { \log { n } } )$ and does not bottleneck training.
|
| 116 |
+
|
| 117 |
+
# 4 EXPERIMENTS
|
| 118 |
+
|
| 119 |
+
For empirical verification of this approach, we test two DDSP autoencoder variants–supervised and unsupervised–on two different musical datasets: NSynth (Engel et al., 2017) and a collection of solo violin performances. The supervised DDSP autoencoder is conditioned on fundamental frequency (F0) and loudness features extracted from audio, while the unsupervised DDSP autoencoder learns F0 jointly with the rest of the network.
|
| 120 |
+
|
| 121 |
+

|
| 122 |
+
Figure 2: Autoencoder architecture. Red components are part of the neural network architecture, green components are the latent representation, and yellow components are deterministic synthesizers and effects. Components with dashed borders are not used in all of our experiments. Namely, $_ z$ is not used in the model trained on solo violin, and reverb is not used in the models trained on NSynth. See the appendix for more detailed diagrams of the neural network components.
|
| 123 |
+
|
| 124 |
+
# 4.1 DDSP AUTOENCODER
|
| 125 |
+
|
| 126 |
+
DDSP components do not put constraints on the choice of generative model (GAN, VAE, Flow, etc.), but we focus here on a deterministic autoencoder to investigate the strength of DDSP components independent of any particular approach to adversarial training, variational inference, or Jacobian design. Just as autoencoders utilizing convolutional layers outperform fully-connected autoencoders on images, we find DDSP components are able to dramatically improve autoencoder performance in the audio domain. Introducing stochastic latents (such as in GAN, VAE, and Flow models) will likely further improve performance, but we leave that to future work as it is orthogonal to the core question of DDSP component performance that we investigate in this paper.
|
| 127 |
+
|
| 128 |
+
In a standard autoencoder, an encoder network $f _ { \mathrm { e n c } } ( \cdot )$ maps the input $_ { \textbf { \em x } }$ to a latent representation $z = f _ { \mathrm { e n c } } ( \pmb { x } )$ and a decoder network $f _ { \mathrm { d e c } } ( \cdot )$ attempts to directly reconstruct the input $\begin{array} { r } { \bar { \hat { \pmb x } } = f _ { \mathrm { d e c } } ( \pmb z ) } \end{array}$ . Our architecture (Figure 2) contrasts with this approach through the use of DDSP components and a decomposed latent representation.
|
| 129 |
+
|
| 130 |
+
Encoders: Detailed descriptions of the encoders are given in Section B.1. For the supervised autoencoder, the loudness $l ( t )$ is extracted directly from the audio, a pretrained CREPE model with fixed weights (Kim et al., 2018) is used as an $f ( t )$ encoder to extact the fundamental frequency, and optional encoder extracts a time-varying latent encoding $z ( t )$ of the residual information. For the $z ( t )$ encoder, MFCC coefficients (30 per a frame) are first extracted from the audio, which correspond to the smoothed spectral envelope of harmonics (Beauchamp, 2007), and transformed by a single GRU layer into 16 latent variables per a frame.
|
| 131 |
+
|
| 132 |
+
For the unsupervised autoencoder, the pretrained CREPE model is replaced with a Resnet architecture (He et al., 2016) that extracts $f ( t )$ from a mel-scaled log spectrogram of the audio, and is jointly trained with the rest of the network.
|
| 133 |
+
|
| 134 |
+
Decoder: A detailed description of the decoder network is given in Section B.2. The decoder network maps the tuple $( f ( \bar { t } ) , l ( t ) , z ( t ) )$ to control parameters for the additive and filtered noise synthesizers described in Section 3. The synthesizers generate audio based on these parameters, and a reconstruction loss between the synthesized and original audio is minimized. The network architecture is chosen to be fairly generic (fully connected, with a single recurrent layer) to demonstrate that it is the DDSP components, and not other modeling decisions, that enables the quality of the work.
|
| 135 |
+
|
| 136 |
+
Also unique to our approach, the latent $f ( t )$ is fed directly to the additive synthesizer as it has structural meaning for the synthesizer outside the context of any given dataset. As shown later in Section 5.2, this disentangled representation enables the model to both interpolate within and ex
|
| 137 |
+
|
| 138 |
+
<table><tr><td></td><td>Loudness (L1)</td><td>F0 (L1)</td><td>F0 Outliers</td></tr><tr><td>Supervised WaveRNN (Hantrakul et al., 2019)</td><td>0.10</td><td>1.00</td><td>0.07</td></tr><tr><td>DDSP Autoencoder Unsupervised</td><td>0.07</td><td>0.02</td><td>0.003</td></tr><tr><td>DDSP Autoencoder</td><td>0.09</td><td>0.80</td><td>0.04</td></tr></table>
|
| 139 |
+
|
| 140 |
+
Table 1: Resynthesis accuracies. Comparison of DDSP models to SOTA WaveRNN model provided the same conditioning information. The supervised DDSP Autoencoder and WaveRNN models use the fundamental frequency from a pretrained CREPE model, while the unsupervised DDSP autoencoder learns to infer the frequency from the audio during training.
|
| 141 |
+
|
| 142 |
+
trapolate outside the data distribution. Indeed, recent work support incorporation of strong inductive biases as a prerequisite for learning disentangled representations (Locatello et al., 2018).
|
| 143 |
+
|
| 144 |
+
Model Size: Table B.6, compares parameter counts for the DDSP models and comparable models including GANSynth (Engel et al., 2019), WaveRNN (Hantrakul et al., 2019), and a WaveNet Autoencoder (Engel et al., 2017). The DDSP models have the fewest parameters (up to 10 times less), despite no effort to minimize the model size in these experiments. Initial experiments with very small models (240k parameters, $3 0 0 \mathrm { x }$ smaller than a WaveNet Autoencoder) have less realistic outputs than the full models, but still have fairly high quality and are promising for low-latency applications, even on CPU or embedded devices. Audio samples are available in the online supplement2.
|
| 145 |
+
|
| 146 |
+
# 4.2 DATASETS
|
| 147 |
+
|
| 148 |
+
NSynth: We focus on a smaller subset of the NSynth dataset (Engel et al., 2017) consistent with other work (Engel et al., 2019; Hantrakul et al., 2019). It totals 70,379 examples comprised mostly of strings, brass, woodwinds and mallets with pitch labels within MIDI pitch range 24-84. We employ a 80/20 train/test split shuffling across instrument families. For the NSynth experiments, we use the autoencoder as described above (with the $z ( t )$ encoder). We experiment with both the supervised and unsupervised variants.
|
| 149 |
+
|
| 150 |
+
Solo Violin: The NSynth dataset does not capture aspects of a real musical performance. Using the MusOpen royalty free music library, we collected 13 minutes of expressive, solo violin performances4. We purposefully selected pieces from a single performer (John Garner), that were monophonic and shared a consistent room environment to encourage the model to focus on performance. Like NSynth, audio is converted to mono 16kHz and divided into 4 second training examples (64000 samples total). Code to process the audio files into a dataset is available online.5
|
| 151 |
+
|
| 152 |
+
For the solo violin experiments, we use the supervised variant of the autoencoder (without the $z ( t )$ encoder), and add a reverb module to the signal processor chain to account for room reverberation. While the room impulse response could be produced as an output of the decoder, given that the solo violin dataset has a single acoustic environment, we use a single fixed variable (4 second reverb corresponding to 64000 dimensions) for the impulse response.
|
| 153 |
+
|
| 154 |
+
# 4.2.1 MULTI-SCALE SPECTRAL LOSS
|
| 155 |
+
|
| 156 |
+
The primary objective of the autoencoder is to minimize reconstruction loss. However, for audio waveforms, point-wise loss on the raw waveform is not ideal, as two perceptually identical audio samples may have distinct waveforms, and point-wise similar waveforms may sound very different.
|
| 157 |
+
|
| 158 |
+
Instead, we use a multi-scale spectral loss–similar to the multi-resolution spectral amplitude distance in Wang et al. (2019)–defined as follows. Given the original and synthesized audio, we compute their (magnitude) spectrogram $S _ { i }$ and $\hat { S } _ { i }$ , respectively, with a given FFT size $i$ , and define the loss as the
|
| 159 |
+
|
| 160 |
+

|
| 161 |
+
Figure 3: Separate interpolations over loudness, pitch, and timbre. The conditioning features (solid lines) are extracted from two notes and linearly mixed (dark to light coloring). The features of the resynthsized audio (dashed lines) closely follow the conditioning. On the right, the latent vectors, $z ( t )$ , are interpolated, and the spectral centroid of resulting audio (thin solid lines) smoothly varies between the original samples (dark solid lines).
|
| 162 |
+
|
| 163 |
+
sum of the L1 difference between $S _ { i }$ and $\hat { S } _ { i }$ as well as the L1 difference between $\log { S _ { i } }$ and $\log { \hat { S } _ { i } }$ .
|
| 164 |
+
|
| 165 |
+
$$
|
| 166 |
+
L _ { i } = | | S _ { i } - \hat { S _ { i } } | | _ { 1 } + \alpha | | \log S _ { i } - \log \hat { S } _ { i } | | _ { 1 } .
|
| 167 |
+
$$
|
| 168 |
+
|
| 169 |
+
where $\alpha$ is a weighting term set to 1.0 in our experiments. The total reconstruction loss is then the sum of all the spectral losses, $\begin{array} { r } { L _ { \mathrm { r e c o n s t r u c t i o n } } = \sum _ { i } { L _ { i } } } \end{array}$ . In our experiments, we used FFT sizes (2048, 1024, 512, 256, 128, 64), and the neighboring frames in the Short-Time Fourier Transform (STFT) overlap by $7 5 \%$ . Therefore, the $L _ { i }$ ’s cover differences between the original and synthesized audios at different spatial-temporal resolutions.
|
| 170 |
+
|
| 171 |
+
# 5 RESULTS
|
| 172 |
+
|
| 173 |
+
# 5.1 HIGH-FIDELITY SYNTHESIS
|
| 174 |
+
|
| 175 |
+
As shown in Figure 5, the DDSP autoencoder learns to very accurately resynthesize the solo violin dataset. Again, we highly encourage readers to listen to the samples provided in the online supplement2. A full decomposition of the components is provided Figure 5. High-quality neural audio synthesis has previously required very large autoregressive models (Oord et al., 2016; Kalchbrenner et al., 2018) or adversarial loss functions (Engel et al., 2019). While amenable to an adversarial loss, the DDSP autoencoder achieves these results with a straightforward L1 spectrogram loss, a small amount of data, and a relatively simple model. This demonstrates that the model is able to efficiently exploit the bias of the DSP components, while not losing the expressive power of neural networks.
|
| 176 |
+
|
| 177 |
+
For the NSynth dataset, we quantitatively compare the quality of DDSP resynthesis with that of a state-of-the-art baseline using WaveRNN (Hantrakul et al., 2019). The models are comparable as they are trained on the same data, provided the same conditioning, and both targeted towards realtime synthesis applications. In Table 1, we compute loudness and fundamental frequency (F0) $L _ { 1 }$ metrics described in Section C of the appendix. Despite the strong performance of the baseline, the supervised DDSP autoencoder still outperforms it, especially in $\mathrm { F 0 ~ } L _ { 1 }$ . This is not unexpected, as the additive synthesizer directly uses the conditioning frequency to synthesize audio.
|
| 178 |
+
|
| 179 |
+
The unsupervised DDSP autoencoder must learn to infer its own F0 conditioning signal directly from the audio. As described in Section B.4, we improve optimization by also adding a perceptual loss in the form of a pretrained CREPE network (Kim et al., 2018). While not as accurate as the supervised DDSP version, the model does a fair job at learning to generate sounds with the correct frequencies without supervision, outperforming the supervised WaveRNN model.
|
| 180 |
+
|
| 181 |
+
# 5.2 INDEPENDENT CONTROL OF LOUDNESS AND PITCH
|
| 182 |
+
|
| 183 |
+
Interpolation: Interpretable structure allows for independent control over generative factors. Each component of the factorized latent variables $( f ( t ) , l ( t ) , z ( t ) )$ independently alters samples along a matching perceptual axis. For example, Figure 3 shows an interpolation between two sound in the loudness conditioning $l ( t )$ . With other variables held constant, loudness of the synthesized audio closely matches the interpolated input. Similarly, the model reliably matches intermediate pitches between a high pitched $f ( t )$ and low pitched $f ( t )$ . In Table C.2 of the appendix, we quantitatively demonstrate how across interpolations, conditioning independently controls the corresponding characteristics of the audio.
|
| 184 |
+
|
| 185 |
+

|
| 186 |
+
Figure 4: Timbre transfer from singing voice to violin. F0 and loudness features are extracted from the voice and resynthesized with a DDSP autoencoder trained on solo violin.
|
| 187 |
+
|
| 188 |
+
With loudness and pitch explicitly controlled by $( f ( t ) , l ( t ) )$ , the model should use the residual $z ( t )$ to encode timbre. Although architecture and training do not strictly enforce this encoding, we qualitatively demonstrate how varying $_ z$ leads to a smooth change in timbre. In Figure 3, we use the smooth shift in spectral centroid, or “center of mass” of a spectrum, to illustrate this behavior.
|
| 189 |
+
|
| 190 |
+
Extrapolation: As described in Section 4.1, $f ( t )$ directly controls the additive synthesizer and has structural meaning outside the context of any given dataset. Beyond interpolating between datapoints, the model can extrapolate to new conditions not seen during training. The rightmost plot of Figure 7 demonstrates this by resynthesizing a clip of solo violin after shifting $f ( t )$ down an octave and outside the range of the training data. The audio remains coherent and resembles a related instrument such as a cello. $f ( t )$ is only modified for the synthesizer, as the decoder is still bounded by the nearby distribution of the training data and produces unrealistic harmonic content if conditioned far outside that distribution.
|
| 191 |
+
|
| 192 |
+
# 5.3 DEREVERBERATION AND ACOUSTIC TRANSFER
|
| 193 |
+
|
| 194 |
+
Removing reverb in a “blind” setting, where only reverberated audio is available, is a standing problem in acoustics (Naylor & Gaubitch, 2010). However, a benefit of our modular approach to generative modeling is that it becomes possible to completely separate the source audio from the effect of the room. For the solo violin dataset, the DDSP autoencoder is trained with an additional reverb module as shown in Figure 2 and described in Section 3.6. Figure 7 (left) demonstrates that bypassing the reverb module during resynthesis results in completely dereverberated audio, similar to recording in an anechoic chamber. The quality of the approach is limited by the underlying generative model, which is quite high for our autoencoder. Similarly, Figure 7 (center) demonstrates that we can also apply the learned reverb model to new audio, in this case singing, and effectively transfer the acoustic environment of the solo violin recordings.
|
| 195 |
+
|
| 196 |
+
# 5.4 TIMBRE TRANSFER
|
| 197 |
+
|
| 198 |
+
Figure 4 demonstrates timbre transfer, converting the singing voice of an author into a violin. F0 and loudness features are extracted from the singing voice and the DDSP autoencoder trained on solo violin used for resynthesis. To better match the conditioning features, we first shift the fundamental frequency of the singing up by two octaves to fit a violin’s typical register. Next, we transfer the room acoustics of the violin recording (as described in Section 5.3) to the voice before extracting loudness, to better match the loudness contours of the violin recordings. The resulting audio captures many subtleties of the singing with the timbre and room acoustics of the violin dataset. Note the interesting “breathing” artifacts in the silence corresponding to unvoiced syllables from the singing.
|
| 199 |
+
|
| 200 |
+
# 6 CONCLUSION
|
| 201 |
+
|
| 202 |
+
The DDSP library fuses classical DSP with deep learning, providing the ability to take advantage of strong inductive biases without losing the expressive power of neural networks and end-to-end
|
| 203 |
+
|
| 204 |
+
learning. We encourage contributions from domain experts and look forward to expanding the scope of the DDSP library to a wide range of future applications.
|
| 205 |
+
|
| 206 |
+
# REFERENCES
|
| 207 |
+
|
| 208 |
+
S. O. Arik, H. Jun, and G. Diamos. Fast spectrogram inversion using multi-head convolutional neural networks. IEEE Signal Processing Letters, 26(1):94–98, Jan 2019. doi: 10.1109/LSP. 2018.2880284.
|
| 209 |
+
|
| 210 |
+
James W Beauchamp. Analysis, synthesis, and perception of musical sounds. Springer, 2007.
|
| 211 |
+
|
| 212 |
+
Merlijn Blaauw and Jordi Bonada. A neural parametric singing synthesizer modeling timbre and expression from natural songs. Applied Sciences, 7(12):1313, 2017.
|
| 213 |
+
|
| 214 |
+
Pritish Chandna, Merlijn Blaauw, Jordi Bonada, and Emilia Gomez. Wgansing: A multi-voice singing voice synthesizer based on the wasserstein-gan. arXiv preprint arXiv:1903.10729, 2019.
|
| 215 |
+
|
| 216 |
+
Taishih Chi, Powen Ru, and Shihab A Shamma. Multiresolution spectrotemporal analysis of complex sounds. The Journal of the Acoustical Society of America, 118(2):887–906, 2005.
|
| 217 |
+
|
| 218 |
+
Alexandre Defossez, Neil Zeghidour, Nicolas Usunier, Leon Bottou, and Francis Bach. Sing: Symbol-to-instrument neural generator. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett (eds.), Advances in Neural Information Processing Systems 31, pp. 9041–9051. Curran Associates, Inc., 2018. URL http://papers.nips.cc/paper/ 8118-sing-symbol-to-instrument-neural-generator.pdf.
|
| 219 |
+
|
| 220 |
+
Chris Donahue, Julian McAuley, and Miller Puckette. Adversarial audio synthesis. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum? id $=$ ByMVTsR5KQ.
|
| 221 |
+
|
| 222 |
+
Alexey Dosovitskiy and Thomas Brox. Generating images with perceptual similarity metrics based on deep networks. In Advances in neural information processing systems, pp. 658–666, 2016.
|
| 223 |
+
|
| 224 |
+
Jesse Engel, Cinjon Resnick, Adam Roberts, Sander Dieleman, Douglas Eck, Karen Simonyan, and Mohammad Norouzi. Neural audio synthesis of musical notes with WaveNet autoencoders. In ICML, 2017.
|
| 225 |
+
|
| 226 |
+
Jesse Engel, Kumar Krishna Agrawal, Shuo Chen, Ishaan Gulrajani, Chris Donahue, and Adam Roberts. GANSynth: Adversarial neural audio synthesis. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } }$ H1xQVn09FX.
|
| 227 |
+
|
| 228 |
+
Philippe Esling, Naotake Masuda, Adrien Bardet, Romeo Despres, et al. Universal audio synthesizer control with normalizing flows. arXiv preprint arXiv:1907.00971, 2019.
|
| 229 |
+
|
| 230 |
+
James L Flanagan. Speech analysis synthesis and perception, volume 3. Springer Science & Business Media, 2013.
|
| 231 |
+
|
| 232 |
+
David Ha and Jurgen Schmidhuber. World models. ¨ arXiv preprint arXiv:1803.10122, 2018.
|
| 233 |
+
|
| 234 |
+
Lamtharn (Hanoi) Hantrakul, Jesse Engel, Adam Roberts, and Chenjie Gu. Fast and flexible neural audio synthesis. In ISMIR, 2019.
|
| 235 |
+
|
| 236 |
+
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, pp. 770–778, 2016.
|
| 237 |
+
|
| 238 |
+
Matthew D Hoffman and Perry R Cook. Feature-based synthesis: Mapping acoustic and perceptual features onto synthesis parameters. In ICMC. Citeseer, 2006.
|
| 239 |
+
|
| 240 |
+
Kurt Hornik, Maxwell Stinchcombe, and Halbert White. Multilayer feedforward networks are universal approximators. Neural networks, 2(5):359–366, 1989.
|
| 241 |
+
|
| 242 |
+
Cheng-Zhi Anna Huang, David Duvenaud, Kenneth C Arnold, Brenton Partridge, Josiah W Oberholtzer, and Krzysztof Z Gajos. Active learning of intuitive control knobs for synthesizers using gaussian processes. In Proceedings of the 19th international conference on Intelligent User Interfaces, pp. 115–124. ACM, 2014.
|
| 243 |
+
|
| 244 |
+
Nal Kalchbrenner, Erich Elsen, Karen Simonyan, Seb Noury, Norman Casagrande, Edward Lockhart, Florian Stimberg, Aaron van den Oord, Sander Dieleman, and Koray Kavukcuoglu. Efficient neural audio synthesis. arXiv preprint arXiv:1802.08435, 2018.
|
| 245 |
+
|
| 246 |
+
Jong Wook Kim, Justin Salamon, Peter Li, and Juan Pablo Bello. Crepe: A convolutional representation for pitch estimation. In 2018 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 161–165. IEEE, 2018.
|
| 247 |
+
|
| 248 |
+
Anssi Klapuri, Tuomas Virtanen, and Jan-Markus Holm. Robust multipitch estimation for the analysis and manipulation of polyphonic musical signals. In Proc. COST-G6 Conference on Digital Audio Effects, pp. 233–236, 2000.
|
| 249 |
+
|
| 250 |
+
Y. LeCun, B. Boser, J. S. Denker, D. Henderson, R. E. Howard, W. Hubbard, and L. D. Jackel. Backpropagation applied to handwritten zip code recognition. Neural Computation, 1(4):541– 551, 1989. doi: 10.1162/neco.1989.1.4.541. URL https://doi.org/10.1162/neco. 1989.1.4.541.
|
| 251 |
+
|
| 252 |
+
Francesco Locatello, Stefan Bauer, Mario Lucic, Sylvain Gelly, Bernhard Scholkopf, and Olivier ¨ Bachem. Challenging common assumptions in the unsupervised learning of disentangled representations. arXiv preprint arXiv:1811.12359, 2018.
|
| 253 |
+
|
| 254 |
+
Robert McAulay and Thomas Quatieri. Speech analysis/synthesis based on a sinusoidal representation. IEEE Transactions on Acoustics, Speech, and Signal Processing, 34(4):744–754, 1986.
|
| 255 |
+
|
| 256 |
+
Soroush Mehri, Kundan Kumar, Ishaan Gulrajani, Rithesh Kumar, Shubham Jain, Jose Sotelo, Aaron Courville, and Yoshua Bengio. Samplernn: An unconditional end-to-end neural audio generation model. arXiv preprint arXiv:1612.07837, 2016.
|
| 257 |
+
|
| 258 |
+
Michelle Moerel, Federico De Martino, and Elia Formisano. Processing of natural sounds in human auditory cortex: tonotopy, spectral tuning, and relation to voice sensitivity. Journal of Neuroscience, 32(41):14205–14216, 2012.
|
| 259 |
+
|
| 260 |
+
Masanori Morise, Fumiya Yokomori, and Kenji Ozawa. World: a vocoder-based high-quality speech synthesis system for real-time applications. IEICE TRANSACTIONS on Information and Systems, 99(7):1877–1884, 2016.
|
| 261 |
+
|
| 262 |
+
Patrick A Naylor and Nikolay D Gaubitch. Speech dereverberation. Springer Science & Business Media, 2010.
|
| 263 |
+
|
| 264 |
+
Aaron van den Oord, Sander Dieleman, Heiga Zen, Karen Simonyan, Oriol Vinyals, Alex Graves, Nal Kalchbrenner, Andrew Senior, and Koray Kavukcuoglu. Wavenet: A generative model for raw audio. arXiv preprint arXiv:1609.03499, 2016.
|
| 265 |
+
|
| 266 |
+
Heiko Purnhagen and Nikolaus Meine. Hiln-the mpeg-4 parametric audio coding tools. In 2000 IEEE International Symposium on Circuits and Systems. Emerging Technologies for the 21st Century. Proceedings (IEEE Cat No. 00CH36353), volume 3, pp. 201–204. IEEE, 2000.
|
| 267 |
+
|
| 268 |
+
Xavier Serra and Julius Smith. Spectral modeling synthesis: A sound analysis/synthesis system based on a deterministic plus stochastic decomposition. Computer Music Journal, 14(4):12–24, 1990.
|
| 269 |
+
|
| 270 |
+
Julius Orion Smith. Physical audio signal processing: For virtual musical instruments and audio effects. W3K publishing, 2010.
|
| 271 |
+
|
| 272 |
+
Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to sequence learning with neural networks. In Advances in neural information processing systems, pp. 3104–3112, 2014.
|
| 273 |
+
|
| 274 |
+
Edwin Tellman, Lippold Haken, and Bryan Holloway. Timbre morphing of sounds with unequal numbers of features. Journal of the Audio Engineering Society, 43(9):678–689, 1995.
|
| 275 |
+
|
| 276 |
+
Fred´ eric E Theunissen and Julie E Elie. Neural processing of natural sounds. ´ Nature Reviews Neuroscience, 15(6):355, 2014.
|
| 277 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems, pp. 5998–6008, 2017.
|
| 278 |
+
Xin Wang, Shinji Takaki, and Junichi Yamagishi. Neural source-filter waveform models for statistical parametric speech synthesis. arXiv preprint arXiv:1904.12088, 2019.
|
| 279 |
+
Yuxuan Wang, RJ Skerry-Ryan, Daisy Stanton, Yonghui Wu, Ron J Weiss, Navdeep Jaitly, Zongheng Yang, Ying Xiao, Zhifeng Chen, Samy Bengio, et al. Tacotron: Towards end-to-end speech synthesis. In INTERSPEECH, 2017.
|
| 280 |
+
P. J. Werbos. Backpropagation through time: what it does and how to do it. Proceedings of the IEEE, 78(10):1550–1560, Oct 1990. doi: 10.1109/5.58337.
|
| 281 |
+
Ronald J Williams and David Zipser. Gradient-based learning algorithms for recurrent connectionist networks. College of Computer Science, Northeastern University Boston, MA, 1990.
|
| 282 |
+
|
| 283 |
+
A APPENDIX
|
| 284 |
+
|
| 285 |
+

|
| 286 |
+
Figure 5: Decomposition of a clip of solo violin. Audio is visualized with log magnitude spectrograms. Loudness and fundamental frequency signals are extracted from the original audio. The loudness curve does not exhibit clear note segmentations because of the effects of the room acoustics. The DDSP autoencoder takes those conditioning signals and predicts amplitudes, harmonic distributions, and noise magnitudes. Note that the amplitudes are clearly segmented along note boundaries without supervision and that the harmonic and noise distributions are complex and dynamic despite the simple conditioning signals. Finally, the extracted impulse response is applied to the combined audio from the synthesizers to give the full resynthesis audio.
|
| 287 |
+
|
| 288 |
+

|
| 289 |
+
Figure 6: Diagram of the Additive Synthesizer component. The synthesizer generates audio as a sum of sinusoids at harmonic (integer) multiples of the fundamental frequency. The neural network is then tasked with emitting time-varying synthesizer parameters (fundamental frequency, amplitude, harmonic distribution). In this example linear-frequency log-magnitude spectrograms show how the harmonics initially follow the frequency contours of the fundamental. We then factorize the harmonic amplitudes into an overall amplitude envelope that controls the loudness, and a normalized distribution among the different harmonics that determines spectral variations.
|
| 290 |
+
|
| 291 |
+

|
| 292 |
+
Figure 7: Interpretable generative models enables disentanglement and extrapolation. Spectrograms of audio examples include dereverberation of a clip of solo violin playing (left), transfer of the extracted room response to new audio (center), and transposition below the range of training data (right).
|
| 293 |
+
|
| 294 |
+
# B MODEL DETAILS
|
| 295 |
+
|
| 296 |
+
# B.1 ENCODERS
|
| 297 |
+
|
| 298 |
+
The model has three encoders: $f$ -encoder that outputs fundamental frequency $f ( t )$ , $l$ -encoder that outputs loudness $l ( t )$ , and a $_ { z }$ -encoder that outputs residual vector $z ( t )$ .
|
| 299 |
+
|
| 300 |
+
$f$ -encoder: We use a pretrained CREPE pitch detector (Kim et al., 2018) as the $f$ -encoder to extract ground truth fundamental frequencies (F0) from the audio. We used the “large” variant of CREPE, which has SOTA accuracy for monophonic audio samples of musical instruments. For our supervised autoencoder experiments, we fixed the weights of the $f$ -encoder like (Hantrakul et al., 2019), and for our unsupervised autoencoder experiemnts we jointly learn the weights of a resnet model fed log mel spectrograms of the audio. Full details of the resnet architecture are show in Table 2.
|
| 301 |
+
|
| 302 |
+
$l$ -encoder: We use identical computational steps to extract loudness as (Hantrakul et al., 2019). Namely, an A-weighting of the power spectrum, which puts greater emphasis on higher frequencies, followed by log scaling. The vector is then centered according to the mean and standard deviation of the dataset.
|
| 303 |
+
|
| 304 |
+
$_ z$ -encoder: As shown in Figure 8, the encoder first calculates MFCC’s (Mel Frequency Cepstrum Coefficients) from the audio. MFCC is computed from the log-mel-spectrogram of the audio with a FFT size of 1024, 128 bins of frequency range between $2 0 \mathrm { H z }$ to $8 0 0 0 \mathrm { H z }$ , overlap of $7 5 \%$ . We use only the first 30 MFCCs that correspond to a smoothed spectral envelope. The MFCCs are then passed through a normalization layer (which has learnable shift and scale parameters) and a 512-unit GRU. The GRU outputs (over time) fed to a 512-unit linear layer to obtain $z ( t )$ . The $_ z$ embedding reported in this model has 16 dimensions across 250 time-steps.
|
| 305 |
+
|
| 306 |
+
Table 2: Model architecture for the f(t) encoder using a Resnet on log mel spectrograms. Spectrograms have a frame size of 2048 and a hop size of 512, and are upsampled at the end to have the same time resoultion as other latents (4ms per a frame). All convolutions use “same” padding and a temporal stride of 1. Each residual block uses a bottleneck structure (He et al., 2016). The final output is a normalized probablity distribution over 128 frequency values (logarithmically scaled between $8 . 2 \mathrm { H z }$ and $1 3 . 3 \mathrm { k H z }$ (https://www.inspiredacoustics.com/en/MIDI_note numbers_and_center_frequencies)). The finally frequency value is the weighted sum of each frequency by its probability.
|
| 307 |
+
|
| 308 |
+
<table><tr><td>Residual Block</td><td>Output Size</td><td>kTime</td><td>kFreq</td><td>SFreq</td><td>kFilters</td></tr><tr><td>layer norm + relu</td><td></td><td>1</td><td>-</td><td>1</td><td>■</td></tr><tr><td>conv</td><td></td><td>1</td><td>1</td><td>1</td><td>kFilters/4</td></tr><tr><td>layer norm + relu</td><td></td><td></td><td>=</td><td>1</td><td></td></tr><tr><td>conv</td><td></td><td>3</td><td>3</td><td>SFreq</td><td>kFilters/4</td></tr><tr><td>layer norm + relu</td><td></td><td></td><td>-</td><td>-</td><td></td></tr><tr><td>conv</td><td></td><td>1</td><td>1</td><td>1</td><td>kFilters</td></tr><tr><td>add residual</td><td></td><td>=</td><td>-</td><td>-</td><td>=</td></tr><tr><td>Resnet</td><td>Output Size</td><td>kTime</td><td>kFreq</td><td>SFreq</td><td>kFilters</td></tr><tr><td>LogMelSpectrogram</td><td>(125,229, 1)</td><td>1</td><td>-</td><td>1</td><td>1</td></tr><tr><td>conv2d</td><td>(125, 115, 64)</td><td>7</td><td>7</td><td>2</td><td>64</td></tr><tr><td>max pool</td><td>(125,58, 64)</td><td>1</td><td>3</td><td>2</td><td>1</td></tr><tr><td>residual block</td><td>(125,58,128)</td><td>3</td><td>3</td><td>1</td><td>128</td></tr><tr><td>residual block</td><td>(125,57, 128)</td><td>3</td><td>3</td><td>1</td><td>128</td></tr><tr><td>residual block</td><td>(125,29,256)</td><td>3</td><td>3</td><td>2</td><td>256</td></tr><tr><td>residual block</td><td>(125,29,256)</td><td>3</td><td>3</td><td>1</td><td>256</td></tr><tr><td>residual block</td><td>(125,29,256)</td><td>3</td><td>3</td><td>1</td><td>256</td></tr><tr><td>residual block</td><td>(125,15,512)</td><td>3</td><td>3</td><td>2</td><td>512</td></tr><tr><td>residual block</td><td>(125,15, 512)</td><td>3</td><td>3</td><td>1</td><td>512</td></tr><tr><td>residual block</td><td>(125,15, 512)</td><td>3</td><td>3</td><td>1</td><td>512</td></tr><tr><td>residual block</td><td>(125,15, 512)</td><td>3</td><td>3</td><td>1</td><td>512</td></tr><tr><td>residual block</td><td>(125,8, 1024)</td><td>3</td><td>3</td><td>2</td><td>1024</td></tr><tr><td>residual block</td><td>(125, 8,1024)</td><td>3</td><td>3</td><td>1</td><td>1024</td></tr><tr><td>residual block</td><td>(125,8, 1024)</td><td>3</td><td>3</td><td>1</td><td>1024</td></tr><tr><td>dense</td><td>(125,1, 128)</td><td></td><td>=</td><td>128</td><td>1</td></tr><tr><td>upsample time</td><td>(1000, 1, 128)</td><td></td><td></td><td></td><td>=</td></tr><tr><td>softplus and normalize</td><td>(1000, 1, 128)</td><td></td><td></td><td></td><td></td></tr></table>
|
| 309 |
+
|
| 310 |
+
# B.2 DECODER
|
| 311 |
+
|
| 312 |
+
The decoder’s input is the latent tuple $( f ( t ) , l ( t ) , z ( t ) )$ (250 timesteps). Its outputs are the parameters required by the synthesizers. For example, in the case of the harmonic synthesizer and filtered noise synthesizer setup, the decoder outputs $\mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf \Psi \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf \Psi \mathbf { } \mathbf { } \mathbf { } \mathbf \Psi \mathbf { } \mathbf { } \mathbf \Psi \mathbf { } \mathbf { } \mathbf \Psi \mathbf { } \mathbf \Psi \mathbf { } \mathbf \Psi \mathbf { } \mathbf \mathbf { } \mathbf \Psi \mathbf { } \mathbf \mathbf { } \mathbf \mathbf { } \mathbf \mathbf \Psi \Psi \Psi \mathbf { } \mathbf \mathbf \Psi \Psi \mathbf \Psi \Psi \mathbf \Psi \mathbf { } \mathbf \mathbf \mathbf \Psi \Psi \mathbf \Psi \mathbf \Psi \Psi \mathbf \Psi \mathbf \Psi \mathbf \Psi \mathbf \Psi \mathbf \Psi \mathbf \Psi \mathbf \mathbf \Psi \mathbf \Psi \mathbf \Psi \mathbf \mathbf \Psi \mathbf \mathbf \Psi \mathbf \mathbf \Psi \mathbf \mathbf \mathbf \Psi \mathbf \mathbf \Psi \mathbf \mathbf \mathbf \mathbf \Psi \mathbf \mathbf \mathbf \mathbf \Psi \mathbf \mathbf \mathbf \mathbf \mathbf \mathbf \mathbf \mathbf \mathbf \Psi \mathbf \mathbf \mathbf \mathbf \mathbf \mathbf \mathbf \mathbf \mathbf $ (amplitudes of the harmonics) for the harmonic synthesizer (note that $f ( t )$ is fed directly from the latent), and $\pmb { H }$ (transfer function of the FIR filter) for the filtered noise synthesizer.
|
| 313 |
+
|
| 314 |
+

|
| 315 |
+
Figure 8: Diagram of the $_ { z }$ -encoder.
|
| 316 |
+
|
| 317 |
+
As shown in Figure 9, we use a “shared-bottom” architecture, which computes a shared embedding from the latent tuple, and then have one head for each of the $( \pmb { a } ( t ) , \pmb { H } )$ outputs.
|
| 318 |
+
|
| 319 |
+
In particular, we apply separate MLPs to each of the $( f ( t ) , l ( t ) , z ( t ) )$ input. The outputs of the MLPs are concatenated and passed to a 512-unit GRU. We concatenate the GRU outputs with the outputs of the $f ( t )$ and $l ( t )$ MLPs (in the channel dimenssion) and pass it through a final MLP and Linear layer to get the decoder outputs.
|
| 320 |
+
|
| 321 |
+

|
| 322 |
+
Figure 9: Diagram of the decoder for the harmonic synthesizer and the filtered noise synthesizer.
|
| 323 |
+
|
| 324 |
+
The MLP architecture, shown in Figure 10, is a standard MLP with a layer normalization (tf.contrib.layers.layer_norm ) before the RELU nonlinearity. In Figure 9, all the MLPs have 3 layers and each layer has 512 units.
|
| 325 |
+
|
| 326 |
+

|
| 327 |
+
Figure 10: MLP in the decoder.
|
| 328 |
+
|
| 329 |
+
# B.3 TRAINING
|
| 330 |
+
|
| 331 |
+
Because all DDSP components are differentiable, the model is differentiable end-to-end. Therefore, we can apply any SGD optimizer to train the model. We used ADAM optimizer with learning rate 0.001 and exponential learning rate decay 0.98 every 10,000 steps.
|
| 332 |
+
|
| 333 |
+
# B.4 PERCEPTUAL LOSS
|
| 334 |
+
|
| 335 |
+
To help guide the DDSP autoencoder that must predict $f ( t )$ on the NSynth dataset, we also added an additional perceptual loss using pretrained models, such as the CREPE (Kim et al., 2018) pitch estimator and the encoder of the WaveNet autoencoder (Engel et al., 2017). Compared to the L1 loss on the spectrogram, the activations of different layers in these models correlate better with the perceptual quality of the audio. After a large-scale hyperparameter search, we obtained our best results by using the L1 distance between the activations of the small CREPE model’s fifth max pool layer with a weighting of $5 \times 1 0 ^ { - 5 }$ relative to the spectral loss.
|
| 336 |
+
|
| 337 |
+
# B.5 SYNTHESIZERS
|
| 338 |
+
|
| 339 |
+
Harmonic synthesizer / Additive Synthesis: We use 101 harmonics in the harmonic synthesizer (i.e., $\mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf \Psi \Psi \mathbf { } \mathbf { } \mathbf \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf \Psi \mathbf { } \mathbf { } \mathbf \Psi \mathbf { } \mathbf { } \mathbf \Psi \mathbf { } \mathbf { } \mathbf \Psi \mathbf { } \mathbf \Psi \Psi \mathbf { } \mathbf \Psi \mathbf { } \mathbf \Psi \mathbf { } \mathbf \Psi \mathbf { } \mathbf \Psi \mathbf \Psi \Psi \Psi \mathbf { } \mathbf \mathbf \Psi \Psi \mathbf \Psi \Psi \Psi \mathbf \Psi \Psi \mathbf \Psi \mathbf \Psi \Psi \mathbf \Psi \Psi \mathbf \Psi \Psi \mathbf \Psi \mathbf \Psi \mathbf \Psi \Psi \mathbf \Psi \mathbf \Psi \mathbf \Psi \mathbf \Psi \mathbf \Psi \mathbf \Psi \mathbf \Psi \mathbf \Psi \mathbf \mathbf \Psi \mathbf \Psi \mathbf \Psi \mathbf \mathbf \mathbf \Psi \mathbf \mathbf \Psi \mathbf \Psi \mathbf \mathbf \mathbf \Psi \mathbf \mathbf \mathbf \Psi \mathbf \mathbf \Psi \mathbf \mathbf \mathbf \Psi \mathbf \mathbf \mathbf \Psi \mathbf \mathbf \mathbf \mathbf \mathbf \mathbf \mathbf \mathbf \Psi \mathbf \mathbf \mathbf \mathbf \mathbf \mathbf \mathbf \Psi \mathbf $ ’s dimension is 101). Amplitude and harmonic distribution parameters are upsampled with overlapping Hamming window envelopes whose frame size is 128 and hop size is 64. Initial phases are all fixed to zero, as neither the spectrogram loss functions or human perception are sensitive to absolute offsets in harmonic phase. We also do not include synthesis elements to model DC components to signals as they are inaudible and not reflected in the spectrogram losses.
|
| 340 |
+
|
| 341 |
+
We force the amplitudes, harmonic distributions, and filtered noise magnitudes to be non-negative by applying a sigmoid nonlinearity to network outputs. We find a slight improvement in traning stability by modifying the sigmoid to have a scaled output, larger slope by exponentiating, and threshold at a minimum value:
|
| 342 |
+
|
| 343 |
+
$$
|
| 344 |
+
y = 2 . 0 \cdot \mathrm { s i g m o i d } ( x ) ^ { \log 1 0 } + 1 0 ^ { - 7 }
|
| 345 |
+
$$
|
| 346 |
+
|
| 347 |
+
Filtered noise synthesizer: We use 65 network output channels as magnitude inputs to the FIR filter of the filtered noise synthesizer.
|
| 348 |
+
|
| 349 |
+
B.6 PARAMETER COUNTS
|
| 350 |
+
|
| 351 |
+
<table><tr><td>Model</td><td>Parameters</td></tr><tr><td>WaveNet Autoencoder (Engel et al.,2017)</td><td>75M</td></tr><tr><td>WaveRNN (Hantrakul et al., 2019)</td><td>23M</td></tr><tr><td>GANSynth (Engel et al., 2019)</td><td>15M</td></tr><tr><td>DDSP Autoencoder (Unsupervised)</td><td>12M</td></tr><tr><td>DDSP Autoencoder (Supervised, NSynth)</td><td>7M</td></tr><tr><td>DDSP Autoencoder (Supervised, Solo Violin)</td><td>6M</td></tr><tr><td>DDSP Autoencoder Tiny (Supervised, Solo Violin)</td><td>0.24M</td></tr></table>
|
| 352 |
+
|
| 353 |
+
Table 3: Parameter counts for different models. All models trained on NSynth dataset except for those marked (Solo Violin). Autoregressive models have the most parameters with GANs requiring less. The DDSP models examined in this paper (which have not been optimized at all for size) require 2 to 3 times less parameters than GANSynth. The unsupervised model has more parameters because of the CREPE (small) $f ( t )$ encoder, and the autoencoder has additional parameters for the $z ( t )$ encoder. Initial experiments with extremely small models (single GRU, 256 units), have slightly less realistic outputs, but still relatively high quality (as can be heard in the supplemental audio).
|
| 354 |
+
|
| 355 |
+
# C EVALUATION DETAILS
|
| 356 |
+
|
| 357 |
+
# C.1 METRICS
|
| 358 |
+
|
| 359 |
+
Loudness $L _ { 1 }$ distance: The loudness vector is extracted from the synthesized audio and $L _ { 1 }$ distance computed against the input’s conditioning loudness vector (ground truth). A better model will produce lower $L _ { 1 }$ distances, indicating input and generated loudness vectors closely match. Note this distance is not back-propagated through the network as a training objective.
|
| 360 |
+
|
| 361 |
+
F0 $L _ { 1 }$ distance: The $\mathrm { F 0 ~ } L _ { 1 }$ distance is reported in MIDI space for easier interpretation; an average $\mathrm { F 0 ~ } L _ { 1 }$ of 1.0 corresponds to a semitone difference. We use the same confidence threshold of 0.85 in (Hantrakul et al., 2019) to select portions where there was detectable pitch content, and compute the metric only in these areas.
|
| 362 |
+
|
| 363 |
+
F0 Outliers: Pitch tracking using CREPE, like any pitch tracker, is not completely reliable. Instabilities in pitch tracking, such as sudden octave jumps at low volumes, can result errors not due to model performance and need to be accounted for. F0 outliers accounts for pitch tracking imperfections in CREPE (Kim et al., 2018) vs. genuinely bad samples generated by the trained model. CREPE outputs both an F0 value as well as a F0 confidence. Samples with confidences below a threshold of 0.85 in (Hantrakul et al., 2019) are labeled as outliers and usually indicate the sample was mostly noise with no pitch or harmonic component. As the model outputs better quality audio, the number of outliers decrease, thus lower scores indicate better performance.
|
| 364 |
+
|
| 365 |
+
# C.2 INTERPOLATION METRICS
|
| 366 |
+
|
| 367 |
+
Loudness $L _ { 1 }$ and $\mathrm { F 0 ~ } L _ { 1 }$ are shown for different interpolation tasks in table C.2. In reconstruction, the model is supplied with the standard $( f ( t ) _ { A } , \bar { l } ( t ) _ { A } , z ( t ) _ { A } )$ . Loudness $( L _ { 1 } )$ and F0 $( L _ { 1 } )$ are computed against the ground truth inputs. In loudness interpolation, the model is supplied with $( f ( t ) _ { A } , l ( t ) _ { B } , z ( t ) _ { A } )$ , and Loudness $( L _ { 1 } )$ is calculated using $l ( t ) _ { B }$ as ground truth instead of $( l ( t ) _ { A } )$ . For F0 interpolation, the model is supplied with $( f ( t ) _ { B } , l ( t ) _ { A } , z ( t ) _ { A } )$ and F0 $( L _ { 1 } )$ is calculated using $f ( t ) _ { B }$ as ground truth instead of $f ( t ) _ { A }$ . For $\textsf { Z }$ interpolation, the model is supplied with $( f ( t ) _ { A } , l ( t ) _ { A } , z ( t ) _ { B } )$ . The low and constant Loudness $( L _ { 1 } )$ and F0 $( L _ { 1 } )$ metrics across these interpolations indicate the model is able independently vary these variables without affecting other components.
|
| 368 |
+
|
| 369 |
+
Table 4: Loudness and F0 metrics for different interpolation tasks.
|
| 370 |
+
|
| 371 |
+
<table><tr><td>Task</td><td>Loudness (L1)</td><td>F0 (L1)</td></tr><tr><td>Reconstruction</td><td>0.042</td><td>0.060</td></tr><tr><td>Loudness l(t) interp.</td><td>0.061</td><td>0.060</td></tr><tr><td>FO f(t) interp.</td><td>0.048</td><td>0.070</td></tr><tr><td>Zz(t) interp.</td><td>0.063</td><td>0.065</td></tr></table>
|
| 372 |
+
|
| 373 |
+
# D OTHER NOTES
|
| 374 |
+
|
| 375 |
+
# D.1 SINUSOIDAL MODELS
|
| 376 |
+
|
| 377 |
+
While unconstrained sinusoidal oscillator banks are strictly more expressive than harmonic oscillators, we restricted ourselves to harmonic synthesizers for the time being to focus the problem domain. However, this is not a fundamental limitation of the technique and perturbations such as inharmonicity can also be incorporated to handle phenomena such as stiff strings (Smith, 2010).
|
| 378 |
+
|
| 379 |
+
# D.2 REGULARIZATION
|
| 380 |
+
|
| 381 |
+
It is worth mentioning that the modular structure of the synthesizers also makes it possible to define additional losses in terms of different synthesizer outputs and parameters. For example, we may impose an SNR loss to penalize outputs with too much noise if we know the training data consists of mostly clean data. We have not experimented too much with such engineered losses, but we believe they can make training more efficient, even though such engineering methods deviates from the end-to-end training paradigm,
|
parse/train/B1x1ma4tDr/B1x1ma4tDr_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/B1x1ma4tDr/B1x1ma4tDr_middle.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/B1x1ma4tDr/B1x1ma4tDr_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/LhY8QdUGSuw/LhY8QdUGSuw.md
ADDED
|
@@ -0,0 +1,526 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ANATOMY OF CATASTROPHIC FORGETTING: HIDDEN REPRESENTATIONS AND TASK SEMANTICS
|
| 2 |
+
|
| 3 |
+
Vinay V. Ramasesh Blueshift, Alphabet Mountain View, CA
|
| 4 |
+
|
| 5 |
+
Ethan Dyer Blueshift, Alphabet Mountain View, CA
|
| 6 |
+
|
| 7 |
+
Maithra Raghu Google Brain Mountain View, CA
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
Catastrophic forgetting is a recurring challenge to developing versatile deep learning models. Despite its ubiquity, there is limited understanding of its connections to neural network (hidden) representations and task semantics. In this paper, we address this important knowledge gap. Through quantitative analysis of neural representations, we find that deeper layers are disproportionately responsible for forgetting, with sequential training resulting in an erasure of earlier task representational subspaces. Methods to mitigate forgetting stabilize these deeper layers, but show diversity on precise effects, with some increasing feature reuse while others store task representations orthogonally, preventing interference. These insights also enable the development of an analytic argument and empirical picture relating forgetting to task semantic similarity, where we find that maximal forgetting occurs for task sequences with intermediate similarity.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
While the past few years have seen the development of increasingly versatile machine learning systems capable of learning complex tasks (Stokes et al., 2020; Raghu & Schmidt, 2020; Wu et al., 2019b), catastrophic forgetting remains a core capability challenge. Catastrophic forgetting is the ubiquitous phenomena where machine learning models trained on non-stationary data distributions suffer performance losses on older data instances. More specifically, if our machine learning model is trained on a sequence of tasks, accuracy on earlier tasks drops significantly. The catastrophic forgetting problem manifests in many sub-domains of machine learning including continual learning (Kirkpatrick et al., 2017), multi-task learning (Kudugunta et al., 2019), standard supervised learning through input distribution shift (Toneva et al., 2019; Snoek et al., 2019; Rabanser et al., 2019; Recht et al., 2019) and data augmentation (Gontijo-Lopes et al., 2020).
|
| 16 |
+
|
| 17 |
+
Mitigating catastrophic forgetting has been an important research focus (Goodfellow et al., 2013; Kirkpatrick et al., 2017; Lee et al., 2017; Li et al., 2019; Serra et al., 2018; Ritter et al., 2018; Rolnick \` et al., 2019), but many methods are only effective in specific settings (Kemker et al., 2018), and progress is hindered by limited understanding of catastrophic forgetting‘s fundamental properties. How does catastrophic forgetting affect the hidden representations of neural networks? Are earlier tasks forgotten equally across all parameters? Are there underlying principles common across methods to mitigate forgetting? How is catastrophic forgetting affected by (semantic) similarities between sequential tasks? This paper takes steps to answering these questions, specifically:
|
| 18 |
+
|
| 19 |
+
1. With experiments on split CIFAR-10, a novel distribution-shift CIFAR-100 variant, CelebA and ImageNet we analyze neural network layer representations, finding that higher layers are disproportionately responsible for catastrophic forgetting, the sequential training process erasing earlier task subspaces.
|
| 20 |
+
2. We investigate different methods for mitigating forgetting, finding that while all stabilize higher layer representations, some methods encourage greater feature reuse in higher layers, while others store task representations as orthogonal subspaces, preventing interference.
|
| 21 |
+
3. We study the connection between forgetting and task semantics, finding that semantic similarity between subsequent tasks consistently controls the degree of forgetting.
|
| 22 |
+
4. Informed by the representation results, we construct an analytic model that relates task similarity to representation interference and forgetting. This provides a quantitative empirical measure of
|
| 23 |
+
|
| 24 |
+

|
| 25 |
+
Figure 1: Examples of catastrophic forgetting across different architectures and datasets. We plot accuracy of Task 1 (purple) and Task 2 (green), on both the split CIFAR10 task, and the CIFAR100 distribution-shift task across multiple architectures. Catastrophic forgetting is seen as the significant drop of Task 1 accuracy when Task 2 training begins.
|
| 26 |
+
|
| 27 |
+
task similarity, and together these show that forgetting is most severe for tasks with intermediate similarity.
|
| 28 |
+
|
| 29 |
+
# 2 RELATED WORK
|
| 30 |
+
|
| 31 |
+
Mitigation strategies Developing mitigation strategies for catastophic forgetting is an active area of research (Kemker et al., 2018). Popular approaches based on structural regularization include Elastic Weight Consolidation (Kirkpatrick et al., 2017) and Synaptic Intelligence (Zenke et al., 2017). An alternative, functional regularization approach is based on storing and replaying earlier data in a replay buffer (Schaul et al., 2015; Robins, 1995; Rolnick et al., 2019). We study how these mitigation methods affect the internal network representations to better understand their role in preventing catastrophic forgetting.
|
| 32 |
+
|
| 33 |
+
Understanding catastrophic forgetting Our work is similar in spirit to existing empirical studies aimed at better understanding the catastrophic forgetting phenomenon (Goodfellow et al., 2013; Toneva et al., 2019). We focus specifically on understanding how layerwise representations change, and on the relation between forgetting and task semantics, which have not previously been explored. This semantic aspect is related to recent work by Nguyen et al. (2019) examining the influence of task sequences on forgetting. It also builds on work showing that learning in both biological and artificial neural networks is affected by semantic properties of the training data (Saxe et al., 2019; Mandler & McDonough, 1993).
|
| 34 |
+
|
| 35 |
+
Fine-tuning and transfer learning While not studied in the context of catastrophic forgetting, layerwise learning dynamics have been investigated in settings other than continual learning. For example, Raghu et al. (2017) showed that layerwise network representations roughly converge bottomup; (from input to output). Neyshabur et al. (2020) observed similar phenomena in a transfer-learning setting with images, as have others recently in transformers for NLP (Wu et al., 2020; Merchant et al., 2020). Furthermore, the observation that early layers in networks learn general features like edge detectors, while latter layers learn more task specific features is a well-known result in computer vision (Erhan et al., 2009), and here we quantitatively study its ramifications for sequential training and catastrophic forgetting.
|
| 36 |
+
|
| 37 |
+
# 3 SETUP
|
| 38 |
+
|
| 39 |
+
Tasks: We conduct this study over many different tasks and datasets: (i) Split CIFAR-10, where the ten class dataset is split into two tasks of 5 classes each (ii) input distribution shift CIFAR-100, where each task is to distinguish between the CIFAR-100 superclasses, but input data for each task is a different subset of the constituent classes of the superclass (see Appendix A.3) (iii) CelebA attribute prediction: the two tasks have input data either men or women, and we predict either smile or mouth open (iv) ImageNet superclass prediction, similar to CIFAR100.
|
| 40 |
+
|
| 41 |
+
Models: We perform experiments with three common neural network architectures used in image classification — VGG (Simonyan & Zisserman, 2014), ResNet (He et al., 2015) and DenseNet (Huang et al., 2016). Examples of catastrophic forgetting in these models are shown in Figure 1.
|
| 42 |
+
|
| 43 |
+

|
| 44 |
+
Figure 2: Freezing lower layer representations after Task 1 training has little impact on Task 2 accuracy. We freeze the parameters of a contiguous block of layers (starting from the lowest layer) after Task 1 training, and only train the remainder on Task 2, finding that freezing the lowest layers has little impact on Task 2 accuracy.
|
| 45 |
+
|
| 46 |
+
# 4 CATASTROPHIC FORGETTING AND HIDDEN LAYER REPRESENTATIONS
|
| 47 |
+
|
| 48 |
+
We begin by investigating how catastrophic forgetting manifests in the hidden representations of the neural network. Do all parameters (and layers) forget equally? Or are specific components of the network particularly responsible for the drop in accuracy in sequential training? Through a combination of layer freezing experiments, and representational analysis, we find that higher layers (layers closest to output) are disproportionately responsible for catastrophic forgetting, with lower layers (layers closest to input) remaining representationally stable through sequential training. Further analysis of the representational subspaces of Task 1, Task 1 (post Task 2 training) and Task 2, provide insights on both feature reuse and interference.
|
| 49 |
+
|
| 50 |
+
# 4.1 FREEZING LAYER REPRESENTATIONS
|
| 51 |
+
|
| 52 |
+
To study the effect of individual layers on forgetting, we measure the effect of freezing layer representations on Task 2 accuracy (Figure 2). Specifically, we freeze a contiguous block of layers (starting from the lowest layer) after training on Task 1, and only train the remaining layers on Task 2. Across different architectures and tasks, we observe that lower layers can be reliably frozen with very little impact on Task 2 accuracy. This suggests the possibility of lower layer features being reused between both tasks, with higher layers being the main contributor to catastrophic forgetting.
|
| 53 |
+
|
| 54 |
+
# 4.2 REPRESENTATIONAL SIMILARITY THROUGH SEQUENTIAL TRAINING
|
| 55 |
+
|
| 56 |
+
The results of Figure 2 illustrate that lower layer representations on Task 1 can be reused for good performance on Task 2. To determine if this is what actually occurs during the training process, we turn to Centered Kernel Alignment (CKA) (Kornblith et al., 2019), a neural network representation similarity measure. CKA and other related algorithms (Raghu et al., 2017; Morcos et al., 2018) provide a scalar score (between 0 and 1) determining how similar a pair of (hidden) layer representations are, and have been used to study many properties of deep neural networks (Gotmare et al., 2018; Kudugunta et al., 2019; Wu et al., 2019a).
|
| 57 |
+
|
| 58 |
+
Specifically, letting $\ b X \in \mathbb { R } ^ { n \times p }$ and $Y \in \mathbb { R } ^ { n \times p }$ be (centered) layer activation matrices of (the same) $n$ datapoints and $p$ neurons, CKA computes
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
\mathrm { C K A } ( \mathrm { X } , \mathrm { Y } ) = \frac { \mathrm { H S I C } ( \mathrm { X X ^ { T } } , \mathrm { Y Y ^ { T } } ) } { \sqrt { \mathrm { H S I C } ( \mathrm { X X ^ { T } } , \mathrm { X X ^ { T } } ) } \sqrt { \mathrm { H S I C } ( \mathrm { Y Y ^ { T } } , \mathrm { Y Y ^ { T } } ) } }
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
for HSIC Hilbert-Schmidt Independence Criterion (Gretton et al., 2005). We use linear-kernel CKA.
|
| 65 |
+
|
| 66 |
+
In Figure 3, we plot the results of computing CKA on Task 1 layer representations before and after Task 2 training. Across architectures and tasks, we observe that the lower layers have high representation similarity, suggesting that lower layer Task 1 features are reused in Task 2. The higher layers however show significant decreases in representation similarity, suggesting they disproportionately contribute to catastrophic forgetting. These conclusions are further supported by additional layer reset experiments in Appendix Figure 12, which shows that rewinding higher layer parameters from post-Task 2 training to their pre-Task 2 training values significantly improves Task 1 performance.
|
| 67 |
+
|
| 68 |
+
# 4.3 FEATURE REUSE AND SUBSPACE ERASURE
|
| 69 |
+
|
| 70 |
+
Further insights on how the representations of lower and higher layers evolve during sequential training is given through a subspace similarity analysis. Letting $\ b X \in \mathbb R ^ { n \times p }$ be the (centered) layer activation matrix of $n$ examples by $p$ neurons, we compute the PCA decomposition of $X$ , i.e. the
|
| 71 |
+
|
| 72 |
+

|
| 73 |
+
Figure 3: CKA analysis of layer representations before/after Task 2 training shows lower layer feature reuse and higher layer representations changing significantly on CIFAR10, CIFAR100, ImageNet and CelebA. We compute CKA of the Task 1 layer representations before and after Task 2 training. We observe that later layers change more than early layers through second task training.
|
| 74 |
+
|
| 75 |
+

|
| 76 |
+
Figure 4: Subspace similarity analysis shows feature reuse in lower layers and Task 1 subspace erasure in higher layers. For Resnet on CIFAR10 (left), VGG on CIFAR10 (middle), Resnet on CIFAR100 (right), we compute subspace similarity between: (i) (Task 1, Task 2) (purple line) (ii) (Task 1, Task 1 post-Task 2 training) (green line) (iii) (Task 2, Task 1 post-Task 2 training) (blue line). All comparisons show high similarity in lower layers, indicative of feature reuse. Most striking is the comparison between (Task 1, Task 1 post-Task 2 training) and (Task 2, Task 1 post-Task 2 training), which show that after Task 2 training, higher layer representations for Task 1 are more similar to Task 2 than to Task 1! Specifically, the Task 1 subspace in higher layers is erased through Task 2 training.
|
| 77 |
+
|
| 78 |
+
eigenvectors $( v _ { 1 } , v _ { 2 } , \ldots )$ and eigenvalues $( \lambda _ { 1 } , \lambda _ { 2 } . . . )$ of $X ^ { T } X$ . Letting $V _ { k }$ be the matrix formed from the top $k$ principal directions, $v _ { 1 } , . . . , v _ { k }$ as columns, and $U _ { k }$ the corresponding matrix for a different activation matrix $Y$ , we compute
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
\mathrm { S u b s p a c e S i m } _ { k } ( X , Y ) = \frac { 1 } { k } | | V _ { k } ^ { T } U _ { k } | | _ { F } ^ { 2 } .
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
This measures the overlap in the subspaces spanned by $( v _ { 1 } , . . . , v _ { k } )$ and $( u _ { 1 } , . . . , u _ { k } )$ . Concretely, if $X$ and $Y$ correspond to layer activation matrices for two different tasks, Subspace $s \mathrm { i m } _ { k } ( X , Y )$ measures how similarly the top $k$ representations for those tasks are stored in the network.
|
| 85 |
+
|
| 86 |
+
Figure 4 shows the result of computing SubspaceSim ${ } _ { k } ( X , Y )$ for $X , Y$ being the layer activation matrices in (i) (Task 1, Task 2) (purple line) (ii) (Task 1, Task 1 post-Task 2 training) (blue line) (iii) (Task 2, Task 1 post-Task 2 training) (blue line). Supporting the CKA analysis, lower layers have high subspace similarity between Task 1 and Task 2 (feature reuse), but higher layers have low similarity (representations change significantly during Task 2 training.) Furthermore, (Task 1, Task 1 post-Task 2 training) also shows low subspace similarity in the higher layers, indicating that the representational change in later layers is not restricted to Task 2 data, but also alters the networks representation of the initial task. Strikingly, (Task 2, Task 1 post-Task 2 training) shows high similarity in all layers, despite being different tasks.
|
| 87 |
+
|
| 88 |
+
In summary, these results illustrate that during sequential training, effective feature reuse happens in the lower layers, but in the higher layers, after Task 2 training, Task 1 representations are mapped into the same subspace as Task 2. Specifically, Task 2 training causes subspace erasure of Task 1 in the higher layers. (Additional details and results are in Appendix Section A.5.)
|
| 89 |
+
|
| 90 |
+

|
| 91 |
+
Figure 5: CKA analysis of mitigation methods demonstrates that mitigation methods stabilize the higher layer representations. We compute CKA between layer representations of Task 1 before and after Task 2 training, with varying amounts and types of mitigation. We find that across all mitigation methods, even a small amount of mitigation works to stabilize the higher layer representations. In Figure 6, we investigate whether this stabilization results in greater feature reuse or through finding independent subspaces.
|
| 92 |
+
|
| 93 |
+

|
| 94 |
+
Figure 6: Subspace similarity analysis reveals differences between different mitigation methods, with replay storing Task 1 and Task 2 representations in orthogonal subspaces, while EWC and SI promote feature reuse in the higher layers. Top row: We plot subspace similarities like in Figure 4, for different mitigation methods. We observe that (Task 2, Task 1 post-Task 2 training) is much lower in replay compared to EWC/SI, as is (Task1, Task2) similarity. The bottom row plots (Task 2, Task 1 post-Task 2 training) for different amounts of mitigation. Again we see that replay has much lower (Task 2, Task 1 post-Task 2 training) similarity than no mitigation, while EWC/SI maintain the similar subspaces of Task 1 and Task 2 post Task 2 training.
|
| 95 |
+
|
| 96 |
+
# 5 FORGETTING MITIGATION METHODS AND REPRESENTATIONS
|
| 97 |
+
|
| 98 |
+
Informed by this understanding of how catastrophic forgetting manifests in the hidden layers (feature reuse in lower layers and subspace erasure in higher layers), we next study methods to mitigate forgetting. Do popularly used mitigation methods act to stabilize higher layers — given possible alternate approaches such as weight orthogonalization (Appendix C)?
|
| 99 |
+
|
| 100 |
+
We investigate these questions across different successful mitigation strategies (i) EWC (elastic weight consolidation) (Kirkpatrick et al., 2017), a regularization-based approach (ii) replay buffer (Schaul et al., 2015; Ratcliff, 1990; Rolnick et al., 2019), a rehearsal-styled approach (iii) SI (Synaptic Intelligence) (Zenke et al., 2017), another popular regularization-based approach.
|
| 101 |
+
|
| 102 |
+
In Figure 5, we plot the results of computing CKA on layer representations of Task 1 before/after training on Task 2, with different amounts of mitigation applied, and across different mitigation methods, tasks and architectures (full results in Appendix B.7.) Across all of these settings, we observe that even a small amount of mitigation results in a significant increase in similarity (stabilization) in the higher layers. However, there remains a central open question — is this increase in similarity due to feature reuse in the higher layers between Task 1 and Task 2, or does the network store Task 1 and Task 2 representations in non-interfering, orthogonal subspaces?
|
| 103 |
+
|
| 104 |
+

|
| 105 |
+
Figure 7: Subspace similarity analysis of CelebA, with and without replay mitigation. Left pane computes subspace similarities in CelebA, like in Figure 4, showing subspace erasure at top layers. Middle and right panes showt the effect of adding replay, where subspaces in lower/middle layers become more similar but higher layers become more orthogonal, like in Figure 6.
|
| 106 |
+
|
| 107 |
+
To answer this, we compute the Subspace Similarity measure introduced in Section 4.3, with results in Figure 6 (and additional experiments in Appendix Section B.5). These results reveal key differences between the mitigation methods: replay buffer results in orthogonal network subspaces for higher layer representations of Task 1 and Task 2, while EWC and SI promote feature reuse even in the higher layers. In more detail:
|
| 108 |
+
|
| 109 |
+
• Comparing the top row of Figure 6 to Figure 4 (the same plot without mitigation), we see that mitigation methods increase the subspace similarity of (Task 1, Task 1 Post-Task 2) and (Task 1, Task 2) representations in earlier/middling layers (more feature reuse).
|
| 110 |
+
• Most interestingly, comparing the different mitigation methods across top row Figure 6, we see that while EWC and SI maintain high subspace similarity of (Task 2, Task 1 Post-Task 2) even in the highest layers, replay significantly decreases this value in the highest layers. This suggests that replay performs mitigation through use of orthogonal subspaces, while EWC/SI encourage feature reuse even in the highest layers.
|
| 111 |
+
• In the bottom row we show subspace similarity of (Task 2, Task 1 Post-Task 2) for varying strengths of the different mitigation methods. We observe a clear decrease in subspace similarity in higher layers even when a little replay is used (again supporting orthogonal subspaces), while EWC/SI maintain or increase this (feature reuse even in higher layers.)
|
| 112 |
+
|
| 113 |
+
# 6 SEMANTICS
|
| 114 |
+
|
| 115 |
+
With the insights on how catastrophic forgetting relates to the hidden representations, and the effects on network internals of different mitigation methods, we turn to investigating how the semantic similarity between the sequential tasks affects forgetting. Specifically the prior results on lower layer feature reuse suggest a key question: does similarity between tasks result in less forgetting? Surprisingly, the answer is quite nuanced, depending on how precisely the different tasks are represented in the network.
|
| 116 |
+
|
| 117 |
+
# 6.1 FORGETTING, TASK SEMANTICS AND A SIMILARITY PUZZLE
|
| 118 |
+
|
| 119 |
+
Our study of the relationship between task semantic similarity and forgetting reveals a surprising puzzle. In Figure 8 and Table 1, we observe that depending on the task setup, a semantically similar task may be forgotten less or more than a less similar task. This behavior is consistent across different settings and datasets. Specifically, in Figure 8a and 8d, Task 1 and Task 2 consist of binary classifications between animals and objects from CIFAR-10, where we find that the similar categories forget less. But in Figure 8b and 8e, a four category classification between animals and objects followed by a binary classification task results in the similar categories being forgotten more. Table 1 shows an analogous result on ImageNet. This effect of similar categories being forgotten more can also be observed in the CIFAR-100 distribution shift setting, where input distribution shift to the CIFAR-100 superclasses results in more similar categories being forgotten more, e.g. input shifts to natural superclasses (Figure 8c) or artifical superclasses (Figure 8f). Further details and supporting experiments can be found in Appendix B.9.
|
| 120 |
+
|
| 121 |
+
In the subsequent sections, we resolve this puzzle through (i) the development of an analytic model that formalizes the subtle connection between task similarity and forgetting (ii) an ensuing measure of task similarity, trace overlap, empirically quantifies task similarity (iii) showing maximal forgetting happens with intermediate task similarity.
|
| 122 |
+
|
| 123 |
+

|
| 124 |
+
Figure 8: Forgetting severity consistently varies along semantic divisions. (a,d) For sequential binary classification tasks models trained on either objects or animals forgets less on a second object task of the same semantic category. (b,e) Models trained initially on four way classification of two object and two animal classes see more forgetting in semantically similar classes when trained on a second two class task of either objects or animals. (c,f) Models trained on sequential six-way classification with four unaltered categories (shown) and two altered categories show increased forgetting in the unaltered categories semantically most similar to altered categories. For all panes, performance is shown for ResNet, with additional results in Appendix B.9.
|
| 125 |
+
|
| 126 |
+
Table 1: Task Semantics and forgetting in ImageNet Here a ResNet50 is first trained (task 1) to classify either 10 animals, 10 artifacts or 10 animals and artifacts (chosen randomly from ImageNet). The network is then trained (task 2) to either classify 10 different animals or 10 different artifacts. The table shows performance drop on Task 1 after Task 2 training. Similar to Figure 8, when Task 1 is either animals or artifacts (top part of table), similar tasks forget less, while when Task 1 is both animals and artifacts, similar tasks show greater forgetting (bottom part of table).
|
| 127 |
+
|
| 128 |
+
<table><tr><td>Task Description</td><td colspan="2">Performance Drop on Task 1 Animals Artifacts</td></tr><tr><td>Task1:animals Task2:animals</td><td>0.0885 ± 0.0259</td><td></td></tr><tr><td>Task1:animals Task2:artifacts</td><td>0.1832 ± 0.0484</td><td></td></tr><tr><td>Task1:artifacts Task2:artifacts</td><td></td><td>0.2884 ± 0.0187</td></tr><tr><td>Task1:artifacts Task2:animals</td><td>■</td><td>0.3720 ± 0.0288</td></tr><tr><td>Task1:animals and artifacts Task2:animals</td><td>0.1752 ± 0.0193</td><td>0.1532 ± 0.0231</td></tr><tr><td>Task1:animals and artifacts Task2:artifacts</td><td>0.2057 ± 0.0312</td><td>0.2330 ± 0.0292</td></tr></table>
|
| 129 |
+
|
| 130 |
+
# 6.2 AN ANALYTIC MODEL OF FORGETTING SEMANTICS
|
| 131 |
+
|
| 132 |
+
We first formalize a model with a single classification head (like in distribution shift CIFAR-100), $\scriptstyle \sum _ { \mu = 1 } ^ { p } \theta _ { \mu } g _ { \mu } ( w ; x )$ nding m, where $\theta$ ti-head setup in Appendix C. Ware the last layer weights and $g$ write the network output asare features. We consider $f ( x ) =$ sequentially on two tasks. For the first task, we train normally. For the second task, inspired by our empirical observation above that forgetting is driven by deeper layers, we freeze the the earlier layer features, $g _ { \mu } ( w ; x ) = g _ { \mu } ( \hat { w } ; x )$ when training on the second task (here $\hat { w }$ represent the weights after training on the first task). If we train with loss function $L ( f , y )$ and learning rate $\eta$ , the network output SGD update at timestep $t$ is
|
| 133 |
+
|
| 134 |
+
$$
|
| 135 |
+
\Delta f _ { t } ( x ) = - \eta \sum _ { x ^ { \prime } , y ^ { \prime } \in \mathcal { D } _ { \operatorname { t r a i n } } ^ { ( 2 ) } } \Theta ( x , x ^ { \prime } ) \frac { \partial L ( f ( x ^ { \prime } ) , y ^ { \prime } ) } { \partial f } .
|
| 136 |
+
$$
|
| 137 |
+
|
| 138 |
+
Here D(2) is the second-task training data and $\begin{array} { r } { \Theta ( x , x ^ { \prime } ) = \sum _ { \mu = 1 } ^ { p } g _ { \mu } ( \hat { w } ; x ) g _ { \mu } ( \hat { w } ; x ^ { \prime } ) } \end{array}$ is the overlap (inner product) between the model last-layer representations on data point $x$ and $x ^ { \prime }$ . If the overlap $\Theta ( x , x ^ { \bar { \prime } } )$ is small, then the change in the logits is small and forgetting is minimal, specifically:
|
| 139 |
+
|
| 140 |
+
Lemma 1 Let $f _ { t }$ be the logits of a neural network trained via the frozen feature model. Let $x$ be an element of the initial task test set. Let us further denote the vector of the feature overlap applied to the second task training set as $ { \vec { \Theta } } ( x ) : = \{ \Theta ( x , x ^ { \prime } ) : x ^ { \prime } \in X _ { t r a i n } ^ { ( 2 ) } \}$ and the loss vector as $\vec { L } = \{ L ( f ( x ^ { \prime } ) , y ^ { \prime } ) : x ^ { \prime } , y ^ { \prime } \in \mathcal { D } _ { t r a i n } ^ { ( 2 ) } \}$ train. With this, the change in the original task logits is bounded as
|
| 141 |
+
|
| 142 |
+
$$
|
| 143 |
+
| \Delta f _ { t } ( x ) | \leq \eta | | { \vec { \Theta } } ( x ) | | | { \frac { \partial { \vec { L } } } { \partial f } } | | .
|
| 144 |
+
$$
|
| 145 |
+
|
| 146 |
+
Thus representational similarity is necessary for forgetting to occur, and in this model, sufficiently similar and sufficiently dissimilar tasks have minimal forgetting, while intermediate similar tasks have maximal forgetting.
|
| 147 |
+
|
| 148 |
+
# 6.3 CATASTROPHIC FORGETTING ACROSS VARYING TASK SIMILARITIES
|
| 149 |
+
|
| 150 |
+
The analytical result enables us to make precise a measure of task similarity, through using the feature overlap matrix $\Theta ( x ^ { \prime } , x )$ . Concretely, letting $\Theta _ { 1 1 }$ be the overlap matrix on Task 1, $\Theta _ { 2 2 }$ on Task 2, and $\Theta _ { 1 2 }$ on Task 1 and Task 2, we define:
|
| 151 |
+
|
| 152 |
+
$$
|
| 153 |
+
\mathrm { T r a c e ~ o v e r l a p } = \frac { \mathrm { T r } \left( \Theta _ { 1 2 } \Theta _ { 1 2 } ^ { T } \right) } { \sqrt { \left( \right)} \mathrm { T r } \left( \Theta _ { 1 1 } \Theta _ { 1 1 } ^ { T } \right) \mathrm { T r } \left( \Theta _ { 2 2 } \Theta _ { 2 2 } ^ { T } \right) } .
|
| 154 |
+
$$
|
| 155 |
+
|
| 156 |
+
Trace overlap is directly analogous to CKA, where instead of comparing the similarity of different features on the same data, we are comparing the similarity of common features on different data.
|
| 157 |
+
|
| 158 |
+
Increasing task dissimilarity can help reduce forgetting In Lemma 1, we see that very dissimilar tasks, with small overlap matrix, exhibit minimal forgetting. In Figure 9, we test this in the context of sequential binary classification. We introduce an other category to the classification problem (of images from classes not included in the training tasks), which encourages the model to represent Task 1 and Task 2 dissimilarly (lower trace overlap in Figure 9b), and reduces forgetting (Figure 9a).
|
| 159 |
+
|
| 160 |
+
Maximal forgetting at intermediate similarity To empirically study the conclusion from the model that intermediate-similar tasks have maximal forgetting, we use mixup (Zhang et al., 2017), a standard data augmentation technique, to interpolate between the two tasks. Specifically, we first train a model on binary classification (with an other category to encourage dissimilarity) and for $\lambda \in [ 0 , 1 ]$ , generate an mixup dataset D(λ)train $\mathcal { D } _ { \mathrm { t r a i n } } ^ { ( \lambda ) } = \{ ( \lambda x ^ { ( 2 ) } + ( 1 - \lambda ) x ^ { ( 1 ) } , \lambda y ^ { ( 2 ) } + ( 1 - \lambda ) y ^ { ( 1 ) } ) \}$ . We compare model behavior across a range of mixup fractions, finding that the task similarity as measured through the trace overlap between task1 and task2 varies monotonically with mixup fraction (Figure 10b), quantifying that varying the mixing parameter, $\lambda$ , tunes the degree of task similarity. Figure 10a shows that the most extreme forgetting happens for intermediate similarity (i.e. mixing fraction $\sim 0 . 1 - 0 . 2 $ ).
|
| 161 |
+
|
| 162 |
+

|
| 163 |
+
Figure 9: Adding an other category reduces forgetting and increases orthogonalization. (a) Models trained initially on classifying two objects: airplane/automobile, and subsequently on two animals: deer/dog exhibit diminished forgetting when we add an other category to task 1 training. The other category contains randomly sampled images from all classes not present in the initial or final tasks. (b,c) The presence of the other category reduces the similarity between the model’s representations of each task. Additional plots are in Appendix B.8.
|
| 164 |
+
|
| 165 |
+

|
| 166 |
+
Figure 10: Task similarity affects performance. (a) We measure initial task performance for sequential binary classification as we dial the mixup fraction between 0.0, pure task 2 data, and 1.0, pure task 1 data. Maximum forgetting (minimal accuracy) occurs at an intermediate value of the mixup fraction, $\sim 0 . 1 - 0 . 2$ . (b) We measure the similarity between task 1 and task 2 as we vary the mixup fraction, supporting the intuition that interpolating mixup fraction interpolates task similarity. (c) Task 1 performance after task 2 training is plotted against task 1 versus task 2 representational similarity for animal and object classes in the sequential binary classification tasks (solid) and four-way followed by binary classification tasks (hollow) of Figures 8a and Figures 8b. In the case of sequential binary tasks both object and animal second tasks are represented extremely similarly to the initial object task and the slightly less similar, object task, forgets more. For the four way classification task, animals are represented dissimilarly to the second object task and cause less forgetting.
|
| 167 |
+
|
| 168 |
+
Semantic similarity revisited Armed with these quantitative measures, we revisit the task semantics puzzle in Figure 8 where (i) for sequential binary classification, semantically more similar categories were forgotten less, while in (ii) four class classification followed by binary classification and input distribution shift, similar classes were forgotten more. Figure 10c (solid dots) shows that in (i) the net didn’t represent objects and animals differently, and the slightly more similar task is forgotten less. But in (ii) Figure 10c (hollow dots), the model encodes animals and objects differently, minimizing forgetting on the dissimilar tasks, consistent with maximal forgetting for intermediate similarity.
|
| 169 |
+
|
| 170 |
+
# 7 CONCLUSION
|
| 171 |
+
|
| 172 |
+
In this paper, we have studied some of the fundamental properties of catastrophic forgetting, answering important open questions on how it arises and interacts with hidden representations, mitigation strategies and task semantics. By using representational analysis techniques, we demonstrated that forgetting is not evenly distributed throughout the deep learning model but concentrated at the higher layers, which change significantly and erase earlier task subspaces through sequential training. Consistent with this, we find mitigation methods all stabilize higher layer representations, but vary on whether they enforce more feature reuse, or store tasks in orthogonal subspaces. Informed by these insights, we formulate an analytic model to investigate connections between forgetting and task semantics. This gives a quantitative measure of task similarity and shows that intermediate similarity in sequential tasks leads to maximal forgetting. In summary, these results help provide a foundation for a deeper understanding of catastrophic forgetting and suggest new approaches for developing and measuring mitigation methods.
|
| 173 |
+
|
| 174 |
+
# REFERENCES
|
| 175 |
+
|
| 176 |
+
Naveen Arivazhagan, Ankur Bapna, Orhan Firat, Dmitry Lepikhin, Melvin Johnson, Maxim Krikun, Mia Xu Chen, Yuan Cao, George Foster, Colin Cherry, et al. Massively multilingual neural machine translation in the wild: Findings and challenges. arXiv preprint arXiv:1907.05019, 2019.
|
| 177 |
+
|
| 178 |
+
Dumitru Erhan, Y. Bengio, Aaron Courville, and Pascal Vincent. Visualizing higher-layer features of a deep network. Technical Report, Univeriste de Montr ´ eal ´ , 01 2009.
|
| 179 |
+
|
| 180 |
+
Dar Gilboa and Guy Gur-Ari. Wider networks learn better features, 2019.
|
| 181 |
+
|
| 182 |
+
Raphael Gontijo-Lopes, Sylvia J Smullin, Ekin D Cubuk, and Ethan Dyer. Affinity and diversity: Quantifying mechanisms of data augmentation. arXiv preprint arXiv:2002.08973, 2020.
|
| 183 |
+
|
| 184 |
+
Ian J Goodfellow, Mehdi Mirza, Da Xiao, Aaron Courville, and Yoshua Bengio. An empirical investigation of catastrophic forgetting in gradient-based neural networks. arXiv preprint arXiv:1312.6211, 2013.
|
| 185 |
+
|
| 186 |
+
Akhilesh Gotmare, Nitish Shirish Keskar, Caiming Xiong, and Richard Socher. A closer look at deep learning heuristics: Learning rate restarts, warmup and distillation. arXiv preprint arXiv:1810.13243, 2018.
|
| 187 |
+
|
| 188 |
+
Arthur Gretton, Olivier Bousquet, Alex Smola, and Bernhard Scholkopf. Measuring statistical ¨ dependence with hilbert-schmidt norms. In International conference on algorithmic learning theory, pp. 63–77. Springer, 2005.
|
| 189 |
+
|
| 190 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition, 2015.
|
| 191 |
+
|
| 192 |
+
Gao Huang, Zhuang Liu, Laurens van der Maaten, and Kilian Q. Weinberger. Densely connected convolutional networks, 2016.
|
| 193 |
+
|
| 194 |
+
Arthur Jacot, Franck Gabriel, and Clement Hongler. Neural tangent kernel: Convergence and ´ generalization in neural networks. In NeurIPS, 2018.
|
| 195 |
+
|
| 196 |
+
Ronald Kemker, Marc McClure, Angelina Abitino, Tyler L Hayes, and Christopher Kanan. Measuring catastrophic forgetting in neural networks. In Thirty-second AAAI conference on artificial intelligence, 2018.
|
| 197 |
+
|
| 198 |
+
James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, et al. Overcoming catastrophic forgetting in neural networks. Proceedings of the national academy of sciences, 114 (13):3521–3526, 2017.
|
| 199 |
+
|
| 200 |
+
Simon Kornblith, Mohammad Norouzi, Honglak Lee, and Geoffrey Hinton. Similarity of neural network representations revisited. arXiv preprint arXiv:1905.00414, 2019.
|
| 201 |
+
|
| 202 |
+
Sneha Reddy Kudugunta, Ankur Bapna, Isaac Caswell, Naveen Arivazhagan, and Orhan Firat. Investigating multilingual nmt representations at scale. arXiv preprint arXiv:1909.02197, 2019.
|
| 203 |
+
|
| 204 |
+
Sang-Woo Lee, Jin-Hwa Kim, Jaehyun Jun, Jung-Woo Ha, and Byoung-Tak Zhang. Overcoming catastrophic forgetting by incremental moment matching. In Advances in neural information processing systems, pp. 4652–4662, 2017.
|
| 205 |
+
|
| 206 |
+
Xilai Li, Yingbo Zhou, Tianfu Wu, Richard Socher, and Caiming Xiong. Learn to grow: A continual structure learning framework for overcoming catastrophic forgetting. arXiv preprint arXiv:1904.00310, 2019.
|
| 207 |
+
|
| 208 |
+
Jean M. Mandler and Laraine McDonough. Concept formation in infancy. Cognitive Development, 8(3):291 – 318, 1993. ISSN 0885-2014. doi: https://doi.org/10. 1016/S0885-2014(93)80003-C. URL http://www.sciencedirect.com/science/ article/pii/S088520149380003C.
|
| 209 |
+
|
| 210 |
+
Amil Merchant, Elahe Rahimtoroghi, Ellie Pavlick, and Ian Tenney. What happens to bert embeddings during fine-tuning?, 2020.
|
| 211 |
+
|
| 212 |
+
Ari Morcos, Maithra Raghu, and Samy Bengio. Insights on representational similarity in neural networks with canonical correlation. In Advances in Neural Information Processing Systems, pp. 5727–5736, 2018.
|
| 213 |
+
|
| 214 |
+
Behnam Neyshabur, Hanie Sedghi, and Chiyuan Zhang. What is being transferred in transfer learning?, 2020.
|
| 215 |
+
|
| 216 |
+
Cuong V Nguyen, Alessandro Achille, Michael Lam, Tal Hassner, Vijay Mahadevan, and Stefano Soatto. Toward understanding catastrophic forgetting in continual learning. arXiv preprint arXiv:1908.01091, 2019.
|
| 217 |
+
|
| 218 |
+
Stephan Rabanser, Stephan Gunnemann, and Zachary Lipton. Failing loudly: an empirical study of ¨ methods for detecting dataset shift. In Advances in Neural Information Processing Systems, pp. 1394–1406, 2019.
|
| 219 |
+
|
| 220 |
+
Maithra Raghu and Eric Schmidt. A survey of deep learning for scientific discovery. arXiv preprint arXiv:2003.11755, 2020.
|
| 221 |
+
|
| 222 |
+
Maithra Raghu, Justin Gilmer, Jason Yosinski, and Jascha Sohl-Dickstein. Svcca: Singular vector canonical correlation analysis for deep learning dynamics and interpretability. In Advances in Neural Information Processing Systems, pp. 6076–6085, 2017.
|
| 223 |
+
|
| 224 |
+
Roger Ratcliff. Connectionist models of recognition memory: constraints imposed by learning and forgetting functions. Psychological review, 97 2:285–308, 1990.
|
| 225 |
+
|
| 226 |
+
Benjamin Recht, Rebecca Roelofs, Ludwig Schmidt, and Vaishaal Shankar. Do imagenet classifiers generalize to imagenet? arXiv preprint arXiv:1902.10811, 2019.
|
| 227 |
+
|
| 228 |
+
Hippolyt Ritter, Aleksandar Botev, and David Barber. Online structured laplace approximations for overcoming catastrophic forgetting. In Advances in Neural Information Processing Systems, pp. 3738–3748, 2018.
|
| 229 |
+
|
| 230 |
+
Anthony Robins. Catastrophic forgetting, rehearsal and pseudorehearsal. Connection Science, 7(2): 123–146, 1995.
|
| 231 |
+
|
| 232 |
+
David Rolnick, Arun Ahuja, Jonathan Schwarz, Timothy Lillicrap, and Gregory Wayne. Experience replay for continual learning. In Advances in Neural Information Processing Systems, pp. 348–358, 2019.
|
| 233 |
+
|
| 234 |
+
Andrew M. Saxe, James L. McClelland, and Surya Ganguli. A mathematical theory of semantic development in deep neural networks. Proceedings of the National Academy of Sciences, 116 (23):11537–11546, 2019. ISSN 0027-8424. doi: 10.1073/pnas.1820226116. URL https: //www.pnas.org/content/116/23/11537.
|
| 235 |
+
|
| 236 |
+
Tom Schaul, John Quan, Ioannis Antonoglou, and David Silver. Prioritized experience replay. arXiv preprint arXiv:1511.05952, 2015.
|
| 237 |
+
|
| 238 |
+
Joan Serra, Didac Suris, Marius Miron, and Alexandros Karatzoglou. Overcoming catastrophic \` forgetting with hard attention to the task. arXiv preprint arXiv:1801.01423, 2018.
|
| 239 |
+
|
| 240 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition, 2014.
|
| 241 |
+
|
| 242 |
+
Jasper Snoek, Yaniv Ovadia, Emily Fertig, Balaji Lakshminarayanan, Sebastian Nowozin, D Sculley, Joshua Dillon, Jie Ren, and Zachary Nado. Can you trust your model’s uncertainty? evaluating predictive uncertainty under dataset shift. In Advances in Neural Information Processing Systems, pp. 13969–13980, 2019.
|
| 243 |
+
|
| 244 |
+
Jonathan M Stokes, Kevin Yang, Kyle Swanson, Wengong Jin, Andres Cubillos-Ruiz, Nina M Donghia, Craig R MacNair, Shawn French, Lindsey A Carfrae, Zohar Bloom-Ackerman, et al. A deep learning approach to antibiotic discovery. Cell, 180(4):688–702, 2020.
|
| 245 |
+
|
| 246 |
+
Mariya Toneva, Alessandro Sordoni, Remi Tachet des Combes, Adam Trischler, Yoshua Bengio, and Geoffrey J. Gordon. An empirical study of example forgetting during deep neural network learning. ArXiv, abs/1812.05159, 2019.
|
| 247 |
+
|
| 248 |
+
John M. Wu, Yonatan Belinkov, Hassan Sajjad, Nadir Durrani, Fahim Dalvi, and James Glass. Similarity analysis of contextual word representation models, 2020.
|
| 249 |
+
Shijie Wu, Alexis Conneau, Haoran Li, Luke Zettlemoyer, and Veselin Stoyanov. Emerging crosslingual structure in pretrained language models. arXiv preprint arXiv:1911.01464, 2019a.
|
| 250 |
+
Yuxin Wu, Alexander Kirillov, Francisco Massa, Wan-Yen Lo, and Ross Girshick. Detectron2. https://github.com/facebookresearch/detectron2, 2019b.
|
| 251 |
+
Friedemann Zenke, Ben Poole, and Surya Ganguli. Continual learning through synaptic intelligence. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 3987– 3995. JMLR. org, 2017.
|
| 252 |
+
Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. arXiv preprint arXiv:1710.09412, 2017.
|
| 253 |
+
|
| 254 |
+
# A METHODS
|
| 255 |
+
|
| 256 |
+
# A.1 MODELS
|
| 257 |
+
|
| 258 |
+
Here we detail the model architectures used in this study. We use standard versions of the popular VGG (Simonyan & Zisserman, 2014), ResNet (He et al., 2015), and DenseNet (Huang et al., 2016) architectures. These architectures have varying structural properties (e.g., presence or absence of skip connections), meaning observed behaviors common to all of them are likely to be robust and generalizable.
|
| 259 |
+
|
| 260 |
+
VGG: The VGG model we use consists of five stages. Each stage comprises a convolutional layer, a ReLU nonlinearity, another convolutional layer, another ReLU nonlinearity, and finally a MaxPool layer. Each convolution uses a 3-by-3 kernel with unit stride and padding. The MaxPool operation uses a 2-by-2 kernel with stride 2. The number of channels by stage is 16, 32, 64, 128, 128. We do not use batch normalization in the VGG.
|
| 261 |
+
|
| 262 |
+
We test two different version of the VGG: one with just the stages described above, and another with two fully connected layers, of width 1024, after the convolutional layers.
|
| 263 |
+
|
| 264 |
+
ResNet: Our ResNet consists of a initial 3-by-3 convolutional layer with 32 channels, followed by a 2d batch norm operation. This initial pair is followed by four stages, each consisting of two residual blocks per stage. Each block consists of two conv-BN-ReLU sequences, with a shortcut layer directly routing the input to add to the final ReLU preactivations. All convolutions are 3-by-3, with unit padding. In all but the first block, the first convolutional layer downsamples, with a stride of 2; the second convolutional layer maintains stride of 1. The number of channels doubles each block, starting from a base level of 32 channels in the first block.
|
| 265 |
+
|
| 266 |
+
DenseNet: Like ResNet, our DenseNet consists of an initial 3-by-3 convolution, followed by four dense blocks. In between each pair of dense blocks is a transition block. Following the final dense block is a batch-normalization, ReLU, and average pooling operation to generate the final features. Our DenseNet is characterized by a growth rate of 12 and compression rate of 0.5. The first stage of the DenseNet features 6 blocks, with the number of blocks doubling in each subsequent stage.
|
| 267 |
+
|
| 268 |
+
# A.2 TRAINING
|
| 269 |
+
|
| 270 |
+
All networks are trained using cross-entropy loss with SGD with momentum $\beta = 0 . 9 ,$ ), using a batch size 128. We do not use learning-rate schedules here, leaving that investigation to future work. To better correspond with practical situations, however, we choose a learning rate and total number of epochs such that interpolation (of the training set) occurs. For the split CIFAR-10 task, this typically corresponds to training for 30 epochs per task with a learning rate of 0.01 (VGG), 0.03 (ResNet), and 0.03 (DenseNet). We use weight decay with strength 1e-4, and do not apply any data augmentation. For the split CIFAR-100 task, we usually train for 60 or 90 epochs per task, with other the other hyperparameters identical to the CIFAR-10 case.
|
| 271 |
+
|
| 272 |
+
For multi-head networks (used in split CIFAR-10), each head is initialized with weights drawn from a normal distribution with variance $1 / n _ { f }$ , where $n _ { f }$ is the number of features; biases are initialized to zero. We do not copy the parameters from the old head to the new when switching tasks.
|
| 273 |
+
|
| 274 |
+
For the split CIFAR-10 setup, the plots shown in the main text refer to experiments in which the initial task was classifying between the five categories airplane, automobile, bird, cat, and deer; and the second task comprising dog, frog, horse, ship, and truck. To verify that our results were not unique to the particular split of CIFAR-10 we chose, we used three other splits: airplane, bird, deer, frog, ship (task 1) and automobile, cat, dog, horse, truck (task 2); automobile, cat, dog, horse, truck (task 1) and airplane, bird, deer, frog, ship (task 2); and dog, frog, horse, ship, truck (task 1) and airplane, automobile, bird, cat, deer (task 2).
|
| 275 |
+
|
| 276 |
+
# A.3 CIFAR-100 DISTRIBUTION SHIFT TASK
|
| 277 |
+
|
| 278 |
+
Here we provide the concrete example of the CIFAR-100 distribution-shift task shown in Figure 1. This is meant to capture it the scenario where catastrophic forgetting arises through input distribution shift — the input data to the neural network undergoes a distribution shift, causing the neural network to perform poorly on earlier data distributions (Arivazhagan et al., 2019; Snoek et al., 2019; Rabanser et al., 2019). As mentioned in the main text, in this task, the model must identify, for CIFAR-100 images, which of the 20 superclasses the image belongs to. The difference in tasks comes from the difference in subclasses which make up the superclass. As an example, we take the five superclasses aquatic mammals, fruits and vegetables, household electrical devices, trees, and vehicles- $I ^ { \hat { 1 } }$ , with the corresponding task 1 subclasses (1) dolphin, (2) apple, (3) lamp, (4) maple tree, and (5) bicycle and task 2 subclasses (1) whale, (2) orange, (3) television, (4) willow, and (5) motorcycle. A key feature of this setting is that task-specific components (including multiple heads) are precluded since the model does not know the task identity either at inference or time. While we do not explore it here, this setup also allows for continuously varying the data distribution, another situation likely to occur in practice.
|
| 279 |
+
|
| 280 |
+
# A.4 REPRESENTATIONAL SIMILARITY AND CENTERED KERNEL ALIGNMENT
|
| 281 |
+
|
| 282 |
+
To understand properties of neural network hidden representations, we turn to representational similarity algorithms. A key challenge in analyzing neural network hidden representations is the lack of alignment — no natural correspondence exists between hidden neurons across different neural networks. Representational similarity algorithms propose different ways to overcome this — one of the first such algorithms, SVCCA (Raghu et al., 2017; Morcos et al., 2018), uses a Canonical Correlation Analysis (CCA) step to align neurons (enable invariance) through linear transformations.
|
| 283 |
+
|
| 284 |
+
We use centered kernel alignment (CKA), proposed by Kornblith et al. (2019), to measure the similarity between two representations of the same dataset which is invariant to orthogonal transformation and isotropic scaling (but not arbitrary linear transformations). Given a dataset of $m$ examples, we compare two representations $X$ and $Y$ of that dataset (say, from two different neural networks or from the same neural network with different parameters), with $n _ { x }$ and $n _ { y }$ features respectively; that is, $X \in \mathbb { R } ^ { m \times n _ { x } }$ and $Y \in \mathbb { R } ^ { m \times n _ { y } }$ . Then the linear-kernel CKA similarity between the two representations is given by
|
| 285 |
+
|
| 286 |
+
$$
|
| 287 |
+
\mathrm { C K A } ( X , Y ) = { \frac { | | X ^ { T } Y | | _ { F } ^ { 2 } } { | | X ^ { T } X | | _ { F } ^ { 2 } | | Y ^ { T } Y | | _ { F } ^ { 2 } } }
|
| 288 |
+
$$
|
| 289 |
+
|
| 290 |
+
# A.5 SUBSPACE SIMILARITY
|
| 291 |
+
|
| 292 |
+
For the subspace similarity computations we pick a fixed threshold $k$ for all layers so that the first $k$ principal components capture $\mathrm { \bar { 8 0 \% } }$ of variance in the final layer. This gives $k = 3$ for Resnet on CIFAR-10, $k = 4$ for Resnet on CIFAR-100, $k = 4$ for VGG on CIFAR-10 and $k = 7$ for VGG on CIFAR-100 and $k = 4$ for DenseNet on CIFAR-10 and $k = 5$ for DenseNet on CIFAR-100.
|
| 293 |
+
|
| 294 |
+

|
| 295 |
+
Figure 11: Subspace similarity analysis shows feature reuse in lower layers and Task 1 subspace erasure in higher layers.
|
| 296 |
+
|
| 297 |
+
# A.6 MITIGATION METHODS
|
| 298 |
+
|
| 299 |
+
# A.6.1 ELASTIC WEIGHT CONSOLIDATION
|
| 300 |
+
|
| 301 |
+
Developed by Kirkpatrick et al. in 2017, elastic weight consolidation (EWC) adds a term to the loss function of the new task to get the regularized loss function $\mathcal { L } ( \vec { \theta } )$ :
|
| 302 |
+
|
| 303 |
+
$$
|
| 304 |
+
\mathcal { L } ( \vec { \theta } ) = \mathcal { L } _ { B } ( \vec { \theta } ) + \frac { \lambda } { 2 } \sum _ { i } F _ { i } \cdot \left( \theta _ { i } - \theta _ { A , i } ^ { * } \right) ^ { 2 } .
|
| 305 |
+
$$
|
| 306 |
+
|
| 307 |
+
Here, $\vec { \theta }$ are the model parameters; $\mathcal { L } _ { B } ( \vec { \theta } )$ is the unregularized loss function of the new task; $\lambda$ is a parameter which controls the strength of the regularization; $F _ { i }$ is the diagonal of the Fisher information matrix with respect to the parameters; and $\vec { \theta } _ { A } ^ { * }$ are the model parameters after having been trained on task A. We compute the Fisher information via using the squared gradients of the log-likelihood, averaged over a subset of the trainset. We use the empirical Fisher as an approximation.
|
| 308 |
+
|
| 309 |
+
Following standard practice, in our experiments we estimate the Fisher information using a subset of the full training data; for all of our models on CIFAR-10, 200 samples proved sufficient to be reasonably confident of a converged estimate. We do not include a delay between the start of secondtask training and the application of the EWC penalty. Naturally, we do not apply the EWC penalty to the parameters of the head in the multi-head setting.
|
| 310 |
+
|
| 311 |
+
# A.6.2 SYNAPTIC INTELLIGENCE
|
| 312 |
+
|
| 313 |
+
Developed by Zenke et al. (2017), synaptic intelligence, like EWC, is a structural regularization method which adds an elastic penalty to the second task’s loss function:
|
| 314 |
+
|
| 315 |
+
$$
|
| 316 |
+
\mathcal { L } ( \vec { \theta } ) = \mathcal { L } _ { B } ( \vec { \theta } ) + \frac { \lambda } { 2 } \sum _ { i } C _ { i } \cdot \left( \theta _ { i } - \theta _ { A , i } ^ { * } \right) ^ { 2 } .
|
| 317 |
+
$$
|
| 318 |
+
|
| 319 |
+
The difference from EWC is in how the elastic penalties are calculated. In synaptic intelligence, for each parameter, a contribution to the loss is tracked via the product of the gradient of the loss and the stepwise change in the parameter value. The coefficient is then constructed such that changing the parameter by an amount equal to its change during task-1 training will incur a loss penalty equal to the change in loss from the initial value. Our implementation does not differ from the standard implementation.
|
| 320 |
+
|
| 321 |
+
# B SUPPORTING EXPERIMENTS
|
| 322 |
+
|
| 323 |
+
Here we present experiments omitted from the main text for space, which help flesh out some of the conclusions. This section is roughly organized with layerwise experiments first, followed by semantic experiments.
|
| 324 |
+
|
| 325 |
+
# B.1 LAYER RESET EXPERIMENTS
|
| 326 |
+
|
| 327 |
+
As described in the main text, we perform an additional experiment to check that deeper representations get corrupted more than shallower representations. This experiment, corresponding to Figure 12, shows that when layers are reset to their pre-forgetting value, performance improves more dramatically when deeper layers are reset first.
|
| 328 |
+
|
| 329 |
+
# B.2 TASK-SPECIFIC STAGES
|
| 330 |
+
|
| 331 |
+
Our observations that forgetting is driven primarily by the higher layers suggests that in a setting with known task identities (i.e. in the split CIFAR-10 setting described in the main text but not the CIFAR-100 distribution-shift setting), making the deeper stages of the network task-specific would likely mitigate a large portion of forgetting on the old tasks while still allowing for full performance on the new tasks. In particular, since the changes in deeper represntations are much greater than their shallower counterparts, only a few task-specific stages should be necessary to get significant performance increases on the old task. For each of the three network architectures we considered (VGG, ResNet, and DenseNet), we investigated the performance of these task-specific networks on the split CIFAR task. We intend these results to be further evidence of the role of deeper layers in forgetting, not a proposed mitigation scheme.
|
| 332 |
+
|
| 333 |
+

|
| 334 |
+
Figure 12: Layer reset experiments. After training on Task 2 we reset contiguous blocks of layers to their values before training and record the resulting accuracy on Task 1 (bottom row). We see a significant increase in accuracy when resetting the highest $N$ layers (blue line) compared to resetting the $N$ lowest layers (gray line). Together, these results demonstrate that higher layers are disproportionately responsible for forgetting.
|
| 335 |
+
|
| 336 |
+

|
| 337 |
+
Figure 13: Forgetting in networks with task-specific stages on CIFAR-10. Using the same settings as Figure 1 of the main text, we run networks with task-specific layers on split CIFAR-10. We make deeper layers task-specific before shallower layers. Performance increases with number of task-specific layers, denoted by the line color (see legend). In all architectures, two task-specific stages is sufficient to recover significant performance.
|
| 338 |
+
|
| 339 |
+
Results, shown in figure 13, show that for all architectures, performance dramatically rises with the number of task-specific stages. For all architectures, having the deepest two stages be task-specific recovers a significant fraction of the forgotten task performance.
|
| 340 |
+
|
| 341 |
+
# B.3 LAYER RESET AND RETRAIN EXPERIMENTS
|
| 342 |
+
|
| 343 |
+
As an additional probe of the degree to which catastrophic forgetting impacts the representations of various network layers, we perform a reset-and-retrain experiment on the split CIFAR-10 task, using the same training setup as in Figure 3 of the main text. The reset-and-retrain experiment is designed to probe the degree to which network representations get corrupted and can no longer be used by a network of the same architecture to productively classify images. To investigate this, after having trained the network on Task 2, we freeze parameters of stages 1 through $N$ to their post-task-2 values, reset the parameters of stages $N + 1$ onwards to their post-task-1 values, and then retrain those parameters on the Task 1 loss function. This is a natural, operational measure of the degree to which layer 1 through $N$ representations have been corrupted.
|
| 344 |
+
|
| 345 |
+
The results of this experiment, shown in Figure 14, tell a similar story to that of Figure ?? of the main text. In particular, we see even retraining the network with all but the last couple of layers frozen recovers nearly the pre-forgetting performance of the network.
|
| 346 |
+
|
| 347 |
+
Some of the performances in Figure 14 even outperform the pre-forgetting network performance, suggesting that network representations of intermediate layers may actually be improved by training on Task 2. Further suggestive results are shown in Figure 15, in which we retrain the full network again on Task 1 after the training on Task 2. For ResNet and, to some degree, VGG, training on the second task clearly improves performance on the first.
|
| 348 |
+
|
| 349 |
+

|
| 350 |
+
Figure 14: Layer reset and retrain experiments. Consistent with the observations in the freeze-training, layer reset, and CKA experiments, resetting and retraining only a few stages from the top is enough to recover the performance before forgetting.
|
| 351 |
+
|
| 352 |
+

|
| 353 |
+
Figure 15: Training on a different task can improve performance on the original task. Networks are trained on two five-class splits of CIFAR-10. The gray curve shows the test accuracy on task 0 during training on solely that task for 270 epochs; the teal curve shows the task-0 test accuracy when training on task 0 for 90 epochs, then on task 1 for 90 epochs, and task 0 again for 90 epochs. While we see a sharp performance drop for the duration of training on task 1, the performance is quickly recovered once we begin training on task 0, and in fact surpasses the performance of the model only exposed to task-0 data. This effect is consistent across different splits of the original dataset. Of the architectures we studied, this effect is most pronounced for ResNet, but also exists to some degree for VGG and DenseNet models.
|
| 354 |
+
|
| 355 |
+
# B.4 REPRESENTATION CHANGES IN THE CIFAR-100 DISTRIBUTION SHIFT EXPERIMENTS
|
| 356 |
+
|
| 357 |
+
Here we show the change in representations due to training on distribution-shifted CIFAR-100 for the VGG (Figure 16) and DenseNet (Figure 17) networks, to accompany the ResNet results in the main text.
|
| 358 |
+
|
| 359 |
+

|
| 360 |
+
Figure 16: Change in Densenet representations under CIFAR-100 distribution shift.
|
| 361 |
+
|
| 362 |
+

|
| 363 |
+
Figure 17: Change in VGG representations under CIFAR-100 distribution shift.
|
| 364 |
+
|
| 365 |
+
B.5 ADDITIONAL EXPERIMENTS FOR SUBSPACE SIMILARITY OF MITIGATION METHODS
|
| 366 |
+
|
| 367 |
+
We include additional experiments on computing subspace similarities for different mitigation methods across different architectures. The results support the orthogonal storage of Task 1, Task 2 representations by replay, while EWC and SI enforce greater feature reuse in the higher layers.
|
| 368 |
+
|
| 369 |
+

|
| 370 |
+
Figure 18: Subspace similarity analysis reveals differences between different mitigation methods, with replay storing Task 1 and Task 2 representations in orthogonal subspaces, while EWC and SI promote feature reuse in the higher layers. Additional results, compare to Figure 6 in the main text.
|
| 371 |
+
|
| 372 |
+
# B.6 LINEAR REGRESSION ON FORGOTTEN NETWORK ACTIVATIONS
|
| 373 |
+
|
| 374 |
+
To further probe the manner in which catastrophic forgetting affects the internal representation of networks, we perform the following experiment (in the split CIFAR-10 setting). We train a (multihead) model on the first task for some time, resulting in model $M _ { 1 }$ , and then train on the second task for some time, resulting in model $M _ { 2 }$ . Due to forgetting, the model $M _ { 2 }$ of course performs significantly worse than does $M _ { 1 }$ on the first task. But, to probe how much information has been lost internally, we train a linear model to classify between the first-task categories using only the internal activations of $M _ { 2 }$ on the first-task images. We measure both the amount of performance which we can recover using this linear regression, and the weight placed by the linear model on various stages of the network.
|
| 375 |
+
|
| 376 |
+
Model performances are given in Table 2. For all three architectures, the performance of the model before forgetting is naturally the highest, with a performance drop of up to forty percent due to forgetting. Remarkably, however, training a linear model on the internal post-forgetting activations recovers a substantial fraction of the performance loss: for ResNet and VGG, the linear model on post-forgetting activations is only a percent less accurate than the model before forgetting. As a control, we also train a linear model on the activations of networks at initialization (denoted the random lift in the table). Because the number of activations is much higher than the number of pixels in a CIFAR-10 image, this control is necessary to ensure that the boost in performance we see is not simply due to performing a high-dimensional lift which renders the data linearly separable. As the table shows, however, this random lift performance is quite poor.
|
| 377 |
+
|
| 378 |
+
Table 2: Performance of linear model trained on internal activations.
|
| 379 |
+
|
| 380 |
+
<table><tr><td></td><td>DenseNet</td><td>ResNet</td><td>VGG</td></tr><tr><td>Pre-forgetting accuracy</td><td>0.869</td><td>0.7714</td><td>0.7970</td></tr><tr><td>Post-forgetting accuracy</td><td>0.4754</td><td>0.5924</td><td>0.5877</td></tr><tr><td>Linear regression on activations</td><td>0.802</td><td>0.7592</td><td>0.7896</td></tr><tr><td>Linear regression on random lift</td><td>0.447</td><td>0.4198</td><td>0.543</td></tr></table>
|
| 381 |
+
|
| 382 |
+
Figure 19 shows the weights placed by the linear model on the various internal activations of the network. We use the activations both before and after forgetting. Before forgetting, a linear model trained on the activations places most importance on the final layers, as expected; however, after forgetting, the model learns to use information stored in earlier-layer representations of the network. The reduced weighting of the final layers is consistent with the experiments we describe in the main text showing that deeper representations suffer the most from forgetting.
|
| 383 |
+
|
| 384 |
+

|
| 385 |
+
Figure 19: Weights of linear models trained on internal activations.
|
| 386 |
+
|
| 387 |
+
# B.7 CKA MEASUREMENTS ON MITIGATION METHODS
|
| 388 |
+
|
| 389 |
+
This section gives CKA similarity measurements to accompany those in the main text presented in figure 5. The main text figure showed results for ResNet; here we show corresponding results for all architectures on both split CIFAR10 and split CIFAR100 tasks, in figures 20 and 21, repsectively. These plots show that the results discussed in the main text apply broadly across architectures and datasets.
|
| 390 |
+
|
| 391 |
+
# B.8 OTHER CATEGORY IN RESNET AND DENSENET
|
| 392 |
+
|
| 393 |
+
In Figure 9 of the main text, we showed for the VGG architecture that adding an ‘other’ category (by sampling from all images in the dataset which are not in either of the main tasks) can mitigate forgetting by reducing the similarity between the model’s representations of the task 1 data versus
|
| 394 |
+
|
| 395 |
+

|
| 396 |
+
Figure 20: CKA Analysis of mitigation methods on the split CIFAR10 task
|
| 397 |
+
|
| 398 |
+

|
| 399 |
+
Figure 21: CKA Analysis of mitigation methods on the split CIFAR100 task
|
| 400 |
+
|
| 401 |
+

|
| 402 |
+
Figure 22: Adding an ‘other’ category during initial training helps performance through orthogonalization: Densenet. Model is trained initially on classifying two objects: airplane/automobile, and subsequently on two animals: deer/dog. When we add the ‘other’ category, it comprises a random sampling of images from all other classes. This reduces the similarity between the model’s representations of each tasks’ datapoints, leading to improved continual learning.
|
| 403 |
+
|
| 404 |
+

|
| 405 |
+
Figure 23: Adding an ‘other’ category during initial training helps performance through orthogonalization: Resnet. Model is trained initially on classifying two objects: airplane/automobile, and subsequently on two animals: deer/dog. When we add the ‘other’ category, it comprises a random sampling of images from all other classes. This reduces the similarity between the model’s representations of each tasks’ datapoints, leading to improved continual learning.
|
| 406 |
+
|
| 407 |
+
the task 2 data. As our analytic model suggested, increasing this dissimilarity should help forgetting.
|
| 408 |
+
Figures 22 and 23 show corresponding plots for the Resnet and Densenet architectures.
|
| 409 |
+
|
| 410 |
+
# B.9 ADDITIONAL SEMANTIC EXPERIMENTS
|
| 411 |
+
|
| 412 |
+
In this section, comprising figures 24, 25, and 26, we present additional realizations of the semantic experiments presented in Section 6, Figure 8. In particular we present results for sequential binary classification tasks, four-class classification followed by two-class classification, and the CIFAR-100 distribution shift task. We find consistent results across different choices of objects and animals and across VGG, ResNet, and DenseNet architectures. In particular, we find that when models are encouraged to distinguish objects and animals, dissimilar categories lead to less forgetting. In contrast when models are trained with only a single semantic category, there is no pressure to distinguish objects from animals and similar categories lead to less forgetting. We observe one exception to the intuitive semantic groupings of categories. For VGG in Setup 2 (Figure 25) the truck category behaves similarly to animal classes in that the performance suffers more when the second task is animal classification then when it is object classification.
|
| 413 |
+
|
| 414 |
+
# C FROZEN-FEATURE MODEL: FURTHER DETAILS
|
| 415 |
+
|
| 416 |
+
Here we consider extensions and applications of the analytic model introduced in Section 6.2. Both the single and multi-head models relate the change in predictions during training on a second task to
|
| 417 |
+
|
| 418 |
+

|
| 419 |
+
Task 1 - deer, dog, Task 2 - cat, horse or plane, car
|
| 420 |
+
Figure 24: Sequential binary classification tasks show consistent semantic structure. We train on sequential binary subsets of CIFAR-10, distinguishing between two animals or two objects. We find that less forgetting occurs when the initial task is more similar to the second task.
|
| 421 |
+
|
| 422 |
+
the overlap between features, $\begin{array} { r } { \Theta ( x , x ^ { \prime } ) = \sum _ { \mu } g _ { \mu } ( x ) g _ { \mu } ( x ^ { \prime } ) } \end{array}$ , evaluated on the initial and second task data.2
|
| 423 |
+
|
| 424 |
+
Multi-head model In the main text we focused for simplicity on an analytic model of single head forgetting. Here we construct a solvable model for the multi-head setup. We consider a model
|
| 425 |
+
|
| 426 |
+

|
| 427 |
+
Task 1 - deer, dog, ship, truck, Task 2 - cat, horse
|
| 428 |
+
Figure 25: Sequential four class and binary tasks show decreased forgetting for dissimilar tasks. We train on sequential subsets of CIFAR-10, initially distinguishing between four classes (two animals and two objects) and then distinguishing between either two animals or two objects. We find that less forgetting occurs for categories that are dissimilar to those used in the second task.
|
| 429 |
+
|
| 430 |
+
consisting of non-linear features $g ( w ; x )$ , a linear layer with weights, $\theta$ , and a read out head $\it { h ^ { ( i ) } }$
|
| 431 |
+
|
| 432 |
+
$$
|
| 433 |
+
f ^ { ( i ) } ( x ) = \sum _ { a , \mu } h _ { a } ^ { ( i ) } \theta _ { a \mu } g _ { \mu } ( w ; x ) .
|
| 434 |
+
$$
|
| 435 |
+
|
| 436 |
+
Here $\mu$ runs over the feature dimensions, while $a$ runs over the output dimensions of our additional linear layer. For the initial task we use the head $h ^ { ( 1 ) }$ , while for the second task, we swap the head and use $h ^ { ( 2 ) }$ .
|
| 437 |
+
|
| 438 |
+
Again we consider a model trained without restrictions on Task 1 using head $h ^ { ( 1 ) }$ . For Task 2, we first swap the head and then perform head only training on head $h ^ { ( 2 ) }$ . After training the head, we
|
| 439 |
+
|
| 440 |
+

|
| 441 |
+
Figure 26: Semantic structure of forgetting on the CIFAR-100 distribution-shfit task for VGG and DenseNet models
|
| 442 |
+
|
| 443 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>VGG</td><td rowspan=1 colspan=1>ResNet</td><td rowspan=1 colspan=1>DenseNet</td></tr><tr><td rowspan=1 colspan=1>No headfirst training5 epochs headfirst training</td><td rowspan=1 colspan=1>0.147 ± 0.0510.550±0.029</td><td rowspan=1 colspan=1>0.183 ± 0.0010.673 ± 0.010</td><td rowspan=1 colspan=1>0.162 ± 0.0080.700 ± 0.012</td></tr></table>
|
| 444 |
+
|
| 445 |
+
Table 3: Headfirst CKA similarity. CKA similarity between the readout layer after headfirst training and after final training on the second task.
|
| 446 |
+
|
| 447 |
+
freeze the head, $h ^ { ( 2 ) }$ , and the features $g ( w ; x ) = g ( \hat { w } ; x )$ , where $\hat { w }$ is the value of the feature weights after training on the initial task. This model is again inspired by our observation that forgetting is driven by changes in the latter network layers. The multi head model is additionally inspired by our observing that after head first training, the CKA similarity between the second task head before and after second task training is relatively high (see Table 3).
|
| 448 |
+
|
| 449 |
+
After training the second task head, we continue training the weights $\theta$ . The model output evolves as
|
| 450 |
+
|
| 451 |
+
$$
|
| 452 |
+
\Delta f _ { t } ^ { ( i ) } ( x ) = - \eta \sum _ { x ^ { \prime } , y ^ { \prime } \in \mathcal { D } _ { \mathrm { t r a i n } } ^ { ( 2 ) } } \Theta ( x , x ^ { \prime } ) \frac { \partial L ( f ^ { ( j ) } ( x ^ { \prime } ) , y ^ { \prime } ) } { \partial f } h ^ { T ( j ) } h ^ { ( i ) } .
|
| 453 |
+
$$
|
| 454 |
+
|
| 455 |
+
Again we find that if the representation overlap matrix $\begin{array} { r } { \Theta ( x , x ^ { \prime } ) = \sum _ { \mu } g _ { \mu } ( \hat { w } ; x ) g _ { \mu } ( \hat { w } ; x ^ { \prime } ) } \end{array}$ is small between the features evaluated on the initial task and second task data then the predictions do not change significantly. If this overlap is zero, then the predictions are constant. In the multi-head setup we are considering here, we see that the change in predictions is further proportional to the similarity between the model heads, $h ^ { T ( j ) } h ^ { ( i ) }$ .
|
| 456 |
+
|
| 457 |
+
Finally, we note that we have considered a final linear layer before the readout head for simplicity. One can instead include a ReLU non-linearity without changing the essential point, that the change in model output is governed by the overlap matrix, $\Theta$ .
|
| 458 |
+
|
| 459 |
+
Rotating representations in the analytic model. We can use our analytic model (Section 6.2) to investigate how forgetting depends on representation similarity. We again consider sequential binary tasks (car vs plane) followed by (cat vs horse). We then tune the overlap of our initial task and final task features by explicitly rotating the frozen features for the second task to produce new features $g ^ { \prime } ( \theta ; \hat { w } ; x )$ .
|
| 460 |
+
|
| 461 |
+
$$
|
| 462 |
+
\begin{array} { r } { g ^ { \prime } ( \theta ; \hat { w } ; x ) = R ( \theta ) g ( \hat { w } ; x ) . } \end{array}
|
| 463 |
+
$$
|
| 464 |
+
|
| 465 |
+
Here, if we have $P$ features, $R ( \theta ) \in \mathbb { R } ^ { P \times P }$ is a one-parameter family of rotation matrices designed such that $R ( 0 ) = { \bf 1 }$ and $g ^ { T } ( \hat { w } ; x ) g ^ { \prime } ( \pi / 2 ; \hat { w } ; x ^ { \prime } )$ for $x \in X _ { \mathrm { t e s t } } ^ { ( 1 ) }$ )t and x0 ∈ X (2)train is small. Explicitly, we take
|
| 466 |
+
|
| 467 |
+
$$
|
| 468 |
+
R ( \theta ) = V ^ { T } \prod _ { i = 1 } ^ { \lfloor P / 2 \rfloor } r _ { i , P - i } ( \theta ) V ,
|
| 469 |
+
$$
|
| 470 |
+
|
| 471 |
+

|
| 472 |
+
Figure 27: Rotating representations shows diminished forgetting for dissimilar tasks. Here we consider the performance of our frozen feature model on sequential binary CIFAR-10 tasks (Task 1: car vs plane, Task 2: cat vs horse). We use a model built from a two hidden-layer fully connected network with ReLU activations. We increase decrease representational similarity by explicitly rotating the second task features and find as predicted that this leads to diminished forgetting.
|
| 473 |
+
|
| 474 |
+

|
| 475 |
+
Figure 28: Stabilizing final layer weights is not necessary to stop forgetting. Here we look at the change in final layer weights during second task training for a model with severe forgetting (gray) and forgetting mitigated by rotating the second task representations (teal). We see that final layer weights become less and less similar in both cases. The setup is identical to Figure 27
|
| 476 |
+
|
| 477 |
+
where $r _ { i j } ( \theta )$ is the two dimensional rotation matrix between axes $i$ and $j$ , and $V$ is the orthogonal matrix appearing in the singular value decomposition of the feature by data matrix on the initial task, $g ( X _ { \mathrm { t e s t } } ^ { ( 1 ) } ) = U D V$ . We find that explicitly enforcing task dissimilarity via a large rotation minimizes the effect of forgetting (Figure 27).
|
| 478 |
+
|
| 479 |
+
Stopping forgetting without stabilizing weights We saw in Section 4 that both EWC and replay buffers stabilize deeper network representations. As mentioned above, this need not be the case a priori. As an illustrative example, we construct a setup where sequential training leads to no forgetting despite a significant change to final layer weights. We consider the single head model of Section 6.2 where the Task 1 and Task 2 representations are completely orthogonal, $\Theta ( x , x ^ { \prime } ) = 0$ for $x \in X _ { \mathrm { t e s t } } ^ { ( 1 ) }$ and $x ^ { \prime } \in X _ { \mathrm { t r a i n } } ^ { ( 2 ) }$ . In this case the Task 1 predictions remain constant throughout all of Task 2 training, despite significant changes to the final layer weights and predictions on the second task. In Figure 28 we present an example of this setup. The representations are again made orthogonal by explicitly rotating the second task features by the rotation matrix, $R ( \pi / 2 )$ defined in Equation equation 11.
|
| 480 |
+
|
| 481 |
+
# D ADDITIONAL EXPERIMENTS
|
| 482 |
+
|
| 483 |
+
This section presents two additional experiments which are slightly unrelated to the main thrust of the paper. We examine how the degree to which a network forgets is influenced by its width, and also how training the head independently of the rest of the network, in a multi-head setting, can mitigate forgetting.
|
| 484 |
+
|
| 485 |
+
# D.1 FORGETTING VERSUS NETWORK WIDTH
|
| 486 |
+
|
| 487 |
+

|
| 488 |
+
Figure 29: Forgetting as a function of network width. (a) VGG, (b) ResNet, and (c) DenseNet networks of varying widths were trained on two subsets of CIFAR-10 classes. We trained each of these (multi-head) networks for 30 epochs on each task with constant $\eta$ , enough to achieve perfect training accuracy. Further training details can be found in the text. From the plots, which show the percent drop in accuracy (on task 1) due to training on task 2, the effect of width on the performance drop seems to be minimal, even sweeping across roughly a factor of ten in the number of model parameters.
|
| 489 |
+
|
| 490 |
+
Inspired by recent work of Gilboa & Gur-Ari (2019) showing that wider networks can learn better features than their narrower counterparts, we sought to determine whether wider networks also exhibit less catastrophic forgetting than narrower ones. We tested forgetting versus width for VGG, DenseNet, and ResNet networks on the split CIFAR-10 task in the multi-head setting. For VGG and ResNet, the width was varied by changing the number of channels in the initial convolutional layer and scaling the rest of the network layers concurrently while maintaining the network shape; for DenseNet, the width was varied by by changing the growth rate.
|
| 491 |
+
|
| 492 |
+
Surprisingly, though we found that the performances of the networks on each task improved as they grew wider, the amount of forgetting in each network, measured by the percent drop in accuracy (on task 1) due to training on task, exhibited a minimal dependence on network width. These results are shown in Figure 29.
|
| 493 |
+
|
| 494 |
+
# D.2 HEADFIRST TRAINING
|
| 495 |
+
|
| 496 |
+
When training multi-head networks on sequences of tasks, we found that the networks suffered a smaller performance drop on the original task, i.e. forgot less, if only the new task head was trained for a few epochs prior to training the full network. In Figure 30, this effect is shown for all three network architectures on the split CIFAR-10 task. Training only the head for up to five epochs seemed to improve the original-task performance without sacrificing performance on the new task. This suggests that coadaptation between the freshly-initialized head and the rest of the model contributes to forgetting when there is no headfirst training.
|
| 497 |
+
|
| 498 |
+

|
| 499 |
+
Figure 30: Effect of training readout layer separately between task switches. (a) VGG, (b) ResNet, and (c) DenseNet models were trained on two subsets of CIFAR-10 classes: task 0 (dog, frog, horse, ship, and truck), and task 1 (airplane, automobile, bird, cat, deer). When switching tasks, we first trained only the final classification layer (known as the readout layer or head) for a specified number of epochs (here 0, 1, 2, and 5) from a random Gaussian initialization. During this period, the rest of the model parameters are held fixed; after the head-only training, the entire model is trained as usual. Across all architectures, training only the head consistently improves the forgetting performance of the model (its accuracy on task 0) while having a negligible impact on the performance on the next task (task 1).
|
| 500 |
+
|
| 501 |
+
# E FIGURES FOR ANONREVIEWER2
|
| 502 |
+
|
| 503 |
+
# F IMAGENET RESULTS FOR TASK SEMANTICS
|
| 504 |
+
|
| 505 |
+
Figures corresponding to results tables in the main text.
|
| 506 |
+
|
| 507 |
+

|
| 508 |
+
Figure 31: Stage-wise weight change between initial weights and weights after Task 1 (blue) and between weights after Task 1 and Task2 (orange) for a model trained sequentially on disjoint 5 class subsets of CIFAR10. (a) Mean $\ell _ { 2 }$ distance. (b) Cosine similarity. We see no sign of significantly more change in last layer weights, and in fact see the reverse trend in $\ell _ { 2 }$ distance.
|
| 509 |
+
|
| 510 |
+

|
| 511 |
+
Figure 32: Mean and std deviation for the residual, $p _ { i } - y _ { i }$ , for a model trained on ship v truck evaluated on cat, horse data (blue) and plane, car (orange). We see no clear separation between object and animal data. Each point represents a model trained with a different seed.
|
| 512 |
+
|
| 513 |
+

|
| 514 |
+
Task1:10Artifacts Task2:10 Animals or 10 Artifacts
|
| 515 |
+
Figure 33: ImageNet Two-task 10 class sequences in which similar tasks cause less forgetting.
|
| 516 |
+
|
| 517 |
+
(a) Initial classification between 10 artifacts
|
| 518 |
+
|
| 519 |
+

|
| 520 |
+
Task 1:10 Animals Task2:10 Animals or10 Artifacts
|
| 521 |
+
(b) Initial classification between 10 animals
|
| 522 |
+
|
| 523 |
+

|
| 524 |
+
Task 1:10 Artifacts $+ ~ 1 0$ Animals Task 2: 10 Artifacts
|
| 525 |
+
Task 1:10 Artifacts + 10 Animals Task 2:10 Animals
|
| 526 |
+
Figure 34: ImageNet Two-task 20-class followed by 10-class sequences in which similar categories are forgotten more.
|
parse/train/LhY8QdUGSuw/LhY8QdUGSuw_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/LhY8QdUGSuw/LhY8QdUGSuw_middle.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/LhY8QdUGSuw/LhY8QdUGSuw_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/Lpfh1Bpqfk/Lpfh1Bpqfk.md
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Early Convolutions Help Transformers See Better
|
| 2 |
+
|
| 3 |
+
Tete Xiao1,2 Mannat Singh1 Eric Mintun1 Trevor Darrell2 Piotr Dollár1∗ Ross Girshick1∗
|
| 4 |
+
|
| 5 |
+
1Facebook AI Research (FAIR) 2UC Berkeley
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Vision transformer (ViT) models exhibit substandard optimizability. In particular, they are sensitive to the choice of optimizer (AdamW vs. SGD), optimizer hyperparameters, and training schedule length. In comparison, modern convolutional neural networks are easier to optimize. Why is this the case? In this work, we conjecture that the issue lies with the patchify stem of ViT models, which is implemented by a stride- $p p { \times } p$ convolution $\dot { p } = 1 6$ by default) applied to the input image. This large-kernel plus large-stride convolution runs counter to typical design choices of convolutional layers in neural networks. To test whether this atypical design choice causes an issue, we analyze the optimization behavior of ViT models with their original patchify stem versus a simple counterpart where we replace the ViT stem by a small number of stacked stride-two $3 { \times } 3$ convolutions. While the vast majority of computation in the two ViT designs is identical, we find that this small change in early visual processing results in markedly different training behavior in terms of the sensitivity to optimization settings as well as the final model accuracy. Using a convolutional stem in ViT dramatically increases optimization stability and also improves peak performance (by ${ \sim } 1 { - } 2 \%$ top-1 accuracy on ImageNet-1k), while maintaining flops and runtime. The improvement can be observed across the wide spectrum of model complexities (from 1G to 36G flops) and dataset scales (from ImageNet-1k to ImageNet-21k). These findings lead us to recommend using a standard, lightweight convolutional stem for ViT models in this regime as a more robust architectural choice compared to the original ViT model design.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Vision transformer (ViT) models [13] offer an alternative design paradigm to convolutional neural networks (CNNs) [24]. ViTs replace the inductive bias towards local processing inherent in convolutions with global processing performed by multi-headed self-attention [43]. The hope is that this design has the potential to improve performance on vision tasks, akin to the trends observed in natural language processing [11]. While investigating this conjecture, researchers face another unexpected difference between ViTs and CNNs: ViT models exhibit substandard optimizability. ViTs are sensitive to the choice of optimizer [41] (AdamW [27] vs. SGD), to the selection of dataset specific learning hyperparameters [13, 41], to training schedule length, to network depth [42], etc. These issues render former training recipes and intuitions ineffective and impede research.
|
| 14 |
+
|
| 15 |
+
Convolutional neural networks, in contrast, are exceptionally easy and robust to optimize. Simple training recipes based on SGD, basic data augmentation, and standard hyperparameter values have been widely used for years [19]. Why does this difference exist between ViT and CNN models? In this paper we hypothesize that the issues lies primarily in the early visual processing performed by ViT. ViT “patchifies” the input image into $p { \times } p$ non-overlapping patches to form the transformer encoder’s input set. This patchify stem is implemented as a stride- $p p \times p$ convolution, with $p = 1 6$ as a default value. This large-kernel plus large-stride convolution runs counter to the typical design choices used in CNNs, where best-practices have converged to a small stack of stride-two $3 { \times } 3$ kernels as the network’s stem (e.g., [30, 36, 39]).
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Early convolutions help transformers see better: We hypothesize that the substandard optimizability of ViT models compared to CNNs primarily arises from the early visual processing performed by its patchify stem, which is implemented by a non-overlapping stride- $p p { \times } p$ convolution, with $p = 1 6$ by default. We minimally replace the patchify stem in ViT with a standard convolutional stem of only ${ \sim } 5 $ convolutions that has approximately the same complexity as a single transformer block. We reduce the number of transformer blocks by one (i.e., $\bar { L } - 1$ vs. $L$ ) to maintain parity in flops, parameters, and runtime. We refer to the resulting model as $\mathrm { V i T } _ { C }$ and the original ViT as $\mathrm { V i T } _ { P }$ . The vast majority of computation performed by these two models is identical, yet surprisingly we observe that $\mathrm { V i T } _ { C }$ (i) converges faster, (ii) enables, for the first time, the use of either AdamW or SGD without a significant accuracy drop, (iii) shows greater stability to learning rate and weight decay choice, and (iv) yields improvements in ImageNet top-1 error allowing $\mathrm { V i T } _ { C }$ to outperform state-of-the-art CNNs, whereas $\mathrm { V i T } _ { P }$ does not.
|
| 19 |
+
|
| 20 |
+
To test this hypothesis, we minimally change the early visual processing of ViT by replacing its patchify stem with a standard convolutional stem consisting of only ${ \sim } 5$ convolutions, see Figure 1. To compensate for the small addition in flops, we remove one transformer block to maintain parity in flops and runtime. We observe that even though the vast majority of the computation in the two ViT designs is identical, this small change in early visual processing results in markedly different training behavior in terms of the sensitivity to optimization settings as well as the final model accuracy.
|
| 21 |
+
|
| 22 |
+
In extensive experiments we show that replacing the ViT patchify stem with a more standard convolutional stem (i) allows ViT to converge faster (§5.1), (ii) enables, for the first time, the use of either AdamW or SGD without a significant drop in accuracy (§5.2), (iii) brings ViT’s stability w.r.t. learning rate and weight decay closer to that of modern CNNs (§5.3), and (iv) yields improvements in ImageNet [10] top-1 error of $\sim 1 - 2$ percentage points (§6). We consistently observe these improvements across a wide spectrum of model complexities (from 1G flops to 36G flops) and dataset scales (ImageNet-1k to ImageNet-21k).
|
| 23 |
+
|
| 24 |
+
These results show that injecting some convolutional inductive bias into ViTs can be beneficial under commonly studied settings. We did not observe evidence that the hard locality constraint in early layers hampers the representational capacity of the network, as might be feared [9]. In fact we observed the opposite, as ImageNet results improve even with larger-scale models and larger-scale data when using a convolution stem. Moreover, under carefully controlled comparisons, we find that ViTs are only able to surpass state-of-the-art CNNs when equipped with a convolutional stem (§6).
|
| 25 |
+
|
| 26 |
+
We conjecture that restricting convolutions in ViT to early visual processing may be a crucial design choice that strikes a balance between (hard) inductive biases and the representation learning ability of transformer blocks. Evidence comes by comparison to the “hybrid ViT” presented in [13], which uses 40 convolutional layers (most of a ResNet-50) and shows no improvement over the default ViT. This perspective resonates with the findings of [9], who observe that early transformer blocks prefer to learn more local attention patterns than later blocks. Finally we note that exploring the design of hybrid CNN/ViT models is not a goal of this work; rather we demonstrate that simply using a minimal convolutional stem with ViT is sufficient to dramatically change its optimization behavior.
|
| 27 |
+
|
| 28 |
+
In summary, the findings presented in this paper lead us to recommend using a standard, lightweight convolutional stem for ViT models in the analyzed dataset scale and model complexity spectrum as a more robust and higher performing architectural choice compared to the original ViT model design.
|
| 29 |
+
|
| 30 |
+
# 2 Related Work
|
| 31 |
+
|
| 32 |
+
Convolutional neural networks (CNNs). The breakthrough performance of the AlexNet [23] CNN [15, 24] on ImageNet classification [10] transformed the field of recognition, leading to the development of higher performing architectures, e.g., [19, 36, 37, 48], and scalable training methods [16, 21]. These architectures are now core components in object detection (e.g., [34]), instance segmentation (e.g., [18]), and semantic segmentation (e.g., [26]). CNNs are typically trained with stochastic gradient descent (SGD) and are widely considered to be easy to optimize.
|
| 33 |
+
|
| 34 |
+
Self-attention in vision models. Transformers [43] are revolutionizing natural language processing by enabling scalable training. Transformers use multi-headed self-attention, which performs global information processing and is strictly more general than convolution [6]. Wang et al. [46] show that (single-headed) self-attention is a form of non-local means [2] and that integrating it into a ResNet [19] improves several tasks. Ramachandran et al. [32] explore this direction further with stand-alone self-attention networks for vision. They report difficulties in designing an attention-based network stem and present a bespoke solution that avoids convolutions. In contrast, we demonstrate the benefits of a convolutional stem. Zhao et al. [53] explore a broader set of self-attention operations with hard-coded locality constraints, more similar to standard CNNs.
|
| 35 |
+
|
| 36 |
+
Vision transformer (ViT). Dosovitskiy et al. [13] apply a transformer encoder to image classification with minimal vision-specific modifications. As the counterpart of input token embeddings, they partition the input image into, e.g., $1 6 \times 1 6$ pixel, non-overlapping patches and linearly project them to the encoder’s input dimension. They report lackluster results when training on ImageNet-1k, but demonstrate state-of-the-art transfer learning when using large-scale pretraining data. ViTs are sensitive to many details of the training recipe, e.g., they benefit greatly from AdamW [27] compared to SGD and require careful learning rate and weight decay selection. ViTs are generally considered to be difficult to optimize compared to CNNs (e.g., see [13, 41, 42]). Further evidence of challenges comes from Chen et al. [4] who report ViT optimization instability in self-supervised learning (unlike with CNNs), and find that freezing the patchify stem at its random initialization improves stability.
|
| 37 |
+
|
| 38 |
+
ViT improvements. ViTs are gaining rapid interest in part because they may offer a novel direction away from CNNs. Touvron et al. [41] show that with more regularization and stronger data augmentation ViT models achieve competitive accuracy on ImageNet-1k alone (cf . [13]). Subsequently, works concurrent with our own explore numerous other ViT improvements. Dominant themes include multi-scale networks [14, 17, 25, 45, 50], increasing depth [42], and locality priors [5, 9, 17, 47, 49]. In [9], d’Ascoli et al. modify multi-head self-attention with a convolutional bias at initialization and show that this prior improves sample efficiency and ImageNet accuracy. Resonating with our work, [5, 17, 47, 49] present models with convolutional stems, but do not analyze optimizability (our focus).
|
| 39 |
+
|
| 40 |
+
Discussion. Unlike the concurrent work on locality priors in ViT, our focus is studying optimizability under minimal ViT modifications in order to derive crisp conclusions. Our perspective brings several novel observations: by adding only ${ \sim } 5 $ convolutions to the stem, ViT can be optimized well with either AdamW or SGD $_ { c f }$ . all prior works use AdamW to avoid large drops in accuracy [41]), it becomes less sensitive to the specific choice of learning rate and weight decay, and training converges faster. We also observe a consistent improvement in ImageNet top-1 accuracy across a wide spectrum of model complexities (1G flops to 36G flops) and dataset scales (ImageNet-1k to ImageNet-21k). These results suggest that a (hard) convolutional bias early in the network does not compromise representational capacity, as conjectured in [9], and is beneficial within the scope of this study.
|
| 41 |
+
|
| 42 |
+
# 3 Vision Transformer Architectures
|
| 43 |
+
|
| 44 |
+
Next, we review vision transformers [13] and describe the convolutional stems used in our work.
|
| 45 |
+
|
| 46 |
+
The vision transformer (ViT). ViT first partitions an input image into non-overlapping $p { \times } p$ patches and linearly projects each patch to a $d$ -dimensional feature vector using a learned weight matrix. A patch size of $p = 1 6$ and an image size of $2 2 4 \times 2 2 4$ are typical. The resulting patch embeddings (plus positional embeddings and a learned classification token embedding) are processed by a standard transformer encoder [43, 44] followed by a classification head. Using common network nomenclature, we refer to the portion of ViT before the transformer blocks as the network’s stem. ViT’s stem is a
|
| 47 |
+
|
| 48 |
+
<table><tr><td>model</td><td>ref model</td><td>|hidden MLP size</td><td>mult</td><td>num heads</td><td>num blocks</td><td>flops (B)</td><td>params (M)</td><td>acts (M)</td><td>time (min)</td></tr><tr><td>ViTp-1GF</td><td>~ViT-T</td><td>192</td><td>3</td><td>3</td><td>12</td><td>1.1</td><td>4.8</td><td>5.5</td><td>2.6</td></tr><tr><td>ViTp-4GF</td><td>~ViT-S</td><td>384</td><td>3</td><td>6</td><td>12</td><td>3.9</td><td>18.5</td><td>11.1</td><td>3.8</td></tr><tr><td>ViTp-18GF</td><td>=ViT-B</td><td>768</td><td>4</td><td>12</td><td>12</td><td>17.5</td><td>86.7</td><td>24.0</td><td>11.5</td></tr><tr><td>ViTp-36GF</td><td>ViT-L</td><td>1024</td><td>4</td><td>16</td><td>14</td><td>35.9</td><td>178.4</td><td>37.3</td><td>18.8</td></tr></table>
|
| 49 |
+
|
| 50 |
+
<table><tr><td>model</td><td>hidden size</td><td>MLP mult</td><td>num heads blocks</td><td>num</td><td>flops (B)</td><td>params (M)</td><td>acts (M)</td><td>time (min)</td></tr><tr><td>ViTc-1GF</td><td>192</td><td>3</td><td>3</td><td>11</td><td>1.1</td><td>4.6</td><td>5.7</td><td>2.7</td></tr><tr><td>ViTc-4GF</td><td>384</td><td>3</td><td>6</td><td>11</td><td>4.0</td><td>17.8</td><td>11.3</td><td>3.9</td></tr><tr><td>ViTc-18GF</td><td>768</td><td>4</td><td>12</td><td>11</td><td>17.7</td><td>81.6</td><td>24.1</td><td>11.4</td></tr><tr><td>ViTc-36GF</td><td>1024</td><td>4</td><td>16</td><td>13</td><td>35.0</td><td>167.8</td><td>36.7</td><td>18.6</td></tr></table>
|
| 51 |
+
|
| 52 |
+
Table 1: Model definitions: Left: Our $\mathrm { V i T } _ { P }$ models at various complexities, which use the original patchify stem and closely resemble the original ViT models [13]. To facilitate comparisons with CNNs, we modify the original ViT-Tiny, -Small, -Base, -Large models to obtain models at 1GF, 4GF, 18GF, and 36GF, respectively. The modifications are indicated in blue and include reducing the MLP multiplier from $4 \times$ to $3 \times$ for the 1GF and 4GF models, and reducing the number of transformer blocks from 24 to 14 for the 36GF model. Right: Our $\mathrm { V i T } _ { C }$ models at various complexities that use the convolutional stem. The only additional modification relative to the corresponding $\mathrm { V i T } _ { P }$ models is the removal of 1 transformer block to compensate for the increased flops of the convolutional stem. We show complexity measures for all models (flops, parameters, activations, and epoch training time on ImageNet-1k); the corresponding $\mathrm { V i T } _ { P }$ and $\mathrm { V i T } _ { C }$ models match closely on all metrics.
|
| 53 |
+
|
| 54 |
+
specific case of convolution (stride- $p$ , $p { \times } p$ kernel), but we will refer to it as the patchify stem and reserve the terminology of convolutional stem for stems with a more conventional CNN design with multiple layers of overlapping convolutions (i.e., with stride smaller than the kernel size).
|
| 55 |
+
|
| 56 |
+
$\mathbf { V i T } _ { P }$ models. Prior work proposes ViT models of various sizes, such as ViT-Tiny, ViT-Small, ViT-Base, etc. [13, 41]. To facilitate comparisons with CNNs, which are typically standardized to 1 gigaflop (GF), 2GF, 4GF, 8GF, etc., we modify the original ViT models to obtain models at about these complexities. Details are given in Table 1 (left). For easier comparison with CNNs of similar flops, and to avoid subjective size names, we refer the models by their flops, e.g., $\mathrm { V i T } _ { P }$ -4GF in place of ViT-Small. We use the $P$ subscript to indicate that these models use the original patchify stem.
|
| 57 |
+
|
| 58 |
+
Convolutional stem design. We adopt a typical minimalist convolutional stem design by stacking $3 { \times } 3$ convolutions [36], followed by a single $1 \times 1$ convolution at the end to match the $d$ -dimensional input of the transformer encoder. These stems quickly downsample a $2 2 4 \times 2 2 4$ input image using overlapping strided convolutions to $1 4 \times 1 4$ , matching the number of inputs created by the standard patchify stem. We follow a simple design pattern: all $3 { \times } 3$ convolutions either have stride 2 and double the number of output channels or stride 1 and keep the number of output channels constant. We enforce that the stem accounts for approximately the computation of one transformer block of the corresponding model so that we can easily control for flops by removing one transformer block when using the convolutional stem instead of the patchify stem. Our stem design was chosen to be purposefully simple and we emphasize that it was not designed to maximize model accuracy.
|
| 59 |
+
|
| 60 |
+
$\mathbf { V i T } _ { C }$ models. To form a ViT model with a convolutional stem, we simply replace the patchify stem with its counterpart convolutional stem and remove one transformer block to compensate for the convolutional stem’s extra flops (see Figure 1). We refer to the modified ViT with a convolutional stem as $\mathrm { V i T } _ { C }$ . Configurations for $\mathrm { V i T } _ { C }$ at various complexities are given in Table 1 (right); corresponding $\mathrm { V i T } _ { P }$ and $\mathrm { V i T } _ { C }$ models match closely on all complexity metrics including flops and runtime.
|
| 61 |
+
|
| 62 |
+
Convolutional stem details. Our convolutional stem designs use four, four, and six $3 { \times } 3$ convolutions for the 1GF, 4GF, and 18GF models, respectively. The output channels are [24, 48, 96, 192], [48, 96, 192, 384], and [64, 128, 128, 256, 256, 512], respectively. All $3 { \times } 3$ convolutions are followed by batch norm (BN) [21] and then ReLU [29], while the final $1 \times 1$ convolution is not, to be consistent with the original patchify stem. Eventually, matching stem flops to transformer block flops results in an unreasonably large stem, thus $\mathrm { V i T } _ { C }$ -36GF uses the same stem as $\mathrm { V i T } _ { C }$ -18GF.
|
| 63 |
+
|
| 64 |
+
Convolutions in ViT. Dosovitskiy et al. [13] also introduced a “hybrid ViT” architecture that blends a modified ResNet [19] (BiT-ResNet [22]) with a transformer encoder. In their hybrid model, the patchify stem is replaced by a partial BiT-ResNet-50 that terminates at the output of the conv4 stage or the output of an extended conv3 stage. These image embeddings replace the standard patchify stem embeddings. This partial BiT-ResNet-50 stem is deep, with 40 convolutional layers. In this work, we explore lightweight convolutional stems that consist of only 5 to 7 convolutions in total, instead of the 40 used by the hybrid ViT. Moreover, we emphasize that the goal of our work is not to explore the hybrid ViT design space, but rather to study the optimizability effects of simply replacing the patchify stem with a minimal convolutional stem that follows standard CNN design practices.
|
| 65 |
+
|
| 66 |
+
# 4 Measuring Optimizability
|
| 67 |
+
|
| 68 |
+
It has been noted in the literature that ViT models are challenging to optimize, e.g., they may achieve only modest performance when trained on a mid-size dataset (ImageNet-1k) [13], are sensitive to data augmentation [41] and optimizer choice [41], and may perform poorly when made deeper [42]. We empirically observed the general presence of such difficulties through the course of our experiments and informally refer to such optimization characteristics collectively as optimizability.
|
| 69 |
+
|
| 70 |
+
Models with poor optimizability can yield very different results when hyperparameters are varied, which can lead to seemingly bizarre observations, e.g., removing erasing data augmentation [54] causes a catastrophic drop in ImageNet accuracy in [41]. Quantitative metrics to measure optimizability are needed to allow for more robust comparisons. In this section, we establish the foundations of such comparisons; we extensively test various models using these optimizability measures in $\ S 5$ .
|
| 71 |
+
|
| 72 |
+
Training length stability. Prior works train ViT models for lengthy schedules, e.g., 300 to 400 epochs on ImageNet is typical (at the extreme, [17] trains models for 1000 epochs), since results at a formerly common 100-epoch schedule are substantially worse ( $2 \%$ lower top-1 accuracy, see $\begin{array} { r l } { \ S } & { { } \} } \end{array}$ . In the context of ImageNet, we define top-1 accuracy at 400 epochs as an approximate asymptotic result, i.e., training for longer will not meaningfully improve top-1 accuracy, and we compare it to the accuracy of models trained for only 50, 100, or 200 epochs. We define training length stability as the gap to asymptotic accuracy. Intuitively, it’s a measure of convergence speed. Models that converge faster offer obvious practical benefits, especially when training many model variants.
|
| 73 |
+
|
| 74 |
+
Optimizer stability. Prior works use AdamW [27] to optimize ViT models from random initialization. Results of SGD are not typically presented and we are only aware of Touvron et al. [41]’s report of a dramatic $\sim 7 \%$ drop in ImageNet top-1 accuracy. In contrast, widely used CNNs, such as ResNets, can be optimized equally well with either SGD or AdamW (see $\ S 5 . 2 )$ and SGD (always with momentum) is typically used in practice. SGD has the practical benefit of having fewer hyperparameters (e.g., tuning AdamW’s $\beta _ { 2 }$ can be important [3]) and requiring $50 \%$ less optimizer state memory, which can ease scaling. We define optimizer stability as the accuracy gap between AdamW and SGD. Like training length stability, we use optimizer stability as a proxy for the ease of optimization of a model.
|
| 75 |
+
|
| 76 |
+
Hyperparameter $( l r , w d )$ stability. Learning rate $( l r )$ and weight decay (wd) are among the most important hyperparameters governing optimization with SGD and AdamW. New models and datasets often require a search for their optimal values as the choice can dramatically affect results. It is desirable to have a model and optimizer that yield good results for a wide range of learning rate and weight decay values. We will explore this hyperparameter stability by comparing the error distribution functions (EDFs) [30] of models trained with various choices of $l r$ and $w d$ . In this setting, to create an EDF for a model we randomly sample values of $l r$ and wd and train the model accordingly. Distributional estimates, like those provided by EDFs, give a more complete view of the characteristics of models that point estimates cannot reveal [30, 31]. We will review EDFs in $\ S$ .
|
| 77 |
+
|
| 78 |
+
Peak performance. The maximum possible performance of each model is the most commonly used metric in previous literature and it is often provided without carefully controlling training details such as data augmentations, regularization methods, number of epochs, and $l r$ , wd tuning. To make more robust comparisons, we define peak performance as the result of a model at 400 epochs using its best-performing optimizer and parsimoniously tuned $l r$ and $w d$ values (details in $\ S 6$ ), while fixing justifiably good values for all other variables that have a known impact on training. Peak performance results for ViTs and CNNs under these carefully controlled training settings are presented in $\ S 6$ .
|
| 79 |
+
|
| 80 |
+
# 5 Stability Experiments
|
| 81 |
+
|
| 82 |
+
In this section we test the stability of ViT models with the original patchify $( P )$ stem vs. the convolutional $( C )$ stem defined in $\ S$ . For reference, we also train RegNetY [12, 31], a state-of-the-art CNN that is easy to optimize and serves as a reference point for good stability.
|
| 83 |
+
|
| 84 |
+
We conduct experiments using ImageNet-1k [10]’s standard training and validation sets, and report top-1 error. Following [12], for all results, we carefully control training settings and we use a minimal set of data augmentations that still yields strong results, for details see $\ S$ . In this section, unless noted, for each model we use the optimal $l r$ and $w d$ found under a 50 epoch schedule (see Appendix).
|
| 85 |
+
|
| 86 |
+

|
| 87 |
+
Figure 2: Training length stability: We train 9 models for 50 to 400 epochs on ImageNet-1k and plot the ∆top-1 error to the 400 epoch result for each. $\mathrm { V i T } _ { C }$ demonstrates faster convergence than $\mathrm { V i T } _ { P }$ across the model complexity spectrum, and helps close the gap to CNNs (represented by RegNetY).
|
| 88 |
+
|
| 89 |
+

|
| 90 |
+
Figure 3: Optimizer stability: We train each model for 50 to 400 epochs with AdamW (upward triangle $\blacktriangle$ ) and SGD (downward triangle $\blacktriangledown$ ). For the baseline $\mathrm { V i T } _ { P }$ , SGD yields significantly worse results than AdamW. In contrast, $\mathrm { V i T } _ { C }$ and $\mathrm { R e g N e t Y }$ models exhibit a much smaller gap between SGD and AdamW across all settings. Note that for long schedules, $\mathrm { V i T } _ { P }$ often fails to converge with SGD (i.e., loss goes to NaN), in such cases we copy the best results from a shorter schedule of the same model (and show the results via a dashed line).
|
| 91 |
+
|
| 92 |
+
# 5.1 Training Length Stability
|
| 93 |
+
|
| 94 |
+
We first explore how rapidly networks converge to their asymptotic error on ImageNet-1k, i.e., the highest possible accuracy achievable by training for many epochs. We approximate asymptotic error as a model’s error using a 400 epoch schedule based on observing diminishing returns from 200 to 400. We consider a grid of 24 experiments for ViT: $\{ P , C \}$ stems $\times \ \{ 1 , 4 , 1 8 \}$ GF model sizes $\times$ {50, 100, 200, 400} epochs. For reference we also train RegNetY at $\{ 1 , 4 , 1 6 \}$ GF. We use the best optimizer choice for each model (AdamW for ViT models and SGD for RegNetY models).
|
| 95 |
+
|
| 96 |
+
Results. Figure 2 shows the absolute error deltas (∆top-1) between 50, 100, and 200 epoch schedules and asymptotic performance (at 400 epochs). $\mathrm { V i T } _ { C }$ demonstrates faster convergence than $\mathrm { V i T } _ { P }$ across the model complexity spectrum, and closes much of the gap to the rate of CNN convergence. The improvement is most significant in the shortest training schedule (50 epoch), e.g., $\mathrm { V i T } _ { P }$ -1GF has a $10 \%$ error delta, while $\mathrm { V i T } _ { C }$ -1GF reduces this to about $6 \%$ . This opens the door to applications that execute a large number of short-scheduled experiments, such as neural architecture search.
|
| 97 |
+
|
| 98 |
+
# 5.2 Optimizer Stability
|
| 99 |
+
|
| 100 |
+
We next explore how well AdamW and SGD optimize ViT models with the two stem types. We consider the following grid of $4 8 \ \mathrm { V i T }$ experiments: $\{ P , C \}$ stems × {1, 4, 18} GF sizes $\times$ {50, 100, 200, 400} epochs $\times$ {AdamW, SGD} optimizers. As a reference, we also train 24 RegNetY baselines, one for each complexity regime, epoch length, and optimizer.
|
| 101 |
+
|
| 102 |
+
Results. Figure 3 shows the results. As a baseline, RegNetY models show virtually no gap when trained using either SGD or AdamW (the difference ${ \sim } 0 . 1 { - } 0 . 2 \%$ is within noise). On the other hand, $V i T _ { P }$ models suffer a dramatic drop when trained with SGD across all settings (of up to $10 \%$ for larger models and longer training schedules). With a convolutional stem, $\mathrm { V i T } _ { C }$ models exhibit much smaller error gaps between SGD and AdamW across all training schedules and model complexities, including in larger models and longer schedules, where the gap is reduced to less than $0 . 2 \%$ . In other words, both RegNetY and $\mathrm { V i T } _ { C }$ can be easily trained via either SGD or AdamW, but $\mathrm { V i T } _ { P }$ cannot.
|
| 103 |
+
|
| 104 |
+

|
| 105 |
+
Figure 4: Hyperparameter stability for AdamW $_ { l r }$ and ${ \pmb w d }$ ): For each model, we train 64 instances of the model for 50 epochs each with a random1.0 $l r$ and $w d$ (in a fixed width interval around the optimal value for each model). Top: Scatterplots of the $l r$ , $w d$ , and $l r$ ·wd for three 4GF models. Vertical bars indicate optimal $l r , w d$ , and $l r \cdot w d$ values for each model. Bottom: For each model, we generate an EDF of the errors by plotting the cumulative distribution of the 0.6 $\Delta$ top-1 errors ( $\Delta$ to the optimal error for each model). A steeper EDF indicates better stability to 0.4 1GF models 4G $l r$ and odels $w d$ variation. $\mathrm { V i T } _ { C }$ significantly18GF models improves the stability over the baseline0.2 ViTC $\mathrm { V i T } _ { P }$ across the model complexity spectrum, and matches orViTC ViTC even outperforms the stability of the CNN model (RegNetY).0.0 RegNetY R
|
| 106 |
+
|
| 107 |
+

|
| 108 |
+
Figure 5: Hyperparameter stability for SGD $_ { L r }$ and ${ \pmb w d }$ ): We repeat the setup from Figure 4 using SGD instead of AdamW. The stability improvement of $\mathrm { V i T } _ { C }$ over the baseline $\mathrm { V i T } _ { P }$ is even larger than with AdamW. $E . g$ ., ${ \sim } 6 0 \%$ of $\mathrm { V i T } _ { C }$ -18GF models are within $4 \%$ $\Delta$ top-1 error of the best result, while less than $20 \%$ of $\mathrm { V i T } _ { P }$ -18GF models are (in fact most $\mathrm { V i T } _ { P }$ -18GF runs don’t converge).
|
| 109 |
+
|
| 110 |
+
# 5.3 Learning Rate and Weight Decay Stability
|
| 111 |
+
|
| 112 |
+
Next, we characterize how sensitive different model families are to changes in learning rate $( l r )$ and weight decay $( w d )$ under both AdamW and SGD optimizers. To quantify this, we make use of error distribution functions (EDFs) [30]. An EDF is computed by sorting a set of results from low-to-high error and plotting the cumulative proportion of results as error increases, see [30] for details. In particular, we generate EDFs of a model as a function of $l r$ and $w d$ . The intuition is that if a model is robust to these hyperparameter choices, the EDF will be steep (all models will perform similarly), while if the model is sensitive, the EDF will be shallow (performance will be spread out).
|
| 113 |
+
|
| 114 |
+
We test 6 ViT models $( \{ P , C \} \times \{ 1 , 4 , 1 8 \} \mathrm { G F ) }$ and 3 RegNetY models ({1, 4, 16} GF). For each model and each optimizer, we compute an EDF by randomly sampling 64 $( l r , w d )$ pairs with learning rate and weight decay sampled in a fixed width interval around their optimal values for that model and optimizer (see the Appendix for sampling details). Rather than plotting absolute error in the EDF, we plot $\Delta$ top-1 error between the best result (obtained with the optimal $l r$ and $w d$ ) and the observed result. Due to the large number of models, we train each for only 50 epochs.
|
| 115 |
+
|
| 116 |
+
Results. Figure 4 shows scatterplots and EDFs for models trained by AdamW. Figure 5 shows SGD results. In all cases we see that $\mathrm { V i T } _ { C }$ significantly improves the $l r$ and $w d$ stability over $\mathrm { V i T } _ { P }$ for both optimizers. This indicates that the $l r$ and $w d$ are easier to optimize for $\mathrm { V i T } _ { C }$ than for $\mathrm { V i T } _ { P }$ .
|
| 117 |
+
|
| 118 |
+
# 5.4 Experimental Details
|
| 119 |
+
|
| 120 |
+
In all experiments we train with a single half-period cosine learning rate decay schedule with a 5-epoch linear learning rate warm-up [16]. We use a minibatch size of 2048. Crucially, weight decay is not applied to the gain factors found in normalization layers nor to bias parameters anywhere in the model; we found that decaying these parameters can dramatically reduce top-1 accuracy for small models and short schedules. For inference, we use an exponential moving average (EMA) of the model weights (e.g., [8]). The $l r$ and $w d$ used in this section are reported in the Appendix. Other hyperparameters use defaults: SGD momentum is 0.9 and AdamW’s $\beta _ { 1 } = 0 . 9$ and $\beta _ { 2 } = 0 . 9 9 9$ .
|
| 121 |
+
|
| 122 |
+
Regularization and data augmentation. We use a simplified training recipe compared to recent work such as DeiT [41], which we found to be equally effective across a wide spectrum of model complexities and dataset scales. We use AutoAugment [7], mixup [52] $\langle \alpha = 0 . 8 \rangle$ ), CutMix [51] $\alpha = 1 . 0$ ), and label smoothing [38] $\epsilon = 0 . 1$ ). We prefer this setup because it is similar to common settings for CNNs (e.g., [12]) except for stronger mixup and the addition of CutMix (ViTs benefit from both, while CNNs are not harmed). We compare this recipe to the one used for DeiT models in the Appendix, and observe that our setup provides substantially faster training convergence likely because we remove repeating augmentation [1, 20], which is known to slow training [1].
|
| 123 |
+
|
| 124 |
+
# 6 Peak Performance
|
| 125 |
+
|
| 126 |
+
A model’s peak performance is the most commonly used metric in network design. It represents what is possible with the best-known-so-far settings and naturally evolves over time. Making fair comparisons between different models is desirable but fraught with difficulty. Simply citing results from prior work may be negatively biased against that work as it was unable to incorporate newer, yet applicable improvements. Here, we strive to provide a fairer comparison between state-of-the-art CNNs, $\mathrm { V i T } _ { P }$ , and $\mathrm { V i T } _ { C }$ . We identify a set of factors and then strike a pragmatic balance between which subset to optimize for each model vs. which subset share a constant value across all models.
|
| 127 |
+
|
| 128 |
+
In our comparison, all models share the same epochs (400), use of model weight EMA, and set of regularization and augmentation methods (as specified in $\ S \quad ,$ . All CNNs are trained with SGD with $l r$ of 2.54 and wd of $2 . 4 \mathrm { e } { - 5 }$ ; we found this single choice worked well across all models, as similarly observed in [12]. For all ViT models we found AdamW with a $l r / w d$ of $1 . 0 \mathrm { { e - } 3 / 0 . 2 4 }$ was effective, except for the 36GF models. For these larger models we tested a few settings and found a $l r / w d$ of $6 . 0 \mathrm { { e } - 4 / 0 . 2 8 }$ to be more effective for both $\mathrm { V i T } _ { P ^ { - 3 6 } } \mathrm { G F }$ and $\mathrm { V i T } _ { C }$ -36GF models. For training and inference, ViTs use $2 2 4 \times 2 2 4$ resolution (we do not fine-tune at higher resolutions), while the CNNs use (often larger) optimized resolutions specified in [12, 39]. Given this protocol, we compare $\mathrm { V i T } _ { P }$ , $\mathrm { V i T } _ { C }$ , and CNNs across a spectrum of model complexities (1GF to 36GF) and dataset scales (directly training on ImageNet-1k vs. pretraining on ImageNet-21k and then fine-tuning on ImageNet-1k).
|
| 129 |
+
|
| 130 |
+
Results. Figure 6 shows a progression of results. Each plot shows ImageNet-1k val top-1 error vs. ImageNet-1k epoch training time.1 The left plot compares several state-of-the-art CNNs. RegNetY and RegNetZ [12] achieve similar results across the training speed spectrum and outperform EfficientNets [39]. Surprisingly, ResNets [19] are highly competitive at fast runtimes, showing that under a fairer comparison these years-old models perform substantially better than often reported (cf . [39]).
|
| 131 |
+
|
| 132 |
+
The middle plot compares two representative CNNs (ResNet and RegNetY) to ViTs, still using only ImageNet-1k training. The baseline $\mathrm { V i T } _ { P }$ underperforms RegNetY across the entire model complexity spectrum. To our surprise, $V i T _ { P }$ also underperforms ResNets in this regime. $\mathrm { V i T } _ { C }$ is more competitive and outperforms CNNs in the middle-complexity range.
|
| 133 |
+
|
| 134 |
+
The right plot compares the same models but with ImageNet-21k pretraining (details in Appendix). In this setting ViT models demonstrates a greater capacity to benefit from the larger-scale data: now $\mathrm { V i T } _ { C }$ strictly outperforms both $\mathrm { V i T } _ { P }$ and RegNetY. Interestingly, the original $V i T _ { P }$ does not outperform a state-of-the-art CNN even when trained on this much larger dataset. Numerical results are presented in Table 2 for reference to exact values. This table also highlights that flop counts are not significantly correlated with runtime, but that activations are (see Appendix for more details), as also observed by [12]. $E . g .$ ., EfficientNets are slow relative to their flops while ViTs are fast.
|
| 135 |
+
|
| 136 |
+

|
| 137 |
+
Figure 6: Peak performance (epoch training time vs. ImageNet-1k val top-1 error): Results of a fair, controlled comparison of $\mathrm { V i T } _ { P }$ , $\mathrm { V i T } _ { C }$ , and CNNs. Each curve corresponds to a model complexity sweep resulting in a training speed spectrum (minutes per ImageNet-1k epoch). Left: State-of-the-art CNNs. Equipped with a modern training recipe, ResNets are highly competitive in the faster regime, while RegNetY and Z perform similarly, and better than EfficientNets. Middle: Selected CNNs compared to ViTs. With access to only ImageNet-1k training data, RegNetY and ResNet outperform $\mathrm { V i T } _ { P }$ across the board. $\mathrm { V i T } _ { C }$ is more competitive with CNNs. Right: Pretraining on ImageNet-21k improves the ViT models more than the CNNs, making $\mathrm { V i T } _ { P }$ competitive. Here, the proposed $\mathrm { V i T } _ { C }$ outperforms all other models across the full training speed spectrum.
|
| 138 |
+
Table 2: Peak performance (grouped by model family): Model complexity and validation top-1 error at 100, 200, and 400 epoch schedules on ImageNet-1k, and the top-1 error after pretraining on ImageNet-21k (IN 21k) and fine-tuning on ImageNet-1k. This table serves as reference for the results shown in Figure 6. Blue numbers: best model trainable under 20 minutes per ImageNet-1k epoch. Batch sizes and training times are reported normalized to 8 32GB Volta GPUs (see Appendix). Additional results on the ImageNet-V2 [33] test set are presented in the Appendix.
|
| 139 |
+
|
| 140 |
+
<table><tr><td rowspan="2">model</td><td colspan="2">flops params acts</td><td colspan="2"></td><td rowspan="2">time batch|</td><td colspan="2">epochs</td><td rowspan="2"></td><td rowspan="2">IN 21k</td><td rowspan="2">model (B)</td><td colspan="3">flops params</td><td rowspan="2">time batch|</td><td rowspan="2">size</td><td colspan="2">epochs</td><td rowspan="2">IN</td><td rowspan="2">200400 21k</td></tr><tr><td>(B)</td><td>(M)</td><td>(M) (min)</td><td>size</td><td>100</td><td>200400</td><td></td><td>(M)</td><td>(min)</td><td>100</td></tr><tr><td>ResNet-50</td><td>4.1</td><td>25.6</td><td>11.3</td><td>3.4</td><td>2048</td><td>22.5</td><td>21.2</td><td>20.7</td><td>21.6</td><td>EffNet-B2</td><td>1.0</td><td>9.1</td><td>(M) 13.8</td><td>5.9</td><td>2048</td><td></td><td>21.4 20.5</td><td>19.9</td><td>-</td></tr><tr><td>ResNet-101</td><td>7.8</td><td>44.5</td><td>16.4</td><td>5.5</td><td>2048</td><td>20.3</td><td>19.1</td><td>18.5</td><td>19.2</td><td>EffNet-B4</td><td>4.4</td><td>19.3</td><td>49.5</td><td>19.4</td><td>512</td><td>18.5</td><td>17.8</td><td>17.5</td><td></td></tr><tr><td>ResNet-152</td><td>11.5</td><td>60.2</td><td>22.8</td><td>7.7</td><td>2048</td><td>19.5</td><td>18.417.7</td><td></td><td>18.2</td><td>EffNet-B5</td><td>10.3</td><td>30.4</td><td>98.9 41.7</td><td></td><td>256</td><td>17.3</td><td>317.0</td><td>17.0</td><td></td></tr><tr><td>ResNet-200</td><td>15.0</td><td>64.7</td><td>32.3</td><td>10.7</td><td>1024</td><td>19.5</td><td>18.3</td><td>17.6</td><td>17.7</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>RegNetY-1GF</td><td>1.0</td><td>9.6</td><td>6.2</td><td>3.1</td><td>2048</td><td>23.2</td><td>22.2</td><td>21.5</td><td>-</td><td>ViTp-1GF</td><td>1.1</td><td>4.8</td><td>5.5</td><td>2.6</td><td>2048</td><td>33.2</td><td>29.7</td><td>27.7</td><td></td></tr><tr><td>RegNetY-4GF</td><td>4.1</td><td>22.4</td><td>14.5</td><td>7.6</td><td>2048</td><td>19.4</td><td>18.3</td><td>17.9</td><td>18.4</td><td>ViTp-4GF</td><td>3.9</td><td>18.51</td><td>11.1</td><td></td><td>3.82048</td><td></td><td>23.3 20.8</td><td>19.6</td><td>20.6</td></tr><tr><td>RegNetY-16GF</td><td>15.5</td><td>72.3</td><td>30.7</td><td>17.9</td><td>1024</td><td>17.1</td><td>16.4</td><td>16.3</td><td>15.6</td><td>ViTp-18GF</td><td>17.5</td><td>86.6</td><td>24.0</td><td>11.5</td><td>1024</td><td></td><td>19.918.4</td><td>17.9</td><td>16.4</td></tr><tr><td>RegNetY-32GF</td><td>31.1</td><td>128.6</td><td>46.2</td><td>35.1</td><td>512</td><td>16.2</td><td>15.9</td><td>15.9</td><td>15.0</td><td>ViTp-36GF</td><td>35.9</td><td>178.4</td><td>37.3</td><td>18.8</td><td>512</td><td>19.9</td><td>18.8</td><td>18.2</td><td>15.1</td></tr><tr><td>RegNetZ-1GF</td><td>1.0</td><td>11.0</td><td>8.8</td><td>4.2</td><td>2048</td><td></td><td>20.8 20.2</td><td>19.6</td><td>-</td><td>ViTc-1GF</td><td>1.1</td><td>4.6</td><td>5.7</td><td>2.7</td><td>2048</td><td></td><td>28.626.1</td><td>24.7</td><td>-</td></tr><tr><td>RegNetZ-4GF</td><td>4.0</td><td>28.1</td><td>24.3</td><td>12.9</td><td>1024</td><td></td><td>17.4 16.9</td><td>16.6</td><td></td><td>ViTc-4GF</td><td>4.0</td><td>17.8</td><td>11.3</td><td>3.9</td><td>)2048</td><td></td><td>20.919.2</td><td>18.6</td><td>18.8</td></tr><tr><td>RegNetZ-16GF</td><td>16.0</td><td>95.3</td><td>51.3</td><td>32.0</td><td>512</td><td></td><td>16.0 15.9</td><td>15.9</td><td></td><td>ViTc-18GF</td><td>17.7</td><td>81.624.1</td><td></td><td>11.4</td><td>1024</td><td></td><td>18.4 17.5</td><td>17.0</td><td>15.1</td></tr><tr><td>RegNetZ-32GF</td><td>32.0</td><td>175.1</td><td></td><td>79.6 55.3</td><td>256</td><td></td><td>16.3 16.2</td><td>16.1</td><td></td><td>ViTc-36GF</td><td>35.0</td><td>167.8 36.7</td><td></td><td>18.6</td><td>512</td><td></td><td>18.3 17.6</td><td>16.8</td><td>14.2</td></tr></table>
|
| 141 |
+
|
| 142 |
+
These results verify that $\mathrm { V i T } _ { C }$ ’s convolutional stem improves not only optimization stability, as seen in the previous section, but also peak performance. Moreover, this benefit can be seen across the model complexity and dataset scale spectrum. Perhaps surprisingly, given the recent excitement over ViT, we find that $\mathrm { V i T } _ { P }$ struggles to compete with state-of-the-art CNNs. We only observe improvements over CNNs when using both large-scale pretraining data and the proposed convolutional stem.
|
| 143 |
+
|
| 144 |
+
# 7 Conclusion
|
| 145 |
+
|
| 146 |
+
In this work we demonstrated that the optimization challenges of ViT models are linked to the largestride, large-kernel convolution in ViT’s patchify stem. The seemingly trivial change of replacing this patchify stem with a simple convolutional stem leads to a remarkable change in optimization behavior. With the convolutional stem, ViT (termed $\mathrm { V i T } _ { C }$ ) converges faster than the original ViT (termed $\mathrm { V i T } _ { P }$ ) (§5.1), trains well with either AdamW or SGD (§5.2), improves learning rate and weight decay stability (§5.3), and improves ImageNet top-1 error by ${ \sim } 1 { - } 2 \%$ (§6). These results are consistent across a wide spectrum of model complexities (1GF to 36GF) and dataset scales (ImageNet-1k to ImageNet-21k). Our results indicate that injecting a small dose of convolutional inductive bias into the early stages of ViTs can be hugely beneficial. Looking forward, we are interested in the theoretical foundation of why such a minimal architectural modification can have such large (positive) impact on optimizability. We are also interested in studying larger models. Our preliminary explorations into 72GF models reveal that the convolutional stem still improves top-1 error, however we also find that a new form of instability arises that causes training error to randomly spike, especially for $\mathrm { V i T } _ { C }$ .
|
| 147 |
+
|
| 148 |
+
Acknowledgements. We thank Hervé Jegou, Hugo Touvron, and Kaiming He for valuable feedback.
|
parse/train/Lpfh1Bpqfk/Lpfh1Bpqfk_content_list.json
ADDED
|
@@ -0,0 +1,841 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"type": "text",
|
| 4 |
+
"text": "Early Convolutions Help Transformers See Better ",
|
| 5 |
+
"text_level": 1,
|
| 6 |
+
"bbox": [
|
| 7 |
+
197,
|
| 8 |
+
122,
|
| 9 |
+
802,
|
| 10 |
+
147
|
| 11 |
+
],
|
| 12 |
+
"page_idx": 0
|
| 13 |
+
},
|
| 14 |
+
{
|
| 15 |
+
"type": "text",
|
| 16 |
+
"text": "Tete Xiao1,2 Mannat Singh1 Eric Mintun1 Trevor Darrell2 Piotr Dollár1∗ Ross Girshick1∗ ",
|
| 17 |
+
"bbox": [
|
| 18 |
+
184,
|
| 19 |
+
199,
|
| 20 |
+
816,
|
| 21 |
+
215
|
| 22 |
+
],
|
| 23 |
+
"page_idx": 0
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
"type": "text",
|
| 27 |
+
"text": "1Facebook AI Research (FAIR) 2UC Berkeley ",
|
| 28 |
+
"bbox": [
|
| 29 |
+
326,
|
| 30 |
+
228,
|
| 31 |
+
676,
|
| 32 |
+
243
|
| 33 |
+
],
|
| 34 |
+
"page_idx": 0
|
| 35 |
+
},
|
| 36 |
+
{
|
| 37 |
+
"type": "text",
|
| 38 |
+
"text": "Abstract ",
|
| 39 |
+
"text_level": 1,
|
| 40 |
+
"bbox": [
|
| 41 |
+
462,
|
| 42 |
+
279,
|
| 43 |
+
535,
|
| 44 |
+
295
|
| 45 |
+
],
|
| 46 |
+
"page_idx": 0
|
| 47 |
+
},
|
| 48 |
+
{
|
| 49 |
+
"type": "text",
|
| 50 |
+
"text": "Vision transformer (ViT) models exhibit substandard optimizability. In particular, they are sensitive to the choice of optimizer (AdamW vs. SGD), optimizer hyperparameters, and training schedule length. In comparison, modern convolutional neural networks are easier to optimize. Why is this the case? In this work, we conjecture that the issue lies with the patchify stem of ViT models, which is implemented by a stride- $p p { \\times } p$ convolution $\\dot { p } = 1 6$ by default) applied to the input image. This large-kernel plus large-stride convolution runs counter to typical design choices of convolutional layers in neural networks. To test whether this atypical design choice causes an issue, we analyze the optimization behavior of ViT models with their original patchify stem versus a simple counterpart where we replace the ViT stem by a small number of stacked stride-two $3 { \\times } 3$ convolutions. While the vast majority of computation in the two ViT designs is identical, we find that this small change in early visual processing results in markedly different training behavior in terms of the sensitivity to optimization settings as well as the final model accuracy. Using a convolutional stem in ViT dramatically increases optimization stability and also improves peak performance (by ${ \\sim } 1 { - } 2 \\%$ top-1 accuracy on ImageNet-1k), while maintaining flops and runtime. The improvement can be observed across the wide spectrum of model complexities (from 1G to 36G flops) and dataset scales (from ImageNet-1k to ImageNet-21k). These findings lead us to recommend using a standard, lightweight convolutional stem for ViT models in this regime as a more robust architectural choice compared to the original ViT model design. ",
|
| 51 |
+
"bbox": [
|
| 52 |
+
233,
|
| 53 |
+
314,
|
| 54 |
+
766,
|
| 55 |
+
603
|
| 56 |
+
],
|
| 57 |
+
"page_idx": 0
|
| 58 |
+
},
|
| 59 |
+
{
|
| 60 |
+
"type": "text",
|
| 61 |
+
"text": "1 Introduction ",
|
| 62 |
+
"text_level": 1,
|
| 63 |
+
"bbox": [
|
| 64 |
+
174,
|
| 65 |
+
635,
|
| 66 |
+
310,
|
| 67 |
+
652
|
| 68 |
+
],
|
| 69 |
+
"page_idx": 0
|
| 70 |
+
},
|
| 71 |
+
{
|
| 72 |
+
"type": "text",
|
| 73 |
+
"text": "Vision transformer (ViT) models [13] offer an alternative design paradigm to convolutional neural networks (CNNs) [24]. ViTs replace the inductive bias towards local processing inherent in convolutions with global processing performed by multi-headed self-attention [43]. The hope is that this design has the potential to improve performance on vision tasks, akin to the trends observed in natural language processing [11]. While investigating this conjecture, researchers face another unexpected difference between ViTs and CNNs: ViT models exhibit substandard optimizability. ViTs are sensitive to the choice of optimizer [41] (AdamW [27] vs. SGD), to the selection of dataset specific learning hyperparameters [13, 41], to training schedule length, to network depth [42], etc. These issues render former training recipes and intuitions ineffective and impede research. ",
|
| 74 |
+
"bbox": [
|
| 75 |
+
174,
|
| 76 |
+
669,
|
| 77 |
+
825,
|
| 78 |
+
794
|
| 79 |
+
],
|
| 80 |
+
"page_idx": 0
|
| 81 |
+
},
|
| 82 |
+
{
|
| 83 |
+
"type": "text",
|
| 84 |
+
"text": "Convolutional neural networks, in contrast, are exceptionally easy and robust to optimize. Simple training recipes based on SGD, basic data augmentation, and standard hyperparameter values have been widely used for years [19]. Why does this difference exist between ViT and CNN models? In this paper we hypothesize that the issues lies primarily in the early visual processing performed by ViT. ViT “patchifies” the input image into $p { \\times } p$ non-overlapping patches to form the transformer encoder’s input set. This patchify stem is implemented as a stride- $p p \\times p$ convolution, with $p = 1 6$ as a default value. This large-kernel plus large-stride convolution runs counter to the typical design choices used in CNNs, where best-practices have converged to a small stack of stride-two $3 { \\times } 3$ kernels as the network’s stem (e.g., [30, 36, 39]). ",
|
| 85 |
+
"bbox": [
|
| 86 |
+
174,
|
| 87 |
+
800,
|
| 88 |
+
825,
|
| 89 |
+
897
|
| 90 |
+
],
|
| 91 |
+
"page_idx": 0
|
| 92 |
+
},
|
| 93 |
+
{
|
| 94 |
+
"type": "image",
|
| 95 |
+
"img_path": "images/b91aae065046d45a4cf2660ee48625a319b82673ffafb868c9b5ca99235d35b4.jpg",
|
| 96 |
+
"image_caption": [
|
| 97 |
+
"Figure 1: Early convolutions help transformers see better: We hypothesize that the substandard optimizability of ViT models compared to CNNs primarily arises from the early visual processing performed by its patchify stem, which is implemented by a non-overlapping stride- $p p { \\times } p$ convolution, with $p = 1 6$ by default. We minimally replace the patchify stem in ViT with a standard convolutional stem of only ${ \\sim } 5 $ convolutions that has approximately the same complexity as a single transformer block. We reduce the number of transformer blocks by one (i.e., $\\bar { L } - 1$ vs. $L$ ) to maintain parity in flops, parameters, and runtime. We refer to the resulting model as $\\mathrm { V i T } _ { C }$ and the original ViT as $\\mathrm { V i T } _ { P }$ . The vast majority of computation performed by these two models is identical, yet surprisingly we observe that $\\mathrm { V i T } _ { C }$ (i) converges faster, (ii) enables, for the first time, the use of either AdamW or SGD without a significant accuracy drop, (iii) shows greater stability to learning rate and weight decay choice, and (iv) yields improvements in ImageNet top-1 error allowing $\\mathrm { V i T } _ { C }$ to outperform state-of-the-art CNNs, whereas $\\mathrm { V i T } _ { P }$ does not. "
|
| 98 |
+
],
|
| 99 |
+
"image_footnote": [],
|
| 100 |
+
"bbox": [
|
| 101 |
+
173,
|
| 102 |
+
88,
|
| 103 |
+
825,
|
| 104 |
+
242
|
| 105 |
+
],
|
| 106 |
+
"page_idx": 1
|
| 107 |
+
},
|
| 108 |
+
{
|
| 109 |
+
"type": "text",
|
| 110 |
+
"text": "",
|
| 111 |
+
"bbox": [
|
| 112 |
+
176,
|
| 113 |
+
435,
|
| 114 |
+
821,
|
| 115 |
+
463
|
| 116 |
+
],
|
| 117 |
+
"page_idx": 1
|
| 118 |
+
},
|
| 119 |
+
{
|
| 120 |
+
"type": "text",
|
| 121 |
+
"text": "To test this hypothesis, we minimally change the early visual processing of ViT by replacing its patchify stem with a standard convolutional stem consisting of only ${ \\sim } 5$ convolutions, see Figure 1. To compensate for the small addition in flops, we remove one transformer block to maintain parity in flops and runtime. We observe that even though the vast majority of the computation in the two ViT designs is identical, this small change in early visual processing results in markedly different training behavior in terms of the sensitivity to optimization settings as well as the final model accuracy. ",
|
| 122 |
+
"bbox": [
|
| 123 |
+
174,
|
| 124 |
+
469,
|
| 125 |
+
825,
|
| 126 |
+
553
|
| 127 |
+
],
|
| 128 |
+
"page_idx": 1
|
| 129 |
+
},
|
| 130 |
+
{
|
| 131 |
+
"type": "text",
|
| 132 |
+
"text": "In extensive experiments we show that replacing the ViT patchify stem with a more standard convolutional stem (i) allows ViT to converge faster (§5.1), (ii) enables, for the first time, the use of either AdamW or SGD without a significant drop in accuracy (§5.2), (iii) brings ViT’s stability w.r.t. learning rate and weight decay closer to that of modern CNNs (§5.3), and (iv) yields improvements in ImageNet [10] top-1 error of $\\sim 1 - 2$ percentage points (§6). We consistently observe these improvements across a wide spectrum of model complexities (from 1G flops to 36G flops) and dataset scales (ImageNet-1k to ImageNet-21k). ",
|
| 133 |
+
"bbox": [
|
| 134 |
+
174,
|
| 135 |
+
559,
|
| 136 |
+
825,
|
| 137 |
+
656
|
| 138 |
+
],
|
| 139 |
+
"page_idx": 1
|
| 140 |
+
},
|
| 141 |
+
{
|
| 142 |
+
"type": "text",
|
| 143 |
+
"text": "These results show that injecting some convolutional inductive bias into ViTs can be beneficial under commonly studied settings. We did not observe evidence that the hard locality constraint in early layers hampers the representational capacity of the network, as might be feared [9]. In fact we observed the opposite, as ImageNet results improve even with larger-scale models and larger-scale data when using a convolution stem. Moreover, under carefully controlled comparisons, we find that ViTs are only able to surpass state-of-the-art CNNs when equipped with a convolutional stem (§6). ",
|
| 144 |
+
"bbox": [
|
| 145 |
+
174,
|
| 146 |
+
662,
|
| 147 |
+
825,
|
| 148 |
+
746
|
| 149 |
+
],
|
| 150 |
+
"page_idx": 1
|
| 151 |
+
},
|
| 152 |
+
{
|
| 153 |
+
"type": "text",
|
| 154 |
+
"text": "We conjecture that restricting convolutions in ViT to early visual processing may be a crucial design choice that strikes a balance between (hard) inductive biases and the representation learning ability of transformer blocks. Evidence comes by comparison to the “hybrid ViT” presented in [13], which uses 40 convolutional layers (most of a ResNet-50) and shows no improvement over the default ViT. This perspective resonates with the findings of [9], who observe that early transformer blocks prefer to learn more local attention patterns than later blocks. Finally we note that exploring the design of hybrid CNN/ViT models is not a goal of this work; rather we demonstrate that simply using a minimal convolutional stem with ViT is sufficient to dramatically change its optimization behavior. ",
|
| 155 |
+
"bbox": [
|
| 156 |
+
174,
|
| 157 |
+
752,
|
| 158 |
+
825,
|
| 159 |
+
863
|
| 160 |
+
],
|
| 161 |
+
"page_idx": 1
|
| 162 |
+
},
|
| 163 |
+
{
|
| 164 |
+
"type": "text",
|
| 165 |
+
"text": "In summary, the findings presented in this paper lead us to recommend using a standard, lightweight convolutional stem for ViT models in the analyzed dataset scale and model complexity spectrum as a more robust and higher performing architectural choice compared to the original ViT model design. ",
|
| 166 |
+
"bbox": [
|
| 167 |
+
176,
|
| 168 |
+
869,
|
| 169 |
+
825,
|
| 170 |
+
911
|
| 171 |
+
],
|
| 172 |
+
"page_idx": 1
|
| 173 |
+
},
|
| 174 |
+
{
|
| 175 |
+
"type": "text",
|
| 176 |
+
"text": "2 Related Work ",
|
| 177 |
+
"text_level": 1,
|
| 178 |
+
"bbox": [
|
| 179 |
+
174,
|
| 180 |
+
89,
|
| 181 |
+
321,
|
| 182 |
+
106
|
| 183 |
+
],
|
| 184 |
+
"page_idx": 2
|
| 185 |
+
},
|
| 186 |
+
{
|
| 187 |
+
"type": "text",
|
| 188 |
+
"text": "Convolutional neural networks (CNNs). The breakthrough performance of the AlexNet [23] CNN [15, 24] on ImageNet classification [10] transformed the field of recognition, leading to the development of higher performing architectures, e.g., [19, 36, 37, 48], and scalable training methods [16, 21]. These architectures are now core components in object detection (e.g., [34]), instance segmentation (e.g., [18]), and semantic segmentation (e.g., [26]). CNNs are typically trained with stochastic gradient descent (SGD) and are widely considered to be easy to optimize. ",
|
| 189 |
+
"bbox": [
|
| 190 |
+
174,
|
| 191 |
+
126,
|
| 192 |
+
825,
|
| 193 |
+
209
|
| 194 |
+
],
|
| 195 |
+
"page_idx": 2
|
| 196 |
+
},
|
| 197 |
+
{
|
| 198 |
+
"type": "text",
|
| 199 |
+
"text": "Self-attention in vision models. Transformers [43] are revolutionizing natural language processing by enabling scalable training. Transformers use multi-headed self-attention, which performs global information processing and is strictly more general than convolution [6]. Wang et al. [46] show that (single-headed) self-attention is a form of non-local means [2] and that integrating it into a ResNet [19] improves several tasks. Ramachandran et al. [32] explore this direction further with stand-alone self-attention networks for vision. They report difficulties in designing an attention-based network stem and present a bespoke solution that avoids convolutions. In contrast, we demonstrate the benefits of a convolutional stem. Zhao et al. [53] explore a broader set of self-attention operations with hard-coded locality constraints, more similar to standard CNNs. ",
|
| 200 |
+
"bbox": [
|
| 201 |
+
174,
|
| 202 |
+
219,
|
| 203 |
+
825,
|
| 204 |
+
344
|
| 205 |
+
],
|
| 206 |
+
"page_idx": 2
|
| 207 |
+
},
|
| 208 |
+
{
|
| 209 |
+
"type": "text",
|
| 210 |
+
"text": "Vision transformer (ViT). Dosovitskiy et al. [13] apply a transformer encoder to image classification with minimal vision-specific modifications. As the counterpart of input token embeddings, they partition the input image into, e.g., $1 6 \\times 1 6$ pixel, non-overlapping patches and linearly project them to the encoder’s input dimension. They report lackluster results when training on ImageNet-1k, but demonstrate state-of-the-art transfer learning when using large-scale pretraining data. ViTs are sensitive to many details of the training recipe, e.g., they benefit greatly from AdamW [27] compared to SGD and require careful learning rate and weight decay selection. ViTs are generally considered to be difficult to optimize compared to CNNs (e.g., see [13, 41, 42]). Further evidence of challenges comes from Chen et al. [4] who report ViT optimization instability in self-supervised learning (unlike with CNNs), and find that freezing the patchify stem at its random initialization improves stability. ",
|
| 211 |
+
"bbox": [
|
| 212 |
+
174,
|
| 213 |
+
354,
|
| 214 |
+
825,
|
| 215 |
+
493
|
| 216 |
+
],
|
| 217 |
+
"page_idx": 2
|
| 218 |
+
},
|
| 219 |
+
{
|
| 220 |
+
"type": "text",
|
| 221 |
+
"text": "ViT improvements. ViTs are gaining rapid interest in part because they may offer a novel direction away from CNNs. Touvron et al. [41] show that with more regularization and stronger data augmentation ViT models achieve competitive accuracy on ImageNet-1k alone (cf . [13]). Subsequently, works concurrent with our own explore numerous other ViT improvements. Dominant themes include multi-scale networks [14, 17, 25, 45, 50], increasing depth [42], and locality priors [5, 9, 17, 47, 49]. In [9], d’Ascoli et al. modify multi-head self-attention with a convolutional bias at initialization and show that this prior improves sample efficiency and ImageNet accuracy. Resonating with our work, [5, 17, 47, 49] present models with convolutional stems, but do not analyze optimizability (our focus). ",
|
| 222 |
+
"bbox": [
|
| 223 |
+
174,
|
| 224 |
+
503,
|
| 225 |
+
826,
|
| 226 |
+
614
|
| 227 |
+
],
|
| 228 |
+
"page_idx": 2
|
| 229 |
+
},
|
| 230 |
+
{
|
| 231 |
+
"type": "text",
|
| 232 |
+
"text": "Discussion. Unlike the concurrent work on locality priors in ViT, our focus is studying optimizability under minimal ViT modifications in order to derive crisp conclusions. Our perspective brings several novel observations: by adding only ${ \\sim } 5 $ convolutions to the stem, ViT can be optimized well with either AdamW or SGD $_ { c f }$ . all prior works use AdamW to avoid large drops in accuracy [41]), it becomes less sensitive to the specific choice of learning rate and weight decay, and training converges faster. We also observe a consistent improvement in ImageNet top-1 accuracy across a wide spectrum of model complexities (1G flops to 36G flops) and dataset scales (ImageNet-1k to ImageNet-21k). These results suggest that a (hard) convolutional bias early in the network does not compromise representational capacity, as conjectured in [9], and is beneficial within the scope of this study. ",
|
| 233 |
+
"bbox": [
|
| 234 |
+
174,
|
| 235 |
+
626,
|
| 236 |
+
825,
|
| 237 |
+
751
|
| 238 |
+
],
|
| 239 |
+
"page_idx": 2
|
| 240 |
+
},
|
| 241 |
+
{
|
| 242 |
+
"type": "text",
|
| 243 |
+
"text": "3 Vision Transformer Architectures ",
|
| 244 |
+
"text_level": 1,
|
| 245 |
+
"bbox": [
|
| 246 |
+
174,
|
| 247 |
+
770,
|
| 248 |
+
488,
|
| 249 |
+
787
|
| 250 |
+
],
|
| 251 |
+
"page_idx": 2
|
| 252 |
+
},
|
| 253 |
+
{
|
| 254 |
+
"type": "text",
|
| 255 |
+
"text": "Next, we review vision transformers [13] and describe the convolutional stems used in our work. ",
|
| 256 |
+
"bbox": [
|
| 257 |
+
171,
|
| 258 |
+
803,
|
| 259 |
+
803,
|
| 260 |
+
818
|
| 261 |
+
],
|
| 262 |
+
"page_idx": 2
|
| 263 |
+
},
|
| 264 |
+
{
|
| 265 |
+
"type": "text",
|
| 266 |
+
"text": "The vision transformer (ViT). ViT first partitions an input image into non-overlapping $p { \\times } p$ patches and linearly projects each patch to a $d$ -dimensional feature vector using a learned weight matrix. A patch size of $p = 1 6$ and an image size of $2 2 4 \\times 2 2 4$ are typical. The resulting patch embeddings (plus positional embeddings and a learned classification token embedding) are processed by a standard transformer encoder [43, 44] followed by a classification head. Using common network nomenclature, we refer to the portion of ViT before the transformer blocks as the network’s stem. ViT’s stem is a ",
|
| 267 |
+
"bbox": [
|
| 268 |
+
174,
|
| 269 |
+
827,
|
| 270 |
+
825,
|
| 271 |
+
911
|
| 272 |
+
],
|
| 273 |
+
"page_idx": 2
|
| 274 |
+
},
|
| 275 |
+
{
|
| 276 |
+
"type": "table",
|
| 277 |
+
"img_path": "images/3599e6fb185969911a28ae324a67963ed676830a0d957f351ca943e9dc0aad27.jpg",
|
| 278 |
+
"table_caption": [],
|
| 279 |
+
"table_footnote": [],
|
| 280 |
+
"table_body": "<table><tr><td>model</td><td>ref model</td><td>|hidden MLP size</td><td>mult</td><td>num heads</td><td>num blocks</td><td>flops (B)</td><td>params (M)</td><td>acts (M)</td><td>time (min)</td></tr><tr><td>ViTp-1GF</td><td>~ViT-T</td><td>192</td><td>3</td><td>3</td><td>12</td><td>1.1</td><td>4.8</td><td>5.5</td><td>2.6</td></tr><tr><td>ViTp-4GF</td><td>~ViT-S</td><td>384</td><td>3</td><td>6</td><td>12</td><td>3.9</td><td>18.5</td><td>11.1</td><td>3.8</td></tr><tr><td>ViTp-18GF</td><td>=ViT-B</td><td>768</td><td>4</td><td>12</td><td>12</td><td>17.5</td><td>86.7</td><td>24.0</td><td>11.5</td></tr><tr><td>ViTp-36GF</td><td>ViT-L</td><td>1024</td><td>4</td><td>16</td><td>14</td><td>35.9</td><td>178.4</td><td>37.3</td><td>18.8</td></tr></table>",
|
| 281 |
+
"bbox": [
|
| 282 |
+
173,
|
| 283 |
+
85,
|
| 284 |
+
506,
|
| 285 |
+
150
|
| 286 |
+
],
|
| 287 |
+
"page_idx": 3
|
| 288 |
+
},
|
| 289 |
+
{
|
| 290 |
+
"type": "table",
|
| 291 |
+
"img_path": "images/79c844634d5f88ad843d0ccbedac33c38a9980eb6213fb6125e5349400d7d0fd.jpg",
|
| 292 |
+
"table_caption": [],
|
| 293 |
+
"table_footnote": [],
|
| 294 |
+
"table_body": "<table><tr><td>model</td><td>hidden size</td><td>MLP mult</td><td>num heads blocks</td><td>num</td><td>flops (B)</td><td>params (M)</td><td>acts (M)</td><td>time (min)</td></tr><tr><td>ViTc-1GF</td><td>192</td><td>3</td><td>3</td><td>11</td><td>1.1</td><td>4.6</td><td>5.7</td><td>2.7</td></tr><tr><td>ViTc-4GF</td><td>384</td><td>3</td><td>6</td><td>11</td><td>4.0</td><td>17.8</td><td>11.3</td><td>3.9</td></tr><tr><td>ViTc-18GF</td><td>768</td><td>4</td><td>12</td><td>11</td><td>17.7</td><td>81.6</td><td>24.1</td><td>11.4</td></tr><tr><td>ViTc-36GF</td><td>1024</td><td>4</td><td>16</td><td>13</td><td>35.0</td><td>167.8</td><td>36.7</td><td>18.6</td></tr></table>",
|
| 295 |
+
"bbox": [
|
| 296 |
+
522,
|
| 297 |
+
85,
|
| 298 |
+
820,
|
| 299 |
+
150
|
| 300 |
+
],
|
| 301 |
+
"page_idx": 3
|
| 302 |
+
},
|
| 303 |
+
{
|
| 304 |
+
"type": "text",
|
| 305 |
+
"text": "Table 1: Model definitions: Left: Our $\\mathrm { V i T } _ { P }$ models at various complexities, which use the original patchify stem and closely resemble the original ViT models [13]. To facilitate comparisons with CNNs, we modify the original ViT-Tiny, -Small, -Base, -Large models to obtain models at 1GF, 4GF, 18GF, and 36GF, respectively. The modifications are indicated in blue and include reducing the MLP multiplier from $4 \\times$ to $3 \\times$ for the 1GF and 4GF models, and reducing the number of transformer blocks from 24 to 14 for the 36GF model. Right: Our $\\mathrm { V i T } _ { C }$ models at various complexities that use the convolutional stem. The only additional modification relative to the corresponding $\\mathrm { V i T } _ { P }$ models is the removal of 1 transformer block to compensate for the increased flops of the convolutional stem. We show complexity measures for all models (flops, parameters, activations, and epoch training time on ImageNet-1k); the corresponding $\\mathrm { V i T } _ { P }$ and $\\mathrm { V i T } _ { C }$ models match closely on all metrics. ",
|
| 306 |
+
"bbox": [
|
| 307 |
+
173,
|
| 308 |
+
161,
|
| 309 |
+
825,
|
| 310 |
+
300
|
| 311 |
+
],
|
| 312 |
+
"page_idx": 3
|
| 313 |
+
},
|
| 314 |
+
{
|
| 315 |
+
"type": "text",
|
| 316 |
+
"text": "specific case of convolution (stride- $p$ , $p { \\times } p$ kernel), but we will refer to it as the patchify stem and reserve the terminology of convolutional stem for stems with a more conventional CNN design with multiple layers of overlapping convolutions (i.e., with stride smaller than the kernel size). ",
|
| 317 |
+
"bbox": [
|
| 318 |
+
176,
|
| 319 |
+
316,
|
| 320 |
+
823,
|
| 321 |
+
358
|
| 322 |
+
],
|
| 323 |
+
"page_idx": 3
|
| 324 |
+
},
|
| 325 |
+
{
|
| 326 |
+
"type": "text",
|
| 327 |
+
"text": "$\\mathbf { V i T } _ { P }$ models. Prior work proposes ViT models of various sizes, such as ViT-Tiny, ViT-Small, ViT-Base, etc. [13, 41]. To facilitate comparisons with CNNs, which are typically standardized to 1 gigaflop (GF), 2GF, 4GF, 8GF, etc., we modify the original ViT models to obtain models at about these complexities. Details are given in Table 1 (left). For easier comparison with CNNs of similar flops, and to avoid subjective size names, we refer the models by their flops, e.g., $\\mathrm { V i T } _ { P }$ -4GF in place of ViT-Small. We use the $P$ subscript to indicate that these models use the original patchify stem. ",
|
| 328 |
+
"bbox": [
|
| 329 |
+
174,
|
| 330 |
+
369,
|
| 331 |
+
825,
|
| 332 |
+
452
|
| 333 |
+
],
|
| 334 |
+
"page_idx": 3
|
| 335 |
+
},
|
| 336 |
+
{
|
| 337 |
+
"type": "text",
|
| 338 |
+
"text": "Convolutional stem design. We adopt a typical minimalist convolutional stem design by stacking $3 { \\times } 3$ convolutions [36], followed by a single $1 \\times 1$ convolution at the end to match the $d$ -dimensional input of the transformer encoder. These stems quickly downsample a $2 2 4 \\times 2 2 4$ input image using overlapping strided convolutions to $1 4 \\times 1 4$ , matching the number of inputs created by the standard patchify stem. We follow a simple design pattern: all $3 { \\times } 3$ convolutions either have stride 2 and double the number of output channels or stride 1 and keep the number of output channels constant. We enforce that the stem accounts for approximately the computation of one transformer block of the corresponding model so that we can easily control for flops by removing one transformer block when using the convolutional stem instead of the patchify stem. Our stem design was chosen to be purposefully simple and we emphasize that it was not designed to maximize model accuracy. ",
|
| 339 |
+
"bbox": [
|
| 340 |
+
174,
|
| 341 |
+
463,
|
| 342 |
+
825,
|
| 343 |
+
602
|
| 344 |
+
],
|
| 345 |
+
"page_idx": 3
|
| 346 |
+
},
|
| 347 |
+
{
|
| 348 |
+
"type": "text",
|
| 349 |
+
"text": "$\\mathbf { V i T } _ { C }$ models. To form a ViT model with a convolutional stem, we simply replace the patchify stem with its counterpart convolutional stem and remove one transformer block to compensate for the convolutional stem’s extra flops (see Figure 1). We refer to the modified ViT with a convolutional stem as $\\mathrm { V i T } _ { C }$ . Configurations for $\\mathrm { V i T } _ { C }$ at various complexities are given in Table 1 (right); corresponding $\\mathrm { V i T } _ { P }$ and $\\mathrm { V i T } _ { C }$ models match closely on all complexity metrics including flops and runtime. ",
|
| 350 |
+
"bbox": [
|
| 351 |
+
174,
|
| 352 |
+
612,
|
| 353 |
+
823,
|
| 354 |
+
681
|
| 355 |
+
],
|
| 356 |
+
"page_idx": 3
|
| 357 |
+
},
|
| 358 |
+
{
|
| 359 |
+
"type": "text",
|
| 360 |
+
"text": "Convolutional stem details. Our convolutional stem designs use four, four, and six $3 { \\times } 3$ convolutions for the 1GF, 4GF, and 18GF models, respectively. The output channels are [24, 48, 96, 192], [48, 96, 192, 384], and [64, 128, 128, 256, 256, 512], respectively. All $3 { \\times } 3$ convolutions are followed by batch norm (BN) [21] and then ReLU [29], while the final $1 \\times 1$ convolution is not, to be consistent with the original patchify stem. Eventually, matching stem flops to transformer block flops results in an unreasonably large stem, thus $\\mathrm { V i T } _ { C }$ -36GF uses the same stem as $\\mathrm { V i T } _ { C }$ -18GF. ",
|
| 361 |
+
"bbox": [
|
| 362 |
+
174,
|
| 363 |
+
693,
|
| 364 |
+
825,
|
| 365 |
+
775
|
| 366 |
+
],
|
| 367 |
+
"page_idx": 3
|
| 368 |
+
},
|
| 369 |
+
{
|
| 370 |
+
"type": "text",
|
| 371 |
+
"text": "Convolutions in ViT. Dosovitskiy et al. [13] also introduced a “hybrid ViT” architecture that blends a modified ResNet [19] (BiT-ResNet [22]) with a transformer encoder. In their hybrid model, the patchify stem is replaced by a partial BiT-ResNet-50 that terminates at the output of the conv4 stage or the output of an extended conv3 stage. These image embeddings replace the standard patchify stem embeddings. This partial BiT-ResNet-50 stem is deep, with 40 convolutional layers. In this work, we explore lightweight convolutional stems that consist of only 5 to 7 convolutions in total, instead of the 40 used by the hybrid ViT. Moreover, we emphasize that the goal of our work is not to explore the hybrid ViT design space, but rather to study the optimizability effects of simply replacing the patchify stem with a minimal convolutional stem that follows standard CNN design practices. ",
|
| 372 |
+
"bbox": [
|
| 373 |
+
174,
|
| 374 |
+
786,
|
| 375 |
+
825,
|
| 376 |
+
911
|
| 377 |
+
],
|
| 378 |
+
"page_idx": 3
|
| 379 |
+
},
|
| 380 |
+
{
|
| 381 |
+
"type": "text",
|
| 382 |
+
"text": "4 Measuring Optimizability ",
|
| 383 |
+
"text_level": 1,
|
| 384 |
+
"bbox": [
|
| 385 |
+
176,
|
| 386 |
+
88,
|
| 387 |
+
421,
|
| 388 |
+
107
|
| 389 |
+
],
|
| 390 |
+
"page_idx": 4
|
| 391 |
+
},
|
| 392 |
+
{
|
| 393 |
+
"type": "text",
|
| 394 |
+
"text": "It has been noted in the literature that ViT models are challenging to optimize, e.g., they may achieve only modest performance when trained on a mid-size dataset (ImageNet-1k) [13], are sensitive to data augmentation [41] and optimizer choice [41], and may perform poorly when made deeper [42]. We empirically observed the general presence of such difficulties through the course of our experiments and informally refer to such optimization characteristics collectively as optimizability. ",
|
| 395 |
+
"bbox": [
|
| 396 |
+
174,
|
| 397 |
+
121,
|
| 398 |
+
823,
|
| 399 |
+
190
|
| 400 |
+
],
|
| 401 |
+
"page_idx": 4
|
| 402 |
+
},
|
| 403 |
+
{
|
| 404 |
+
"type": "text",
|
| 405 |
+
"text": "Models with poor optimizability can yield very different results when hyperparameters are varied, which can lead to seemingly bizarre observations, e.g., removing erasing data augmentation [54] causes a catastrophic drop in ImageNet accuracy in [41]. Quantitative metrics to measure optimizability are needed to allow for more robust comparisons. In this section, we establish the foundations of such comparisons; we extensively test various models using these optimizability measures in $\\ S 5$ . ",
|
| 406 |
+
"bbox": [
|
| 407 |
+
174,
|
| 408 |
+
196,
|
| 409 |
+
825,
|
| 410 |
+
267
|
| 411 |
+
],
|
| 412 |
+
"page_idx": 4
|
| 413 |
+
},
|
| 414 |
+
{
|
| 415 |
+
"type": "text",
|
| 416 |
+
"text": "Training length stability. Prior works train ViT models for lengthy schedules, e.g., 300 to 400 epochs on ImageNet is typical (at the extreme, [17] trains models for 1000 epochs), since results at a formerly common 100-epoch schedule are substantially worse ( $2 \\%$ lower top-1 accuracy, see $\\begin{array} { r l } { \\ S } & { { } \\} } \\end{array}$ . In the context of ImageNet, we define top-1 accuracy at 400 epochs as an approximate asymptotic result, i.e., training for longer will not meaningfully improve top-1 accuracy, and we compare it to the accuracy of models trained for only 50, 100, or 200 epochs. We define training length stability as the gap to asymptotic accuracy. Intuitively, it’s a measure of convergence speed. Models that converge faster offer obvious practical benefits, especially when training many model variants. ",
|
| 417 |
+
"bbox": [
|
| 418 |
+
174,
|
| 419 |
+
277,
|
| 420 |
+
825,
|
| 421 |
+
388
|
| 422 |
+
],
|
| 423 |
+
"page_idx": 4
|
| 424 |
+
},
|
| 425 |
+
{
|
| 426 |
+
"type": "text",
|
| 427 |
+
"text": "Optimizer stability. Prior works use AdamW [27] to optimize ViT models from random initialization. Results of SGD are not typically presented and we are only aware of Touvron et al. [41]’s report of a dramatic $\\sim 7 \\%$ drop in ImageNet top-1 accuracy. In contrast, widely used CNNs, such as ResNets, can be optimized equally well with either SGD or AdamW (see $\\ S 5 . 2 )$ and SGD (always with momentum) is typically used in practice. SGD has the practical benefit of having fewer hyperparameters (e.g., tuning AdamW’s $\\beta _ { 2 }$ can be important [3]) and requiring $50 \\%$ less optimizer state memory, which can ease scaling. We define optimizer stability as the accuracy gap between AdamW and SGD. Like training length stability, we use optimizer stability as a proxy for the ease of optimization of a model. ",
|
| 428 |
+
"bbox": [
|
| 429 |
+
174,
|
| 430 |
+
398,
|
| 431 |
+
825,
|
| 432 |
+
511
|
| 433 |
+
],
|
| 434 |
+
"page_idx": 4
|
| 435 |
+
},
|
| 436 |
+
{
|
| 437 |
+
"type": "text",
|
| 438 |
+
"text": "Hyperparameter $( l r , w d )$ stability. Learning rate $( l r )$ and weight decay (wd) are among the most important hyperparameters governing optimization with SGD and AdamW. New models and datasets often require a search for their optimal values as the choice can dramatically affect results. It is desirable to have a model and optimizer that yield good results for a wide range of learning rate and weight decay values. We will explore this hyperparameter stability by comparing the error distribution functions (EDFs) [30] of models trained with various choices of $l r$ and $w d$ . In this setting, to create an EDF for a model we randomly sample values of $l r$ and wd and train the model accordingly. Distributional estimates, like those provided by EDFs, give a more complete view of the characteristics of models that point estimates cannot reveal [30, 31]. We will review EDFs in $\\ S$ . ",
|
| 439 |
+
"bbox": [
|
| 440 |
+
174,
|
| 441 |
+
520,
|
| 442 |
+
825,
|
| 443 |
+
645
|
| 444 |
+
],
|
| 445 |
+
"page_idx": 4
|
| 446 |
+
},
|
| 447 |
+
{
|
| 448 |
+
"type": "text",
|
| 449 |
+
"text": "Peak performance. The maximum possible performance of each model is the most commonly used metric in previous literature and it is often provided without carefully controlling training details such as data augmentations, regularization methods, number of epochs, and $l r$ , wd tuning. To make more robust comparisons, we define peak performance as the result of a model at 400 epochs using its best-performing optimizer and parsimoniously tuned $l r$ and $w d$ values (details in $\\ S 6$ ), while fixing justifiably good values for all other variables that have a known impact on training. Peak performance results for ViTs and CNNs under these carefully controlled training settings are presented in $\\ S 6$ . ",
|
| 450 |
+
"bbox": [
|
| 451 |
+
173,
|
| 452 |
+
656,
|
| 453 |
+
825,
|
| 454 |
+
753
|
| 455 |
+
],
|
| 456 |
+
"page_idx": 4
|
| 457 |
+
},
|
| 458 |
+
{
|
| 459 |
+
"type": "text",
|
| 460 |
+
"text": "5 Stability Experiments ",
|
| 461 |
+
"text_level": 1,
|
| 462 |
+
"bbox": [
|
| 463 |
+
174,
|
| 464 |
+
773,
|
| 465 |
+
387,
|
| 466 |
+
791
|
| 467 |
+
],
|
| 468 |
+
"page_idx": 4
|
| 469 |
+
},
|
| 470 |
+
{
|
| 471 |
+
"type": "text",
|
| 472 |
+
"text": "In this section we test the stability of ViT models with the original patchify $( P )$ stem vs. the convolutional $( C )$ stem defined in $\\ S$ . For reference, we also train RegNetY [12, 31], a state-of-the-art CNN that is easy to optimize and serves as a reference point for good stability. ",
|
| 473 |
+
"bbox": [
|
| 474 |
+
174,
|
| 475 |
+
806,
|
| 476 |
+
825,
|
| 477 |
+
849
|
| 478 |
+
],
|
| 479 |
+
"page_idx": 4
|
| 480 |
+
},
|
| 481 |
+
{
|
| 482 |
+
"type": "text",
|
| 483 |
+
"text": "We conduct experiments using ImageNet-1k [10]’s standard training and validation sets, and report top-1 error. Following [12], for all results, we carefully control training settings and we use a minimal set of data augmentations that still yields strong results, for details see $\\ S$ . In this section, unless noted, for each model we use the optimal $l r$ and $w d$ found under a 50 epoch schedule (see Appendix). ",
|
| 484 |
+
"bbox": [
|
| 485 |
+
174,
|
| 486 |
+
854,
|
| 487 |
+
825,
|
| 488 |
+
911
|
| 489 |
+
],
|
| 490 |
+
"page_idx": 4
|
| 491 |
+
},
|
| 492 |
+
{
|
| 493 |
+
"type": "image",
|
| 494 |
+
"img_path": "images/1b817452fed13ecd8d39700f88900c771e3a9e3f6dfc8bdc649446f86b908a32.jpg",
|
| 495 |
+
"image_caption": [
|
| 496 |
+
"Figure 2: Training length stability: We train 9 models for 50 to 400 epochs on ImageNet-1k and plot the ∆top-1 error to the 400 epoch result for each. $\\mathrm { V i T } _ { C }$ demonstrates faster convergence than $\\mathrm { V i T } _ { P }$ across the model complexity spectrum, and helps close the gap to CNNs (represented by RegNetY). "
|
| 497 |
+
],
|
| 498 |
+
"image_footnote": [],
|
| 499 |
+
"bbox": [
|
| 500 |
+
178,
|
| 501 |
+
90,
|
| 502 |
+
818,
|
| 503 |
+
198
|
| 504 |
+
],
|
| 505 |
+
"page_idx": 5
|
| 506 |
+
},
|
| 507 |
+
{
|
| 508 |
+
"type": "image",
|
| 509 |
+
"img_path": "images/43debc0650f8f893da5ed8e572faf39672229881bcf0855f86dff3d9306f34f9.jpg",
|
| 510 |
+
"image_caption": [
|
| 511 |
+
"Figure 3: Optimizer stability: We train each model for 50 to 400 epochs with AdamW (upward triangle $\\blacktriangle$ ) and SGD (downward triangle $\\blacktriangledown$ ). For the baseline $\\mathrm { V i T } _ { P }$ , SGD yields significantly worse results than AdamW. In contrast, $\\mathrm { V i T } _ { C }$ and $\\mathrm { R e g N e t Y }$ models exhibit a much smaller gap between SGD and AdamW across all settings. Note that for long schedules, $\\mathrm { V i T } _ { P }$ often fails to converge with SGD (i.e., loss goes to NaN), in such cases we copy the best results from a shorter schedule of the same model (and show the results via a dashed line). "
|
| 512 |
+
],
|
| 513 |
+
"image_footnote": [],
|
| 514 |
+
"bbox": [
|
| 515 |
+
178,
|
| 516 |
+
268,
|
| 517 |
+
818,
|
| 518 |
+
376
|
| 519 |
+
],
|
| 520 |
+
"page_idx": 5
|
| 521 |
+
},
|
| 522 |
+
{
|
| 523 |
+
"type": "text",
|
| 524 |
+
"text": "5.1 Training Length Stability ",
|
| 525 |
+
"text_level": 1,
|
| 526 |
+
"bbox": [
|
| 527 |
+
174,
|
| 528 |
+
500,
|
| 529 |
+
390,
|
| 530 |
+
513
|
| 531 |
+
],
|
| 532 |
+
"page_idx": 5
|
| 533 |
+
},
|
| 534 |
+
{
|
| 535 |
+
"type": "text",
|
| 536 |
+
"text": "We first explore how rapidly networks converge to their asymptotic error on ImageNet-1k, i.e., the highest possible accuracy achievable by training for many epochs. We approximate asymptotic error as a model’s error using a 400 epoch schedule based on observing diminishing returns from 200 to 400. We consider a grid of 24 experiments for ViT: $\\{ P , C \\}$ stems $\\times \\ \\{ 1 , 4 , 1 8 \\}$ GF model sizes $\\times$ {50, 100, 200, 400} epochs. For reference we also train RegNetY at $\\{ 1 , 4 , 1 6 \\}$ GF. We use the best optimizer choice for each model (AdamW for ViT models and SGD for RegNetY models). ",
|
| 537 |
+
"bbox": [
|
| 538 |
+
173,
|
| 539 |
+
525,
|
| 540 |
+
825,
|
| 541 |
+
609
|
| 542 |
+
],
|
| 543 |
+
"page_idx": 5
|
| 544 |
+
},
|
| 545 |
+
{
|
| 546 |
+
"type": "text",
|
| 547 |
+
"text": "Results. Figure 2 shows the absolute error deltas (∆top-1) between 50, 100, and 200 epoch schedules and asymptotic performance (at 400 epochs). $\\mathrm { V i T } _ { C }$ demonstrates faster convergence than $\\mathrm { V i T } _ { P }$ across the model complexity spectrum, and closes much of the gap to the rate of CNN convergence. The improvement is most significant in the shortest training schedule (50 epoch), e.g., $\\mathrm { V i T } _ { P }$ -1GF has a $10 \\%$ error delta, while $\\mathrm { V i T } _ { C }$ -1GF reduces this to about $6 \\%$ . This opens the door to applications that execute a large number of short-scheduled experiments, such as neural architecture search. ",
|
| 548 |
+
"bbox": [
|
| 549 |
+
174,
|
| 550 |
+
619,
|
| 551 |
+
825,
|
| 552 |
+
703
|
| 553 |
+
],
|
| 554 |
+
"page_idx": 5
|
| 555 |
+
},
|
| 556 |
+
{
|
| 557 |
+
"type": "text",
|
| 558 |
+
"text": "5.2 Optimizer Stability ",
|
| 559 |
+
"text_level": 1,
|
| 560 |
+
"bbox": [
|
| 561 |
+
174,
|
| 562 |
+
720,
|
| 563 |
+
346,
|
| 564 |
+
736
|
| 565 |
+
],
|
| 566 |
+
"page_idx": 5
|
| 567 |
+
},
|
| 568 |
+
{
|
| 569 |
+
"type": "text",
|
| 570 |
+
"text": "We next explore how well AdamW and SGD optimize ViT models with the two stem types. We consider the following grid of $4 8 \\ \\mathrm { V i T }$ experiments: $\\{ P , C \\}$ stems × {1, 4, 18} GF sizes $\\times$ {50, 100, 200, 400} epochs $\\times$ {AdamW, SGD} optimizers. As a reference, we also train 24 RegNetY baselines, one for each complexity regime, epoch length, and optimizer. ",
|
| 571 |
+
"bbox": [
|
| 572 |
+
174,
|
| 573 |
+
747,
|
| 574 |
+
825,
|
| 575 |
+
804
|
| 576 |
+
],
|
| 577 |
+
"page_idx": 5
|
| 578 |
+
},
|
| 579 |
+
{
|
| 580 |
+
"type": "text",
|
| 581 |
+
"text": "Results. Figure 3 shows the results. As a baseline, RegNetY models show virtually no gap when trained using either SGD or AdamW (the difference ${ \\sim } 0 . 1 { - } 0 . 2 \\%$ is within noise). On the other hand, $V i T _ { P }$ models suffer a dramatic drop when trained with SGD across all settings (of up to $10 \\%$ for larger models and longer training schedules). With a convolutional stem, $\\mathrm { V i T } _ { C }$ models exhibit much smaller error gaps between SGD and AdamW across all training schedules and model complexities, including in larger models and longer schedules, where the gap is reduced to less than $0 . 2 \\%$ . In other words, both RegNetY and $\\mathrm { V i T } _ { C }$ can be easily trained via either SGD or AdamW, but $\\mathrm { V i T } _ { P }$ cannot. ",
|
| 582 |
+
"bbox": [
|
| 583 |
+
174,
|
| 584 |
+
814,
|
| 585 |
+
825,
|
| 586 |
+
911
|
| 587 |
+
],
|
| 588 |
+
"page_idx": 5
|
| 589 |
+
},
|
| 590 |
+
{
|
| 591 |
+
"type": "image",
|
| 592 |
+
"img_path": "images/aba9b861e8efcb57d826b09c432be1e0382b373a7817ab870f1aaced18950672.jpg",
|
| 593 |
+
"image_caption": [
|
| 594 |
+
"Figure 4: Hyperparameter stability for AdamW $_ { l r }$ and ${ \\pmb w d }$ ): For each model, we train 64 instances of the model for 50 epochs each with a random1.0 $l r$ and $w d$ (in a fixed width interval around the optimal value for each model). Top: Scatterplots of the $l r$ , $w d$ , and $l r$ ·wd for three 4GF models. Vertical bars indicate optimal $l r , w d$ , and $l r \\cdot w d$ values for each model. Bottom: For each model, we generate an EDF of the errors by plotting the cumulative distribution of the 0.6 $\\Delta$ top-1 errors ( $\\Delta$ to the optimal error for each model). A steeper EDF indicates better stability to 0.4 1GF models 4G $l r$ and odels $w d$ variation. $\\mathrm { V i T } _ { C }$ significantly18GF models improves the stability over the baseline0.2 ViTC $\\mathrm { V i T } _ { P }$ across the model complexity spectrum, and matches orViTC ViTC even outperforms the stability of the CNN model (RegNetY).0.0 RegNetY R "
|
| 595 |
+
],
|
| 596 |
+
"image_footnote": [],
|
| 597 |
+
"bbox": [
|
| 598 |
+
173,
|
| 599 |
+
89,
|
| 600 |
+
825,
|
| 601 |
+
304
|
| 602 |
+
],
|
| 603 |
+
"page_idx": 6
|
| 604 |
+
},
|
| 605 |
+
{
|
| 606 |
+
"type": "image",
|
| 607 |
+
"img_path": "images/be011ecde540fa81014ef4ee685adfdc4ac01205383316fdb5d9823fcc557d92.jpg",
|
| 608 |
+
"image_caption": [
|
| 609 |
+
"Figure 5: Hyperparameter stability for SGD $_ { L r }$ and ${ \\pmb w d }$ ): We repeat the setup from Figure 4 using SGD instead of AdamW. The stability improvement of $\\mathrm { V i T } _ { C }$ over the baseline $\\mathrm { V i T } _ { P }$ is even larger than with AdamW. $E . g$ ., ${ \\sim } 6 0 \\%$ of $\\mathrm { V i T } _ { C }$ -18GF models are within $4 \\%$ $\\Delta$ top-1 error of the best result, while less than $20 \\%$ of $\\mathrm { V i T } _ { P }$ -18GF models are (in fact most $\\mathrm { V i T } _ { P }$ -18GF runs don’t converge). "
|
| 610 |
+
],
|
| 611 |
+
"image_footnote": [],
|
| 612 |
+
"bbox": [
|
| 613 |
+
174,
|
| 614 |
+
440,
|
| 615 |
+
823,
|
| 616 |
+
549
|
| 617 |
+
],
|
| 618 |
+
"page_idx": 6
|
| 619 |
+
},
|
| 620 |
+
{
|
| 621 |
+
"type": "text",
|
| 622 |
+
"text": "5.3 Learning Rate and Weight Decay Stability ",
|
| 623 |
+
"text_level": 1,
|
| 624 |
+
"bbox": [
|
| 625 |
+
173,
|
| 626 |
+
643,
|
| 627 |
+
506,
|
| 628 |
+
660
|
| 629 |
+
],
|
| 630 |
+
"page_idx": 6
|
| 631 |
+
},
|
| 632 |
+
{
|
| 633 |
+
"type": "text",
|
| 634 |
+
"text": "Next, we characterize how sensitive different model families are to changes in learning rate $( l r )$ and weight decay $( w d )$ under both AdamW and SGD optimizers. To quantify this, we make use of error distribution functions (EDFs) [30]. An EDF is computed by sorting a set of results from low-to-high error and plotting the cumulative proportion of results as error increases, see [30] for details. In particular, we generate EDFs of a model as a function of $l r$ and $w d$ . The intuition is that if a model is robust to these hyperparameter choices, the EDF will be steep (all models will perform similarly), while if the model is sensitive, the EDF will be shallow (performance will be spread out). ",
|
| 635 |
+
"bbox": [
|
| 636 |
+
173,
|
| 637 |
+
671,
|
| 638 |
+
825,
|
| 639 |
+
768
|
| 640 |
+
],
|
| 641 |
+
"page_idx": 6
|
| 642 |
+
},
|
| 643 |
+
{
|
| 644 |
+
"type": "text",
|
| 645 |
+
"text": "We test 6 ViT models $( \\{ P , C \\} \\times \\{ 1 , 4 , 1 8 \\} \\mathrm { G F ) }$ and 3 RegNetY models ({1, 4, 16} GF). For each model and each optimizer, we compute an EDF by randomly sampling 64 $( l r , w d )$ pairs with learning rate and weight decay sampled in a fixed width interval around their optimal values for that model and optimizer (see the Appendix for sampling details). Rather than plotting absolute error in the EDF, we plot $\\Delta$ top-1 error between the best result (obtained with the optimal $l r$ and $w d$ ) and the observed result. Due to the large number of models, we train each for only 50 epochs. ",
|
| 646 |
+
"bbox": [
|
| 647 |
+
174,
|
| 648 |
+
775,
|
| 649 |
+
825,
|
| 650 |
+
859
|
| 651 |
+
],
|
| 652 |
+
"page_idx": 6
|
| 653 |
+
},
|
| 654 |
+
{
|
| 655 |
+
"type": "text",
|
| 656 |
+
"text": "Results. Figure 4 shows scatterplots and EDFs for models trained by AdamW. Figure 5 shows SGD results. In all cases we see that $\\mathrm { V i T } _ { C }$ significantly improves the $l r$ and $w d$ stability over $\\mathrm { V i T } _ { P }$ for both optimizers. This indicates that the $l r$ and $w d$ are easier to optimize for $\\mathrm { V i T } _ { C }$ than for $\\mathrm { V i T } _ { P }$ . ",
|
| 657 |
+
"bbox": [
|
| 658 |
+
174,
|
| 659 |
+
869,
|
| 660 |
+
825,
|
| 661 |
+
911
|
| 662 |
+
],
|
| 663 |
+
"page_idx": 6
|
| 664 |
+
},
|
| 665 |
+
{
|
| 666 |
+
"type": "text",
|
| 667 |
+
"text": "5.4 Experimental Details ",
|
| 668 |
+
"text_level": 1,
|
| 669 |
+
"bbox": [
|
| 670 |
+
174,
|
| 671 |
+
90,
|
| 672 |
+
359,
|
| 673 |
+
106
|
| 674 |
+
],
|
| 675 |
+
"page_idx": 7
|
| 676 |
+
},
|
| 677 |
+
{
|
| 678 |
+
"type": "text",
|
| 679 |
+
"text": "In all experiments we train with a single half-period cosine learning rate decay schedule with a 5-epoch linear learning rate warm-up [16]. We use a minibatch size of 2048. Crucially, weight decay is not applied to the gain factors found in normalization layers nor to bias parameters anywhere in the model; we found that decaying these parameters can dramatically reduce top-1 accuracy for small models and short schedules. For inference, we use an exponential moving average (EMA) of the model weights (e.g., [8]). The $l r$ and $w d$ used in this section are reported in the Appendix. Other hyperparameters use defaults: SGD momentum is 0.9 and AdamW’s $\\beta _ { 1 } = 0 . 9$ and $\\beta _ { 2 } = 0 . 9 9 9$ . ",
|
| 680 |
+
"bbox": [
|
| 681 |
+
174,
|
| 682 |
+
117,
|
| 683 |
+
825,
|
| 684 |
+
214
|
| 685 |
+
],
|
| 686 |
+
"page_idx": 7
|
| 687 |
+
},
|
| 688 |
+
{
|
| 689 |
+
"type": "text",
|
| 690 |
+
"text": "Regularization and data augmentation. We use a simplified training recipe compared to recent work such as DeiT [41], which we found to be equally effective across a wide spectrum of model complexities and dataset scales. We use AutoAugment [7], mixup [52] $\\langle \\alpha = 0 . 8 \\rangle$ ), CutMix [51] $\\alpha = 1 . 0$ ), and label smoothing [38] $\\epsilon = 0 . 1$ ). We prefer this setup because it is similar to common settings for CNNs (e.g., [12]) except for stronger mixup and the addition of CutMix (ViTs benefit from both, while CNNs are not harmed). We compare this recipe to the one used for DeiT models in the Appendix, and observe that our setup provides substantially faster training convergence likely because we remove repeating augmentation [1, 20], which is known to slow training [1]. ",
|
| 691 |
+
"bbox": [
|
| 692 |
+
173,
|
| 693 |
+
224,
|
| 694 |
+
825,
|
| 695 |
+
335
|
| 696 |
+
],
|
| 697 |
+
"page_idx": 7
|
| 698 |
+
},
|
| 699 |
+
{
|
| 700 |
+
"type": "text",
|
| 701 |
+
"text": "6 Peak Performance ",
|
| 702 |
+
"text_level": 1,
|
| 703 |
+
"bbox": [
|
| 704 |
+
174,
|
| 705 |
+
354,
|
| 706 |
+
357,
|
| 707 |
+
372
|
| 708 |
+
],
|
| 709 |
+
"page_idx": 7
|
| 710 |
+
},
|
| 711 |
+
{
|
| 712 |
+
"type": "text",
|
| 713 |
+
"text": "A model’s peak performance is the most commonly used metric in network design. It represents what is possible with the best-known-so-far settings and naturally evolves over time. Making fair comparisons between different models is desirable but fraught with difficulty. Simply citing results from prior work may be negatively biased against that work as it was unable to incorporate newer, yet applicable improvements. Here, we strive to provide a fairer comparison between state-of-the-art CNNs, $\\mathrm { V i T } _ { P }$ , and $\\mathrm { V i T } _ { C }$ . We identify a set of factors and then strike a pragmatic balance between which subset to optimize for each model vs. which subset share a constant value across all models. ",
|
| 714 |
+
"bbox": [
|
| 715 |
+
174,
|
| 716 |
+
386,
|
| 717 |
+
825,
|
| 718 |
+
483
|
| 719 |
+
],
|
| 720 |
+
"page_idx": 7
|
| 721 |
+
},
|
| 722 |
+
{
|
| 723 |
+
"type": "text",
|
| 724 |
+
"text": "In our comparison, all models share the same epochs (400), use of model weight EMA, and set of regularization and augmentation methods (as specified in $\\ S \\quad ,$ . All CNNs are trained with SGD with $l r$ of 2.54 and wd of $2 . 4 \\mathrm { e } { - 5 }$ ; we found this single choice worked well across all models, as similarly observed in [12]. For all ViT models we found AdamW with a $l r / w d$ of $1 . 0 \\mathrm { { e - } 3 / 0 . 2 4 }$ was effective, except for the 36GF models. For these larger models we tested a few settings and found a $l r / w d$ of $6 . 0 \\mathrm { { e } - 4 / 0 . 2 8 }$ to be more effective for both $\\mathrm { V i T } _ { P ^ { - 3 6 } } \\mathrm { G F }$ and $\\mathrm { V i T } _ { C }$ -36GF models. For training and inference, ViTs use $2 2 4 \\times 2 2 4$ resolution (we do not fine-tune at higher resolutions), while the CNNs use (often larger) optimized resolutions specified in [12, 39]. Given this protocol, we compare $\\mathrm { V i T } _ { P }$ , $\\mathrm { V i T } _ { C }$ , and CNNs across a spectrum of model complexities (1GF to 36GF) and dataset scales (directly training on ImageNet-1k vs. pretraining on ImageNet-21k and then fine-tuning on ImageNet-1k). ",
|
| 725 |
+
"bbox": [
|
| 726 |
+
173,
|
| 727 |
+
489,
|
| 728 |
+
825,
|
| 729 |
+
628
|
| 730 |
+
],
|
| 731 |
+
"page_idx": 7
|
| 732 |
+
},
|
| 733 |
+
{
|
| 734 |
+
"type": "text",
|
| 735 |
+
"text": "Results. Figure 6 shows a progression of results. Each plot shows ImageNet-1k val top-1 error vs. ImageNet-1k epoch training time.1 The left plot compares several state-of-the-art CNNs. RegNetY and RegNetZ [12] achieve similar results across the training speed spectrum and outperform EfficientNets [39]. Surprisingly, ResNets [19] are highly competitive at fast runtimes, showing that under a fairer comparison these years-old models perform substantially better than often reported (cf . [39]). ",
|
| 736 |
+
"bbox": [
|
| 737 |
+
174,
|
| 738 |
+
638,
|
| 739 |
+
825,
|
| 740 |
+
708
|
| 741 |
+
],
|
| 742 |
+
"page_idx": 7
|
| 743 |
+
},
|
| 744 |
+
{
|
| 745 |
+
"type": "text",
|
| 746 |
+
"text": "The middle plot compares two representative CNNs (ResNet and RegNetY) to ViTs, still using only ImageNet-1k training. The baseline $\\mathrm { V i T } _ { P }$ underperforms RegNetY across the entire model complexity spectrum. To our surprise, $V i T _ { P }$ also underperforms ResNets in this regime. $\\mathrm { V i T } _ { C }$ is more competitive and outperforms CNNs in the middle-complexity range. ",
|
| 747 |
+
"bbox": [
|
| 748 |
+
174,
|
| 749 |
+
714,
|
| 750 |
+
825,
|
| 751 |
+
771
|
| 752 |
+
],
|
| 753 |
+
"page_idx": 7
|
| 754 |
+
},
|
| 755 |
+
{
|
| 756 |
+
"type": "text",
|
| 757 |
+
"text": "The right plot compares the same models but with ImageNet-21k pretraining (details in Appendix). In this setting ViT models demonstrates a greater capacity to benefit from the larger-scale data: now $\\mathrm { V i T } _ { C }$ strictly outperforms both $\\mathrm { V i T } _ { P }$ and RegNetY. Interestingly, the original $V i T _ { P }$ does not outperform a state-of-the-art CNN even when trained on this much larger dataset. Numerical results are presented in Table 2 for reference to exact values. This table also highlights that flop counts are not significantly correlated with runtime, but that activations are (see Appendix for more details), as also observed by [12]. $E . g .$ ., EfficientNets are slow relative to their flops while ViTs are fast. ",
|
| 758 |
+
"bbox": [
|
| 759 |
+
174,
|
| 760 |
+
776,
|
| 761 |
+
825,
|
| 762 |
+
875
|
| 763 |
+
],
|
| 764 |
+
"page_idx": 7
|
| 765 |
+
},
|
| 766 |
+
{
|
| 767 |
+
"type": "image",
|
| 768 |
+
"img_path": "images/294e2fe483ed1695691c2b1470b6210c847eef9d58f017019c1c1cfd8b31695c.jpg",
|
| 769 |
+
"image_caption": [
|
| 770 |
+
"Figure 6: Peak performance (epoch training time vs. ImageNet-1k val top-1 error): Results of a fair, controlled comparison of $\\mathrm { V i T } _ { P }$ , $\\mathrm { V i T } _ { C }$ , and CNNs. Each curve corresponds to a model complexity sweep resulting in a training speed spectrum (minutes per ImageNet-1k epoch). Left: State-of-the-art CNNs. Equipped with a modern training recipe, ResNets are highly competitive in the faster regime, while RegNetY and Z perform similarly, and better than EfficientNets. Middle: Selected CNNs compared to ViTs. With access to only ImageNet-1k training data, RegNetY and ResNet outperform $\\mathrm { V i T } _ { P }$ across the board. $\\mathrm { V i T } _ { C }$ is more competitive with CNNs. Right: Pretraining on ImageNet-21k improves the ViT models more than the CNNs, making $\\mathrm { V i T } _ { P }$ competitive. Here, the proposed $\\mathrm { V i T } _ { C }$ outperforms all other models across the full training speed spectrum. ",
|
| 771 |
+
"Table 2: Peak performance (grouped by model family): Model complexity and validation top-1 error at 100, 200, and 400 epoch schedules on ImageNet-1k, and the top-1 error after pretraining on ImageNet-21k (IN 21k) and fine-tuning on ImageNet-1k. This table serves as reference for the results shown in Figure 6. Blue numbers: best model trainable under 20 minutes per ImageNet-1k epoch. Batch sizes and training times are reported normalized to 8 32GB Volta GPUs (see Appendix). Additional results on the ImageNet-V2 [33] test set are presented in the Appendix. "
|
| 772 |
+
],
|
| 773 |
+
"image_footnote": [],
|
| 774 |
+
"bbox": [
|
| 775 |
+
178,
|
| 776 |
+
89,
|
| 777 |
+
816,
|
| 778 |
+
198
|
| 779 |
+
],
|
| 780 |
+
"page_idx": 8
|
| 781 |
+
},
|
| 782 |
+
{
|
| 783 |
+
"type": "table",
|
| 784 |
+
"img_path": "images/bfee31f4a850d3ac234c45e7f45341c3c4f9311de9e2162c5b1cbf2aa1a80323.jpg",
|
| 785 |
+
"table_caption": [],
|
| 786 |
+
"table_footnote": [],
|
| 787 |
+
"table_body": "<table><tr><td rowspan=\"2\">model</td><td colspan=\"2\">flops params acts</td><td colspan=\"2\"></td><td rowspan=\"2\">time batch|</td><td colspan=\"2\">epochs</td><td rowspan=\"2\"></td><td rowspan=\"2\">IN 21k</td><td rowspan=\"2\">model (B)</td><td colspan=\"3\">flops params</td><td rowspan=\"2\">time batch|</td><td rowspan=\"2\">size</td><td colspan=\"2\">epochs</td><td rowspan=\"2\">IN</td><td rowspan=\"2\">200400 21k</td></tr><tr><td>(B)</td><td>(M)</td><td>(M) (min)</td><td>size</td><td>100</td><td>200400</td><td></td><td>(M)</td><td>(min)</td><td>100</td></tr><tr><td>ResNet-50</td><td>4.1</td><td>25.6</td><td>11.3</td><td>3.4</td><td>2048</td><td>22.5</td><td>21.2</td><td>20.7</td><td>21.6</td><td>EffNet-B2</td><td>1.0</td><td>9.1</td><td>(M) 13.8</td><td>5.9</td><td>2048</td><td></td><td>21.4 20.5</td><td>19.9</td><td>-</td></tr><tr><td>ResNet-101</td><td>7.8</td><td>44.5</td><td>16.4</td><td>5.5</td><td>2048</td><td>20.3</td><td>19.1</td><td>18.5</td><td>19.2</td><td>EffNet-B4</td><td>4.4</td><td>19.3</td><td>49.5</td><td>19.4</td><td>512</td><td>18.5</td><td>17.8</td><td>17.5</td><td></td></tr><tr><td>ResNet-152</td><td>11.5</td><td>60.2</td><td>22.8</td><td>7.7</td><td>2048</td><td>19.5</td><td>18.417.7</td><td></td><td>18.2</td><td>EffNet-B5</td><td>10.3</td><td>30.4</td><td>98.9 41.7</td><td></td><td>256</td><td>17.3</td><td>317.0</td><td>17.0</td><td></td></tr><tr><td>ResNet-200</td><td>15.0</td><td>64.7</td><td>32.3</td><td>10.7</td><td>1024</td><td>19.5</td><td>18.3</td><td>17.6</td><td>17.7</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>RegNetY-1GF</td><td>1.0</td><td>9.6</td><td>6.2</td><td>3.1</td><td>2048</td><td>23.2</td><td>22.2</td><td>21.5</td><td>-</td><td>ViTp-1GF</td><td>1.1</td><td>4.8</td><td>5.5</td><td>2.6</td><td>2048</td><td>33.2</td><td>29.7</td><td>27.7</td><td></td></tr><tr><td>RegNetY-4GF</td><td>4.1</td><td>22.4</td><td>14.5</td><td>7.6</td><td>2048</td><td>19.4</td><td>18.3</td><td>17.9</td><td>18.4</td><td>ViTp-4GF</td><td>3.9</td><td>18.51</td><td>11.1</td><td></td><td>3.82048</td><td></td><td>23.3 20.8</td><td>19.6</td><td>20.6</td></tr><tr><td>RegNetY-16GF</td><td>15.5</td><td>72.3</td><td>30.7</td><td>17.9</td><td>1024</td><td>17.1</td><td>16.4</td><td>16.3</td><td>15.6</td><td>ViTp-18GF</td><td>17.5</td><td>86.6</td><td>24.0</td><td>11.5</td><td>1024</td><td></td><td>19.918.4</td><td>17.9</td><td>16.4</td></tr><tr><td>RegNetY-32GF</td><td>31.1</td><td>128.6</td><td>46.2</td><td>35.1</td><td>512</td><td>16.2</td><td>15.9</td><td>15.9</td><td>15.0</td><td>ViTp-36GF</td><td>35.9</td><td>178.4</td><td>37.3</td><td>18.8</td><td>512</td><td>19.9</td><td>18.8</td><td>18.2</td><td>15.1</td></tr><tr><td>RegNetZ-1GF</td><td>1.0</td><td>11.0</td><td>8.8</td><td>4.2</td><td>2048</td><td></td><td>20.8 20.2</td><td>19.6</td><td>-</td><td>ViTc-1GF</td><td>1.1</td><td>4.6</td><td>5.7</td><td>2.7</td><td>2048</td><td></td><td>28.626.1</td><td>24.7</td><td>-</td></tr><tr><td>RegNetZ-4GF</td><td>4.0</td><td>28.1</td><td>24.3</td><td>12.9</td><td>1024</td><td></td><td>17.4 16.9</td><td>16.6</td><td></td><td>ViTc-4GF</td><td>4.0</td><td>17.8</td><td>11.3</td><td>3.9</td><td>)2048</td><td></td><td>20.919.2</td><td>18.6</td><td>18.8</td></tr><tr><td>RegNetZ-16GF</td><td>16.0</td><td>95.3</td><td>51.3</td><td>32.0</td><td>512</td><td></td><td>16.0 15.9</td><td>15.9</td><td></td><td>ViTc-18GF</td><td>17.7</td><td>81.624.1</td><td></td><td>11.4</td><td>1024</td><td></td><td>18.4 17.5</td><td>17.0</td><td>15.1</td></tr><tr><td>RegNetZ-32GF</td><td>32.0</td><td>175.1</td><td></td><td>79.6 55.3</td><td>256</td><td></td><td>16.3 16.2</td><td>16.1</td><td></td><td>ViTc-36GF</td><td>35.0</td><td>167.8 36.7</td><td></td><td>18.6</td><td>512</td><td></td><td>18.3 17.6</td><td>16.8</td><td>14.2</td></tr></table>",
|
| 788 |
+
"bbox": [
|
| 789 |
+
173,
|
| 790 |
+
338,
|
| 791 |
+
821,
|
| 792 |
+
483
|
| 793 |
+
],
|
| 794 |
+
"page_idx": 8
|
| 795 |
+
},
|
| 796 |
+
{
|
| 797 |
+
"type": "text",
|
| 798 |
+
"text": "These results verify that $\\mathrm { V i T } _ { C }$ ’s convolutional stem improves not only optimization stability, as seen in the previous section, but also peak performance. Moreover, this benefit can be seen across the model complexity and dataset scale spectrum. Perhaps surprisingly, given the recent excitement over ViT, we find that $\\mathrm { V i T } _ { P }$ struggles to compete with state-of-the-art CNNs. We only observe improvements over CNNs when using both large-scale pretraining data and the proposed convolutional stem. ",
|
| 799 |
+
"bbox": [
|
| 800 |
+
174,
|
| 801 |
+
585,
|
| 802 |
+
825,
|
| 803 |
+
656
|
| 804 |
+
],
|
| 805 |
+
"page_idx": 8
|
| 806 |
+
},
|
| 807 |
+
{
|
| 808 |
+
"type": "text",
|
| 809 |
+
"text": "7 Conclusion ",
|
| 810 |
+
"text_level": 1,
|
| 811 |
+
"bbox": [
|
| 812 |
+
174,
|
| 813 |
+
674,
|
| 814 |
+
299,
|
| 815 |
+
693
|
| 816 |
+
],
|
| 817 |
+
"page_idx": 8
|
| 818 |
+
},
|
| 819 |
+
{
|
| 820 |
+
"type": "text",
|
| 821 |
+
"text": "In this work we demonstrated that the optimization challenges of ViT models are linked to the largestride, large-kernel convolution in ViT’s patchify stem. The seemingly trivial change of replacing this patchify stem with a simple convolutional stem leads to a remarkable change in optimization behavior. With the convolutional stem, ViT (termed $\\mathrm { V i T } _ { C }$ ) converges faster than the original ViT (termed $\\mathrm { V i T } _ { P }$ ) (§5.1), trains well with either AdamW or SGD (§5.2), improves learning rate and weight decay stability (§5.3), and improves ImageNet top-1 error by ${ \\sim } 1 { - } 2 \\%$ (§6). These results are consistent across a wide spectrum of model complexities (1GF to 36GF) and dataset scales (ImageNet-1k to ImageNet-21k). Our results indicate that injecting a small dose of convolutional inductive bias into the early stages of ViTs can be hugely beneficial. Looking forward, we are interested in the theoretical foundation of why such a minimal architectural modification can have such large (positive) impact on optimizability. We are also interested in studying larger models. Our preliminary explorations into 72GF models reveal that the convolutional stem still improves top-1 error, however we also find that a new form of instability arises that causes training error to randomly spike, especially for $\\mathrm { V i T } _ { C }$ . ",
|
| 822 |
+
"bbox": [
|
| 823 |
+
173,
|
| 824 |
+
707,
|
| 825 |
+
825,
|
| 826 |
+
886
|
| 827 |
+
],
|
| 828 |
+
"page_idx": 8
|
| 829 |
+
},
|
| 830 |
+
{
|
| 831 |
+
"type": "text",
|
| 832 |
+
"text": "Acknowledgements. We thank Hervé Jegou, Hugo Touvron, and Kaiming He for valuable feedback. ",
|
| 833 |
+
"bbox": [
|
| 834 |
+
169,
|
| 835 |
+
897,
|
| 836 |
+
767,
|
| 837 |
+
911
|
| 838 |
+
],
|
| 839 |
+
"page_idx": 8
|
| 840 |
+
}
|
| 841 |
+
]
|
parse/train/Lpfh1Bpqfk/Lpfh1Bpqfk_middle.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/Lpfh1Bpqfk/Lpfh1Bpqfk_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/PS3IMnScugk/PS3IMnScugk.md
ADDED
|
@@ -0,0 +1,628 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING TO RECOMBINE AND RESAMPLE DATA FOR COMPOSITIONAL GENERALIZATION
|
| 2 |
+
|
| 3 |
+
Ekin Akyürek MIT CSAIL akyurek@mit.edu
|
| 4 |
+
|
| 5 |
+
Afra Feyza Akyürek Boston University akyurek@bu.edu
|
| 6 |
+
|
| 7 |
+
Jacob Andreas MIT CSAIL jda@mit.edu
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
Flexible neural sequence models outperform grammar- and automaton-based counterparts on a variety of tasks. However, neural models perform poorly in settings requiring compositional generalization beyond the training data—particularly to rare or unseen subsequences. Past work has found symbolic scaffolding (e.g. grammars or automata) essential in these settings. We describe R&R, a learned data augmentation scheme that enables a large category of compositional generalizations without appeal to latent symbolic structure. R&R has two components: recombination of original training examples via a prototype-based generative model and resampling of generated examples to encourage extrapolation. Training an ordinary neural sequence model on a dataset augmented with recombined and resampled examples significantly improves generalization in two language processing problems—instruction following (SCAN) and morphological analysis (SIGMORPHON 2018)—where R&R enables learning of new constructions and tenses from as few as eight initial examples.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
How can we build machine learning models with the ability to learn new concepts in context from little data? Human language learners acquire new word meanings from a single exposure (Carey & Bartlett, 1978), and immediately incorporate words and their meanings productively and compositionally into larger linguistic and conceptual systems (Berko, 1958; Piantadosi & Aslin, 2016). Despite the remarkable success of neural network models on many learning problems in recent years—including one-shot learning of classifiers and policies (Santoro et al., 2016; Wang et al., 2016)—this kind of few-shot learning of composable concepts remains beyond the reach of standard neural models in both diagnostic and naturalistic settings (Lake & Baroni, 2018; Bahdanau et al., 2019a).
|
| 16 |
+
|
| 17 |
+
Consider the few-shot morphology learning problem shown in Fig. 1, in which a learner must predict various linguistic features (e.g. 3rd person, SinGular, PRESent tense) from word forms, with only a small number of examples of the PAST tense in the training set. Neural sequenceto-sequence models (e.g. Bahdanau et al., 2015) trained on this kind of imbalanced data fail to predict past-tense tags on held-out inputs of any kind (Section 5). Previous attempts to address this and related shortcomings in neural models have focused on explicitly encouraging rule-like behavior by e.g. modeling data with symbolic grammars (Jia & Liang, 2016; Xiao et al., 2016; Cai et al., 2017) or applying rule-based data augmentation (Andreas, 2020). These procedures involve highly task-specific models or generative assumptions, preventing them from generalizing effectively to less structured problems that combine rule-like and exceptional behavior. More fundamentally, they fail to answer the question of whether explicit rules are necessary for compositional inductive bias, and whether it is possible to obtain “rule-like” inductive bias without appeal to an underlying symbolic generative process.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: We first train a generative model to reconstruct training pairs $( x \triangleright y )$ by constructing them from other training pairs (a). We then perform data augmentation by sampling from this model, preferentially generating samples in which $_ y$ contains rare tokens or substructures (b). Dashed boxes show prediction targets. Conditional models trained on the augmented dataset accurately predict outputs $_ y$ from new inputs $_ x$ requiring compositional generalization (c).
|
| 21 |
+
|
| 22 |
+
This paper describes a procedure for improving few-shot compositional generalization in neural sequence models without symbolic scaffolding. Our key insight is that even fixed, imbalanced training datasets provide a rich source of supervision for few-shot learning of concepts and composition rules. In particular, we propose a new class of prototype-based neural sequence models (c.f. Gu et al., 2018) that can be directly trained to perform the kinds of generalization exhibited in Fig. 1 by explicitly recombining fragments of training examples to reconstruct other examples. Even when these prototype-based models are not effective as general-purpose predictors, we can resample their outputs to select high-quality synthetic examples of rare phenomena. Ordinary neural sequence models may then be trained on datasets augmented with these synthetic examples, distilling the learned regularities into more flexible predictors. This procedure, which we abbreviate R&R, promotes efficient generalization in both challenging synthetic sequence modeling tasks (Lake & Baroni, 2018) and morphological analysis in multiple natural languages (Cotterell et al., 2018).
|
| 23 |
+
|
| 24 |
+
By directly optimizing for the kinds of generalization that symbolic representations are supposed to support, we can bypass the need for symbolic representations themselves: R&R gives performance comparable to or better than state-of-the-art neuro-symbolic approaches on tests of compositional generalization. Our results suggest that some failures of systematicity in neural models can be explained by simpler structural constraints on data distributions and corrected with weaker inductive bias than previously described.1
|
| 25 |
+
|
| 26 |
+
# 2 BACKGROUND AND RELATED WORK
|
| 27 |
+
|
| 28 |
+
Compositional generalization Systematic compositionality—the capacity to identify rule-like regularities from limited data and generalize these rules to novel situations—is an essential feature of human reasoning (Fodor et al., 1988). While details vary, a common feature of existing attempts to formalize systematicity in sequence modeling problems (e.g. Gordon et al., 2020) is the intuition that learners should make accurate predictions in situations featuring novel combinations of previously observed input or output subsequences. For example, learners should generalize from actions seen in isolation to more complex commands involving those actions (Lake et al., 2019), and from relations of the form $\boldsymbol { \Gamma } ( \mathsf { a } , \mathsf { b } )$ to ${ \sf r } ( { \sf b } , \sf a )$ (Keysers et al., 2020; Bahdanau et al., 2019b). In machine learning, previous studies have found that standard neural architectures fail to generalize systematically even when they achieve high in-distribution accuracy in a variety of settings (Lake & Baroni, 2018; Bastings et al., 2018; Johnson et al., 2017).
|
| 29 |
+
|
| 30 |
+
Data augmentation and resampling Learning to predict sequential outputs with rare or novel subsequences is related to the widely studied problem of class imbalance in classification problems. There, undersampling of the majority class or oversampling of the minority class has been found to improve the quality of predictions for rare phenomena (Japkowicz et al., 2000). This can be combined with targeted data augmentation with synthetic examples of the minority class (Chawla et al., 2002). Generically, given a training dataset $\mathcal { D }$ , learning with class resampling and data augmentation involves defining an augmentation distribution $\tilde { p ( \boldsymbol { x } , \boldsymbol { y } \mid \boldsymbol { D } ) }$ and sample weighting function $u ( x , y )$ and maximizing a training objective of the form:
|
| 31 |
+
|
| 32 |
+
$$
|
| 33 |
+
\begin{array} { r } { \mathcal { L } ( \theta ) = \underbrace { \frac { 1 } { | \mathcal { D } | } \sum _ { x \in \mathcal { D } } \log p _ { \theta } ( y \mid x ) } _ { \mathrm { O r i g i n a l t r a i n i n g d a t a } } + \underbrace { { \mathbb { E } } _ { ( x , y ) \sim \tilde { p } } u ( x , y ) \log p _ { \theta } ( y \mid x ) } _ { \mathrm { A u g m e n t e d d a t a } } . } \end{array}
|
| 34 |
+
$$
|
| 35 |
+
|
| 36 |
+
In addition to task-specific model architectures (Andreas et al., 2016; Russin et al., 2019), recent years have seen a renewed interest in data augmentation as a flexible and model-agnostic tool for encouraging controlled generalization (Ratner et al., 2017). Existing proposals for sequence models are mainly rule-based—in sequence modeling problems, specifying a synchronous context-free grammar (Jia & Liang, 2016) or string rewriting system (Andreas, 2020) to generate new examples. Rule-based data augmentation schemes that recombine multiple training examples have been proposed for image classification (Inoue, 2018) and machine translation (Fadaee et al., 2017). While rulebased data augmentation is highly effective in structured problems featuring crisp correspondences between inputs and outputs, the effectiveness of such approaches involving more complicated, context-dependent relationships between inputs and outputs has not been well-studied.
|
| 37 |
+
|
| 38 |
+
Learned data augmentation What might compositional data augmentation look like without rules as a source of inductive bias? As Fig. 1 suggests, an ideal data augmentation procedure $\tilde { p }$ in Eq. 1) should automatically identify valid ways of transforming and combining examples, without pre-committing to a fixed set of transformations.2 A promising starting point is provided by prototype-based models, a number of which (Gu et al., 2018; Guu et al., 2018; Khandelwal et al., 2020) have been recently proposed for sequence modeling. Such models generate data according to:
|
| 39 |
+
|
| 40 |
+
$$
|
| 41 |
+
d \sim p _ { \mathrm { r e w r i t e } } ( \cdot \mid d ^ { \prime } ; \theta ) \quad \mathrm { w h e r e } \quad d ^ { \prime } \sim \mathrm { U n i f } ( \mathcal { D } ) ;
|
| 42 |
+
$$
|
| 43 |
+
|
| 44 |
+
for a dataset $\mathcal { D }$ and a learned sequence rewriting model $p _ { \mathrm { r e w r i t e } } ( d \mid d ^ { \prime } ; \theta )$ . (To avoid confusion, we will use the symbol $d$ to denote a datum. Because a data augmentation procedure must produce complete input–output examples, each $d$ is an $( x , y )$ pair for the conditional tasks evaluated in this paper.) While recent variants implement $p _ { \mathrm { r e w r i t e } }$ with neural networks, these models are closely related to classical kernel density estimators (Rosenblatt, 1956). But additionally—building on the motivation in Section 1—they may be viewed as one-shot learners trained to generate new data $d$ from a single example.
|
| 45 |
+
|
| 46 |
+
Existing work uses prototype-based models as replacements for standard sequence models. We will show here that they are even better suited to use as data augmentation procedures: they can produce high-precision examples in the neighborhood of existing training data, then be used to bootstrap simpler predictors that extrapolate more effectively. But our experiments will also show that existing prototype-based models give mixed results on challenging generalizations of the kind depicted in Fig. 1 when used for either direct prediction or data augmentation—performing well in some settings but barely above baseline in others.
|
| 47 |
+
|
| 48 |
+
Accordingly, R&R is built on two model components that transform prototype-based language models into an effective learned data augmentation scheme. Section 3 describes an implementation of prewrite that encourages greater sample diversity and well-formedness via a multi-prototype copying mechanism (a two-shot learner). Section 4 describes heuristics for sampling prototypes $d ^ { \prime }$ and model outputs $d$ to focus data augmentation on the most informative examples. Section 5 investigates the empirical performance of both components of the approach, finding that they together provide they a simple but surprisingly effective tool for enabling compositional generalization.
|
| 49 |
+
|
| 50 |
+
# 3 PROTOTYPE-BASED SEQUENCE MODELS FOR DATA RECOMBINATION
|
| 51 |
+
|
| 52 |
+
We begin with a brief review of existing prototype-based sequence models. Our presentation mostly follows the retrieve-and-edit approach of Guu et al. (2018), but versions of the approach in this paper could also be built on retrieval-based models implemented with memory networks (Miller et al., 2016; Gu et al., 2018) or transformers (Khandelwal et al., 2020; Guu et al., 2020). The generative process described in Eq. 2 implies a marginal sequence probability:
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
p ( d ) = { \frac { 1 } { | { \mathcal { D } } | } } \sum _ { d ^ { \prime } \in { \mathcal { D } } } p _ { \mathrm { r e w r i t e } } ( d \mid d ^ { \prime } ; \theta )
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
Maximizing this quantity over the training set with respect to $\theta$ will encourage $p _ { \mathrm { r e w r i t e } }$ to act as a model of valid data transformations: To be assigned high probability, every training example must be explained by at least one other example and a parametric rewriting operation. (The trivial solution where $p _ { \theta }$ is the identity function, with $p _ { \theta } ( d \mid d ^ { \prime } = d ) = 1$ , can be ruled out manually in the design of $p _ { \theta }$ .) When $\mathcal { D }$ is large, the sum in Eq. 3 is too large to enumerate exhaustively when computing the marginal likelihood. Instead, we can optimize a lower bound by restricting the sum to a neighborhood $\bar { \mathcal { N } } ( d ) \subset \mathcal { D }$ of training examples around each $d$ :
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
p ( d ) \geq { \frac { 1 } { | { \mathcal { D } } | } } \sum _ { d ^ { \prime } \in { \mathcal { N } } ( d ) } p _ { \mathrm { r e w r i t e } } ( d \mid d ^ { \prime } ; \theta ) ~ .
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
The choice of $\mathcal { N }$ is discussed in more detail in Section 4. Now observe that:
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\begin{array} { l } { \displaystyle \log p ( { d } ) \geq \log \left( | \mathcal { N } ( d ) | \sum _ { d ^ { \prime } \in \mathcal { N } ( d ) } \frac { 1 } { | \mathcal { N } ( d ) | } p _ { \mathrm { r e w r i t e } } ( d \mid d ^ { \prime } ; \theta ) \right) - \log | \mathcal { D } | } \\ { \geq \displaystyle \frac { 1 } { | \mathcal { N } ( d ) | } \sum _ { d ^ { \prime } \in \mathcal { N } ( d ) } \log p _ { \mathrm { r e w r i t e } } ( d \mid d ^ { \prime } ; \theta ) + \log \left( \frac { | \mathcal { N } ( d ) | } { | \mathcal { D } | } \right) } \end{array}
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
where the second step uses Jensen’s inequality. If all $| \mathcal { N } ( d ) |$ are the same size, maximizing this lower bound on log-likelihood is equivalent to simply maximizing
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\sum _ { d ^ { \prime } \in \mathcal { N } ( d ) } \log p _ { \mathrm { r e w r i t e } } ( d \mid d ^ { \prime } ; \theta )
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
over $\mathcal { D }$ —this is the ordinary conditional likelihood for a string transducer (Ristad & Yianilos, 1998) or sequence-to-sequence model (Sutskever et al., 2014) with examples $d , d ^ { \prime } \in \mathcal { N } ( d )$ . 3
|
| 77 |
+
|
| 78 |
+
We have motivated prototype-based models by arguing that $p _ { \mathrm { r e w r i t e } }$ learns a model of transformations licensed by the training data. However, when generalization involves complex compositions, we will show that neither a basic RNN implementation of $p _ { \mathrm { r e w r i t e } }$ or a single prototype is enough; we must provide the learned rewriting model with a larger inventory of parts and encourage reuse of those parts as faithfully as possible. This motivates the two improvements on the prototype-based modeling framework described in the remainder of this section: generalization to multiple prototypes (Section 3.1) and a new rewriting model (Section 3.2).
|
| 79 |
+
|
| 80 |
+
# 3.1 $n$ -PROTOTYPE MODELS
|
| 81 |
+
|
| 82 |
+
To improve compositionality in prototype-based models, we equip them with the ability to condition on multiple examples simultaneously. We extend the basic prototype-based language model to $n$ prototypes, which we now refer to as a recombination model $p _ { \mathrm { r e c o m b } }$ :
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
d \sim p _ { \mathrm { r e c o m b } } ( \cdot \mid d _ { 1 : n } ^ { \prime } ; \theta ) \quad \mathrm { w h e r e } \quad d _ { 1 : n } ^ { \prime } \stackrel { \scriptscriptstyle \mathrm { d e f } } { = } ( d _ { 1 } ^ { \prime } , d _ { 2 } ^ { \prime } , \ldots , d _ { n } ^ { \prime } ) \sim p _ { \Omega } ( \cdot )
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
A multi-protype model may be viewed as a meta-learner (Thrun & Pratt, 1998; Santoro et al., 2016): it maps from a small number of examples (the prototypes) to a distribution over new datapoints consistent with those examples. By choosing the neighborhood and implementation of $p _ { \mathrm { r e c o m b } }$ appropriately, we can train this meta-learner to specialize in one-shot concept learning (by reusing a fragment exhibited in a single prototype) or compositional generalization (by assembling fragments of prototypes into a novel configuration). To enable this behavior, we define a set of compatible prototypes $\Omega \subset { \mathcal { D } } ^ { n }$ (Section 4) and let $p _ { \Omega } \ { \stackrel { \mathrm { d e f } } { = } } \ \operatorname { U n i f } ( \Omega )$ . We update Eq. 6 to feature a corresponding multi-prototype neighborhood $\mathcal { N } : \mathcal { D } \Omega$ . The only terms that have changed are the conditioning variable and the constant term, and it is again sufficient to choose $\theta$ to optimize $\begin{array} { r } { \sum _ { d _ { 1 : n } ^ { \prime } \in \mathcal { N } ( d ) } \log p _ { \mathrm { r e c o m b } } ( d \mid d _ { 1 : n } ^ { \prime } ) } \end{array}$ over $\mathcal { D }$ , implementing $p _ { \mathrm { r e c o m b } }$ as described next.
|
| 89 |
+
|
| 90 |
+
# 3.2 RECOMBINATION NETWORKS
|
| 91 |
+
|
| 92 |
+
Past work has found that latent-variable neural sequence models often ignore the latent variable and attempt to directly model sequence marginals (Bowman et al., 2016). When an ordinary sequence-tosequence model with attention is used to implement $p _ { \mathrm { r e c o m b } }$ , even in the one-prototype case, generated
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
p _ { \mathrm { r e w r i t e } } ( d \mid d ^ { \prime } ) = \mathbb { E } _ { z \sim p ( z ) } [ p _ { \mathrm { r e w r i t e } } ( d \mid d ^ { \prime } , z ; \theta ) ]
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+

|
| 99 |
+
Figure 2: (a) RNN encoders produce contextual embeddings for prototype tokens. (b) In the decoder, a gated copy mechanism reuses prototypes and generated output tokens via an attention mechanism (dashed lines).
|
| 100 |
+
|
| 101 |
+
sentences often have little overlap with their prototypes (Weston et al., 2018). We describe a specific model architecture for $p _ { \mathrm { r e c o m b } }$ that does not function as a generic noise model, and in which outputs are primarily generated via explicit reuse of fragments of multiple prototypes, by facilitating copying from independent streams containing prototypes and previously generated input tokens.
|
| 102 |
+
|
| 103 |
+
We take $p _ { \mathrm { r e c o m b } } ( d \mid d _ { 1 : n } ^ { \prime } ; \theta )$ to be a neural (multi-)sequence-to-sequence model (c.f. Sutskever et al., 2014) which decomposes probability autoregressively: $\begin{array} { r } { p _ { \mathrm { r e c o m b } } ( d \mid \mathcal { \bar { d } } _ { 1 : n } ^ { \prime } ; \theta ) = \prod _ { t } p ( d ^ { t } \mid d ^ { < t } , d _ { 1 : n } ^ { \prime } ; \theta ) } \end{array}$ . As shown in Fig. 2, three LSTM encoders—two for the prototypes and one for the input prefix— compute sequences of token representations $h _ { \mathrm { p r o t o } }$ and $h _ { \mathrm { o u t } }$ respectively. Given the current decoder hidden state $\setminus h _ { o u t } ^ { t }$ , the model first attends to both prototype and output tokens:
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
\begin{array} { r l } { \alpha _ { \mathrm { o u t } } ^ { i } \propto \exp ( { h _ { \mathrm { o u t } } ^ { t } W _ { o } h _ { \mathrm { o u t } } ^ { i } } ) } & { { i < t } } \\ { \alpha _ { \mathrm { p r o t o } } ^ { k j } \propto \exp ( { h _ { \mathrm { o u t } } ^ { t } W _ { p } h _ { \mathrm { p r o t o } } ^ { k j } } ) } & { { k \le n , j \le | d _ { k } ^ { \prime } | } } \end{array}
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
To enable copying from each sequence, we project attention weights $\alpha _ { \mathrm { o u t } }$ and $\alpha _ { \mathrm { p r o t o } } ^ { k }$ onto the output vocabulary to produce a sparse vector of probabilities:
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\begin{array} { r l } & { p _ { \mathrm { c o p y , o u t } } ^ { t } ( d ^ { t } = w ) = \sum _ { i < t } \mathbb { 1 } [ d _ { i } = w ] \cdot \alpha _ { \mathrm { o u t } } ^ { i } } \\ & { p _ { \mathrm { c o p y , p r o t o - k } } ^ { t } ( d ^ { t } = w ) = \sum _ { j \le | d _ { k } ^ { \prime } | } \mathbb { 1 } [ d _ { k , j } ^ { \prime } = w ] \cdot \alpha _ { \mathrm { p r o t o } } ^ { k j } } \end{array}
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
Unlike rule-based data recombination procedures, however, $p _ { \mathrm { r e c o m b } }$ is not required to copy from the prototypes, and can predict output tokens directly using values retrieved by the attention mechanism:
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
\begin{array} { r l } & { \begin{array} { r l } { h _ { \mathrm { p r e } } ^ { t } = \left[ h _ { \mathrm { o u t } } ^ { t } , \quad \sum _ { i } \alpha _ { \mathrm { o u t } } ^ { i } h _ { \mathrm { o u t } } ^ { i } , } & { \sum _ { k , j } \alpha _ { \mathrm { p r o t o } } ^ { k j } h _ { \mathrm { p r o t o } } ^ { k j } \right] } \end{array} } \\ & { \begin{array} { r l } { p _ { \mathrm { w r i t e } } ^ { t } \propto \exp ( W _ { \mathrm { w r i t e } } h _ { \mathrm { p r e } } ^ { t } ) } & { } \end{array} } \end{array}
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+
To produce a final distribution over output tokens at time $t$ , we combine predictions from each stream:
|
| 122 |
+
|
| 123 |
+
$$
|
| 124 |
+
\begin{array} { r } { \beta _ { \mathrm { g a t e } } = \mathrm { s o f t m a x } ( W _ { g a t e } h _ { o u t } ^ { t } ) \qquad } \\ { p ( d ^ { t } = w \mid d ^ { < t } , d _ { 1 : n } ^ { t } ; \theta ) = \beta _ { \mathrm { g a t e } } \cdot [ p _ { \mathrm { w r i t e } } ^ { t } ( w ) , p _ { \mathrm { c o p y , o u t } } ^ { t } ( w ) , p _ { \mathrm { c o p y , p r o u o - } 1 } ^ { t } ( w ) , . . . , p _ { \mathrm { c o p y , p r o u o - n } } ^ { t } ( w ) ] } \end{array}
|
| 125 |
+
$$
|
| 126 |
+
|
| 127 |
+
This copy mechanism is similar to the one proposed by Merity et al. (2017) and See et al. (2017). We compare 1- and 2-prototype models to an ordinary sequence model and baselines in Section 5.
|
| 128 |
+
|
| 129 |
+
# 4 SAMPLING SCHEMES
|
| 130 |
+
|
| 131 |
+
The models above provide generic procedures for generating well-formed combinations of training data, but do nothing to ensure that the generated samples are of a kind useful for compositional generalization. While the training objective in Eq. 7 encourages the learned $p ( d )$ to lie close to the training data, an effective data augmentation procedure should intuitively provide novel examples of rare phenomena. To generate augmented training data, we combine the generative models of Section 3 with a simple sampling procedure that upweights useful examples.
|
| 132 |
+
|
| 133 |
+
# 4.1 RESAMPLING AUGMENTED DATA
|
| 134 |
+
|
| 135 |
+
In classification problems with imbalanced classes, a common strategy for improving accuracy on the rare class is to resample so that the rare class is better represented in training data (Japkowicz
|
| 136 |
+
|
| 137 |
+
et al., 2000). When constructing an augmented dataset using the models described above, we apply a simple rejection sampling scheme. In Eq. 1, we set:
|
| 138 |
+
|
| 139 |
+
$$
|
| 140 |
+
u ( d ) = \mathbb { 1 } [ \operatorname* { m i n } _ { t } p ( d ^ { t } ) < \epsilon ] .
|
| 141 |
+
$$
|
| 142 |
+
|
| 143 |
+
Here $p ( d ^ { t } )$ is the marginal probability that the token $d ^ { t }$ appears in any example and $\epsilon$ is a hyperparameter. The final model is then trained using Eq. 1, retaining those augmented samples for which $u ( d ) = 1$ . For extremely imbalanced problems, like the ones considered in Section 5, this weighting scheme effectively functions as a rare tag constraint: only examples containing rare words or tags are used to augment the original training data.
|
| 144 |
+
|
| 145 |
+
# 4.2 NEIGHBORHOODS AND PROTOTYPE PRIORS
|
| 146 |
+
|
| 147 |
+
How can we ensure that the data augmentation procedure generates any samples with positive weight in Eq. 18? The prototype-based models described in Section 3 offer an additional means of control over the generated data. Aside from the implementation of $p _ { \mathrm { r e c o m b } }$ , the main factors governing the behavior of the model are the choice of neighborhood function ${ \mathcal { N } } ( d )$ and, for $n \geq 2$ , the set of prior compatible prototypes $\Omega$ . Defining these so that rare tags also preferentially appear in prototypes helps ensure that the generated samples contribute to generalization. Let $d _ { 1 }$ and $d _ { 2 }$ be prototypes. As a notational convenience, given two sequences $d _ { 1 }$ , $d _ { 2 }$ , let $d _ { 1 } \backslash d _ { 2 }$ the set of tokens in $d _ { 1 }$ but not $d _ { 2 }$ , and $d _ { 1 } \Delta d _ { 2 }$ denote the set of tokens not common to $d _ { 1 }$ and $d _ { 2 }$ .
|
| 148 |
+
|
| 149 |
+
1-prototype neighborhoods Guu et al. (2018) define a one-prototype $\mathcal { N }$ based on a Jaccard distance threshold (Jaccard, 1901). For experiments with one-prototype models we employ a similar strategy, choosing an initial neighborhood of candidates such that
|
| 150 |
+
|
| 151 |
+
$$
|
| 152 |
+
{ \mathcal { N } } ( d ) \ { \stackrel { \scriptscriptstyle { \mathrm { d e f } } } { = } } \ \left\{ d _ { 1 } \in { \mathcal { D } } : ( { \boldsymbol { \alpha } } \cdot | d \Delta d _ { 1 } | + { \boldsymbol { \beta } } \cdot \operatorname { l e v } ( d , d _ { 1 } ) ) < \delta \right\}
|
| 153 |
+
$$
|
| 154 |
+
|
| 155 |
+
where lev is string edit distance (Levenshtein, 1966) and $\alpha , \beta$ and $\delta$ are hyperparameters (discussed in Appendix B).
|
| 156 |
+
|
| 157 |
+
2-prototype neighborhoods The $n \geq 2$ prototype case requires a more complex neighborhood function—intuitively, for an input $d$ , we want each $( d _ { 1 } , d _ { 2 } , \ldots )$ in the neighborhood to collectively contain enough information to reconstruct $d$ . Future work might treat the neighborhood function itself as latent, allowing the model to identify groups of prototypes that make $d$ probable; here, as in existing one-prototype models, we provide heuristic implementations for the $n = 2$ case.
|
| 158 |
+
|
| 159 |
+
Long–short recombination: For each $( d _ { 1 } , d _ { 2 } ) \in \mathcal { N } ( d )$ , $d _ { 1 }$ is chosen to be similar to $d$ , and $d _ { 2 }$ is chosen to be similar to the difference between $d$ and $d _ { 1 }$ . (The neighborhood is so named because one of the prototypes will generally have fewer tokens than the other one.)
|
| 160 |
+
|
| 161 |
+
$$
|
| 162 |
+
{ \mathcal { N } } ( d ) ~ { \stackrel { \mathrm { d e f } } { = } } ~ \left\{ ( d _ { 1 } , d _ { 2 } ) \in \Omega : { \mathrm { ~ l e v } } \left( d , d _ { 1 } \right) < \delta , { \mathrm { l e v } } \left( [ d \backslash d _ { 1 } ] , d _ { 2 } \right) < \delta , | d \backslash d _ { 1 } | > 0 , | d \backslash d _ { 1 } \backslash d _ { 2 } | = 0 \right\}
|
| 163 |
+
$$
|
| 164 |
+
|
| 165 |
+
Here $[ d \backslash d _ { 1 } ]$ is the sequence obtained by removing all tokens in $d _ { 1 }$ from $d$ . Recall that we have defined $p _ { \Omega } ( d _ { 1 : n } ) \ { \stackrel { \mathrm { d e f } } { = } } \ \mathrm { U n i f } ( \Omega )$ for a set $\Omega$ of “compatible” prototypes. For experiments using long–short combination, all prototypes are treated as compatible; that is, $\Omega = \mathcal { D } \times \mathcal { D }$ .
|
| 166 |
+
|
| 167 |
+
Long–long recombination: ${ \mathcal { N } } ( d )$ contains pairs of prototypes that are individually similar to $d$ and collectively contain all the tokens needed to reconstruct $d$ :
|
| 168 |
+
|
| 169 |
+
$$
|
| 170 |
+
{ \mathcal { N } } ( d ) \ { \stackrel { \mathrm { d e f } } { = } } \ \{ ( d _ { 1 } , d _ { 2 } ) \in \Omega : \ { \mathrm { l e v } } \left( d , d _ { 1 } \right) < \delta , { \mathrm { l e v } } \left( d , d _ { 2 } \right) < \delta , | d \Delta d _ { 1 } | = 1 , | d \backslash d _ { 1 } \backslash d _ { 2 } | = 0 \}
|
| 171 |
+
$$
|
| 172 |
+
|
| 173 |
+
For experiments using long–long recombination, we take $\Omega = \{ ( d _ { 1 } , d _ { 2 } ) \in \mathcal { D } \times \mathcal { D } : | d _ { 1 } \Delta d _ { 2 } | = 1 \}$
|
| 174 |
+
|
| 175 |
+
# 5 DATASETS & EXPERIMENTS
|
| 176 |
+
|
| 177 |
+
We evaluate R&R on two tests of compositional generalization: the SCAN instruction following task (Lake & Baroni, 2018) and a few-shot morphology learning task derived from the SIGMORPHON 2018 dataset (Kirov et al., 2018; Cotterell et al., 2018). Our experiments are designed to explore the effectiveness of learned data recombination procedures in controlled and natural settings. Both tasks involve conditional sequence prediction: while preceding sections have discussed augmentation
|
| 178 |
+
|
| 179 |
+
Table 1: Results on the SCAN dataset. (a) Comparison of R&R with previous work. Connecting lines indicate that model components are inherited from the parent (e.g. the row labeled recomb-2 also includes resampling). Data augmentation with recomb- $^ { 2 + }$ resampling performs slightly worse than GECA on the jump and around right splits; data augmentation with recomb- $l +$ resampling or an ordinary RNN does not generalize robustly to either split. All differences except between GECA and recomb- $^ { 2 + }$ resampling in jump are significant (paired $t$ -test, $p \ll 0 . 0 0 1$ ). (Dashes indicate that all samples were rejected by resampling when decoding with temperature $T = 1 .$ ) (b) Ablation experiments on the jump split. Introducing the latent variable used in previous work (Guu et al., 2018) does not change performance; removing the copy mechanism results in a complete failure of generalization. While it is possible to perform conditional inference of $p ( y \mid x )$ given the generative model in Eq. 3 (direct inference), this gives significantly worse results than data augmentation (see Sec. 5.3).
|
| 180 |
+
|
| 181 |
+
<table><tr><td colspan="3">(a)</td></tr><tr><td></td><td>around right</td><td> jump</td></tr><tr><td>baseline</td><td>0.00 ±0.00</td><td>0.00 ±0.00</td></tr><tr><td>GECA (published)</td><td>0.82 ±0.11</td><td>0.87 ±0.05</td></tr><tr><td>GECA (ours)</td><td>0.98 ±0.02</td><td>1.00 ±0.001</td></tr><tr><td>learned aug. (basic)</td><td>0.00 ±0.00</td><td>0.00 ±0.00</td></tr><tr><td>L resampling</td><td>-</td><td>-</td></tr><tr><td>├ recomb-1</td><td>0.17 ±0.07</td><td>-</td></tr><tr><td>Lrecomb-2</td><td>0.75 ±0.14</td><td>0.87 ±0.08</td></tr><tr><td>recomb-2 (no resampling)</td><td>0.82 ±0.08</td><td>0.88 ±0.07</td></tr></table>
|
| 182 |
+
|
| 183 |
+
<table><tr><td colspan="2"> jump</td></tr><tr><td>recomb-2 (no resampling)</td><td>0.88 ±0.07</td></tr><tr><td>+ VAE</td><td>0.88 ±0.07</td></tr><tr><td>+resampling</td><td>0.87 ±0.08</td></tr><tr><td>- copying direct inference</td><td>0.00 ±0.00</td></tr><tr><td></td><td>0.57 ±0.05</td></tr></table>
|
| 184 |
+
|
| 185 |
+
procedures that produce data points $d = ( x , y )$ , learners are evaluated on their ability to predict an output $y$ from an input $x$ : actions $y$ given instructions $x$ , or morphological analyses $y$ given words $x$
|
| 186 |
+
|
| 187 |
+
For each task, we compare a baseline with no data augmentation, the rule-based GECA data augmentation procedure (Andreas, 2020), and a sequence of ablated versions of R&R that measure the importance of resampling and recombination. The basic Learned Aug model trains an RNN to generate $( x , y )$ pairs, then trains a conditional model on the original data and samples from the generative model. Resampling filters these samples as described in Section 4. Recomb-n models replace the RNN with a prototype-based model as described in Section 3. Additional experiments (Table 1b) compare data augmentation to prediction of $y$ via direct inference (Appendix E) in the prototype-based model and several other model variants.
|
| 188 |
+
|
| 189 |
+
# 5.1 SCAN
|
| 190 |
+
|
| 191 |
+
SCAN (Lake & Baroni, 2018) is a synthetic dataset featuring simple English commands paired with sequences of actions. Our experiments aim to show that R&R performs well at one-shot concept learning and zero-shot generalization on controlled tasks where rule-based models succeed. We experiment with two splits of the dataset, jump and around right. In the jump split, which tests one-shot learning, the word jump appears in a single command in the training set but in more complex commands in the test set (e.g. look and jump twice). The around right split (Loula et al., 2018) tests zero-shot generalization by presenting learners with constructions like walk around left and walk right in the training set, but walk around right only in the test set.
|
| 192 |
+
|
| 193 |
+
Despite the apparent simplicity of the task, ordinary neural sequence-to-sequence models completely fail to make correct predictions on SCAN test set (Table 1). As such it has been a major focus of research on compositional generalization in sequence-to-sequence models, and a number of heuristic procedures and specialized model architectures and training procedures have been developed to solve it (Russin et al., 2019; Gordon et al., 2020; Lake, 2019; Andreas, 2020). Here we show that the generic prototype recombination procedure described above does so as well. We use long–short recombination for the jump split and long–long recombination for the around right split. We use a recombination network to generate 400 samples $d = ( x , y )$ and then train an ordinary LSTM with attention (Bahdanau et al., 2019b) on the original and augmented data to predict $y$ from $x$ . Training hyperparameters are provided in Appendix D.
|
| 194 |
+
|
| 195 |
+
Table 1 shows the results of training these models on the SCAN dataset.4 2-prototype recombination is essential for successful generalization on both splits. Additional ablations (Table 1b) show that the continuous latent variable used by Guu et al. (2018) does not affect performance, but that the copy mechanism described in Section 3.2 and the use of the recomb-2 model for data augmentation rather than direct inference are necessary for accurate prediction.
|
| 196 |
+
|
| 197 |
+
Table 2: $F _ { 1 }$ score for morphological analysis on rare $\mathrm { ( F U T + P S T ) }$ ) and frequent (OTHER) word forms. R&R variants with 1- and 2-prototype recombination (shaded in grey) consistently match or outperform both a no-augmentation baseline and GECA; recomb- $^ { l + }$ resampling is best overall. Bold numbers are not significantly different from the best result in each column under a paired t-test $\mathit { p } < 0 . 0 5$ after Bonferroni correction; nothing is bold if all differences are insignificant). The NOVEL portion of the table shows model accuracy on examples whose exact tag set never appeared in the training data. (There were no such words in the test set for the Spanish OTHER.) Differences between GECA and the best R&R variant (recomb- $^ { l + }$ resampling) are larger than in the full evaluation set. ∗The Spanish past tense was used as a development set.
|
| 198 |
+
|
| 199 |
+
<table><tr><td></td><td></td><td colspan="2">Spanish</td><td colspan="2">Swahili</td><td colspan="2">Turkish</td></tr><tr><td></td><td></td><td>FUT+PST*</td><td>OTHER</td><td>FUT+PST</td><td>OTHER</td><td>FUT+PST</td><td>OTHER</td></tr><tr><td>baseline Lresampling</td><td></td><td>0.66 ±0.01</td><td>0.88 ±0.01</td><td>0.75 ±0.02</td><td>0.90 ±0.01</td><td>0.69 ±0.04</td><td>0.85 ±0.03</td></tr><tr><td></td><td></td><td>0.65 ±0.01</td><td>0.88 ±0.01</td><td>0.77 ±0.01</td><td>0.90 ±0.02</td><td>0.69 ±0.04</td><td>0.84 ±0.04</td></tr><tr><td>GECA</td><td></td><td>0.66 ±0.01</td><td>0.88 ±0.01</td><td>0.76 ±0.02</td><td>0.90±0.02</td><td>0.69 ±0.02</td><td>0.87 ±0.01</td></tr><tr><td>Lresampling A</td><td></td><td>0.72 ±0.02</td><td>0.88 ±0.01</td><td>0.81 ±0.02</td><td>0.89 ±0.01</td><td>0.75 ±0.03</td><td>0.85 ±0.02</td></tr><tr><td></td><td>learned aug. (basic)</td><td>0.66 ±0.02</td><td>0.88 ±0.01</td><td>0.77 ±0.02</td><td>0.90 ±0.01</td><td>0.70 ±0.02</td><td>0.87 ±0.01</td></tr><tr><td>L resampling</td><td></td><td>0.70 ±0.02</td><td>0.86 ±0.01</td><td>0.84 ±0.01</td><td>0.90 ±0.01</td><td>0.73 ±0.04</td><td>0.85 ±0.03</td></tr><tr><td></td><td>├recomb-1</td><td>0.72 ±0.02</td><td>0.87 ±0.01</td><td>0.85 ±0.01</td><td>0.90 ±0.02</td><td>0.77 ±0.02</td><td>0.87 ±0.02</td></tr><tr><td></td><td>recomb-2</td><td>0.71 ±0.01</td><td>0.87 ±0.02</td><td>0.82 ±0.02</td><td>0.90 ±0.01</td><td>0.75 ±0.03</td><td>0.86 ±0.03</td></tr><tr><td></td><td> GECA + recomb-1 + resamp.</td><td>0.74 ±0.02</td><td>0.86 ±0.01</td><td>0.85 ±0.02</td><td>0.89 ±0.01</td><td>0.79 ±0.02</td><td>0.84 ±0.01</td></tr><tr><td>THAON</td><td>baseline</td><td>0.63 ±0.03</td><td></td><td>0.72 ±0.02</td><td>0.42 ±0.12</td><td>0.68 ±0.04</td><td>0.66 ±0.15</td></tr><tr><td></td><td>GECA + resampling</td><td>0.67 ±0.03</td><td></td><td>0.79 ±0.02</td><td>0.26 ±0.20</td><td>0.73 ±0.04</td><td>0.71 ±0.10</td></tr><tr><td></td><td> recomb-1 + resampling</td><td>0.69 ±0.02</td><td></td><td>0.83 ±0.02</td><td>0.42 ±0.12</td><td>0.75 ±0.03</td><td>0.82 ±0.04</td></tr><tr><td></td><td> GECA + recomb-1 + resamp.</td><td>0.69 ±0.02</td><td></td><td>0.83 ±0.02</td><td>0.35 ±0.11</td><td>0.77 ±0.03</td><td>0.71 ±0.07</td></tr></table>
|
| 200 |
+
|
| 201 |
+
# 5.2 SIGMORPHON 2018
|
| 202 |
+
|
| 203 |
+
The SIGMORPHON 2018 dataset consists of words paired with morphological analyses (lemmas, or base forms, and tags for linguistic features like tense and case, as depicted in Fig. 1). We use the data to construct a morphological analysis task (Akyürek et al., 2019) (predicting analyses from surface forms) to test models’ few-shot learning of new morphological paradigms. In three languages of varying morphological complexity (Spanish, Swahili, and Turkish) we construct splits of the data featuring a training set of 1000 examples and three test sets of 100 examples. One test set consists exclusively of words in the past tense, one in the future tense and one with other word forms (present tense verbs, nouns and adjectives). The training set contains exactly eight past-tense and eight future-tense examples; all the rest are other word forms. Experiments evaluate R&R’s ability to efficiently learn noisy morphological rules, long viewed a key challenge for connectionist approaches to language learning (Rumelhart & McClelland, 1986). As approaches may be sensitive to the choice of the eight examples from which the model must generalize, we construct five different splits per language and use the Spanish past-tense data as a development set. As above, we use long–long recombination with similarity criteria applied to $y$ only. We augment the training data with 180 samples from $p _ { \mathrm { r e c o m b } }$ and again train an ordinary LSTM with attention for final predictions. Details are provided in Appendix B.
|
| 204 |
+
|
| 205 |
+
Table 2 shows aggregate results across languages. We report the model’s $F _ { 1 }$ score for predicting morphological analyses of words in the few-shot training condition (past and future) and the standard training condition (other word forms). Here, learned data augmentation with both one- and twoprototype models consistently matches or outperforms GECA. The improvement is sometimes dramatic: for few-shot prediction in Swahili, recomb-1 augmentation reduces the error rate by $40 \%$ relative to the baseline and $21 \%$ relative to GECA. An additional baseline $^ +$ resampling experiment upweights the existing rare samples rather than synthesizing new ones; results demonstrate that recombination, and not simply reweighting, is important for generalization. Table 2 also includes a finer-grained analysis of novel word forms: words in the evaluation set whose exact morphological analysis never appeared in the training set. R&R again significantly outperforms both the baseline and GECA-based data augmentation in the few-shot FUT+PAST condition and the ordinary OTHER condition, underscoring the effectiveness of this approach for “in-distribution” compositional generalization. Finally, the gains provided by learned augmentation and GECA appear to be at least partially orthogonal: combining the GECA $^ +$ resampling and recomb- $\cdot l +$ resampling models gives further improvements in Spanish and Turkish.
|
| 206 |
+
|
| 207 |
+
# 5.3 ANALYSIS
|
| 208 |
+
|
| 209 |
+
Why is R&R effective? Samples from the best learned data augmentation models for SCAN and SIGMORPHON may be found in the Appendix G.3 . We programaticaly analyzed 400 samples from recomb-2 models in SCAN and found that $40 \%$ of novel samples are exactly correct in the around right split and $74 \%$ in the jump split. A manual analysis of 50 Turkish samples indicated that only $14 \%$ of the novel samples were exactly correct. The augmentation procedure has a high error rate! However, our analysis found that malformed samples either (1) feature malformed $x s$ that will never appear in a test set (a phenomenon also observed by Andreas (2020) for outputs of GECA), or (2) are mostly correct at the token level (inducing predictions with a high $F _ { 1 }$ score). Data augmentation thus contributes a mixture of irrelevant examples, label noise—which may exert a positive regularizing effect (Bishop, 1995)—and well-formed examples, a small number of which are sufficient to induce generalization (Bastings et al., 2018). Without resampling, SIGMORPHON models generate almost no examples of rare tags.
|
| 210 |
+
|
| 211 |
+
Why does R&R outperform direct inference? A partial explanation is provided by the preceding analysis, which notes that the accuracy of the data augmentation procedure as a generative model is comparatively low. Additionally, the data augmentation procedure selects only the highest-confidence samples from the model, so the quality of predicted ys conditioned on random $x \mathbf { s }$ will in general be even lower. A conditional model trained on augmented data is able to compensate for errors in augmentation or direct inference (Table 12 in the Appendix).
|
| 212 |
+
|
| 213 |
+
Why is Resampling without Recombination effective? One surprising feature of Table 2 is performance of the learned aug (basic) $^ +$ resampling model. While less effective than the recombinationbased models, augmentation with samples from an ordinary RNN trained on $( x , y )$ pairs improves performance for some test splits. One possible explanation is that resampling effectively acts as a posterior constraint on the final model’s predictive distribution, guiding it toward solutions in which rare tags are more probable than observed in the original training data. Future work might model this constraint explicitly, e.g. via posterior regularization (as in Li & Rush, 2020).
|
| 214 |
+
|
| 215 |
+
# 6 CONCLUSIONS
|
| 216 |
+
|
| 217 |
+
We have described a method for improving compositional generalization in sequence-to-sequence models via data augmentation with learned prototype recombination models. These are the first results we are aware of demonstrating that generative models of data are effective as data augmentation schemes in sequence-to-sequence learning problems, even when the generative models are themselves unreliable as base predictors. Our experiments demonstrate that it is possible to achieve compositional generalization on-par with complex symbolic models in clean, highly structured domains, and outperform them in natural ones, with basic neural modeling tools and without symbolic representations.
|
| 218 |
+
|
| 219 |
+
# ACKNOWLEDGMENTS
|
| 220 |
+
|
| 221 |
+
We thank Eric Chu for feedback on early drafts of this paper. This work was supported by a hardware donation from NVIDIA under the NVAIL grant program. The authors acknowledge the MIT SuperCloud and Lincoln Laboratory Supercomputing Center (Reuther et al., 2018) for providing HPC resources that have contributed to the research results reported within this paper.
|
| 222 |
+
|
| 223 |
+
# REFERENCES
|
| 224 |
+
|
| 225 |
+
Ekin Akyürek, Erenay Dayanık, and Deniz Yuret. Morphological analysis using a sequence decoder. Transactions of the Association for Computational Linguistics, 7:567–579, 2019.
|
| 226 |
+
|
| 227 |
+
Jacob Andreas. Good-enough compositional data augmentation. In Procedings of the Annual Meeting of the Association for Computational Linguistics, 2020.
|
| 228 |
+
|
| 229 |
+
Jacob Andreas, Marcus Rohrbach, Trevor Darrell, and Dan Klein. Neural module networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 39–48, 2016.
|
| 230 |
+
|
| 231 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In International Conference on Learning Representations, 2015.
|
| 232 |
+
|
| 233 |
+
Dzmitry Bahdanau, Harm de Vries, Timothy J O’Donnell, Shikhar Murty, Philippe Beaudoin, Yoshua Bengio, and Aaron Courville. Closure: Assessing systematic generalization of clevr models. arXiv preprint arXiv:1912.05783, 2019a.
|
| 234 |
+
|
| 235 |
+
Dzmitry Bahdanau, Shikhar Murty, Michael Noukhovitch, Thien Huu Nguyen, Harm de Vries, and Aaron Courville. Systematic generalization: What is required and can it be learned? In International Conference on Learning Representations, 2019b.
|
| 236 |
+
|
| 237 |
+
Jasmijn Bastings, Marco Baroni, Jason Weston, Kyunghyun Cho, and Douwe Kiela. Jump to better conclusions: SCAN both left and right. In Proceedings of the EMNLP BlackboxNLP Workshop, pp. 47–55, Brussels, Belgium, 2018.
|
| 238 |
+
|
| 239 |
+
Jean Berko. The child’s learning of english morphology. Word, 14(2-3):150–177, 1958.
|
| 240 |
+
|
| 241 |
+
Jeff Bezanson, Alan Edelman, Stefan Karpinski, and Viral B Shah. Julia: A fresh approach to numerical computing. SIAM review, 59(1):65–98, 2017. URL https://doi.org/10.1137/ 141000671.
|
| 242 |
+
|
| 243 |
+
Chris M Bishop. Training with noise is equivalent to tikhonov regularization. Neural computation, 7 (1):108–116, 1995.
|
| 244 |
+
|
| 245 |
+
Samuel Bowman, Luke Vilnis, Oriol Vinyals, Andrew Dai, Rafal Jozefowicz, and Samy Bengio. Generating sentences from a continuous space. In Proceedings of The 20th SIGNLL Conference on Computational Natural Language Learning, pp. 10–21, 2016.
|
| 246 |
+
|
| 247 |
+
Jonathon Cai, Richard Shin, and Dawn Song. Making neural programming architectures generalize via recursion. In International Conference on Learning Representations, ICLR 2017, 2017.
|
| 248 |
+
|
| 249 |
+
Susan Carey and Elsa Bartlett. Acquiring a single new word. Papers and Reports on Child Language Development, 2, 1978.
|
| 250 |
+
|
| 251 |
+
Nitesh V Chawla, Kevin W Bowyer, Lawrence O Hall, and W Philip Kegelmeyer. Smote: synthetic minority over-sampling technique. Journal of artificial intelligence research, 16:321–357, 2002.
|
| 252 |
+
|
| 253 |
+
Alexander Clark and Rémi Eyraud. Polynomial identification in the limit of substitutable context-free languages. Journal of Machine Learning Research, 8(Aug):1725–1745, 2007.
|
| 254 |
+
|
| 255 |
+
Ryan Cotterell, Christo Kirov, John Sylak-Glassman, Géraldine Walther, Ekaterina Vylomova, Arya D. McCarthy, Katharina Kann, Sabrina J. Mielke, Garrett Nicolai, Miikka Silfverberg, David Yarowsky, Jason Eisner, and Mans Hulden. The CoNLL–SIGMORPHON 2018 shared task: Universal morphological reinflection. In Proceedings of the CoNLL–SIGMORPHON 2018 Shared Task: Universal Morphological Reinflection, pp. 1–27, 2018.
|
| 256 |
+
|
| 257 |
+
Marzieh Fadaee, Arianna Bisazza, and Christof Monz. Data augmentation for low-resource neural machine translation. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics, pp. 567–573, 2017.
|
| 258 |
+
|
| 259 |
+
Jerry A Fodor, Zenon W Pylyshyn, et al. Connectionism and cognitive architecture: A critical analysis. Cognition, 28(1-2):3–71, 1988.
|
| 260 |
+
|
| 261 |
+
Felix A Gers and E Schmidhuber. Lstm recurrent networks learn simple context-free and contextsensitive languages. IEEE Transactions on Neural Networks, 12(6):1333–1340, 2001.
|
| 262 |
+
|
| 263 |
+
Jonathan Gordon, David Lopez-Paz, Marco Baroni, and Diane Bouchacourt. Permutation equivariant models for compositional generalization in language. In International Conference on Learning Representations, 2020.
|
| 264 |
+
|
| 265 |
+
Jiatao Gu, Zhengdong Lu, Hang Li, and Victor O.K. Li. Incorporating copying mechanism in sequence-to-sequence learning. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, pp. 1631–1640, 2016.
|
| 266 |
+
|
| 267 |
+
Jiatao Gu, Yong Wang, Kyunghyun Cho, and Victor OK Li. Search engine guided neural machine translation. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
|
| 268 |
+
|
| 269 |
+
Kelvin Guu, Tatsunori B. Hashimoto, Yonatan Oren, and Percy Liang. Generating sentences by editing prototypes. Transactions of the Association for Computational Linguistics, 6:437–450, 2018.
|
| 270 |
+
|
| 271 |
+
Kelvin Guu, Kenton Lee, Zora Tung, Panupong Pasupat, and Ming-Wei Chang. Realm: Retrievalaugmented language model pre-training. arXiv preprint arXiv:2002.08909, 2020.
|
| 272 |
+
|
| 273 |
+
Tatsunori B Hashimoto, Kelvin Guu, Yonatan Oren, and Percy S Liang. A retrieve-and-edit framework for predicting structured outputs. In Advances in Neural Information Processing Systems, pp. 10052–10062, 2018.
|
| 274 |
+
|
| 275 |
+
Hiroshi Inoue. Data augmentation by pairing samples for images classification. In International Conference on Learning Representations, 2018.
|
| 276 |
+
|
| 277 |
+
Paul Jaccard. Comparative study of the distribution of flora in a portion of the Alps and Jura. Bull Soc Vaudoise Sci Nat, 37:547–579, 1901.
|
| 278 |
+
|
| 279 |
+
Nathalie Japkowicz et al. Learning from imbalanced data sets: a comparison of various strategies. In AAAI workshop on learning from imbalanced data sets, volume 68, pp. 10–15, 2000.
|
| 280 |
+
|
| 281 |
+
Robin Jia and Percy Liang. Data recombination for neural semantic parsing. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, pp. 12–22, 2016.
|
| 282 |
+
|
| 283 |
+
Justin Johnson, Bharath Hariharan, Laurens van der Maaten, Li Fei-Fei, C Lawrence Zitnick, and Ross Girshick. Clevr: A diagnostic dataset for compositional language and elementary visual reasoning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2901–2910, 2017.
|
| 284 |
+
|
| 285 |
+
Daniel Keysers, Nathanael Schärli, Nathan Scales, Hylke Buisman, Daniel Furrer, Sergii Kashubin, Nikola Momchev, Danila Sinopalnikov, Lukasz Stafiniak, Tibor Tihon, Dmitry Tsarkov, Xiao Wang, Marc van Zee, and Olivier Bousquet. Measuring compositional generalization: A comprehensive method on realistic data. In International Conference on Learning Representations, 2020.
|
| 286 |
+
|
| 287 |
+
Urvashi Khandelwal, Omer Levy, Dan Jurafsky, Luke Zettlemoyer, and Mike Lewis. Generalization through memorization: Nearest neighbor language models. In International Conference on Learning Representations, 2020.
|
| 288 |
+
|
| 289 |
+
Christo Kirov, Ryan Cotterell, John Sylak-Glassman, Géraldine Walther, Ekaterina Vylomova, Patrick Xia, Manaal Faruqui, Sabrina J. Mielke, Arya McCarthy, Sandra Kübler, David Yarowsky, Jason Eisner, and Mans Hulden. UniMorph 2.0: Universal Morphology. In Proceedings of the Eleventh International Conference on Language Resources and Evaluation (LREC 2018). European Language Resources Association (ELRA), 2018.
|
| 290 |
+
|
| 291 |
+
B. Lake, Tal Linzen, and M. Baroni. Human few-shot learning of compositional instructions. In CogSci, 2019.
|
| 292 |
+
|
| 293 |
+
Brenden Lake and Marco Baroni. Generalization without systematicity: On the compositional skills of sequence-to-sequence recurrent networks. In Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 2873–2882, 2018.
|
| 294 |
+
|
| 295 |
+
Brenden M Lake. Compositional generalization through meta sequence-to-sequence learning. In Advances in Neural Information Processing Systems, pp. 9788–9798, 2019.
|
| 296 |
+
|
| 297 |
+
Vladimir I Levenshtein. Binary codes capable of correcting deletions, insertions, and reversals. In Soviet physics doklady, volume 10, pp. 707–710, 1966.
|
| 298 |
+
|
| 299 |
+
Xiang Lisa Li and Alexander M Rush. Posterior control of blackbox generation. arXiv preprint arXiv:2005.04560, 2020.
|
| 300 |
+
|
| 301 |
+
João Loula, Marco Baroni, and Brenden Lake. Rearranging the familiar: Testing compositional generalization in recurrent networks. In Proceedings of the 2018 EMNLP Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, pp. 108–114, 2018.
|
| 302 |
+
|
| 303 |
+
Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer sentinel mixture models. In International Conference on Learning Representations, ICLR 2017, 2017.
|
| 304 |
+
|
| 305 |
+
Alexander Miller, Adam Fisch, Jesse Dodge, Amir-Hossein Karimi, Antoine Bordes, and Jason Weston. Key-value memory networks for directly reading documents. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pp. 1400–1409, 2016.
|
| 306 |
+
|
| 307 |
+
Steven Piantadosi and Richard Aslin. Compositional reasoning in early childhood. PloS one, 11(9), 2016.
|
| 308 |
+
|
| 309 |
+
Alexander J Ratner, Henry Ehrenberg, Zeshan Hussain, Jared Dunnmon, and Christopher Ré. Learning to compose domain-specific transformations for data augmentation. In Advances in neural information processing systems, pp. 3236–3246, 2017.
|
| 310 |
+
|
| 311 |
+
Albert Reuther, Jeremy Kepner, Chansup Byun, Siddharth Samsi, William Arcand, David Bestor, Bill Bergeron, Vijay Gadepally, Michael Houle, Matthew Hubbell, et al. Interactive supercomputing on 40,000 cores for machine learning and data analysis. In 2018 IEEE High Performance extreme Computing Conference (HPEC), pp. 1–6. IEEE, 2018.
|
| 312 |
+
|
| 313 |
+
Eric Sven Ristad and Peter N Yianilos. Learning string-edit distance. IEEE Transactions on Pattern Analysis and Machine Intelligence, 20(5):522–532, 1998.
|
| 314 |
+
|
| 315 |
+
Murray Rosenblatt. Remarks on some nonparametric estimates of a density function. The Annals of Mathematical Statistics, pp. 832–837, 1956.
|
| 316 |
+
|
| 317 |
+
David E. Rumelhart and James L. McClelland. On learning the past tenses of english verbs. Mechanisms of language aquisition, pp. 195–248, 1986.
|
| 318 |
+
|
| 319 |
+
Jake Russin, Jason Jo, Randall C O’Reilly, and Yoshua Bengio. Compositional generalization in a deep seq2seq model by separating syntax and semantics. arXiv preprint arXiv:1904.09708, 2019.
|
| 320 |
+
|
| 321 |
+
Adam Santoro, Sergey Bartunov, Matthew Botvinick, Daan Wierstra, and Timothy Lillicrap. Metalearning with memory-augmented neural networks. In International conference on machine learning, pp. 1842–1850, 2016.
|
| 322 |
+
|
| 323 |
+
Abigail See, Peter J. Liu, and Christopher D. Manning. Get to the point: Summarization with pointer-generator networks. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics, pp. 1073–1083, 2017.
|
| 324 |
+
|
| 325 |
+
Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to sequence learning with neural networks. In Advances in neural information processing systems, pp. 3104–3112, 2014.
|
| 326 |
+
|
| 327 |
+
Sebastian Thrun and Lorien Pratt. Learning to learn: Introduction and overview. In Learning to learn, pp. 3–17. Springer, 1998.
|
| 328 |
+
|
| 329 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Ł ukasz Kaiser, and Illia Polosukhin. Attention is all you need. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett (eds.), Advances in Neural Information Processing Systems, volume 30, 2017.
|
| 330 |
+
|
| 331 |
+
Jane X. Wang, Zeb Kurth-Nelson, Hubert Soyer, Joel Z. Leibo, Dhruva Tirumala, Rémi Munos, Charles Blundell, Dharshan Kumaran, and Matt M. Botvinick. Learning to reinforcement learn. In CogSci, 2016.
|
| 332 |
+
|
| 333 |
+
Gail Weiss, Yoav Goldberg, and Eran Yahav. On the practical computational power of finite precision RNNs for language recognition. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics, pp. 740–745, 2018.
|
| 334 |
+
|
| 335 |
+
Jason Weston, Emily Dinan, and Alexander Miller. Retrieve and refine: Improved sequence generation models for dialogue. In Proceedings of the 2018 EMNLP Workshop SCAI: The 2nd International Workshop on Search-Oriented Conversational AI, pp. 87–92, 2018.
|
| 336 |
+
|
| 337 |
+
Chunyang Xiao, Marc Dymetman, and Claire Gardent. Sequence-based structured prediction for semantic parsing. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, pp. 1341–1350, 2016.
|
| 338 |
+
|
| 339 |
+
Deniz Yuret. Knet: beginning deep learning with 100 lines of julia. In Machine Learning Systems Workshop at NIPS, volume 2016, pp. 5, 2016.
|
| 340 |
+
|
| 341 |
+
# A MODEL ARCHITECTURE
|
| 342 |
+
|
| 343 |
+
A.1 PROTOTYPE ENCODER
|
| 344 |
+
|
| 345 |
+
We use a single layer BiLSTM network to encode $h _ { \mathrm { p r o t o } } ^ { k j }$ as follows:
|
| 346 |
+
|
| 347 |
+
$$
|
| 348 |
+
h _ { \mathrm { p r o t o } } ^ { k } = \mathrm { p r o j } ( \mathrm { B i L S T M } \left( W _ { e } d _ { k } ^ { \prime } \right) )
|
| 349 |
+
$$
|
| 350 |
+
|
| 351 |
+
Morphology The hidden and embedding sizes are 1024. No dropout is applied. We project bidirectional embeddings to the hidden size with a linear projection. We concatenate the backward and the forward hidden states.
|
| 352 |
+
|
| 353 |
+
SCAN We choose the hidden size as 512, and embedding size as 64. We apply 0.5 dropout to the input. We project hidden vectors in the attention mechanism.
|
| 354 |
+
|
| 355 |
+
# A.2 DECODER
|
| 356 |
+
|
| 357 |
+
The decoder is implemented by a single layer. In addition to the hidden state and memory cell, we also carry out a feed vector through time:
|
| 358 |
+
|
| 359 |
+
$$
|
| 360 |
+
\begin{array} { l l l } { { } } & { { \displaystyle h _ { \mathrm { p r e } } ^ { t } = \left[ h _ { \mathrm { o u t } } ^ { t } , ~ \sum _ { i } \alpha _ { \mathrm { o u t } } ^ { i } h _ { \mathrm { o u t } } ^ { i } , ~ \sum _ { j \leq | d _ { 1 } | } \alpha _ { \mathrm { p r o t o } } ^ { 1 j } h _ { \mathrm { p r o t o } } ^ { 1 j } , ~ \cdots ~ , ~ \sum _ { j \leq | d _ { n } | } \alpha _ { \mathrm { p r o t o } } ^ { n j } h _ { \mathrm { p r o t o } } ^ { n j } ~ \right] } } \\ { { } } & { { \mathrm { f e e d } ^ { t } = \mathrm { L i n e a r } _ { \mathrm { f e e d } } ( h _ { \mathrm { p r e } } ^ { t } ) } } \end{array}
|
| 361 |
+
$$
|
| 362 |
+
|
| 363 |
+
The input to the LSTM decoder at time step $t$ is the concatenation of the previous token’s representation, previous feed vector, and a latent $z$ vector (in the VAE model).
|
| 364 |
+
|
| 365 |
+
$$
|
| 366 |
+
\mathrm { i n p u t } ^ { t } = [ W _ { d } d ^ { t - 1 } , f e e d ^ { t - 1 } , z ]
|
| 367 |
+
$$
|
| 368 |
+
|
| 369 |
+
Morphology We use a single-layer LSTM network with a hidden size of 1024, and an embedding size of 1024. We initialize the decoder hidden states with the final hidden states of the BiLSTM encoder. feed is the same size as the hidden state. No dropout is applied in the decoder. Output calculations are provided in the original paper in equation Eq. 16. The query vector for the attentions is identically the hidden state:
|
| 370 |
+
|
| 371 |
+
$$
|
| 372 |
+
{ \sf q u e r y } ^ { t } = h _ { \mathrm { o u t } } ^ { t }
|
| 373 |
+
$$
|
| 374 |
+
|
| 375 |
+
Further details of the attention are provided in Appendix A.3.
|
| 376 |
+
|
| 377 |
+
SCAN The decoder is implemented by a single layer LSTM network with hidden size of 512, and embedding size of 64. The embedding parameters are shared with the encoder. Here the size of the feed vector is equal to embedding size, 64.
|
| 378 |
+
|
| 379 |
+
We have no self-attention for this decoder in the feed vector. There is an attention projection with dimension is 128. The details of the attention mechanism given in Appendix A.3. Finally, we use transpose of the embedding matrix to project feed to the output space.
|
| 380 |
+
|
| 381 |
+
$$
|
| 382 |
+
\mathrm { o u t p u t } ^ { t } = W _ { e } ^ { \top } \mathrm { f e e d } ^ { t }
|
| 383 |
+
$$
|
| 384 |
+
|
| 385 |
+
outputt contains unnormalized scores before the final softmax layer. We apply 0.7 dropout to $h _ { o u t } ^ { t }$ during both training and test. The copy mechanism will be further described in Appendix A.3.
|
| 386 |
+
|
| 387 |
+
The input to the LSTM decoder is the same as Eq. 25 except the decoder embedding matrix, $W _ { d }$ , shares parameters with encoder embedding matrix $W _ { e }$ . We applied 0.5 dropout to the embeddings $d _ { t - 1 }$ .
|
| 388 |
+
|
| 389 |
+
The query vector for the attention is calculated by:
|
| 390 |
+
|
| 391 |
+
$$
|
| 392 |
+
{ \displaystyle \mathrm { q u e r y } ^ { t } } = [ h _ { \mathrm { o u t } } ^ { t } , \mathrm { i n p u t } ^ { t } ]
|
| 393 |
+
$$
|
| 394 |
+
|
| 395 |
+
# A.3 ATTENTION AND COPYING
|
| 396 |
+
|
| 397 |
+
We use the attention mechanism described in Vaswani et al. (2017) with slight modifications.
|
| 398 |
+
|
| 399 |
+
Morphology We use a linear transformation for key while retaining an embedding size of 1024, and leave query and value transformations as the identity. We do not normalize by the square root of the attention dimension. The query vector is described in the decoder Appendix A.2. The copy mechanism for the morphology task is explained in the paper in detail.
|
| 400 |
+
|
| 401 |
+
SCAN We use the nonlinear tanh transformation for key, query and value. That the attention scores are calculated separately for each prototype using different parameters as well as the normalization i.e. obtaining $\alpha$ ’s is performed separately for each prototype.
|
| 402 |
+
|
| 403 |
+
The copy mechanism for this task is slightly different and follows Gu et al. (2016) We normalize prototype attention scores and output scores jointly. Let $\bar { \alpha } _ { i }$ represent attention weights for each prototype sequence before normalization. Then, we concatenate them to the output vector in Eq. 27.
|
| 404 |
+
|
| 405 |
+
$$
|
| 406 |
+
\mathrm { f i n a l } ^ { t } = [ \mathrm { o u t p u t } ^ { t } , \bar { \alpha } _ { 1 } , . . . , \bar { \alpha } _ { n } ]
|
| 407 |
+
$$
|
| 408 |
+
|
| 409 |
+
We obtain a probability vector via a final softmax layer:
|
| 410 |
+
|
| 411 |
+
$$
|
| 412 |
+
{ \mathrm { p r o b } } ^ { t } = \operatorname { s o f t m a x } ( f i n a l ^ { t } )
|
| 413 |
+
$$
|
| 414 |
+
|
| 415 |
+
That size of this probability vector is vocabulary size plus the total length all prototypes. We then project this into the output space by:
|
| 416 |
+
|
| 417 |
+
$$
|
| 418 |
+
p ^ { t } ( w ) = \mathtt { p r o b } ^ { t } ( \mathtt { i n d i c e s } ( w ) )
|
| 419 |
+
$$
|
| 420 |
+
|
| 421 |
+
where indices finds all corresponding scores in probt for token $w$ where there might be more than one element for a given $w$ . This is because one score can come from the outputt region, and others from the prototype regions of $p r o b ^ { t }$ . During training we applied 0.5 dropout to the indices from outputt. Thus, the model is encouraged to copy more.
|
| 422 |
+
|
| 423 |
+
# B NEIGHBORHOODS AND SAMPLING
|
| 424 |
+
|
| 425 |
+
In the Eq. 20 and Eq. 21 we expressed the generic form of neighborhood sets. Here we provide the implementation details.
|
| 426 |
+
|
| 427 |
+
SCAN In the jump split, we use long-short recombination with $\delta = 0 . 5$ . In around right we use long-long recombination with $\delta = 0 . 5$ , and construct $\Omega$ so that the first and second prototypes to differ by a single token. We randomly pick $k < 1 0 \times 3$ (10 different first prototypes, and 3 different second prototypes for each of them) prototype pairs that satisfy these conditions. For the recomb- $^ { l }$ experiment, we use the same neighborhood setup except but consider only the $k < 1 0$ first prototypes.
|
| 428 |
+
|
| 429 |
+
Sampling In the jump split, we used beam search with beam size 4 in the decoder. We calculate the mean and standard deviation over the lengths of both among the first $d _ { 1 } ^ { \prime }$ and the second $d _ { 2 } ^ { \prime }$ prototypes in the train set. Then, during the sampling, we expect the first and second prototypes whose length is shorter than their respective mean plus standard deviation. This decision is based on the fact that the part of the $\Omega$ that the model is exposed to is determined by the empirical distribution, $\hat { \Omega }$ , that arises from training neighborhoods. When sampling, we try to pick prototypes from a distribution that are close to properties of that empirical distribution. In around right, we use temperature sampling with $T = 0 . 4$ . If a model cannot sample the expected number of both novel and unique samples within a reasonable time, we increase temperature $T$ .
|
| 430 |
+
|
| 431 |
+
Morphology We use long-long recombination, as explained in the paper, with slight modifications which leverage the structure of the task. We set $\Omega$ as:
|
| 432 |
+
|
| 433 |
+
$$
|
| 434 |
+
\begin{array} { r } { \Omega = \{ ( d _ { 1 } , d _ { 2 } ) | d _ { \mathrm { 1 t a g s } } ^ { \prime } \neq d _ { 2 t a g s } ^ { \prime } , ( d _ { \mathrm { t a g s } } \backslash d _ { \mathrm { 1 t a g s } } ^ { \prime } \backslash d _ { \mathrm { 2 t a g s } } ^ { \prime } ) = 0 \} } \end{array}
|
| 435 |
+
$$
|
| 436 |
+
|
| 437 |
+
For the recomb-1 model ${ \mathcal { N } } ( d )$ utilizes tag similarity, lemma similarity and is constructed using a score function:
|
| 438 |
+
|
| 439 |
+
$$
|
| 440 |
+
\mathrm { s c o r e } _ { 1 } ( d , d _ { 1 } ^ { \prime } ) = \left( | d _ { \mathrm { t a g s } } \Delta d _ { \mathrm { 1 t a g s } } ^ { \prime } | , \mathrm { j a c c a r d } ( d _ { \mathrm { l e m m a } } , d _ { \mathrm { 1 l e m m a } } ^ { \prime } ) \right)
|
| 441 |
+
$$
|
| 442 |
+
|
| 443 |
+
Given $d$ , we sort training examples by using $s c o r e _ { 1 }$ as the comparison key and pick the four smallest neighbors (using a lexicographic sort) to form ${ \mathcal { N } } ( d )$ .
|
| 444 |
+
|
| 445 |
+
For the recomb-2 model, ${ \mathcal { N } } ( d )$ uses the same score function for the first prototype as in the recomb-1 case. The second prototype is selected using:
|
| 446 |
+
|
| 447 |
+
$$
|
| 448 |
+
\mathrm { s c o r e } _ { 2 } ( d , d _ { 1 } ^ { \prime } , d _ { 2 } ^ { \prime } ) = \left( d _ { \mathrm { t a g s } } \neq d _ { \mathrm { 2 t a g s } } ^ { \prime } , | d _ { \mathrm { 1 t a g s } } ^ { \prime } \Delta d _ { \mathrm { 2 t a g s } } ^ { \prime } | \right)
|
| 449 |
+
$$
|
| 450 |
+
|
| 451 |
+
Given $x$ , and a scored first prototype, we do one more sort over training examples by using ${ \mathrm { s c o r e } } _ { 2 }$ as the comparison key. Then we pick first four neighbors for ${ \mathcal { N } } ( d )$ .
|
| 452 |
+
|
| 453 |
+
Sampling We use a mix strategy of temperature sampling with $T = 0 . 5$ and greedy sampling in which we use the former for $d _ { \mathrm { i n p u t } }$ and the latter for $d _ { \mathrm { o u t p u t } }$ . We sample 180 unique and novel examples.
|
| 454 |
+
|
| 455 |
+
# C GENERATIVE MODEL TRAINING
|
| 456 |
+
|
| 457 |
+
Morphology All of the hyper parameters mentioned here are optimized by a grid search on the Spanish validation set. We train our models for 25 epochs5. We use Adam optimizer with learning rate 0.0001. The generative model is trained on morphological reinflection order $( d _ { \mathrm { l e m m a } } d _ { \mathrm { t a g s } } \triangleright d _ { \mathrm { i n f l e c t i o n } } )$ from left to right, then the samples from the model are reordered for morphological analysis task $( d _ { \mathrm { i n f l e c t i o n } } \triangleright d _ { \mathrm { l e m m a } } d _ { \mathrm { t a g s } } )$ .
|
| 458 |
+
|
| 459 |
+
SCAN We use different number of epochs for jump and around right splits where all models are trained for 8 epochs in the former and 3 epochs in the latter. We use Adam optimizer with learning rate 0.002, and gradient norm clip with 1.0.
|
| 460 |
+
|
| 461 |
+
# D SEQ2SEQ BASELINE MODEL
|
| 462 |
+
|
| 463 |
+
After generating novel samples, we either concatenate them to the training data (in morphology), or sample training batches from a mixture of the original training data and the augmented data. Our conditional model is the same as the generative model used in morphology experiments, described in detail in the paper body, replacing $d _ { \mathrm { p r o t o } }$ with $x$ , and $d$ with $y$ .
|
| 464 |
+
|
| 465 |
+
Every conditional model’s size is the same as the corresponding generative model which was used for augmentation. This is to ensure that the conditional model and the generative model have the same capacity. We train conditional models for 150 epochs for SCAN and we used augmentation ratios of $p _ { \mathrm { a u g } } = 0 . 0 1$ and $p _ { \mathrm { a u g } } = 0 . 2$ in jump and around right, respectively. For morphology, we train the conditional models for 100 epochs, and we use all generated examples for augmentation.
|
| 466 |
+
|
| 467 |
+
# E DIRECT INFERENCE
|
| 468 |
+
|
| 469 |
+
To adapt the prototype-based model for conditional prediction, we condition the neighborhood function on the input $x$ rather than the full datum $d$ , as in Hashimoto et al. (2018). Candidate $y \mathrm { s }$ are then sampled from the generative model given the observed $x$ while marginalizing over retrieved prototypes. Finally, we re-rank these candidates via Eq. 7 and output the highest-scoring candidate.
|
| 470 |
+
|
| 471 |
+
# F VAE MODEL
|
| 472 |
+
|
| 473 |
+
Prior $p ( z )$ : We use the same prior as Guu et al. (2018) given in Eq. 31. In this prior, $z$ is defined by a norm and direction vector. The norm is sampled from the uniform distribution between zero and a maximum possible norm $\mu _ { \mathrm { m a x } } ~ = ~ 1 0 . 0$ , and the direction is sampled uniformly from the unit hypersphere. This sampling procedure corresponds to a von Mises–Fisher distribution with concentration parameter zero.
|
| 474 |
+
|
| 475 |
+
$$
|
| 476 |
+
z = z _ { \mathrm { n o r m } } \cdot z _ { \mathrm { d i r } } \quad w h e r e \quad z _ { \mathrm { n o r m } } \sim U ( 0 , \mu _ { \mathrm { m a x } } ) , \quad z _ { \mathrm { d i r } } \sim \mathrm { v m F } ( \vec { u } , 0 )
|
| 477 |
+
$$
|
| 478 |
+
|
| 479 |
+
For SCAN, the size of $z$ is 32, and for morphology the size of $z$ is 2.
|
| 480 |
+
|
| 481 |
+
Proposal Network $\boldsymbol { q } ( \boldsymbol { z } | \boldsymbol { d } , d _ { 1 : n } )$ : Similarly to the prior, the posterior network decomposes $z$ into its norm and direction vectors. The norm vector is sampled from a uniform distribution at $( | \mu | , \operatorname* { m i n } ( | \mu | +$ $\epsilon , \mu _ { \mathrm { m a x } } )$ ), and the direction is sampled from the von Mises–Fisher distribution $\operatorname { v m F } ( \mu , \kappa )$ where $\kappa = 2 5 , \epsilon = 1 . 0$ .
|
| 482 |
+
|
| 483 |
+
$$
|
| 484 |
+
\begin{array} { r l } & { h _ { \mathrm { f i n a l } } = \bigl ( \overline { { h } } _ { \mathrm { p r o t o } } \bigr ) _ { \mathrm { s t a r t } } + \bigl ( \overline { { h } } _ { \mathrm { p r o t o } } \bigr ) _ { e n d } } \\ & { \qquad \mu = \mathrm { t a n h } \bigl ( W _ { z } \left[ h _ { d \mathrm { f i n a l } } , h _ { q \mathrm { f i n a l } } \right] \bigr ) } \\ & { z _ { \mathrm { n o r m } } \sim U ( | \mu | , m i n ( | \mu | + \epsilon , \mu _ { \mathrm { m a x } } ) \bigr ) } \\ & { \qquad z _ { \mathrm { d i r } } \sim v m F ( \mu , \kappa ) } \\ & { \qquad z = z _ { \mathrm { n o r m } } \cdot z _ { \mathrm { d i r } } } \end{array}
|
| 485 |
+
$$
|
| 486 |
+
|
| 487 |
+
# G ADDITIONAL RESULTS
|
| 488 |
+
|
| 489 |
+
# G.1 MORPHOLOGY RESULTS
|
| 490 |
+
|
| 491 |
+
In the paper, Table 2 shows morphology results for (non-VAE) models with 8 hints (past- and futuretense examples in the training set). Here, we provide additional results for different hint set sizes and model variants.
|
| 492 |
+
|
| 493 |
+
# G.1.1 HINTS=4
|
| 494 |
+
|
| 495 |
+
Table 3: Exact Match Accuracy
|
| 496 |
+
|
| 497 |
+
<table><tr><td></td><td colspan="2">Spanish</td><td colspan="2">Swahili</td><td colspan="2">Turkish</td></tr><tr><td></td><td>FUT+PST*</td><td>OTHER</td><td>FUT+PST</td><td>OTHER</td><td>FUT+PST</td><td>OTHER</td></tr><tr><td>baseline</td><td>0.078 ±0.029</td><td>0.63 ±0.09</td><td>0.107 ±0.034</td><td>0.532 ±0.029</td><td>0.067 ±0.020</td><td>0.57 ±0.04</td></tr><tr><td>geca</td><td>0.072 ±0.019</td><td>0.63 ±0.05</td><td>0.039 ±0.011</td><td>0.496 ±0.027</td><td>0.052 ±0.014</td><td>0.54 ±0.08</td></tr><tr><td>geca + resampling</td><td>0.16 ±0.04</td><td>0.65 ±0.05</td><td>0.27 ±0.08</td><td>0.52 ±0.04</td><td>0.12 ±0.04</td><td>0.554 ±0.029</td></tr><tr><td>learned aug</td><td>0.063 ±0.012</td><td>0.65 ±0.04</td><td>0.066 ±0.034</td><td>0.52 ±0.04</td><td>0.074 ±0.021</td><td>0.57 ±0.04</td></tr><tr><td>learned aug + resampling</td><td>0.098 ±0.021</td><td>0.65 ±0.05</td><td>0.29 ±0.06</td><td>0.480 ±0.035</td><td>0.092 ±0.029</td><td>0.54 ±0.06</td></tr><tr><td>recomb-1</td><td>0.063 ±0.017</td><td>0.674 ±0.021</td><td>0.061 ±0.017</td><td>0.520 ±0.028</td><td>0.055 ±0.021</td><td>0.554 ±0.030</td></tr><tr><td>recomb-1 + resampling</td><td>0.13 ±0.04</td><td>0.64 ±0.04</td><td>0.29 ±0.04</td><td>0.48 ±0.04</td><td>0.15 ±0.04</td><td>0.52 ±0.06</td></tr><tr><td>recomb-2</td><td>0.061 ±0.010</td><td>0.656 ±0.030</td><td>0.08 ±0.06</td><td>0.524 ±0.026</td><td>0.073 ±0.019</td><td>0.58 ±0.05</td></tr><tr><td>recomb-2+resampling</td><td>0.108 ±0.021</td><td>0.64 ±0.05</td><td>0.18 ±0.04</td><td>0.542 ±0.035</td><td>0.067 ±0.026</td><td>0.55 ±0.06</td></tr></table>
|
| 498 |
+
|
| 499 |
+
Table 4: F1 Accuracy
|
| 500 |
+
|
| 501 |
+
<table><tr><td></td><td colspan="2">Spanish</td><td colspan="2">Swahili</td><td colspan="2">Turkish</td></tr><tr><td></td><td>FUT+PST*</td><td>OTHER</td><td>FUT+PST</td><td>OTHER</td><td>FUT+PST</td><td>OTHER</td></tr><tr><td>baseline</td><td>0.609 ±0.025</td><td>0.873 ±0.034</td><td>0.746 ±0.013</td><td>0.897 ±0.005</td><td>0.561 ±0.032</td><td>0.867 ±0.015</td></tr><tr><td>geca</td><td>0.606 ±0.019</td><td>0.871 ±0.017</td><td>0.722 ±0.018</td><td>0.884 ±0.007</td><td>0.565 ±0.034</td><td>0.856 ±0.028</td></tr><tr><td>geca + resampling</td><td>0.675 ±0.017</td><td>0.870 ±0.022</td><td>0.802 ±0.023</td><td>0.892 ±0.010</td><td>0.65 ±0.05</td><td>0.850 ±0.019</td></tr><tr><td>learned aug</td><td>0.597 ±0.021</td><td>0.871 ±0.024</td><td>0.737 ±0.010</td><td>0.897 ±0.011</td><td>0.58 ±0.04</td><td>0.853 ±0.026</td></tr><tr><td>learned aug +resampling</td><td>0.646 ±0.007</td><td>0.872 ±0.028</td><td>0.826 ±0.013</td><td>0.887 ±0.010</td><td>0.637 ±0.032</td><td>0.835 ±0.034</td></tr><tr><td>recomb-1</td><td>0.596 ±0.020</td><td>0.884 ±0.010</td><td>0.727 ±0.012</td><td>0.893 ±0.010</td><td>0.557 ±0.032</td><td>0.868 ±0.010</td></tr><tr><td>recomb-1 + resampling</td><td>0.663 ±0.029</td><td>0.874 ±0.014</td><td>0.812 ±0.017</td><td>0.886 ±0.011</td><td>0.67 ±0.04</td><td>0.84 ±0.04</td></tr><tr><td>recomb-2</td><td>0.598 ±0.019</td><td>0.874 ±0.007</td><td>0.730 ±0.023</td><td>0.894 ±0.008</td><td>0.581 ±0.035</td><td>0.865 ±0.024</td></tr><tr><td>recomb-2 + resampling</td><td>0.658 ±0.012</td><td>0.872 ±0.015</td><td>0.778 ±0.011</td><td>0.897 ±0.007</td><td>0.609 ±0.032</td><td>0.850 ±0.029</td></tr></table>
|
| 502 |
+
|
| 503 |
+
# G.1.2 HINTS=8
|
| 504 |
+
|
| 505 |
+
Main 8-prototype $F _ { 1 }$ results are provided in the body of the paper. Here we provide exact match results and an extra set of comparisons to the VAE model.
|
| 506 |
+
|
| 507 |
+
Table 5: Exact Match Accuracy
|
| 508 |
+
|
| 509 |
+
<table><tr><td></td><td colspan="2">Spanish</td><td colspan="2">Swahili</td><td colspan="2">Turkish</td></tr><tr><td></td><td>FUT+PST*</td><td>OTHER</td><td>FUT+PST</td><td>OTHER</td><td>FUT+PST</td><td>OTHER</td></tr><tr><td>baseline</td><td>0.151 ±0.017</td><td>0.65 ±0.04</td><td>0.15 ±0.04</td><td>0.554 ±0.034</td><td>0.23 ±0.06</td><td>0.55 ±0.04</td></tr><tr><td>geca</td><td>0.136 ±0.030</td><td>0.638 ±0.026</td><td>0.15 ±0.05</td><td>0.55 ±0.06</td><td>0.21 ±0.05</td><td>0.550 ±0.032</td></tr><tr><td>geca +resampling</td><td>0.249 ±0.034</td><td>0.64 ±0.04</td><td>0.25 ±0.05</td><td>0.532 ±0.033</td><td>0.27 ±0.07</td><td>0.524 ±0.026</td></tr><tr><td>learned aug</td><td>0.163 ±0.030</td><td>0.652 ±0.033</td><td>0.18 ±0.05</td><td>0.560 ±0.026</td><td>0.23 ±0.04</td><td>0.548 ±0.019</td></tr><tr><td>learned aug + resampling</td><td>0.181 ±0.026</td><td>0.590 ±0.032</td><td>0.34 ±0.06</td><td>0.552 ±0.029</td><td>0.24 ±0.04</td><td>0.53 ±0.05</td></tr><tr><td>recomb-1</td><td>0.155 ±0.018</td><td>0.628 ±0.020</td><td>0.161 ±0.017</td><td>0.560 ±0.025</td><td>0.22 ±0.04</td><td>0.538 ±0.025</td></tr><tr><td>recomb-1 +resampling</td><td>0.218 ±0.032</td><td>0.616 ±0.034</td><td>0.35 ±0.04</td><td>0.53 ±0.04</td><td>0.30 ±0.04</td><td>0.52 ±0.04</td></tr><tr><td>recomb-2</td><td>0.131 ±0.028</td><td>0.634 ±0.027</td><td>0.19 ±0.11</td><td>0.56 ±0.04</td><td>0.24 ±0.05</td><td>0.528 ±0.032</td></tr><tr><td>recomb-2 +resampling</td><td>0.203 ±0.035</td><td>0.63 ±0.05</td><td>0.27 ±0.07</td><td>0.552 ±0.031</td><td>0.25 ±0.05</td><td>0.54 ±0.06</td></tr></table>
|
| 510 |
+
|
| 511 |
+
Table 6: $F _ { 1 }$ Accuracy (VAE model)
|
| 512 |
+
|
| 513 |
+
<table><tr><td></td><td colspan="2">Spanish</td><td colspan="2">Swahili</td><td colspan="2">Turkish</td></tr><tr><td></td><td>FUT+PST*</td><td>OTHER</td><td>FUT+PST</td><td>OTHER</td><td>FUT+PST</td><td>OTHER</td></tr><tr><td>learned aug + resampling +vae</td><td>0.689 ±0.018</td><td>0.859 ±0.010</td><td>0.845 ±0.014</td><td>0.896 ±0.011</td><td>0.730 ±0.032</td><td>0.850 ±0.015</td></tr><tr><td>recomb-1 + resampling +vae</td><td>0.717 ±0.014</td><td>0.870 ±0.007</td><td>0.843 ±0.014</td><td>0.898 ±0.010</td><td>0.736 ±0.030</td><td>0.859 ±0.031</td></tr><tr><td>recomb-2 + resampling +vae</td><td>0.710 ±0.008</td><td>0.865 ±0.012</td><td>0.824 ±0.015</td><td>0.896 ±0.011</td><td>0.751 ±0.027</td><td>0.848 ±0.027</td></tr></table>
|
| 514 |
+
|
| 515 |
+
# G.1.3 HINTS=16
|
| 516 |
+
|
| 517 |
+
Table 7: Exact Match Accuracy
|
| 518 |
+
|
| 519 |
+
<table><tr><td></td><td colspan="2">Spanish</td><td colspan="2">Swahili</td><td colspan="2">Turkish</td></tr><tr><td></td><td>FUT+PST*</td><td>OTHER</td><td>FUT+PST</td><td>OTHER</td><td>FUT+PST</td><td>OTHER</td></tr><tr><td>baseline</td><td>0.27 ±0.05</td><td>0.65 ±0.04</td><td>0.28 ±0.06</td><td>0.544 ±0.029</td><td>0.40 ±0.04</td><td>0.614 ±0.032</td></tr><tr><td>geca</td><td>0.26 ±0.06</td><td>0.65 ±0.06</td><td>0.26 ±0.05</td><td>0.530 ±0.028</td><td>0.37 ±0.05</td><td>0.570 ±0.035</td></tr><tr><td>geca +resampling</td><td>0.34 ±0.05</td><td>0.63 ±0.04</td><td>0.32 ±0.07</td><td>0.506 ±0.034</td><td>0.42 ±0.05</td><td>0.590 ±0.035</td></tr><tr><td>learned aug</td><td>0.25 ±0.04</td><td>0.65 ±0.04</td><td>0.32 ±0.06</td><td>0.538 ±0.028</td><td>0.39 ±0.04</td><td>0.58 ±0.05</td></tr><tr><td>learned aug +resampling</td><td>0.230 ±0.035</td><td>0.61 ±0.04</td><td>0.42 ±0.06</td><td>0.54 ±0.04</td><td>0.42 ±0.05</td><td>0.578 ±0.027</td></tr><tr><td>recomb-1</td><td>0.27 ±0.05</td><td>0.63 ±0.06</td><td>0.32 ±0.05</td><td>0.55 ±0.04</td><td>0.35 ±0.06</td><td>0.60 ±0.05</td></tr><tr><td>recomb-1 +resampling</td><td>0.28 ±0.04</td><td>0.61 ±0.07</td><td>0.418 ±0.035</td><td>0.548 ±0.023</td><td>0.35 ±0.06</td><td>0.56 ±0.04</td></tr><tr><td>recomb-2</td><td>0.22 ±0.06</td><td>0.62 ±0.07</td><td>0.28 ±0.04</td><td>0.56 ±0.04</td><td>0.40 ±0.06</td><td>0.596 ±0.024</td></tr><tr><td>recomb-2 +resampling</td><td>0.262 ±0.025</td><td>0.61 ±0.07</td><td>0.405 ±0.028</td><td>0.53 ±0.04</td><td>0.43 ±0.06</td><td>0.61 ±0.04</td></tr></table>
|
| 520 |
+
|
| 521 |
+
Table 8: F1 Accuracy
|
| 522 |
+
|
| 523 |
+
<table><tr><td></td><td colspan="2">Spanish</td><td colspan="2">Swahili</td><td colspan="2">Turkish</td></tr><tr><td></td><td>FUT+PST*</td><td>OTHER</td><td>FUT+PST</td><td>OTHER</td><td>FUT+PST</td><td>OTHER</td></tr><tr><td>baseline</td><td>0.733 ±0.014</td><td>0.881 ±0.012</td><td>0.811 ±0.018</td><td>0.893 ±0.011</td><td>0.750 ±0.026</td><td>0.875 ±0.021</td></tr><tr><td>geca</td><td>0.736 ±0.019</td><td>0.884 ±0.018</td><td>0.800 ±0.024</td><td>0.889 ±0.012</td><td>0.74 ±0.04</td><td>0.863 ±0.019</td></tr><tr><td>geca + resampling</td><td>0.782 ±0.024</td><td>0.867 ±0.012</td><td>0.830 ±0.021</td><td>0.885 ±0.013</td><td>0.794 ±0.032</td><td>0.865 ±0.018</td></tr><tr><td>learned aug</td><td>0.738 ±0.020</td><td>0.877 ±0.008</td><td>0.816 ±0.024</td><td>0.893 ±0.012</td><td>0.752 ±0.024</td><td>0.868 ±0.020</td></tr><tr><td>learned aug + resampling</td><td>0.745 ±0.019</td><td>0.870 ±0.012</td><td>0.866 ±0.016</td><td>0.894 ±0.013</td><td>0.787 ±0.031</td><td>0.863 ±0.021</td></tr><tr><td>recomb-1</td><td>0.738 ±0.021</td><td>0.877 ±0.019</td><td>0.820 ±0.018</td><td>0.896 ±0.014</td><td>0.735 ±0.033</td><td>0.874 ±0.026</td></tr><tr><td>recomb-1 + resampling</td><td>0.770 ±0.020</td><td>0.867 ±0.023</td><td>0.872 ±0.005</td><td>0.892 ±0.010</td><td>0.778 ±0.024</td><td>0.861 ±0.022</td></tr><tr><td>recomb-2</td><td>0.716 ±0.019</td><td>0.876 ±0.022</td><td>0.815 ±0.017</td><td>0.897 ±0.016</td><td>0.752 ±0.034</td><td>0.873 ±0.017</td></tr><tr><td>recomb-2+resampling</td><td>0.765 ±0.023</td><td>0.868 ±0.021</td><td>0.856 ±0.015</td><td>0.888 ±0.016</td><td>0.808 ±0.018</td><td>0.868 ±0.027</td></tr></table>
|
| 524 |
+
|
| 525 |
+
# G.2 SIGNIFICANCE TESTS
|
| 526 |
+
|
| 527 |
+
Tables 9, 10 and 11 sho the $p$ -values for pairwise differences between the baseline and prototype-based models
|
| 528 |
+
|
| 529 |
+
Table 9: Turkish language $p$ -values for paired $t$ -test in $\mathrm { P S T + F U T }$ tenses for the average $F _ { 1 }$ (micro) scores over several runs without Bonferronni correction.
|
| 530 |
+
|
| 531 |
+
<table><tr><td></td><td>baseline</td><td>geca</td><td>learned aug</td><td>recomb-1</td><td>recomb-2</td><td>geca + resampling</td><td></td><td>learned aug + resamplingrecomb-1 + resamplingrecomb-2 + resampling</td><td></td></tr><tr><td>baseline</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>geca</td><td>0.259314</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>learned aug</td><td>0.352506</td><td>0.802058</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>recomb-1</td><td>0.707534</td><td>0.129244</td><td>0.187597</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>recomb-2</td><td>0.233578</td><td>0.0230554</td><td>0.0331794</td><td>0.363375</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>geca + resampling</td><td>1.0125e-16</td><td>3.7044e-12</td><td>4.07678e-15</td><td>6.04788e-17</td><td>1.71167e-19</td><td></td><td></td><td></td><td></td></tr><tr><td>leamed aug + resampling</td><td>8.00807e-10</td><td>1.37553e-07</td><td>6.51548e-08</td><td>6.35314e-11</td><td>3.76501e-13</td><td>0.0167999</td><td></td><td></td><td></td></tr><tr><td>recomb-1 + resampling</td><td>3.85877e-26</td><td>1.60117e-20</td><td>2.76421e-22</td><td>6.41228e-26</td><td>2.07776e-26</td><td>0.0109365</td><td>1.948e-06</td><td></td><td></td></tr><tr><td>recomb-2 + resampling</td><td>2.56689e-15</td><td>3.4083e-13</td><td>2.08177e-14</td><td>2.92113e-18</td><td>1.79928e-19</td><td>0.981886</td><td>0.0190462</td><td>0.0101878</td><td></td></tr></table>
|
| 532 |
+
|
| 533 |
+
Table 10: Spanish language $p$ -values for paired $t$ -test in PST+FUT tenses for the average $F _ { 1 }$ (micro) scores over several runs without Bonferronni correction.
|
| 534 |
+
|
| 535 |
+
<table><tr><td></td><td>baseline</td><td>geca</td><td>learned aug</td><td>recomb-1</td><td>recomb-2</td><td></td><td>geca + resamplinglearned aug + resamplingrecomb-1 + resamplingrecomb-2 + resampling</td><td></td><td></td></tr><tr><td>baseline</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>geca</td><td>0.394748</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>learned aug</td><td>0.761129</td><td>0.635337</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>recomb-1</td><td>0.428606</td><td>0.974851</td><td>0.620601</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>recomb-2</td><td>0.199768</td><td>0.601998</td><td>0.317494</td><td>0.625078</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>geca + resampling</td><td>2.27478e-25</td><td>6.11513e-29</td><td>3.30904e-24</td><td>1.38242e-24</td><td>2.19894e-27</td><td></td><td></td><td></td><td></td></tr><tr><td>learned aug + resampling</td><td>1.09224e-10</td><td>9.34816e-13</td><td>1.40474e-11</td><td>4.70624e-13</td><td>4.78418e-14</td><td>0.000137083</td><td></td><td></td><td></td></tr><tr><td>recomb-1 + resampling</td><td>4.00039e-27</td><td>8.88347e-30</td><td>4.06546e-25</td><td>1.2159e-28</td><td>7.2465e-29</td><td>0.495734</td><td>1.35727e-05</td><td></td><td></td></tr><tr><td>recomb-2 + resampling</td><td>1.17709e-17</td><td>1.29429e-21</td><td>4.07864e-18</td><td>1.12332e-19</td><td>1.66638e-21</td><td>0.313143</td><td>0.00925477</td><td>0.103819</td><td></td></tr></table>
|
| 536 |
+
|
| 537 |
+
Table 11: Swahili language $p$ -values for paired $t$ -test in $\mathrm { P S T + F U T }$ tenses for the average $F _ { 1 }$ (micro) scores over several runs without Bonferronni correction.
|
| 538 |
+
|
| 539 |
+
<table><tr><td></td><td>baseline</td><td>geca</td><td>learned aug</td><td>recomb-1</td><td>recomb-2</td><td></td><td>geca + resamplinglearned aug + resamplingrecomb-1 + resamplingrecomb-2 + resampling</td><td></td><td></td></tr><tr><td>baseline</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>geca</td><td>0.606002</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>learned aug</td><td>0.000857131</td><td>0.00384601</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>recomb-1</td><td>6.27581e-05</td><td>0.00101351</td><td>0.769589</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>recomb-2</td><td>1.75947e-05</td><td>0.000207507</td><td>0.263242</td><td>0.402064</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>geca + resampling</td><td>2.58696e-21</td><td>8.85433e-19</td><td>4.57259e-11</td><td>1.33673e-11</td><td>1.87968e-08</td><td></td><td></td><td></td><td></td></tr><tr><td>learned aug + resampling</td><td>7.09377e-53</td><td>1.46895e-47</td><td>2.3846e-38</td><td>6.32242e-38</td><td>2.09274e-30</td><td>3.26321e-10</td><td></td><td></td><td></td></tr><tr><td>recomb-1 + resampling</td><td>1.66361e-58</td><td>1.28557e-54</td><td>9.46035e-44</td><td>2.05703e-45</td><td>9.46848e-37</td><td>1.60241e-17</td><td>0.0749463</td><td></td><td></td></tr><tr><td>recomb-2 +resampling</td><td>2.16531e-31</td><td>3.52334e-25</td><td>7.80047e-20</td><td>1.08762e-19</td><td>1.26218e-15</td><td>0.0756646</td><td>1.52594e-06</td><td>2.51776e-11</td><td></td></tr></table>
|
| 540 |
+
|
| 541 |
+
# G.3 GENERATED SAMPLES
|
| 542 |
+
|
| 543 |
+
All samples are randomly selected unless otherwise indicated.
|
| 544 |
+
|
| 545 |
+
# G.3.1 SCAN
|
| 546 |
+
|
| 547 |
+
In Table 12, we present three test samples from the SCAN task along with the predictions by direct inference and the conditional model trained on the augmented data with recomb-2. Note that the augmentation procedure was able to create novel samples whose input $( x )$ happens to be in the test set (Examples 1 and 3) while $y$ may or may not be correct (Example 1).
|
| 548 |
+
|
| 549 |
+
<table><tr><td></td><td>Example 1 (jump)</td><td>Example 2 (jump)</td><td>Example 3 (around right)</td></tr><tr><td>Input (𝑥= )</td><td>walk twice after jump twice</td><td>run right after jump twice</td><td> jump left and jump around right</td></tr><tr><td>True label (y) in augmented dataset</td><td>JUMP JUMP WALK WALK JUMP JUMP JUMP WALK</td><td>JUMP JUMP RTURN RUN (not generated)</td><td>TURN LEFT JUMP'TURN RIGHT JUMP TURN RIGHT JUMP TURN RIGHT JUMP TURN RIGHT JUMP TURN LEFT JUMP TURN RIGHT JUMP TURN RIGHT JUMP TURN RIGHT JUMP TURN RIGHT JUMP</td></tr><tr><td>Predicted @</td><td></td><td></td><td></td></tr><tr><td>├ direct inference Lrecomb-2</td><td>JUMP JUMP JUMP WALK JUMP JUMP WALK WALK</td><td>LOOK LOOK RTURN JUMP JUMP JUMP RTURN RUN</td><td>TURN LEFT JUMP TURN LEFT JUMP TURN LEFT JUMP TURN LEFT JUMP TURN LEFT JUMP</td></tr></table>
|
| 550 |
+
|
| 551 |
+
Table 12: Comparison of generative and unconditional model predictions with and without data augmentation. The conditional model trained on augmented data (final row) is able to compensate for errors in data augmentation (Example 1) and generalize to examples never generated by the data augmentation procedure (Example 2), and often times if a sample is correctly created by the augmentation procedure, the conditional model also gets it right (Example 3).
|
| 552 |
+
|
| 553 |
+
Below are a set of samples from the learned aug (basic) model for SCAN dataset’s jump and around right splits, in order:
|
| 554 |
+
|
| 555 |
+
IN: run opposite and walk opposite right twice OUT: RUN TURN RIGHT TURN RIGHT RUN TURN RIGHT TURN RIGHT WALK
|
| 556 |
+
IN: look around right thrice after run around thrice thrice OUT: TURN RIGHT RUN TURN RIGHT RUN TURN RIGHT RUN TURN RIGHT RUN TURN RIGHT RUN TURN RIGHT RUN TURN RIGHT RUN TURN RIGHT RUN TURN RIGHT RUN TURN RIGHT RUN TURN RIGHT RUN TURN RIGHT RUN TURN RIGHT LOOK TURN RIGHT LOOK TURN RIGHT LOOK TURN RIGHT LOOK TURN RIGHT LOOK
|
| 557 |
+
IN: look opposite right twice and walk around twice OUT: TURN RIGHT TURN RIGHT LOOK TURN RIGHT TURN RIGHT LOOK TURN RIGHT WALK TURN LEFT WALK TURN LEFT WALK TURN LEFT WALK
|
| 558 |
+
IN: run opposite and thrice OUT: RUN TURN LEFT RUN RUN
|
| 559 |
+
|
| 560 |
+
IN: walk opposite right thrice turn turn right thrice OUT: TURN RIGHT TURN RIGHT TURN RIGHT TURN RIGHT TURN RIGHT TURN RIGHT TURN RIGHT TURN RIGHT TURN RIGHT TURN RIGHT WALK IN: jump opposite right twice jump look around left OUT: TURN RIGHT TURN RIGHT JUMP TURN LEFT TURN LEFT JUMP TURN LEFT TURN LEFT LOOK TURN LEFT TURN LEFT LOOK
|
| 561 |
+
|
| 562 |
+
IN: walk around left thrice after jump left left OUT: TURN LEFT WALK TURN LEFT WALK TURN LEFT WALK TURN LEFT WALK TURN LEFT WALK TURN LEFT WALK TURN LEFT WALK TURN LEFT WALK TURN LEFT WALK TURN LEFT WALK TURN LEFT WALK TURN LEFT WALK TURN LEFT WALK TURN LEFT WALK TURN LEFT WALK TURN LEFT WALK TURN LEFT WALK
|
| 563 |
+
|
| 564 |
+
IN: run opposite right twice walk run left thrice OUT: TURN RIGHT TURN RIGHT RUN TURN RIGHT TURN RIGHT WALK TURN LEFT TURN LEFT RUN TURN LEFT TURN LEFT RUN
|
| 565 |
+
|
| 566 |
+
Below are a set of samples from the recomb-1 model for SCAN dataset’s around right split. Note that there were no samples with rare tags generated by the model for the jump split:
|
| 567 |
+
|
| 568 |
+
IN: run around right after walk around left OUT: TURN LEFT WALK TURN LEFT WALK TURN LEFT RUN TURN LEFT RUN TURN LEFT WALK TURN LEFT WALK TURN LEFT WALK TURN LEFT WALK
|
| 569 |
+
IN: look around right after jump around left OUT: TURN LEFT LOOK TURN LEFT JUMP TURN LEFT LOOK TURN LEFT LOOK TURN LEFT JUMP TURN LEFT JUMP TURN LEFT JUMP TURN LEFT JUMP
|
| 570 |
+
IN: look around right and jump around left OUT: TURN RIGHT LOOK TURN RIGHT LOOK TURN RIGHT LOOK TURN LEFT JUMP TURN LEFT JUMP TURN LEFT JUMP TURN LEFT JUMP TURN LEFT JUMP
|
| 571 |
+
IN: walk around right and turn right twice OUT: TURN RIGHT WALK TURN RIGHT WALK TURN RIGHT WALK TURN RIGHT WALK TURN RIGHT TURN RIGHT
|
| 572 |
+
|
| 573 |
+
Below are 4 samples from the recomb-2 model for each of SCAN dataset’s jump and around right splits, respectively:
|
| 574 |
+
|
| 575 |
+
IN: jump opposite left thrice after jump opposite left thrice OUT: TURN LEFT TURN LEFT JUMP TURN LEFT TURN LEFT JUMP TURN LEFT TURN LEFT JUMP TURN LEFT TURN LEFT WALK TURN LEFT TURN LEFT WALK TURN LEFT TURN LEFT WALK
|
| 576 |
+
IN: jump left thrice and jump left thrice OUT: TURN LEFT LOOK TURN LEFT LOOK TURN LEFT LOOK TURN LEFT JUMP TURN LEFT JUMP TURN LEFT JUMP IN: jump opposite right and turn around left OUT: TURN RIGHT TURN RIGHT JUMP
|
| 577 |
+
TURN LEFT TURN LEFT TURN LEFT TURN LEFT
|
| 578 |
+
IN: turn around left and jump around left OUT: TURN LEFT TURN LEFT TURN LEFT TURN LEFT TURN LEFT JUMP TURN LEFT JUMP TURN LEFT JUMP TURN LEFT JUMP IN: look right twice after run around right OUT: TURN RIGHT RUN TURN RIGHT RUN TURN RIGHT RUN TURN RIGHT RUN TURN RIGHT LOOK TURN RIGHT LOOK
|
| 579 |
+
IN: turn right twice after look around right OUT: TURN RIGHT LOOK TURN RIGHT LOOK TURN RIGHT LOOK TURN RIGHT LOOK TURN RIGHT TURN RIGHT
|
| 580 |
+
IN: look twice and run around right OUT: LOOK LOOK TURN RIGHT RUN TURN RIGHT RUN TURN RIGHT RUN TURN RIGHT RUN
|
| 581 |
+
IN: walk opposite right twice and jump around right OUT: TURN RIGHT TURN RIGHT WALK TURN RIGHT TURN RIGHT WALK TURN RIGHT JUMP TURN RIGHT JUMP TURN RIGHT JUMP TURN RIGHT JUMP
|
| 582 |
+
|
| 583 |
+
# G.3.2 MORPHOLOGY
|
| 584 |
+
|
| 585 |
+
Below are a set of samples from the learned aug (basic) model in SIGMORPHON format.
|
| 586 |
+
|
| 587 |
+
şahmiçe şahmiçende N;LOC;SG;PSS2S
|
| 588 |
+
karadan havaya füze karadan havaya füzel N;DAT;PL;PSS3P
|
| 589 |
+
ernek erneklerine N;DAT;PL;PSS3P
|
| 590 |
+
kiler kilerime N;DAT;SG;PSS1S
|
| 591 |
+
mahlep mahlebimizi N;ACC;SG;PSS1P
|
| 592 |
+
süzmek süzerler V;IND;3;PL;PRS;POS;DECL
|
| 593 |
+
âlap âlaps N;LGSPEC1;3S;SG;PRS
|
| 594 |
+
jöle jöleleri N;ACC;PL
|
| 595 |
+
|
| 596 |
+
envejecerse envejeciéndose V.CVB;PRS colaxar colaxa V;IND;PRS;3;SG pergedrer no pergedremos V;NEG;IMP;1;PL mantear no mantees V;NEG;IMP;2;SG flaguear no flagueen V;NEG;IMP;3;PL malacostar malacostaría V;COND;3;SG
|
| 597 |
+
|
| 598 |
+
desinstar desinse V;POS;IMP;3;SG concretizar no concretices V;NEG;IMP;2;SG
|
| 599 |
+
|
| 600 |
+
Below are a set of samples from the learned aug (basic) $^ +$ resampling model.
|
| 601 |
+
|
| 602 |
+
şaşırmak şaşırmıyor musun? V;IND;2;PL;PST;PROG;POS;INTR ayılmak ayılmaya V;IND;1;SG;PST;DECL pleşmek pleşmiyor muyuz? V;IND;1;PL;PST;PROG;NEG;INTR imciyetmek imciyetmezdeğiz V;IND;1;PL;FUT;NEG;DECL kuvaşmak kuvaşmayacağız V;IND;1;PL;FUT;NEG;DECL yermek yermeyeceğiz V;IND;1;PL;FUT;NEG;DECL yarıtmak yarıtmayacağız V;IND;1;PL;FUT;NEG;DECL kelimek kelimeyeceğiz V;IND;1;PL;FUT;NEG;DECL
|
| 603 |
+
|
| 604 |
+
trasescar trasescáis V;IND;PST;2;PL;IPFV tronar tronar V;IND;FUT;1;SG terzcalminar terzcalminan V;IND;PST;3;PL;IPFV esubronizar esubronizamos V;IND;PST;1;PL;IPFV urdir urdiremos V;IND;FUT;1;PL conder conderemos V;IND;FUT;1;PL florear florearían V;IND;PST;3;PL;LGSPEC1;SG sabrordar sabrordamos V;IND;PST;1;PL;IPFV
|
| 605 |
+
|
| 606 |
+
Below are a set of samples from the recomb- $l +$ resampling model (the best performing model in Table 2). Here we additionally annotate samples with error categories.
|
| 607 |
+
|
| 608 |
+
kovulmak kovulmaz mısınız V;IND;2;PL;FUT;NEG;INTR (Inflection and tags don’t match.) düşünmek düşündüler V;IND;3;PL;PST;POS;DECL (Correct and novel.) sütmek sütmez miyiz? V;IND;2;SG;FUT;NEG;INTR (Inflection and tags don’t match.) bakmak bakmayacak mıyım? V;IND;1;PL;FUT;NEG;INTR (Inflection and tags don’t match) döndürmek döndürecek misiniz? V;IND;2;PL;FUT;POS;INTR (Correct and novel.) türkçeleştirtmek türkçeleştirtiyor m V;IND;2;PL;PST;PROG;NEG;INTR (Wrong inflection, novel tag.) çalmak çalmayız V;IND;2;PL;FUT;POS;DECL (Inflection and tags don’t match.) üsürmek üsürmezsin V;IND;2;SG;PST;NEG;DECL (Inflection and tags don’t match.)
|
| 609 |
+
|
| 610 |
+
duplicar duplicaráis V;IND;FUT;2;PL (Correct and novel)
|
| 611 |
+
efundar efundan V;SBJV;FUT;3;PL (Inflection and tags don’t match)
|
| 612 |
+
deshumanizar deshumanicas V;SBJV;PST;2;SG (Inplausible inflection.)
|
| 613 |
+
emular emulares V;SBJV;FUT;2;SG (Correct and also in train set.)
|
| 614 |
+
languidecer languidecíamos V;IND;PST;1;SG;IPFV (Inflection and tags don’t match)
|
| 615 |
+
nominar nominamos V;SBJV;FUT;1;PL (Novel tags, incorrect inflection.)
|
| 616 |
+
finciar finciare V;SBJV;FUT;1;SG (Correct and novel.)
|
| 617 |
+
abastar abasto V;IND;PST;1;SG (Inflection and tags don’t match)
|
| 618 |
+
|
| 619 |
+
# G.4 ATTENTION HEATMAP
|
| 620 |
+
|
| 621 |
+
Here we provide a visualization copy and attention mechanism in recomb-2 model for SCAN experiments.
|
| 622 |
+
|
| 623 |
+

|
| 624 |
+
Figure 3: Generation of a sample. We plot normalized output scores on the left, and attention weights to the different prototypes on the right. The prototypes are on the y axes. The model is recomb-2 model trained on SCAN jump split.
|
| 625 |
+
|
| 626 |
+
# H COMPUTE
|
| 627 |
+
|
| 628 |
+
We use a single 32GB NVIDIA V100 Volta GPU for each experiment. For every experiment, the whole pipeline which consists of training of the generative model, sampling and training of the conditional model takes less than an hour.
|
parse/train/PS3IMnScugk/PS3IMnScugk_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/PS3IMnScugk/PS3IMnScugk_middle.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/PS3IMnScugk/PS3IMnScugk_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/Sklsm20ctX/Sklsm20ctX.md
ADDED
|
@@ -0,0 +1,322 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# COMPETITIVE EXPERIENCE REPLAY
|
| 2 |
+
|
| 3 |
+
Hao Liu∗, Alexander Trott, Richard Socher, Caiming Xiong
|
| 4 |
+
Salesforce Research
|
| 5 |
+
Palo Alto, 94301
|
| 6 |
+
lhao499@gmail.com,{atrott, rsocher, cxiong}@salesforce.com
|
| 7 |
+
|
| 8 |
+
# ABSTRACT
|
| 9 |
+
|
| 10 |
+
Deep learning has achieved remarkable successes in solving challenging reinforcement learning (RL) problems when dense reward function is provided. However, in sparse reward environment it still often suffers from the need to carefully shape reward function to guide policy optimization. This limits the applicability of RL in the real world since both reinforcement learning and domain-specific knowledge are required. It is therefore of great practical importance to develop algorithms which can learn from a binary signal indicating successful task completion or other unshaped, sparse reward signals. We propose a novel method called competitive experience replay, which efficiently supplements a sparse reward by placing learning in the context of an exploration competition between a pair of agents. Our method complements the recently proposed hindsight experience replay (HER) by inducing an automatic exploratory curriculum. We evaluate our approach on the tasks of reaching various goal locations in an ant maze and manipulating objects with a robotic arm. Each task provides only binary rewards indicating whether or not the goal is achieved. Our method asymmetrically augments these sparse rewards for a pair of agents each learning the same task, creating a competitive game designed to drive exploration. Extensive experiments demonstrate that this method leads to faster converge and improved task performance.
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION
|
| 13 |
+
|
| 14 |
+
Recent progress in deep reinforcement learning has achieved very impressive results in domains ranging from playing games (Mnih et al., 2015; Silver et al., 2016; 2017; OpenAI, 2018), to high dimensional continuous control (Schulman et al., 2016; 2017; 2015), and robotics (Levine et al., 2018; Kalashnikov et al., 2018; Andrychowicz et al., 2018b).
|
| 15 |
+
|
| 16 |
+
Despite these successes, in robotics control and many other areas, deep reinforcement learning still suffers from the need to engineer a proper reward function to guide policy optimization (see e.g. Popov et al. 2017, $\mathrm { N g }$ et al. 2006). In robotic control as stacking bricks, reward function need to be sharped to very complex which consists of multiple terms(Popov et al., 2017). It is extremely hard and not applicable to engineer such reward function for each task in real world since both reinforcement learning expertise and domain-specific knowledge are required. Learning to perform well in environments with sparse rewards remains a major challenge. Therefore, it is of great practical importance to develop algorithms which can learn from binary signal indicating successful task completion or other unshaped reward signal.
|
| 17 |
+
|
| 18 |
+
In environments where dense reward function is not available, only a small fraction of the agents’ experiences will be useful to compute gradient to optimize policy, leading to substantial high sample complexity. Providing agents with useful signals to pursue in sparse reward environments becomes crucial in these scenarios.
|
| 19 |
+
|
| 20 |
+
In the domain of goal-directed RL, the recently proposed hindsight experience replay (HER) (Andrychowicz et al., 2017) addresses the challenge of learning from sparse rewards by re-labelling visited states as goal states during training. However, this technique continues to suffer from sample inefficiency, ostensibly due to difficulties related to exploration. In this work, we address these limitations by introducing a method called Competitive Experience Replay $( C E R )$ . This technique attempts to emphasize exploration by introducing a competition between two agents attempting to learn the same task. Intuitively, agent $A$ (the agent ultimately used for evaluation) receives a penalty for visiting states that the competitor agent $( B )$ also visits; and $B$ is rewarded for visiting states found by $A$ . Our approach maintains the reward from the original task such that exploration is biased towards the behaviors best suited to accomplishing the task goals. We show that this competition between agents can automatically generate a curriculum of exploration and shape otherwise sparse reward. We jointly train both agents’ policies by adopting methods from multi-agent RL. In addition, we propose two versions of CER, independent CER, and interact CER, which differ in the state initialization of agent $B$ : whether it is sampled from the initial state distribution or sampled from off-policy samples of agent $A$ , respectively.
|
| 21 |
+
|
| 22 |
+
Whereas HER re-labels samples based on an agent’s individual rollout, our method re-labels samples based on intra-agent behavior; as such, the two methods do not interfere with each other algorithmically and are easily combined during training. We evaluate our method both with and without HER on a variety of reinforcement learning tasks, including navigating an ant agent to reach a goal position and manipulating objects with a robotic arm. For each such task the default reward is sparse, corresponding to a binary indicator of goal completion. Ablation studies show that our method is important for achieving a high success rate and often demonstrates faster convergence. Interestingly, we find that CER and HER are complementary methods and employ both to reach peak efficiency and performance. Furthermore, we observe that, when combined with HER, CER outperforms curiosity-driven exploration.
|
| 23 |
+
|
| 24 |
+
# 2 BACKGROUND
|
| 25 |
+
|
| 26 |
+
Here, we provide an introduction to the relevant concepts for reinforcement learning with sparse reward (Section 2.1), Deep Deterministic Policy Gradient, the backbone algorithm we build off of, (Section 2.2), and Hindsight Experience Replay (Section 2.3).
|
| 27 |
+
|
| 28 |
+
# 2.1 SPARSE REWARD REINFORCEMENT LEARNING
|
| 29 |
+
|
| 30 |
+
Reinforcement learning considers the problem of finding an optimal policy for an agent that interacts with an uncertain environment and collects reward per action. The goal of the agent is to maximize its cumulative reward. Formally, this problem can be viewed as a Markov decision process over the environment states $s \in S$ and agent actions $a \in A$ , with the (unknown) environment dynamics defined by the transition probability $T ( s ^ { \prime } | \bar { s } , a )$ and reward function $r ( s _ { t } , a _ { t } )$ , which yields a reward immediately following the action $a _ { t }$ performed in state $s _ { t }$ .
|
| 31 |
+
|
| 32 |
+
We consider goal-conditioned reinforcement learning from sparse rewards. This constitutes a modification to the reward function such that it depends on a goal $g \in G$ , such that $r _ { g } : S \times A \times G \to R$ . Every episode starts with sampling a state-goal pair from some distribution $p ( s _ { 0 } , g )$ . Unlike the state, the goal stays fixed for the whole episode. At every time step, an action is chosen according to some policy $\pi$ , which is expressed as a function of the state and the goal, $\pi : S \times G \to A$ . For generality, our only restriction on $G$ is that it is a subset of $S$ . In other words, the goal describes a target state and the task of the agent is to reach that state. Therefore, we apply the following sparse reward function:
|
| 33 |
+
|
| 34 |
+
$$
|
| 35 |
+
r _ { t } = r _ { g } ( s _ { t } , a _ { t } , g ) = { \left\{ \begin{array} { l l } { 0 , { \mathrm { i f } } \ | s _ { t } - g | < \delta } \\ { - 1 , { \mathrm { o t h e r w i s e } } } \end{array} \right. }
|
| 36 |
+
$$
|
| 37 |
+
|
| 38 |
+
where $g$ is a goal, $| s _ { t } - g |$ is a distance measure, and $\delta$ is a predefined threshold that controls when the goal is considered completed.
|
| 39 |
+
|
| 40 |
+
Following policy gradient methods, we model the policy as a conditional probability distribution over states, $\pi _ { \boldsymbol { \theta } } ( a | [ s , g ] )$ , where $[ s , g ]$ denotes concatenation of state $s$ and goal $g$ , and $\theta$ are the learnable parameters. Our objective is to optimize $\theta$ with respect to the expected cumulative reward, given by:
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
J ( \theta ) = \mathbb { E } _ { s \sim \rho _ { \pi } , a \sim \pi ( a | s , g ) , g \sim G } \left[ r _ { g } ( s , a , g ) \right] ,
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
where $\begin{array} { r } { \rho _ { \pi } ( s ) = \sum _ { t = 1 } ^ { \infty } \gamma ^ { t - 1 } \mathrm { P r } ( s _ { t } = s ) } \end{array}$ is the normalized discounted state visitation distribution with discount factor $\gamma \in [ 0 , 1 )$ . To simplify the notation, we denote $\mathbb { E } _ { s \sim \rho _ { \pi } , a \sim \pi ( a | s , g ) , g \sim G } [ \cdot ]$ by simply $\mathbb { E } _ { \pi } [ \cdot ]$ in the rest of paper. According to the policy gradient theorem (Sutton et al., 1998), the gradient of $J ( \theta )$ can be written as
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\nabla _ { \theta } J ( \theta ) = \mathbb { E } _ { \pi } \left[ \nabla _ { \theta } \log \pi ( a | s , g ) Q ^ { \pi } ( s , a , g ) \right] ,
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
where $\begin{array} { r } { Q ^ { \pi } ( s , a , g ) = \mathbb { E } _ { \pi } \left[ \sum _ { t = 1 } ^ { \infty } \gamma ^ { t - 1 } r _ { g } ( s _ { t } , a _ { t } , g ) | s _ { 1 } = s , a _ { 1 } = a \right] } \end{array}$ , called the critic, denotes the expected return under policy $\pi$ after taking an action $a$ in state $s$ , with goal $g$ .
|
| 53 |
+
|
| 54 |
+
# 2.2 DDPG ALGORITHM
|
| 55 |
+
|
| 56 |
+
Here, we introduce Deep Deterministic Policy Gradient (DDPG) (Lillicrap et al., 2015), a model-free RL algorithm for continuous action spaces that serves as our backbone algorithm. Our proposed modifications need not be restricted to DDPG; however, we leave experimentation with other continuous control algorithms to future work. In DDPG, we maintain a deterministic target policy $\mu ( s , g )$ and a critic $Q ( s , a , g )$ , both implemented as deep neural networks (note: we modify the standard notation to accommodate goal-conditioned tasks). To train these networks, episodes are generated by sampling actions from the policy plus some noise, $a \sim \mu ( s , g ) + N ( 0 , 1 )$ . The transition tuple associated with each action $\left( { { s _ { t } } , { a _ { t } } , { g _ { t } } , { r _ { t } } , { s _ { t + 1 } } } \right)$ is stored in the so-called replay buffer. During training, transition tuples are sampled from the buffer to perform mini-batch gradient descent on the loss $L$ which encourages the approximated Q-function to satisfy the Bellman equation $\mathbf { \bar { \boldsymbol { L } } } = \mathbb { E } ( Q ( s _ { t } , a _ { t } , g _ { t } ) - y _ { t } ) ^ { 2 }$ , where $y _ { t } = r _ { t } + \bar { \gamma } Q ( s _ { t + 1 } , \bar { \mu } ( s _ { t + 1 } , g _ { t } ) , g _ { t } )$ . Similarly, the actor can be updated by training with mini-batch gradient descent on the loss $J ( \theta ) = - \mathbb { E } _ { s } Q ( s , \mu ( s , g ) , g )$ through the deterministic policy gradient algorithm (Silver et al., 2014),
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
\nabla _ { \theta } J ( \theta ) = \mathbb { E } [ \nabla _ { \theta } \mu ( s , g ) \nabla _ { a } Q ( s , a , g ) | _ { a = \mu ( s , g ) } ] .
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
To make training more stable, the targets $y _ { t }$ are typically computed using a separate target network, whose weights are periodically updated to the current weights of the main network (Lillicrap et al., 2015; Mnih et al., 2013; 2015).
|
| 63 |
+
|
| 64 |
+
# 2.3 HINDSIGHT EXPERIENCE REPLAY
|
| 65 |
+
|
| 66 |
+
Despite numerous advances in the application of deep learning to RL challenges, learning in the presence of sparse rewards remains a major challenge. Intuitively, these algorithms depend on sufficient variability within the encountered rewards and, in many cases, random exploration is unlikely to uncover this variability if goals are difficult to reach. Recently, Andrychowicz et al. (2017) proposed Hindsight Experience Replay (HER) as a technique to address this challenge. The key insight of HER is that failed rollouts (where no task reward was obtained) can be treated as successful by assuming that a visited state was the actual goal. Basically, HER amounts to a relabelling strategy. For every episode the agent experiences, it gets stored in the replay buffer twice: once with the original goal pursued in the episode and once with the goal replaced with a future state achieved in the episode, as if the agent were instructed to reach this state from the beginning. Formally, HER randomly samples a mini-batch of episodes in buffer, for each episode $( \{ s ^ { i } \} _ { i = 1 } ^ { T } , \{ \stackrel { \smile } { g ^ { i } } \} _ { i = 1 } ^ { T } , \{ a ^ { i } \} _ { i = 1 } ^ { T } , \{ r ^ { i } \} _ { i = 1 } ^ { T } , \{ s ^ { \prime i } \} _ { i = 1 } ^ { T } \big )$ , for each state $s _ { t }$ , where $1 \leq t \leq T - 1$ in an episode, we randomly choose $s _ { k }$ where $t + 1 \leq k \leq T$ and relabel transition $\left( { { s _ { t } } , { a _ { t } } , { g _ { t } } , { r _ { t } } , { s _ { t + 1 } } } \right)$ to $\left( s _ { t } , a _ { t } , s _ { k } , r _ { t } ^ { \prime } , s _ { t + 1 } \right)$ and recalculate reward $r _ { t } ^ { \prime }$ ,
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
r _ { t } ^ { \prime } = r _ { g } ( s _ { t } , s _ { k } ) = \left\{ { 0 , \mathrm { i f } | s _ { t } - s _ { k } | < \delta , \atop { - 1 , \mathrm { o t h e r w i s e . } } } \right.
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
# 3 METHOD
|
| 73 |
+
|
| 74 |
+
In this section, we present Competitive Experience Replay (CER) for policy gradient methods (Section 3.1) and describe the application of multi-agent DDPG to enable this technique (Section 3.2).
|
| 75 |
+
|
| 76 |
+
# 3.1 COMPETITIVE EXPERIENCE REPLAY
|
| 77 |
+
|
| 78 |
+
While the re-labelling strategy introduced by HER provides useful rewards for training a goal-conditioned policy, it assumes that learning from arbitrary goals will generalize to the actual task goals. As such, exploration remains a fundamental challenge for goal-directed RL with sparse reward. We propose a relabelling strategy designed to overcome this challenge. Our method is partly inspired by the success of self-play in learning to play competitive games, where sparse rewards (i.e. win or lose) are common. Rather than train a single agent, we train a pair of agents on the same task and apply an asymmetric reward relabelling strategy to induce a competition designed to encourage exploration. We call this strategy Competitive Experience Replay (CER).
|
| 79 |
+
|
| 80 |
+
To implement CER, we learn a policy for each agent, $\pi _ { A }$ and $\pi _ { B }$ , as well as a multi-agent critic (see below), taking advantage of methods for decentralized execution and centralized training. During decentralized execution, $\pi _ { A }$ and $\pi _ { B }$ collect DDPG episode rollouts in parallel. Each agent effectively plays a singleplayer game; however, to take advantage of multi-agent training methods, we arbitrarily pair the rollout from $\pi _ { A }$ with that from $\pi _ { B }$ and store them as a single, multi-agent rollout in the replay buffer $\mathcal { D }$ . When training on a mini-batch of off policy samples, we first randomly sample a mini-batch of episodes in $\mathcal { D }$ and then randomly sample transitions in each episode. We denote the resulting mini-batch of transitions as $\{ ( s _ { A } ^ { i } , a _ { A } ^ { i } , g _ { A } ^ { i } , r _ { A } ^ { i } , s ^ { \prime } { } ^ { i } _ { A } ) , ( s _ { B } ^ { i } , a _ { B } ^ { i } , g _ { B } ^ { i } , r _ { B } ^ { i } , s ^ { \prime } { } ^ { i } _ { B } ) \} _ { i = 1 } ^ { m }$ , where $m$ is the size of the mini-batch.
|
| 81 |
+
|
| 82 |
+
Reward re-labelling in CER attempts to create an implicit exploration curriculum by punishing agent $A$ for visiting states that agent $B$ also visited, and, for those same states, rewarding agent $B$ . For each $A$ state $s _ { A } ^ { i }$ in a mini-batch of transitions, we check if any $B$ state $s _ { B } ^ { j }$ in the mini-batch satisfies $| s _ { A } ^ { i } - s _ { B } ^ { j } | < \delta$ and, if so, re-label $r _ { A } ^ { i }$ with $r _ { A } ^ { i } - 1$ . Conversely, each time such a nearby state pair is found, we increment the associated reward for agent $B$ , $r _ { B } ^ { j }$ , by $+ 1$ . Each transition for agent $A$ can therefore be penalized only once, whereas no restriction is placed on the extra reward given to a transition for agent $B$ . Following training both agents with the re-labelled rewards, we retain the policy $\pi _ { A }$ for evaluation. Additional implementation details are provided in the appendix (Section D).
|
| 83 |
+
|
| 84 |
+
We focus on two variations of CER that satisfy the multi-agent self-play requirements: first, the policy $\pi _ { B }$ receives its initial state from the task’s initial state distribution; second, although more restricted to re-settable environments, $\pi _ { B }$ receives its initial state from a random off-policy sample of $\pi _ { A }$ . We refer to the above methods as independent-CER and interact-CER, respectively, in the following sections.
|
| 85 |
+
|
| 86 |
+
Importantly, CER re-labels rewards based on intra-agent behavior, whereas HER re-labels rewards based on each individual agent’s behavior. As a result, the two methods can be easily combined. In fact, as our experiments demonstrate, CER and HER are complementary and likely reflect distinct challenges that are both addressed through reward re-labelling.
|
| 87 |
+
|
| 88 |
+
# 3.2 GOAL CONDITIONED MULTI-AGENT LEARNING
|
| 89 |
+
|
| 90 |
+
We extend multi-agent DDPG (MADDPG), proposed by Lowe et al. (2017), for training using CER. MADDPG attempts to learn a different policy per agent and a single, centralized critic that has access to the combined states, actions, and goals of all agents.
|
| 91 |
+
|
| 92 |
+
More precisely, consider a game with $N$ agents with policies parameterized by $\pmb { \theta } = \{ \theta _ { 1 } , \dots , \theta _ { N } \}$ , and let $\pmb { \pi } = \{ \bar { \pi } _ { 1 } , . . . , \bar { \pi } _ { N } \}$ be the set of all agent policies. $\mathbf { g } = [ \boldsymbol { g } _ { 1 } , \dots , \boldsymbol { g } _ { N } ]$ represents the concatenation of each agent’s goal, $\mathbf { s } = [ s _ { 1 } , \ldots , s _ { N } ]$ the concatenated states, and $\mathbf { a } = [ a _ { 1 } , \ldots , a _ { N } ]$ the concatenated actions. With this notation, we can write the gradient of the expected return for agent $i$ , $\bar { J ( \theta _ { i } ) } = \mathbb { E } [ R _ { i } ]$ as:
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\begin{array} { r } { \nabla _ { \theta _ { i } } J ( \theta _ { i } ) = \mathbb { E } _ { \pmb { \pi } } [ \nabla _ { \theta _ { i } } \log \pi _ { i } ( a _ { i } | s _ { i } , g _ { i } ) Q _ { i } ^ { \pi } ( \mathbf { s } , \mathbf { a } , \mathbf { g } ) ] . } \end{array}
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
With deterministic policies ${ \pmb \mu } = \{ \mu _ { 1 } , . . . , \mu _ { N } \}$ , the gradient becomes:
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
\nabla _ { \theta _ { i } } J ( \theta _ { i } ) = \mathbb { E } _ { \pmb { \mu } } [ \nabla _ { \theta _ { i } } \mu _ { i } ( s _ { i } , g _ { i } ) \nabla _ { a _ { i } } Q _ { i } ^ { \pmb { \mu } } ( \mathbf { s } , \mathbf { a } , \mathbf { g } ) | _ { a _ { i } = \mu _ { i } ( s _ { i } , g _ { i } ) } ] ,
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
The centralized action-value function $Q _ { i } ^ { \mu }$ , which estimates the expected return for agent $i$ , is updated as:
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
\begin{array} { r } { \mathcal { L } ( \theta _ { i } ) = \mathbb { E } _ { { \mathbf s } , { \mathbf a } , { \mathbf r } , { \mathbf s } ^ { \prime } } [ ( Q _ { i } ^ { \mu } ( { \mathbf s } , { \mathbf a } , { \mathbf g } ) - y ) ^ { 2 } ] , \quad y = r _ { i } + \gamma Q _ { i } ^ { \mu ^ { \prime } } ( { \mathbf s } ^ { \prime } , a _ { 1 } ^ { \prime } , \dots , a _ { N } ^ { \prime } , { \mathbf g } ) \big | _ { a _ { j } ^ { \prime } = \mu _ { j } ^ { \prime } ( s _ { j } ) } , } \end{array}
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
where $\pmb { \mu } ^ { \prime } = \{ \pmb { \mu } _ { \theta _ { 1 } ^ { \prime } } , . . . , \pmb { \mu } _ { \theta _ { N } ^ { \prime } } \}$ is the set of target policies with delayed parameters $\theta _ { i } ^ { \prime }$ . In practice people usually soft update it as $\mathbf { \dot { \theta } } _ { i } ^ { \prime } \gets \tau \dot { \theta } _ { i } + ( 1 - \tau ) \theta _ { i } ^ { \prime }$ , where $\tau$ is a Polyak coefficient.
|
| 111 |
+
|
| 112 |
+
During training, we collect paired rollouts as described above, apply any re-labelling strategies (such as CER or HER) and use the MADDPG algorithm to train both agent policies and the centralized critic, concatenating states, actions, and goals where appropriate. Putting everything together, we summarize the full method in Algorithm 1.
|
| 113 |
+
|
| 114 |
+
# 4 EXPERIMENT
|
| 115 |
+
|
| 116 |
+

|
| 117 |
+
Figure 1: Goal conditioned ’U’ shaped maze and $\mathbf { \vec { \nabla } } S \mathbf { \vec { \nabla } }$ shaped maze. For each plot pair, the left illustrates a rendering of the maze type and the right shows the associated success rate throughout training for each method. Each line shows results averaged over 5 random initializations; the X-axis corresponds to epoch number and shaded regions show standard deviation. All metrics based on CER reference the performance of agent $A$ .
|
| 118 |
+
|
| 119 |
+
# 4.1 COMBINING COMPETITIVE EXPERIENCE REPLAY WITH EXISTING METHODS
|
| 120 |
+
|
| 121 |
+
We start by asking whether CER improves performance and sample efficiency in a sparse reward task. To this end, we constructed two different mazes, an easier ’U’ shaped maze and a more difficult $\mathbf { \vec { \nabla } } S \mathbf { \vec { \nabla } }$ shaped maze (Figure 1). The goal of the ant agent is to reach the target mark by a red sphere, whose location is randomly sampled for each new episode. At each step, the agent obtains a reward of 0 if the goal has been achieved and $- 1$ otherwise. Additional details of the ant maze environments are found in Appendix B. An advantage of this environment is that it can be reset to any given state, facilitating comparison between our two proposed variants of CER (int-CER requires the environment to have this feature).
|
| 122 |
+
|
| 123 |
+
We compare agents trained with HER, both variants of CER, and both variants of CER with HER. Since each uses DDPG as a backbone algorithm, we also include results from a policy trained using DDPG alone. To confirm that any difficulties are not simply due to DDPG, we include results from a policy trained using Proximal Policy Optimization (PPO) (Schulman et al., 2017). The results for each maze are shown in Figure 1. DDPG and PPO each performs quite poorly by itself, likely due to the sparsity of the reward in this task set up. Adding CER to DDPG partially overcomes this limitation in terms of final success rate, and, notably, reaches this stronger result with many fewer examples. A similar result is seen when adding HER to DDPG. Importantly, adding both HER and CER offers the best improvement of final success rate without requiring any observable increase in the number of episodes, as compared to each of the other baselines. These results support our hypothesis that existing state-of-the-art methods do not sufficiently address the exploration challenge intrinsic to sparse reward environments. Furthermore, these results show that CER improves both the quality and efficiency of learning in such challenging settings, especially when combined with HER. These results also show that int-CER tends to outperform ind-CER. As such, int-CER is considered preferable but has more restrictive technical requirements.
|
| 124 |
+
|
| 125 |
+
To examine the efficacy of our method on a broader range of tasks, we evaluate the change in performance when ind-CER is added to HER on the challenging multi-goal sparse reward environments introduced in Plappert et al. (2018). (Note: we would prefer to examine int-CER but are prevented by technical issues related to the environment.) Results for each of the 12 tasks we trained on are illustrated in Figure 3. Our method, when used on top of HER, improves performance wherever it is not already saturated. This is especially true on harder tasks, where HER alone achieves only modest success (e.g., HandManipulateEggFull and handManipulatePenRotate). These results further support the conclusion that existing methods often fail to achieve sufficient exploration. Our method, which provides a targeted solution to this challenge, naturally complements HER.
|
| 126 |
+
|
| 127 |
+

|
| 128 |
+
Figure 2: Comparing CER and ICM with and without HER. Each line shows task success rate averaged over 5 random initializations. $\mathrm { X }$ -axis is epoch number; shaded regions denote standard deviation.
|
| 129 |
+
|
| 130 |
+
# 4.2 COMPARING CER WITH CURIOSITY-DRIVEN EXPLORATION
|
| 131 |
+
|
| 132 |
+
CER is designed to encourage exploration, but, unlike other methods, uses the behavior of a competitor agent to automatically determine the criteria for exploratory reward. Numerous methods have been proposed for improving exploration; for example, count-based exploration (Bellemare et al., 2016; Tang et al., 2017), VIME (Houthooft et al., 2016), bootstrap DQN (Osband et al., 2016), goal exploration process (Forestier et al., 2017), parameter space noise (Plappert et al., 2017), dynamics curiosity and boredom (Schmidhuber, 1991), and EX2 (Fu et al., 2017). One recent and popular method, intrinsic curiosity module (ICM) (Pathak et al., 2017; Burda et al., 2018), augments task reward with curiosity-driven reward. Much like CER and HER, ICM provides a method to relabel the reward associated with each transition; this reward comes from the error in a jointly trained forward prediction model. We compare how CER and ICM affect task performance and how they interact with HER across 4 tasks where we were able to implement ICM successfully. Figure 2 shows the results on several robotic control and maze tasks. We observe CER to consistently outperform ICM when each is implemented in isolation. In addition, we observe HER to benefit more from the addition of CER than of ICM. Compared to ICM, CER also tends to improve the speed of learning. These results suggest that the underlying problem is not a lack of diversity of states being visited but the size of the state space that the agent must explore (as also discussed in Andrychowicz et al. (2017)). One interpretation is that, since the two CER agents are both learning the task, the dynamics of their competition encourage more task-relevant exploration. From this perspective, CER provides an automatic curriculum for exploration such that visited states are utilized more efficiently.
|
| 133 |
+
|
| 134 |
+

|
| 135 |
+
Figure 3: Evaluation of HER with ind-CER across different robotic control environments. Each line shows results averaged over 5 random initializations. X-axis shows epoch number; shaded regions denote standard deviation.
|
| 136 |
+
|
| 137 |
+
# 4.3 ANALYSIS OF CER
|
| 138 |
+
|
| 139 |
+
Figure 4 illustrates the success rates of agents of mini-batch samples whose reward is chang $A$ nd y C $B$ as well as the ‘effect ratio,’ whR during training, calculated as e fractiwhere $\begin{array} { r } { \phi = \frac { N } { M } } \end{array}$ $N$ $M$
|
| 140 |
+
strong correspondence between the success rate and effect ratio, likely reflecting the influence of CER on the
|
| 141 |
+
learning dynamics. While a deeper analysis would be required to concretely understand the interplay of these
|
| 142 |
+
two terms, we point out that CER re-labels a substantial fraction of rewards in the mini-batch. Interestingly,
|
| 143 |
+
even the relatively small effect ratio observed in the first few epochs is enough support rapid learning. We
|
| 144 |
+
speculate that the sampling strategy used in int-CER provides a more targeted re-labelling, leading to the more
|
| 145 |
+
rapid increase in success rate for agent $A$ . We observe that agent $B$ reaches a lower level of performance.
|
| 146 |
+
|
| 147 |
+

|
| 148 |
+
|
| 149 |
+

|
| 150 |
+
Figure 4: Illustration of the automatically generated curriculum between $A$ and $B$ on ‘U‘ shaped AntMaze task. From left to right are success rate of ind-CER, effect ratio of ind-CER, success rate of int-CER, and effect ratio of int-CER. Each line shows results averaged over 5 random initializations. $\mathrm { X }$ -axis is epoch number.
|
| 151 |
+
Figure 5: State visitation frequency on ’U’ maze. Top row is from after 5 epochs; bottom row from after 35. Blue on the colormap denotes no visitation. The start and goal locations are labeled with the blue and green markers, respectively. ICM and CER are trained with HER also.
|
| 152 |
+
|
| 153 |
+
This likely results from resetting the parameters of agent $B$ periodically during early training, which we observe to improve the ultimate performance of agent $A$ (see Section D for details). It is also possible that the reward structure of CER asymmetrically benefits agent $A$ with respect to the underlying task.
|
| 154 |
+
|
| 155 |
+
To gain additional insight into how each method influences the behaviors learned across training, we visualize the frequency with which each location in the ‘U’ maze is visited after the 5th and 35th training epoch (Figure 5). Comparing DDPG and HER shows that the latter clearly helps move the state distribution towards the goal, especially during the early parts of training. When CER is added, states near the goal create a clear mode in the visitation distribution. This is never apparent with DDPG alone and only obvious for HER and $\mathrm { I C M + H E R }$ later in training. CER also appears to focus the visitation of the agent, as it less frequently gets caught along the outer walls. These disparities are emphasized in Figure 6, where we show the difference in the visitation profiles. The left two plots compare CER $^ +$ HER vs. HER. The right two plots compare Agent A vs Agent B from CER+HER. Interestingly, the Agents A and B exhibit fairly similar aggregate visitation profiles with the exception that Agent A reaches the goal more often later during training. These visitation profiles underscore both the quantitative and qualitative improvements associated with CER.
|
| 156 |
+
|
| 157 |
+
# 5 RELATED WORK
|
| 158 |
+
|
| 159 |
+
Self-play has a long history in this domain of research (Samuel, 1959; Tesauro, 1995; Heess et al., 2017). Silver et al. (2017) use self-play with deep reinforcement learning techniques to master the game of Go; and self-play has even been applied in Dota 5v5 (OpenAI, 2018).
|
| 160 |
+
|
| 161 |
+

|
| 162 |
+
Figure 6: State visitation difference on ’U’ maze. Left plots compare CER against HER; right plots compare the two CER agents. Each plot illustrates the difference in visitation, with red indicating more visitation by CER(A). Note: here, the “CER” agent is trained with $_ \mathrm { C E R + H E R }$ .
|
| 163 |
+
|
| 164 |
+
Curriculum learning is widely used for training neural networks (see e.g., Bengio et al., 2009; Graves et al., 2017; Elman, 1993; Olsson, 1995). A general framework for automatic task selection is Powerplay (Schmidhuber, 2013; Srivastava et al., 2013), which proposes an asymptotically optimal way of selecting tasks from a set of tasks with program search, and use replay buffer to avoid catastrophic forgetting. Florensa et al. (2017); Held et al. (2017) propose to automatically adjust task difficulty during training. Forestier et al. (2017) study intrinsically motivated goal for robotic learning. Recently, Sukhbaatar et al. (2017) suggest to use self-play between two agents where reward depends on the time of the other agent to complete to enable implicit curriculum. Our work is similar to theirs, but we propose to use sample-based competitive experience replay, which is not only more readily scalable to high-dimension control but also integrates easily with Hindsight Experience Replay (Andrychowicz et al., 2017). The method of initializing based on a state not sampled from the initial state distribution has been explored in other works. For example, Ivanovic et al. (2018) propose to create a backwards curriculum for continuous control tasks through learning a dynamics model. Resnick et al. (2018b) and Salimans & Chen (2018) propose to train policies on Pommerman (Resnick et al., 2018a) and the Atari game ‘Montezumas Revenge’ by starting each episode from a different point along a demonstration. Recently, Goyal et al. (2018) and Edwards et al. (2018) propose a learned backtracking model to generate traces that lead to high value states in order to obtain higher sample efficiency.
|
| 165 |
+
|
| 166 |
+
Experience replay has been introduced in (Lin, 1992) and later was a crucial ingredient in learning to master Atari games (Mnih et al., 2013; 2015). Wang et al. (2016) propose truncation with bias correction to reduce variance from using off-policy data in buffer and achieves good performance on continuous and discrete tasks. Different approaches have been proposed to incorporate model-free learning with experience replay(Gu et al., 2016; Feng et al., 2019). Schaul et al. (2015) improve experience replay by assigning priorities to transitions in the buffer to efficiently utilize samples. Horgan et al. (2018) further improve experience replay by proposing a distributed RL system in which experiences are shared between parallel workers and accumulated into a central replay memory and prioritized replay is used to update the policy based on the diverse accumulated experiences.
|
| 167 |
+
|
| 168 |
+
# 6 CONCLUSION
|
| 169 |
+
|
| 170 |
+
We introduce Competitive Experience Replay, a new and general method for encouraging exploration through implicit curriculum learning in sparse reward settings. We demonstrate an empirical advantage of our technique when combined with existing methods in several challenging RL tasks. In future work, we aim to investigate richer ways to re-label rewards based on intra-agent samples to further harness multi-agent competition, it’s interesting to investigate counterfactual inference to promote efficient re-label off-policy samples. We hope that this will facilitate the application of our method to more open-end environments with even more challenging task structures. In addition, future work will explore integrating our method into approaches more closely related to model-based learning, where adequate exposure to the dynamics of the environment is often crucial.
|
| 171 |
+
|
| 172 |
+
# REFERENCES
|
| 173 |
+
|
| 174 |
+
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. In Advances in Neural Information Processing Systems, pp. 5048–5058, 2017.
|
| 175 |
+
|
| 176 |
+
Marcin Andrychowicz, Bowen Baker, Maciek Chociej, Rafal Jozefowicz, Bob McGrew, Jakub Pachocki, Arthur Petron, Matthias Plappert, Glenn Powell, Alex Ray, Jonas Schneider, Szymon Sidor, Josh Tobin, Peter Welinder, Lilian Weng, and Wojciech Zaremba. Learning dexterous in-hand manipulation. arXiv:1808.00177, 2018a.
|
| 177 |
+
|
| 178 |
+
Marcin Andrychowicz, Bowen Baker, Maciek Chociej, Rafal Jozefowicz, Bob McGrew, Jakub Pachocki, Arthur Petron, Matthias Plappert, Glenn Powell, Alex Ray, et al. Learning dexterous in-hand manipulation. arXiv preprint arXiv:1808.00177, 2018b.
|
| 179 |
+
|
| 180 |
+
Marc Bellemare, Sriram Srinivasan, Georg Ostrovski, Tom Schaul, David Saxton, and Remi Munos. Unifying count-based exploration and intrinsic motivation. In Advances in Neural Information Processing Systems, pp. 1471–1479, 2016.
|
| 181 |
+
|
| 182 |
+
Yoshua Bengio, Jer´ ome Louradour, Ronan Collobert, and Jason Weston. Curriculum learning. In ˆ Proceedings of the 26th annual international conference on machine learning, pp. 41–48. ACM, 2009.
|
| 183 |
+
|
| 184 |
+
Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym. arXiv preprint arXiv:1606.01540, 2016.
|
| 185 |
+
|
| 186 |
+
Yuri Burda, Harri Edwards, Deepak Pathak, Amos Storkey, Trevor Darrell, and Alexei A Efros. Large-scale study of curiosity-driven learning. arXiv preprint arXiv:1808.04355, 2018.
|
| 187 |
+
|
| 188 |
+
Ashley D Edwards, Laura Downs, and James C Davidson. Forward-backward reinforcement learning. arXiv preprint arXiv:1803.10227, 2018.
|
| 189 |
+
|
| 190 |
+
Jeffrey L Elman. Learning and development in neural networks: The importance of starting small. Cognition, 48(1):71–99, 1993.
|
| 191 |
+
|
| 192 |
+
Yihao Feng, Hao Liu, Jian Peng, and Qiang Liu. Shrinkage-based bias-variance trade-off for deep reinforcement learning, 2019. URL https://openreview.net/forum?id=S1z9ehAqYX.
|
| 193 |
+
|
| 194 |
+
Carlos Florensa, David Held, Markus Wulfmeier, Michael Zhang, and Pieter Abbeel. Reverse curriculum generation for reinforcement learning. arXiv preprint arXiv:1707.05300, 2017.
|
| 195 |
+
|
| 196 |
+
Sebastien Forestier, Yoan Mollard, and Pierre-Yves Oudeyer. Intrinsically motivated goal exploration ´ processes with automatic curriculum learning. arXiv preprint arXiv:1708.02190, 2017.
|
| 197 |
+
|
| 198 |
+
Justin Fu, John Co-Reyes, and Sergey Levine. Ex2: Exploration with exemplar models for deep reinforcement learning. In Advances in Neural Information Processing Systems, pp. 2577–2587, 2017.
|
| 199 |
+
|
| 200 |
+
Anirudh Goyal, Philemon Brakel, William Fedus, Timothy Lillicrap, Sergey Levine, Hugo Larochelle, and Yoshua Bengio. Recall traces: Backtracking models for efficient reinforcement learning. arXiv preprint arXiv:1804.00379, 2018.
|
| 201 |
+
|
| 202 |
+
Alex Graves, Marc G Bellemare, Jacob Menick, Remi Munos, and Koray Kavukcuoglu. Automated curriculum learning for neural networks. arXiv preprint arXiv:1704.03003, 2017.
|
| 203 |
+
|
| 204 |
+
Shixiang Gu, Timothy Lillicrap, Ilya Sutskever, and Sergey Levine. Continuous deep q-learning with model-based acceleration. In International Conference on Machine Learning, pp. 2829–2838, 2016.
|
| 205 |
+
|
| 206 |
+
Nicolas Heess, Srinivasan Sriram, Jay Lemmon, Josh Merel, Greg Wayne, Yuval Tassa, Tom Erez, Ziyu Wang, Ali Eslami, Martin Riedmiller, et al. Emergence of locomotion behaviours in rich environments. arXiv preprint arXiv:1707.02286, 2017.
|
| 207 |
+
|
| 208 |
+
David Held, Xinyang Geng, Carlos Florensa, and Pieter Abbeel. Automatic goal generation for reinforcement learning agents. arXiv preprint arXiv:1705.06366, 2017.
|
| 209 |
+
|
| 210 |
+
Dan Horgan, John Quan, David Budden, Gabriel Barth-Maron, Matteo Hessel, Hado Van Hasselt, and David Silver. Distributed prioritized experience replay. arXiv preprint arXiv:1803.00933, 2018.
|
| 211 |
+
|
| 212 |
+
Rein Houthooft, Xi Chen, Yan Duan, John Schulman, Filip De Turck, and Pieter Abbeel. Vime: Variational information maximizing exploration. In Advances in Neural Information Processing Systems, pp. 1109– 1117, 2016.
|
| 213 |
+
|
| 214 |
+
Boris Ivanovic, James Harrison, Apoorva Sharma, Mo Chen, and Marco Pavone. Barc: Backward reachability curriculum for robotic reinforcement learning. arXiv preprint arXiv:1806.06161, 2018.
|
| 215 |
+
|
| 216 |
+
Dmitry Kalashnikov, Alex Irpan, Peter Pastor, Julian Ibarz, Alexander Herzog, Eric Jang, Deirdre Quillen, Ethan Holly, Mrinal Kalakrishnan, Vincent Vanhoucke, et al. Qt-opt: Scalable deep reinforcement learning for vision-based robotic manipulation. arXiv preprint arXiv:1806.10293, 2018.
|
| 217 |
+
|
| 218 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 219 |
+
|
| 220 |
+
Sergey Levine, Peter Pastor, Alex Krizhevsky, Julian Ibarz, and Deirdre Quillen. Learning hand-eye coordination for robotic grasping with deep learning and large-scale data collection. The International Journal of Robotics Research, 37(4-5):421–436, 2018.
|
| 221 |
+
|
| 222 |
+
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.
|
| 223 |
+
|
| 224 |
+
Long-Ji Lin. Self-improving reactive agents based on reinforcement learning, planning and teaching. Machine learning, 8(3-4):293–321, 1992.
|
| 225 |
+
|
| 226 |
+
Ryan Lowe, Yi Wu, Aviv Tamar, Jean Harb, Pieter Abbeel, and Igor Mordatch. Multi-agent actor-critic for mixed cooperative-competitive environments. In Advances in Neural Information Processing Systems, pp. 6379–6390, 2017.
|
| 227 |
+
|
| 228 |
+
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wierstra, and Martin Riedmiller. Playing atari with deep reinforcement learning. arXiv preprint arXiv:1312.5602, 2013.
|
| 229 |
+
|
| 230 |
+
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G Bellemare, Alex Graves, Martin Riedmiller, Andreas K Fidjeland, Georg Ostrovski, et al. Human-level control through deep reinforcement learning. Nature, 518(7540):529, 2015.
|
| 231 |
+
|
| 232 |
+
Andrew Y Ng, Adam Coates, Mark Diel, Varun Ganapathi, Jamie Schulte, Ben Tse, Eric Berger, and Eric Liang. Autonomous inverted helicopter flight via reinforcement learning. In Experimental Robotics IX, pp. 363–372. Springer, 2006.
|
| 233 |
+
|
| 234 |
+
Roland Olsson. Inductive functional programming using incremental program transformation. Artificial intelligence, 74(1):55–81, 1995.
|
| 235 |
+
|
| 236 |
+
OpenAI. Openai five. https://blog.openai.com/openai-five/, 2018.
|
| 237 |
+
|
| 238 |
+
Ian Osband, Charles Blundell, Alexander Pritzel, and Benjamin Van Roy. Deep exploration via bootstrapped dqn. In Advances in neural information processing systems, pp. 4026–4034, 2016.
|
| 239 |
+
|
| 240 |
+
Deepak Pathak, Pulkit Agrawal, Alexei A Efros, and Trevor Darrell. Curiosity-driven exploration by selfsupervised prediction. In International Conference on Machine Learning (ICML), volume 2017, 2017.
|
| 241 |
+
|
| 242 |
+
Matthias Plappert, Rein Houthooft, Prafulla Dhariwal, Szymon Sidor, Richard Y Chen, Xi Chen, Tamim Asfour, Pieter Abbeel, and Marcin Andrychowicz. Parameter space noise for exploration. arXiv preprint arXiv:1706.01905, 2017.
|
| 243 |
+
|
| 244 |
+
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.
|
| 245 |
+
|
| 246 |
+
Ivaylo Popov, Nicolas Heess, Timothy Lillicrap, Roland Hafner, Gabriel Barth-Maron, Matej Vecerik, Thomas Lampe, Yuval Tassa, Tom Erez, and Martin Riedmiller. Data-efficient deep reinforcement learning for dexterous manipulation. arXiv preprint arXiv:1704.03073, 2017.
|
| 247 |
+
|
| 248 |
+
Cinjon Resnick, Wes Eldridge, David Ha, Denny Britz, Jakob Foerster, Julian Togelius, Kyunghyun Cho, and Joan Bruna. Pommerman: A multi-agent playground. arXiv preprint arXiv:1809.07124, 2018a.
|
| 249 |
+
|
| 250 |
+
Cinjon Resnick, Roberta Raileanu, Sanyam Kapoor, Alex Peysakhovich, Kyunghyun Cho, and Joan Bruna. Backplay:” man muss immer umkehren”. arXiv preprint arXiv:1807.06919, 2018b.
|
| 251 |
+
|
| 252 |
+
Tim Salimans and Richard Chen. Learning montezumas revenge from a single demonstration. https://blog.openai.com/ learning-montezumas-revenge-from-a-single-demonstration/, 2018.
|
| 253 |
+
|
| 254 |
+
Arthur L Samuel. Some studies in machine learning using the game of checkers. IBM Journal of research and development, 3(3):210–229, 1959.
|
| 255 |
+
|
| 256 |
+
Tom Schaul, John Quan, Ioannis Antonoglou, and David Silver. Prioritized experience replay. arXiv preprint arXiv:1511.05952, 2015.
|
| 257 |
+
|
| 258 |
+
Jurgen Schmidhuber. A possibility for implementing curiosity and boredom in model-building neural¨ controllers. In Proc. of the international conference on simulation of adaptive behavior: From animals to animats, pp. 222–227, 1991.
|
| 259 |
+
|
| 260 |
+
Jurgen Schmidhuber. Powerplay: Training an increasingly general problem solver by continually searching ¨ for the simplest still unsolvable problem. Frontiers in psychology, 4:313, 2013.
|
| 261 |
+
|
| 262 |
+
John Schulman, Sergey Levine, Philipp Moritz, Michael I. Jordan, and Pieter Abbeel. Trust region policy optimization. In International Conference on Machine Learning, 2015.
|
| 263 |
+
|
| 264 |
+
John Schulman, Philipp Moritz, Sergey Levine, Michael Jordan, and Pieter Abbeel. High-dimensional continuous control using generalized advantage estimation. International Conference of Learning Representations (ICLR), 2016.
|
| 265 |
+
|
| 266 |
+
John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. Advances in Neural Information Processing Systems, 2017.
|
| 267 |
+
|
| 268 |
+
David Silver, Guy Lever, Nicolas Heess, Thomas Degris, Daan Wierstra, and Martin Riedmiller. Deterministic policy gradient algorithms. In ICML, 2014.
|
| 269 |
+
|
| 270 |
+
David Silver, Aja Huang, Chris J Maddison, Arthur Guez, Laurent Sifre, George Van Den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Veda Panneershelvam, Marc Lanctot, et al. Mastering the game of go with deep neural networks and tree search. Nature, 529(7587):484–489, 2016.
|
| 271 |
+
|
| 272 |
+
David Silver, Thomas Hubert, Julian Schrittwieser, Ioannis Antonoglou, Matthew Lai, Arthur Guez, Marc Lanctot, Laurent Sifre, Dharshan Kumaran, Thore Graepel, et al. Mastering chess and shogi by self-play with a general reinforcement learning algorithm. arXiv preprint arXiv:1712.01815, 2017.
|
| 273 |
+
|
| 274 |
+
Rupesh Kumar Srivastava, Bas R Steunebrink, and Jurgen Schmidhuber. First experiments with powerplay.¨ Neural Networks, 41:130–136, 2013.
|
| 275 |
+
|
| 276 |
+
Sainbayar Sukhbaatar, Zeming Lin, Ilya Kostrikov, Gabriel Synnaeve, Arthur Szlam, and Rob Fergus. Intrinsic motivation and automatic curricula via asymmetric self-play. arXiv preprint arXiv:1703.05407, 2017.
|
| 277 |
+
|
| 278 |
+
Richard S Sutton, Andrew G Barto, et al. Reinforcement learning: An introduction. MIT press, 1998.
|
| 279 |
+
|
| 280 |
+
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. In Advances in Neural Information Processing Systems, pp. 2753–2762, 2017.
|
| 281 |
+
|
| 282 |
+
Gerald Tesauro. Temporal difference learning and td-gammon. Communications of the ACM, 38(3):58–68, 1995.
|
| 283 |
+
|
| 284 |
+
Emanuel Todorov, Tom Erez, and Yuval Tassa. Mujoco: A physics engine for model-based control. In Intelligent Robots and Systems (IROS), 2012 IEEE/RSJ International Conference on, pp. 5026–5033. IEEE, 2012.
|
| 285 |
+
|
| 286 |
+
Ziyu Wang, Victor Bapst, Nicolas Heess, Volodymyr Mnih, Remi Munos, Koray Kavukcuoglu, and Nando de Freitas. Sample efficient actor-critic with experience replay. arXiv preprint arXiv:1611.01224, 2016.
|
| 287 |
+
|
| 288 |
+
# A ALGORITHM
|
| 289 |
+
|
| 290 |
+
We summarize the algorithm for HER with CER in Algorithm 1.
|
| 291 |
+
|
| 292 |
+
<table><tr><td>Algorithm1HER with CER</td></tr><tr><td>Initialize a random process N for action exploration,max episode length to L Set CER to ind-CER or int-CER</td></tr><tr><td>for episode= 1 to M do</td></tr><tr><td>Receive initial state S A</td></tr><tr><td>Receive a goal rA for this episode</td></tr><tr><td>Initialize episode buffer buffer A</td></tr><tr><td>for t=1to L do</td></tr><tr><td>select action aA = μe(sA) +Nt w.r.t. the current policy and exploration Execute actions αA and observe reward rA and new state s'A</td></tr><tr><td>Store (sA,aA,gA,rA,SA') in buffer A</td></tr><tr><td>SA↑SA</td></tr><tr><td>end for</td></tr><tr><td> Receive initial state SB or Receive initial state SB, where SB is a state sampled from buffer A</td></tr><tr><td>Receive a goal rB for this episode Initialize episode buffer buffer B</td></tr><tr><td>for t=1 to L do</td></tr><tr><td>select action aB = μe(sB)+Nt w.r.t. the current policy and exploration</td></tr><tr><td>Execute actions αB and observe reward rB and new state s'B</td></tr><tr><td>Store (sB,aB,gB,rB,SB') in bufferB</td></tr><tr><td>SB↑SB</td></tr><tr><td>end for</td></tr><tr><td>ConcatenatebuferA and bufferg and store ({si}=1,{ai}T=1,{g}T=1,{ri}=1,{s'i}T=1) in replay buffer D</td></tr><tr><td>// Optimization based on off-policysamples</td></tr><tr><td>fork=1 toKdo // Relabelling off-policy samples</td></tr></table>
|
| 293 |
+
|
| 294 |
+
# B ENVIRONMENT DETAILS
|
| 295 |
+
|
| 296 |
+
Robotic control environments The robotic control environments shown in Figure 7 are part of challenging continuous robotics control suite (Plappert et al., 2018) integrated in OpenAI Gym (Brockman et al., 2016) and based on Mujoco simulation enginge (Todorov et al., 2012). The Fetch environments are based on the 7-DoF Fetch robotics arm, which has a two-fingered parallel gripper. The Hand environments are based on the Shadow Dexterous Hand, which is an anthropomorphic robotic hand with 24 degrees of freedom. In all tasks, rewards are sparse and binary: the agent obtains a reward of 0 if the goal has been achieved and $- 1$ otherwise. For more details please refer to Plappert et al. (2018).
|
| 297 |
+
|
| 298 |
+
Ant maze environments We also construct two maze environments with the re-settable property, rendered in Figure 1, in which walls are placed to construct ”U” or ”S” shaped maze. At the beginning of each episode, the agent is always initialized at position $( 0 , 0 )$ , and can move in any direction as long as it is not obstructed by a wall. The $\mathbf { X } ^ { - }$ and y-axis locations of the target ball are sampled uniformly from $[ - 5 , 2 0 ]$ , $[ - 5 , 2 0 ]$ , respectively.
|
| 299 |
+
|
| 300 |
+

|
| 301 |
+
Figure 7: Robotics control environments used in our experiments
|
| 302 |
+
|
| 303 |
+
# C COMPETITIVE EXPERIENCE REPLAY WITH DIFFERENT ADVERSARIAL AGENTS
|
| 304 |
+
|
| 305 |
+

|
| 306 |
+
Figure 8: Performance on FetchSlide (top) and HandManipulatePenFull (bottom) for different batch-size multipliers when training using HER (left columns) or HER $^ +$ CER (middle, right columns). Middle plots show the performance of agent $A$ and, in the right plots, performance of agent $B$ is shown for reference.
|
| 307 |
+
|
| 308 |
+
As Andrychowicz et al. (2017) and Andrychowicz et al. (2018a) observe (and we also observe), performance depends on the batch size. We leverage this observation to tune the relative strengths of Agents $A$ and $B$ by separately manipulating the batch sizes used for updating each.
|
| 309 |
+
|
| 310 |
+
For simplicity, we control the batch size by changing the number of MPI workers devoted to a particular update. Each MPI worker computes the gradients for a batch size of 256; averaging the gradients from each worker results in an effective batch size of $N * 2 5 6$ . For our single-agent baselines, we choose $N = 3 0$ workers, and, when using CER, a default of $N = 1 5$ for each $A$ and $B$ In the following, $A x B y$ denotes, for agent $A$ , $N = x$ and, for agent $B$ , $N = y$ . These results suggest that, while a sufficiently large batch size is important for achieving the best performance, the optimal configuration occurs when the batch sizes used for the two agents are balanced. Interestingly, we observe that batch size imbalance adversely effects both agents trained during CER.
|
| 311 |
+
|
| 312 |
+
# D IMPLEMENTATION DETAILS
|
| 313 |
+
|
| 314 |
+
In the code for HER (Andrychowicz et al., 2017), the authors use MPI to increase the batch size. MPI is used here to run rollouts in parallel and average gradients over all MPI workers. We found that MPI is crucial for good performance, since training for longer time with a smaller batch size gives sub-optimal performance. This is consistent with the authors’ findings in their code that having a much larger batch size helps a lot. For each experiment, we provide the per-worker batch sizes in Table 1; note that the effective batch size is multiplied by the number of MPI workers $N$ .
|
| 315 |
+
|
| 316 |
+
In our implementation, we do $N$ rollouts in parallel for each agent and have separate optimizers for each. We found that periodically resetting the parameters of agent $B$ in early stage of training helps agent $A$ more consistently reach a high level of performance. This resetting helps to strike an optimal balance between the influences of HER and CER in training agent $A$ . We also add L2 regularization, following the practice of Andrychowicz et al. (2017).
|
| 317 |
+
|
| 318 |
+
For the experiments with neural networks, all parameters are randomly initialized from $\mathcal { N } ( 0 , 0 . 2 )$ . We use networks with three layers of hidden layer size 256 and Adam (Kingma & Ba, 2014) for optimization. Presented results are averaged over 5 random seeds. We summarize the hyperparameters in Table 1.
|
| 319 |
+
|
| 320 |
+
Table 1: Hyperparameter values used in experiments.
|
| 321 |
+
|
| 322 |
+
<table><tr><td rowspan=1 colspan=1>Hyperparametername</td><td rowspan=1 colspan=1>'U'AntMaze</td><td rowspan=1 colspan=1>'S'AntMaze</td><td rowspan=1 colspan=1>FetchControl</td><td rowspan=1 colspan=1>HandControl</td></tr><tr><td rowspan=1 colspan=1>Buffer size</td><td rowspan=1 colspan=1>1E5</td><td rowspan=1 colspan=1>1E6</td><td rowspan=1 colspan=1>1E6</td><td rowspan=1 colspan=1>1E6</td></tr><tr><td rowspan=1 colspan=1>Batch size</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>256</td></tr><tr><td rowspan=1 colspan=1>Max steps ofepisode</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>100</td></tr><tr><td rowspan=1 colspan=1>Reset epochs</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>5</td></tr><tr><td rowspan=1 colspan=1>Max reset epochs</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>30</td></tr><tr><td rowspan=1 colspan=1>Total epochs</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>100/50</td><td rowspan=1 colspan=1>200</td></tr><tr><td rowspan=1 colspan=1>ActorLearning rate</td><td rowspan=1 colspan=1>0.0004</td><td rowspan=1 colspan=1>0.0004</td><td rowspan=1 colspan=1>0.001</td><td rowspan=1 colspan=1>0.001</td></tr><tr><td rowspan=1 colspan=1>CriticLearning rate</td><td rowspan=1 colspan=1>0.0004</td><td rowspan=1 colspan=1>0.0004</td><td rowspan=1 colspan=1>0.001</td><td rowspan=1 colspan=1>0.001</td></tr><tr><td rowspan=1 colspan=1>ActionL2 regularization</td><td rowspan=1 colspan=1>0.01</td><td rowspan=1 colspan=1>0.01</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td></tr><tr><td rowspan=1 colspan=1>Polyak</td><td rowspan=1 colspan=1>0.95</td><td rowspan=1 colspan=1>0.95</td><td rowspan=1 colspan=1>0.95</td><td rowspan=1 colspan=1>0.95</td></tr></table>
|
parse/train/Sklsm20ctX/Sklsm20ctX_content_list.json
ADDED
|
@@ -0,0 +1,1706 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"type": "text",
|
| 4 |
+
"text": "COMPETITIVE EXPERIENCE REPLAY ",
|
| 5 |
+
"text_level": 1,
|
| 6 |
+
"bbox": [
|
| 7 |
+
148,
|
| 8 |
+
117,
|
| 9 |
+
576,
|
| 10 |
+
137
|
| 11 |
+
],
|
| 12 |
+
"page_idx": 0
|
| 13 |
+
},
|
| 14 |
+
{
|
| 15 |
+
"type": "text",
|
| 16 |
+
"text": "Hao Liu∗, Alexander Trott, Richard Socher, Caiming Xiong \nSalesforce Research \nPalo Alto, 94301 \nlhao499@gmail.com,{atrott, rsocher, cxiong}@salesforce.com ",
|
| 17 |
+
"bbox": [
|
| 18 |
+
161,
|
| 19 |
+
161,
|
| 20 |
+
728,
|
| 21 |
+
218
|
| 22 |
+
],
|
| 23 |
+
"page_idx": 0
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
"type": "text",
|
| 27 |
+
"text": "ABSTRACT ",
|
| 28 |
+
"text_level": 1,
|
| 29 |
+
"bbox": [
|
| 30 |
+
452,
|
| 31 |
+
253,
|
| 32 |
+
544,
|
| 33 |
+
270
|
| 34 |
+
],
|
| 35 |
+
"page_idx": 0
|
| 36 |
+
},
|
| 37 |
+
{
|
| 38 |
+
"type": "text",
|
| 39 |
+
"text": "Deep learning has achieved remarkable successes in solving challenging reinforcement learning (RL) problems when dense reward function is provided. However, in sparse reward environment it still often suffers from the need to carefully shape reward function to guide policy optimization. This limits the applicability of RL in the real world since both reinforcement learning and domain-specific knowledge are required. It is therefore of great practical importance to develop algorithms which can learn from a binary signal indicating successful task completion or other unshaped, sparse reward signals. We propose a novel method called competitive experience replay, which efficiently supplements a sparse reward by placing learning in the context of an exploration competition between a pair of agents. Our method complements the recently proposed hindsight experience replay (HER) by inducing an automatic exploratory curriculum. We evaluate our approach on the tasks of reaching various goal locations in an ant maze and manipulating objects with a robotic arm. Each task provides only binary rewards indicating whether or not the goal is achieved. Our method asymmetrically augments these sparse rewards for a pair of agents each learning the same task, creating a competitive game designed to drive exploration. Extensive experiments demonstrate that this method leads to faster converge and improved task performance. ",
|
| 40 |
+
"bbox": [
|
| 41 |
+
207,
|
| 42 |
+
285,
|
| 43 |
+
792,
|
| 44 |
+
520
|
| 45 |
+
],
|
| 46 |
+
"page_idx": 0
|
| 47 |
+
},
|
| 48 |
+
{
|
| 49 |
+
"type": "text",
|
| 50 |
+
"text": "1 INTRODUCTION ",
|
| 51 |
+
"text_level": 1,
|
| 52 |
+
"bbox": [
|
| 53 |
+
150,
|
| 54 |
+
546,
|
| 55 |
+
310,
|
| 56 |
+
561
|
| 57 |
+
],
|
| 58 |
+
"page_idx": 0
|
| 59 |
+
},
|
| 60 |
+
{
|
| 61 |
+
"type": "text",
|
| 62 |
+
"text": "Recent progress in deep reinforcement learning has achieved very impressive results in domains ranging from playing games (Mnih et al., 2015; Silver et al., 2016; 2017; OpenAI, 2018), to high dimensional continuous control (Schulman et al., 2016; 2017; 2015), and robotics (Levine et al., 2018; Kalashnikov et al., 2018; Andrychowicz et al., 2018b). ",
|
| 63 |
+
"bbox": [
|
| 64 |
+
148,
|
| 65 |
+
577,
|
| 66 |
+
851,
|
| 67 |
+
632
|
| 68 |
+
],
|
| 69 |
+
"page_idx": 0
|
| 70 |
+
},
|
| 71 |
+
{
|
| 72 |
+
"type": "text",
|
| 73 |
+
"text": "Despite these successes, in robotics control and many other areas, deep reinforcement learning still suffers from the need to engineer a proper reward function to guide policy optimization (see e.g. Popov et al. 2017, $\\mathrm { N g }$ et al. 2006). In robotic control as stacking bricks, reward function need to be sharped to very complex which consists of multiple terms(Popov et al., 2017). It is extremely hard and not applicable to engineer such reward function for each task in real world since both reinforcement learning expertise and domain-specific knowledge are required. Learning to perform well in environments with sparse rewards remains a major challenge. Therefore, it is of great practical importance to develop algorithms which can learn from binary signal indicating successful task completion or other unshaped reward signal. ",
|
| 74 |
+
"bbox": [
|
| 75 |
+
148,
|
| 76 |
+
640,
|
| 77 |
+
851,
|
| 78 |
+
751
|
| 79 |
+
],
|
| 80 |
+
"page_idx": 0
|
| 81 |
+
},
|
| 82 |
+
{
|
| 83 |
+
"type": "text",
|
| 84 |
+
"text": "In environments where dense reward function is not available, only a small fraction of the agents’ experiences will be useful to compute gradient to optimize policy, leading to substantial high sample complexity. Providing agents with useful signals to pursue in sparse reward environments becomes crucial in these scenarios. ",
|
| 85 |
+
"bbox": [
|
| 86 |
+
148,
|
| 87 |
+
758,
|
| 88 |
+
851,
|
| 89 |
+
800
|
| 90 |
+
],
|
| 91 |
+
"page_idx": 0
|
| 92 |
+
},
|
| 93 |
+
{
|
| 94 |
+
"type": "text",
|
| 95 |
+
"text": "In the domain of goal-directed RL, the recently proposed hindsight experience replay (HER) (Andrychowicz et al., 2017) addresses the challenge of learning from sparse rewards by re-labelling visited states as goal states during training. However, this technique continues to suffer from sample inefficiency, ostensibly due to difficulties related to exploration. In this work, we address these limitations by introducing a method called Competitive Experience Replay $( C E R )$ . This technique attempts to emphasize exploration by introducing a competition between two agents attempting to learn the same task. Intuitively, agent $A$ (the agent ultimately used for evaluation) receives a penalty for visiting states that the competitor agent $( B )$ also visits; and $B$ is rewarded for visiting states found by $A$ . Our approach maintains the reward from the original task such that exploration is biased towards the behaviors best suited to accomplishing the task goals. We show that this competition between agents can automatically generate a curriculum of exploration and shape otherwise sparse reward. We jointly train both agents’ policies by adopting methods from multi-agent RL. In addition, we propose two versions of CER, independent CER, and interact CER, which differ in the state initialization of agent $B$ : whether it is sampled from the initial state distribution or sampled from off-policy samples of agent $A$ , respectively. ",
|
| 96 |
+
"bbox": [
|
| 97 |
+
148,
|
| 98 |
+
119,
|
| 99 |
+
851,
|
| 100 |
+
314
|
| 101 |
+
],
|
| 102 |
+
"page_idx": 1
|
| 103 |
+
},
|
| 104 |
+
{
|
| 105 |
+
"type": "text",
|
| 106 |
+
"text": "Whereas HER re-labels samples based on an agent’s individual rollout, our method re-labels samples based on intra-agent behavior; as such, the two methods do not interfere with each other algorithmically and are easily combined during training. We evaluate our method both with and without HER on a variety of reinforcement learning tasks, including navigating an ant agent to reach a goal position and manipulating objects with a robotic arm. For each such task the default reward is sparse, corresponding to a binary indicator of goal completion. Ablation studies show that our method is important for achieving a high success rate and often demonstrates faster convergence. Interestingly, we find that CER and HER are complementary methods and employ both to reach peak efficiency and performance. Furthermore, we observe that, when combined with HER, CER outperforms curiosity-driven exploration. ",
|
| 107 |
+
"bbox": [
|
| 108 |
+
147,
|
| 109 |
+
320,
|
| 110 |
+
851,
|
| 111 |
+
446
|
| 112 |
+
],
|
| 113 |
+
"page_idx": 1
|
| 114 |
+
},
|
| 115 |
+
{
|
| 116 |
+
"type": "text",
|
| 117 |
+
"text": "2 BACKGROUND ",
|
| 118 |
+
"text_level": 1,
|
| 119 |
+
"bbox": [
|
| 120 |
+
148,
|
| 121 |
+
469,
|
| 122 |
+
300,
|
| 123 |
+
486
|
| 124 |
+
],
|
| 125 |
+
"page_idx": 1
|
| 126 |
+
},
|
| 127 |
+
{
|
| 128 |
+
"type": "text",
|
| 129 |
+
"text": "Here, we provide an introduction to the relevant concepts for reinforcement learning with sparse reward (Section 2.1), Deep Deterministic Policy Gradient, the backbone algorithm we build off of, (Section 2.2), and Hindsight Experience Replay (Section 2.3). ",
|
| 130 |
+
"bbox": [
|
| 131 |
+
148,
|
| 132 |
+
503,
|
| 133 |
+
851,
|
| 134 |
+
546
|
| 135 |
+
],
|
| 136 |
+
"page_idx": 1
|
| 137 |
+
},
|
| 138 |
+
{
|
| 139 |
+
"type": "text",
|
| 140 |
+
"text": "2.1 SPARSE REWARD REINFORCEMENT LEARNING ",
|
| 141 |
+
"text_level": 1,
|
| 142 |
+
"bbox": [
|
| 143 |
+
148,
|
| 144 |
+
565,
|
| 145 |
+
509,
|
| 146 |
+
580
|
| 147 |
+
],
|
| 148 |
+
"page_idx": 1
|
| 149 |
+
},
|
| 150 |
+
{
|
| 151 |
+
"type": "text",
|
| 152 |
+
"text": "Reinforcement learning considers the problem of finding an optimal policy for an agent that interacts with an uncertain environment and collects reward per action. The goal of the agent is to maximize its cumulative reward. Formally, this problem can be viewed as a Markov decision process over the environment states $s \\in S$ and agent actions $a \\in A$ , with the (unknown) environment dynamics defined by the transition probability $T ( s ^ { \\prime } | \\bar { s } , a )$ and reward function $r ( s _ { t } , a _ { t } )$ , which yields a reward immediately following the action $a _ { t }$ performed in state $s _ { t }$ . ",
|
| 153 |
+
"bbox": [
|
| 154 |
+
148,
|
| 155 |
+
593,
|
| 156 |
+
851,
|
| 157 |
+
678
|
| 158 |
+
],
|
| 159 |
+
"page_idx": 1
|
| 160 |
+
},
|
| 161 |
+
{
|
| 162 |
+
"type": "text",
|
| 163 |
+
"text": "We consider goal-conditioned reinforcement learning from sparse rewards. This constitutes a modification to the reward function such that it depends on a goal $g \\in G$ , such that $r _ { g } : S \\times A \\times G \\to R$ . Every episode starts with sampling a state-goal pair from some distribution $p ( s _ { 0 } , g )$ . Unlike the state, the goal stays fixed for the whole episode. At every time step, an action is chosen according to some policy $\\pi$ , which is expressed as a function of the state and the goal, $\\pi : S \\times G \\to A$ . For generality, our only restriction on $G$ is that it is a subset of $S$ . In other words, the goal describes a target state and the task of the agent is to reach that state. Therefore, we apply the following sparse reward function: ",
|
| 164 |
+
"bbox": [
|
| 165 |
+
147,
|
| 166 |
+
684,
|
| 167 |
+
852,
|
| 168 |
+
781
|
| 169 |
+
],
|
| 170 |
+
"page_idx": 1
|
| 171 |
+
},
|
| 172 |
+
{
|
| 173 |
+
"type": "equation",
|
| 174 |
+
"img_path": "images/bc3b0c05124a7d82463e3cb60fe4ad4972449d1f1b688d6d0ee1b750ecbd9381.jpg",
|
| 175 |
+
"text": "$$\nr _ { t } = r _ { g } ( s _ { t } , a _ { t } , g ) = { \\left\\{ \\begin{array} { l l } { 0 , { \\mathrm { i f } } \\ | s _ { t } - g | < \\delta } \\\\ { - 1 , { \\mathrm { o t h e r w i s e } } } \\end{array} \\right. }\n$$",
|
| 176 |
+
"text_format": "latex",
|
| 177 |
+
"bbox": [
|
| 178 |
+
359,
|
| 179 |
+
791,
|
| 180 |
+
635,
|
| 181 |
+
827
|
| 182 |
+
],
|
| 183 |
+
"page_idx": 1
|
| 184 |
+
},
|
| 185 |
+
{
|
| 186 |
+
"type": "text",
|
| 187 |
+
"text": "where $g$ is a goal, $| s _ { t } - g |$ is a distance measure, and $\\delta$ is a predefined threshold that controls when the goal is considered completed. ",
|
| 188 |
+
"bbox": [
|
| 189 |
+
145,
|
| 190 |
+
119,
|
| 191 |
+
852,
|
| 192 |
+
148
|
| 193 |
+
],
|
| 194 |
+
"page_idx": 2
|
| 195 |
+
},
|
| 196 |
+
{
|
| 197 |
+
"type": "text",
|
| 198 |
+
"text": "Following policy gradient methods, we model the policy as a conditional probability distribution over states, $\\pi _ { \\boldsymbol { \\theta } } ( a | [ s , g ] )$ , where $[ s , g ]$ denotes concatenation of state $s$ and goal $g$ , and $\\theta$ are the learnable parameters. Our objective is to optimize $\\theta$ with respect to the expected cumulative reward, given by: ",
|
| 199 |
+
"bbox": [
|
| 200 |
+
147,
|
| 201 |
+
155,
|
| 202 |
+
852,
|
| 203 |
+
198
|
| 204 |
+
],
|
| 205 |
+
"page_idx": 2
|
| 206 |
+
},
|
| 207 |
+
{
|
| 208 |
+
"type": "equation",
|
| 209 |
+
"img_path": "images/af22a8a4a6d72a51da4964219477015bfefdf2041ad4cc321fcd5ca9d94c28e5.jpg",
|
| 210 |
+
"text": "$$\nJ ( \\theta ) = \\mathbb { E } _ { s \\sim \\rho _ { \\pi } , a \\sim \\pi ( a | s , g ) , g \\sim G } \\left[ r _ { g } ( s , a , g ) \\right] ,\n$$",
|
| 211 |
+
"text_format": "latex",
|
| 212 |
+
"bbox": [
|
| 213 |
+
356,
|
| 214 |
+
203,
|
| 215 |
+
638,
|
| 216 |
+
222
|
| 217 |
+
],
|
| 218 |
+
"page_idx": 2
|
| 219 |
+
},
|
| 220 |
+
{
|
| 221 |
+
"type": "text",
|
| 222 |
+
"text": "where $\\begin{array} { r } { \\rho _ { \\pi } ( s ) = \\sum _ { t = 1 } ^ { \\infty } \\gamma ^ { t - 1 } \\mathrm { P r } ( s _ { t } = s ) } \\end{array}$ is the normalized discounted state visitation distribution with discount factor $\\gamma \\in [ 0 , 1 )$ . To simplify the notation, we denote $\\mathbb { E } _ { s \\sim \\rho _ { \\pi } , a \\sim \\pi ( a | s , g ) , g \\sim G } [ \\cdot ]$ by simply $\\mathbb { E } _ { \\pi } [ \\cdot ]$ in the rest of paper. According to the policy gradient theorem (Sutton et al., 1998), the gradient of $J ( \\theta )$ can be written as ",
|
| 223 |
+
"bbox": [
|
| 224 |
+
147,
|
| 225 |
+
234,
|
| 226 |
+
852,
|
| 227 |
+
280
|
| 228 |
+
],
|
| 229 |
+
"page_idx": 2
|
| 230 |
+
},
|
| 231 |
+
{
|
| 232 |
+
"type": "equation",
|
| 233 |
+
"img_path": "images/d2eaaf445d9676d09b0abe1f32ca8f84691878086c2f7fde001b9cc9b9f1b7d8.jpg",
|
| 234 |
+
"text": "$$\n\\nabla _ { \\theta } J ( \\theta ) = \\mathbb { E } _ { \\pi } \\left[ \\nabla _ { \\theta } \\log \\pi ( a | s , g ) Q ^ { \\pi } ( s , a , g ) \\right] ,\n$$",
|
| 235 |
+
"text_format": "latex",
|
| 236 |
+
"bbox": [
|
| 237 |
+
349,
|
| 238 |
+
285,
|
| 239 |
+
647,
|
| 240 |
+
303
|
| 241 |
+
],
|
| 242 |
+
"page_idx": 2
|
| 243 |
+
},
|
| 244 |
+
{
|
| 245 |
+
"type": "text",
|
| 246 |
+
"text": "where $\\begin{array} { r } { Q ^ { \\pi } ( s , a , g ) = \\mathbb { E } _ { \\pi } \\left[ \\sum _ { t = 1 } ^ { \\infty } \\gamma ^ { t - 1 } r _ { g } ( s _ { t } , a _ { t } , g ) | s _ { 1 } = s , a _ { 1 } = a \\right] } \\end{array}$ , called the critic, denotes the expected return under policy $\\pi$ after taking an action $a$ in state $s$ , with goal $g$ . ",
|
| 247 |
+
"bbox": [
|
| 248 |
+
147,
|
| 249 |
+
309,
|
| 250 |
+
857,
|
| 251 |
+
339
|
| 252 |
+
],
|
| 253 |
+
"page_idx": 2
|
| 254 |
+
},
|
| 255 |
+
{
|
| 256 |
+
"type": "text",
|
| 257 |
+
"text": "2.2 DDPG ALGORITHM ",
|
| 258 |
+
"text_level": 1,
|
| 259 |
+
"bbox": [
|
| 260 |
+
148,
|
| 261 |
+
354,
|
| 262 |
+
325,
|
| 263 |
+
369
|
| 264 |
+
],
|
| 265 |
+
"page_idx": 2
|
| 266 |
+
},
|
| 267 |
+
{
|
| 268 |
+
"type": "text",
|
| 269 |
+
"text": "Here, we introduce Deep Deterministic Policy Gradient (DDPG) (Lillicrap et al., 2015), a model-free RL algorithm for continuous action spaces that serves as our backbone algorithm. Our proposed modifications need not be restricted to DDPG; however, we leave experimentation with other continuous control algorithms to future work. In DDPG, we maintain a deterministic target policy $\\mu ( s , g )$ and a critic $Q ( s , a , g )$ , both implemented as deep neural networks (note: we modify the standard notation to accommodate goal-conditioned tasks). To train these networks, episodes are generated by sampling actions from the policy plus some noise, $a \\sim \\mu ( s , g ) + N ( 0 , 1 )$ . The transition tuple associated with each action $\\left( { { s _ { t } } , { a _ { t } } , { g _ { t } } , { r _ { t } } , { s _ { t + 1 } } } \\right)$ is stored in the so-called replay buffer. During training, transition tuples are sampled from the buffer to perform mini-batch gradient descent on the loss $L$ which encourages the approximated Q-function to satisfy the Bellman equation $\\mathbf { \\bar { \\boldsymbol { L } } } = \\mathbb { E } ( Q ( s _ { t } , a _ { t } , g _ { t } ) - y _ { t } ) ^ { 2 }$ , where $y _ { t } = r _ { t } + \\bar { \\gamma } Q ( s _ { t + 1 } , \\bar { \\mu } ( s _ { t + 1 } , g _ { t } ) , g _ { t } )$ . Similarly, the actor can be updated by training with mini-batch gradient descent on the loss $J ( \\theta ) = - \\mathbb { E } _ { s } Q ( s , \\mu ( s , g ) , g )$ through the deterministic policy gradient algorithm (Silver et al., 2014), ",
|
| 270 |
+
"bbox": [
|
| 271 |
+
147,
|
| 272 |
+
381,
|
| 273 |
+
852,
|
| 274 |
+
549
|
| 275 |
+
],
|
| 276 |
+
"page_idx": 2
|
| 277 |
+
},
|
| 278 |
+
{
|
| 279 |
+
"type": "equation",
|
| 280 |
+
"img_path": "images/61cbf72e039883c96a15b5be262e8304b5f77fd6ec0e534652890592ab47011c.jpg",
|
| 281 |
+
"text": "$$\n\\nabla _ { \\theta } J ( \\theta ) = \\mathbb { E } [ \\nabla _ { \\theta } \\mu ( s , g ) \\nabla _ { a } Q ( s , a , g ) | _ { a = \\mu ( s , g ) } ] .\n$$",
|
| 282 |
+
"text_format": "latex",
|
| 283 |
+
"bbox": [
|
| 284 |
+
341,
|
| 285 |
+
554,
|
| 286 |
+
656,
|
| 287 |
+
573
|
| 288 |
+
],
|
| 289 |
+
"page_idx": 2
|
| 290 |
+
},
|
| 291 |
+
{
|
| 292 |
+
"type": "text",
|
| 293 |
+
"text": "To make training more stable, the targets $y _ { t }$ are typically computed using a separate target network, whose weights are periodically updated to the current weights of the main network (Lillicrap et al., 2015; Mnih et al., 2013; 2015). ",
|
| 294 |
+
"bbox": [
|
| 295 |
+
147,
|
| 296 |
+
584,
|
| 297 |
+
852,
|
| 298 |
+
627
|
| 299 |
+
],
|
| 300 |
+
"page_idx": 2
|
| 301 |
+
},
|
| 302 |
+
{
|
| 303 |
+
"type": "text",
|
| 304 |
+
"text": "2.3 HINDSIGHT EXPERIENCE REPLAY",
|
| 305 |
+
"text_level": 1,
|
| 306 |
+
"bbox": [
|
| 307 |
+
150,
|
| 308 |
+
643,
|
| 309 |
+
416,
|
| 310 |
+
659
|
| 311 |
+
],
|
| 312 |
+
"page_idx": 2
|
| 313 |
+
},
|
| 314 |
+
{
|
| 315 |
+
"type": "text",
|
| 316 |
+
"text": "Despite numerous advances in the application of deep learning to RL challenges, learning in the presence of sparse rewards remains a major challenge. Intuitively, these algorithms depend on sufficient variability within the encountered rewards and, in many cases, random exploration is unlikely to uncover this variability if goals are difficult to reach. Recently, Andrychowicz et al. (2017) proposed Hindsight Experience Replay (HER) as a technique to address this challenge. The key insight of HER is that failed rollouts (where no task reward was obtained) can be treated as successful by assuming that a visited state was the actual goal. Basically, HER amounts to a relabelling strategy. For every episode the agent experiences, it gets stored in the replay buffer twice: once with the original goal pursued in the episode and once with the goal replaced with a future state achieved in the episode, as if the agent were instructed to reach this state from the beginning. Formally, HER randomly samples a mini-batch of episodes in buffer, for each episode $( \\{ s ^ { i } \\} _ { i = 1 } ^ { T } , \\{ \\stackrel { \\smile } { g ^ { i } } \\} _ { i = 1 } ^ { T } , \\{ a ^ { i } \\} _ { i = 1 } ^ { T } , \\{ r ^ { i } \\} _ { i = 1 } ^ { T } , \\{ s ^ { \\prime i } \\} _ { i = 1 } ^ { T } \\big )$ , for each state $s _ { t }$ , where $1 \\leq t \\leq T - 1$ in an episode, we randomly choose $s _ { k }$ where $t + 1 \\leq k \\leq T$ and relabel transition $\\left( { { s _ { t } } , { a _ { t } } , { g _ { t } } , { r _ { t } } , { s _ { t + 1 } } } \\right)$ to $\\left( s _ { t } , a _ { t } , s _ { k } , r _ { t } ^ { \\prime } , s _ { t + 1 } \\right)$ and recalculate reward $r _ { t } ^ { \\prime }$ , ",
|
| 317 |
+
"bbox": [
|
| 318 |
+
147,
|
| 319 |
+
669,
|
| 320 |
+
851,
|
| 321 |
+
824
|
| 322 |
+
],
|
| 323 |
+
"page_idx": 2
|
| 324 |
+
},
|
| 325 |
+
{
|
| 326 |
+
"type": "text",
|
| 327 |
+
"text": "",
|
| 328 |
+
"bbox": [
|
| 329 |
+
143,
|
| 330 |
+
119,
|
| 331 |
+
854,
|
| 332 |
+
150
|
| 333 |
+
],
|
| 334 |
+
"page_idx": 3
|
| 335 |
+
},
|
| 336 |
+
{
|
| 337 |
+
"type": "equation",
|
| 338 |
+
"img_path": "images/a26e6b0f57bdfdac9fcbc75ddb11695d4d3d55360a134a0e1538445f815fff35.jpg",
|
| 339 |
+
"text": "$$\nr _ { t } ^ { \\prime } = r _ { g } ( s _ { t } , s _ { k } ) = \\left\\{ { 0 , \\mathrm { i f } | s _ { t } - s _ { k } | < \\delta , \\atop { - 1 , \\mathrm { o t h e r w i s e . } } } \\right.\n$$",
|
| 340 |
+
"text_format": "latex",
|
| 341 |
+
"bbox": [
|
| 342 |
+
362,
|
| 343 |
+
159,
|
| 344 |
+
632,
|
| 345 |
+
194
|
| 346 |
+
],
|
| 347 |
+
"page_idx": 3
|
| 348 |
+
},
|
| 349 |
+
{
|
| 350 |
+
"type": "text",
|
| 351 |
+
"text": "3 METHOD ",
|
| 352 |
+
"text_level": 1,
|
| 353 |
+
"bbox": [
|
| 354 |
+
148,
|
| 355 |
+
218,
|
| 356 |
+
254,
|
| 357 |
+
234
|
| 358 |
+
],
|
| 359 |
+
"page_idx": 3
|
| 360 |
+
},
|
| 361 |
+
{
|
| 362 |
+
"type": "text",
|
| 363 |
+
"text": "In this section, we present Competitive Experience Replay (CER) for policy gradient methods (Section 3.1) and describe the application of multi-agent DDPG to enable this technique (Section 3.2). ",
|
| 364 |
+
"bbox": [
|
| 365 |
+
148,
|
| 366 |
+
256,
|
| 367 |
+
849,
|
| 368 |
+
285
|
| 369 |
+
],
|
| 370 |
+
"page_idx": 3
|
| 371 |
+
},
|
| 372 |
+
{
|
| 373 |
+
"type": "text",
|
| 374 |
+
"text": "3.1 COMPETITIVE EXPERIENCE REPLAY ",
|
| 375 |
+
"text_level": 1,
|
| 376 |
+
"bbox": [
|
| 377 |
+
150,
|
| 378 |
+
310,
|
| 379 |
+
434,
|
| 380 |
+
324
|
| 381 |
+
],
|
| 382 |
+
"page_idx": 3
|
| 383 |
+
},
|
| 384 |
+
{
|
| 385 |
+
"type": "text",
|
| 386 |
+
"text": "While the re-labelling strategy introduced by HER provides useful rewards for training a goal-conditioned policy, it assumes that learning from arbitrary goals will generalize to the actual task goals. As such, exploration remains a fundamental challenge for goal-directed RL with sparse reward. We propose a relabelling strategy designed to overcome this challenge. Our method is partly inspired by the success of self-play in learning to play competitive games, where sparse rewards (i.e. win or lose) are common. Rather than train a single agent, we train a pair of agents on the same task and apply an asymmetric reward relabelling strategy to induce a competition designed to encourage exploration. We call this strategy Competitive Experience Replay (CER). ",
|
| 387 |
+
"bbox": [
|
| 388 |
+
147,
|
| 389 |
+
338,
|
| 390 |
+
852,
|
| 391 |
+
450
|
| 392 |
+
],
|
| 393 |
+
"page_idx": 3
|
| 394 |
+
},
|
| 395 |
+
{
|
| 396 |
+
"type": "text",
|
| 397 |
+
"text": "To implement CER, we learn a policy for each agent, $\\pi _ { A }$ and $\\pi _ { B }$ , as well as a multi-agent critic (see below), taking advantage of methods for decentralized execution and centralized training. During decentralized execution, $\\pi _ { A }$ and $\\pi _ { B }$ collect DDPG episode rollouts in parallel. Each agent effectively plays a singleplayer game; however, to take advantage of multi-agent training methods, we arbitrarily pair the rollout from $\\pi _ { A }$ with that from $\\pi _ { B }$ and store them as a single, multi-agent rollout in the replay buffer $\\mathcal { D }$ . When training on a mini-batch of off policy samples, we first randomly sample a mini-batch of episodes in $\\mathcal { D }$ and then randomly sample transitions in each episode. We denote the resulting mini-batch of transitions as $\\{ ( s _ { A } ^ { i } , a _ { A } ^ { i } , g _ { A } ^ { i } , r _ { A } ^ { i } , s ^ { \\prime } { } ^ { i } _ { A } ) , ( s _ { B } ^ { i } , a _ { B } ^ { i } , g _ { B } ^ { i } , r _ { B } ^ { i } , s ^ { \\prime } { } ^ { i } _ { B } ) \\} _ { i = 1 } ^ { m }$ , where $m$ is the size of the mini-batch. ",
|
| 398 |
+
"bbox": [
|
| 399 |
+
147,
|
| 400 |
+
457,
|
| 401 |
+
852,
|
| 402 |
+
574
|
| 403 |
+
],
|
| 404 |
+
"page_idx": 3
|
| 405 |
+
},
|
| 406 |
+
{
|
| 407 |
+
"type": "text",
|
| 408 |
+
"text": "Reward re-labelling in CER attempts to create an implicit exploration curriculum by punishing agent $A$ for visiting states that agent $B$ also visited, and, for those same states, rewarding agent $B$ . For each $A$ state $s _ { A } ^ { i }$ in a mini-batch of transitions, we check if any $B$ state $s _ { B } ^ { j }$ in the mini-batch satisfies $| s _ { A } ^ { i } - s _ { B } ^ { j } | < \\delta$ and, if so, re-label $r _ { A } ^ { i }$ with $r _ { A } ^ { i } - 1$ . Conversely, each time such a nearby state pair is found, we increment the associated reward for agent $B$ , $r _ { B } ^ { j }$ , by $+ 1$ . Each transition for agent $A$ can therefore be penalized only once, whereas no restriction is placed on the extra reward given to a transition for agent $B$ . Following training both agents with the re-labelled rewards, we retain the policy $\\pi _ { A }$ for evaluation. Additional implementation details are provided in the appendix (Section D). ",
|
| 409 |
+
"bbox": [
|
| 410 |
+
147,
|
| 411 |
+
578,
|
| 412 |
+
851,
|
| 413 |
+
696
|
| 414 |
+
],
|
| 415 |
+
"page_idx": 3
|
| 416 |
+
},
|
| 417 |
+
{
|
| 418 |
+
"type": "text",
|
| 419 |
+
"text": "We focus on two variations of CER that satisfy the multi-agent self-play requirements: first, the policy $\\pi _ { B }$ receives its initial state from the task’s initial state distribution; second, although more restricted to re-settable environments, $\\pi _ { B }$ receives its initial state from a random off-policy sample of $\\pi _ { A }$ . We refer to the above methods as independent-CER and interact-CER, respectively, in the following sections. ",
|
| 420 |
+
"bbox": [
|
| 421 |
+
148,
|
| 422 |
+
703,
|
| 423 |
+
849,
|
| 424 |
+
760
|
| 425 |
+
],
|
| 426 |
+
"page_idx": 3
|
| 427 |
+
},
|
| 428 |
+
{
|
| 429 |
+
"type": "text",
|
| 430 |
+
"text": "Importantly, CER re-labels rewards based on intra-agent behavior, whereas HER re-labels rewards based on each individual agent’s behavior. As a result, the two methods can be easily combined. In fact, as our experiments demonstrate, CER and HER are complementary and likely reflect distinct challenges that are both addressed through reward re-labelling. ",
|
| 431 |
+
"bbox": [
|
| 432 |
+
148,
|
| 433 |
+
766,
|
| 434 |
+
851,
|
| 435 |
+
823
|
| 436 |
+
],
|
| 437 |
+
"page_idx": 3
|
| 438 |
+
},
|
| 439 |
+
{
|
| 440 |
+
"type": "text",
|
| 441 |
+
"text": "3.2 GOAL CONDITIONED MULTI-AGENT LEARNING",
|
| 442 |
+
"text_level": 1,
|
| 443 |
+
"bbox": [
|
| 444 |
+
148,
|
| 445 |
+
121,
|
| 446 |
+
513,
|
| 447 |
+
135
|
| 448 |
+
],
|
| 449 |
+
"page_idx": 4
|
| 450 |
+
},
|
| 451 |
+
{
|
| 452 |
+
"type": "text",
|
| 453 |
+
"text": "We extend multi-agent DDPG (MADDPG), proposed by Lowe et al. (2017), for training using CER. MADDPG attempts to learn a different policy per agent and a single, centralized critic that has access to the combined states, actions, and goals of all agents. ",
|
| 454 |
+
"bbox": [
|
| 455 |
+
147,
|
| 456 |
+
145,
|
| 457 |
+
851,
|
| 458 |
+
189
|
| 459 |
+
],
|
| 460 |
+
"page_idx": 4
|
| 461 |
+
},
|
| 462 |
+
{
|
| 463 |
+
"type": "text",
|
| 464 |
+
"text": "More precisely, consider a game with $N$ agents with policies parameterized by $\\pmb { \\theta } = \\{ \\theta _ { 1 } , \\dots , \\theta _ { N } \\}$ , and let $\\pmb { \\pi } = \\{ \\bar { \\pi } _ { 1 } , . . . , \\bar { \\pi } _ { N } \\}$ be the set of all agent policies. $\\mathbf { g } = [ \\boldsymbol { g } _ { 1 } , \\dots , \\boldsymbol { g } _ { N } ]$ represents the concatenation of each agent’s goal, $\\mathbf { s } = [ s _ { 1 } , \\ldots , s _ { N } ]$ the concatenated states, and $\\mathbf { a } = [ a _ { 1 } , \\ldots , a _ { N } ]$ the concatenated actions. With this notation, we can write the gradient of the expected return for agent $i$ , $\\bar { J ( \\theta _ { i } ) } = \\mathbb { E } [ R _ { i } ]$ as: ",
|
| 465 |
+
"bbox": [
|
| 466 |
+
147,
|
| 467 |
+
195,
|
| 468 |
+
851,
|
| 469 |
+
252
|
| 470 |
+
],
|
| 471 |
+
"page_idx": 4
|
| 472 |
+
},
|
| 473 |
+
{
|
| 474 |
+
"type": "equation",
|
| 475 |
+
"img_path": "images/2e6850d92597d835ba628f97c0f7711ea1835645b432dfbb185d432047b1c797.jpg",
|
| 476 |
+
"text": "$$\n\\begin{array} { r } { \\nabla _ { \\theta _ { i } } J ( \\theta _ { i } ) = \\mathbb { E } _ { \\pmb { \\pi } } [ \\nabla _ { \\theta _ { i } } \\log \\pi _ { i } ( a _ { i } | s _ { i } , g _ { i } ) Q _ { i } ^ { \\pi } ( \\mathbf { s } , \\mathbf { a } , \\mathbf { g } ) ] . } \\end{array}\n$$",
|
| 477 |
+
"text_format": "latex",
|
| 478 |
+
"bbox": [
|
| 479 |
+
334,
|
| 480 |
+
257,
|
| 481 |
+
661,
|
| 482 |
+
275
|
| 483 |
+
],
|
| 484 |
+
"page_idx": 4
|
| 485 |
+
},
|
| 486 |
+
{
|
| 487 |
+
"type": "text",
|
| 488 |
+
"text": "With deterministic policies ${ \\pmb \\mu } = \\{ \\mu _ { 1 } , . . . , \\mu _ { N } \\}$ , the gradient becomes: ",
|
| 489 |
+
"bbox": [
|
| 490 |
+
145,
|
| 491 |
+
281,
|
| 492 |
+
602,
|
| 493 |
+
297
|
| 494 |
+
],
|
| 495 |
+
"page_idx": 4
|
| 496 |
+
},
|
| 497 |
+
{
|
| 498 |
+
"type": "equation",
|
| 499 |
+
"img_path": "images/4135d952788d1437a8eb0c338c4eb28bd17da7bdc1e7d7f6e9980d410c2d2423.jpg",
|
| 500 |
+
"text": "$$\n\\nabla _ { \\theta _ { i } } J ( \\theta _ { i } ) = \\mathbb { E } _ { \\pmb { \\mu } } [ \\nabla _ { \\theta _ { i } } \\mu _ { i } ( s _ { i } , g _ { i } ) \\nabla _ { a _ { i } } Q _ { i } ^ { \\pmb { \\mu } } ( \\mathbf { s } , \\mathbf { a } , \\mathbf { g } ) | _ { a _ { i } = \\mu _ { i } ( s _ { i } , g _ { i } ) } ] ,\n$$",
|
| 501 |
+
"text_format": "latex",
|
| 502 |
+
"bbox": [
|
| 503 |
+
305,
|
| 504 |
+
301,
|
| 505 |
+
691,
|
| 506 |
+
320
|
| 507 |
+
],
|
| 508 |
+
"page_idx": 4
|
| 509 |
+
},
|
| 510 |
+
{
|
| 511 |
+
"type": "text",
|
| 512 |
+
"text": "The centralized action-value function $Q _ { i } ^ { \\mu }$ , which estimates the expected return for agent $i$ , is updated as: ",
|
| 513 |
+
"bbox": [
|
| 514 |
+
155,
|
| 515 |
+
327,
|
| 516 |
+
821,
|
| 517 |
+
343
|
| 518 |
+
],
|
| 519 |
+
"page_idx": 4
|
| 520 |
+
},
|
| 521 |
+
{
|
| 522 |
+
"type": "equation",
|
| 523 |
+
"img_path": "images/2da34ef7b3aa9d33ff804f1b9ecbb628b3534a4c0a0ed55f49dacca81dfcfb39.jpg",
|
| 524 |
+
"text": "$$\n\\begin{array} { r } { \\mathcal { L } ( \\theta _ { i } ) = \\mathbb { E } _ { { \\mathbf s } , { \\mathbf a } , { \\mathbf r } , { \\mathbf s } ^ { \\prime } } [ ( Q _ { i } ^ { \\mu } ( { \\mathbf s } , { \\mathbf a } , { \\mathbf g } ) - y ) ^ { 2 } ] , \\quad y = r _ { i } + \\gamma Q _ { i } ^ { \\mu ^ { \\prime } } ( { \\mathbf s } ^ { \\prime } , a _ { 1 } ^ { \\prime } , \\dots , a _ { N } ^ { \\prime } , { \\mathbf g } ) \\big | _ { a _ { j } ^ { \\prime } = \\mu _ { j } ^ { \\prime } ( s _ { j } ) } , } \\end{array}\n$$",
|
| 525 |
+
"text_format": "latex",
|
| 526 |
+
"bbox": [
|
| 527 |
+
215,
|
| 528 |
+
348,
|
| 529 |
+
781,
|
| 530 |
+
375
|
| 531 |
+
],
|
| 532 |
+
"page_idx": 4
|
| 533 |
+
},
|
| 534 |
+
{
|
| 535 |
+
"type": "text",
|
| 536 |
+
"text": "where $\\pmb { \\mu } ^ { \\prime } = \\{ \\pmb { \\mu } _ { \\theta _ { 1 } ^ { \\prime } } , . . . , \\pmb { \\mu } _ { \\theta _ { N } ^ { \\prime } } \\}$ is the set of target policies with delayed parameters $\\theta _ { i } ^ { \\prime }$ . In practice people usually soft update it as $\\mathbf { \\dot { \\theta } } _ { i } ^ { \\prime } \\gets \\tau \\dot { \\theta } _ { i } + ( 1 - \\tau ) \\theta _ { i } ^ { \\prime }$ , where $\\tau$ is a Polyak coefficient. ",
|
| 537 |
+
"bbox": [
|
| 538 |
+
147,
|
| 539 |
+
382,
|
| 540 |
+
852,
|
| 541 |
+
414
|
| 542 |
+
],
|
| 543 |
+
"page_idx": 4
|
| 544 |
+
},
|
| 545 |
+
{
|
| 546 |
+
"type": "text",
|
| 547 |
+
"text": "During training, we collect paired rollouts as described above, apply any re-labelling strategies (such as CER or HER) and use the MADDPG algorithm to train both agent policies and the centralized critic, concatenating states, actions, and goals where appropriate. Putting everything together, we summarize the full method in Algorithm 1. ",
|
| 548 |
+
"bbox": [
|
| 549 |
+
148,
|
| 550 |
+
419,
|
| 551 |
+
849,
|
| 552 |
+
476
|
| 553 |
+
],
|
| 554 |
+
"page_idx": 4
|
| 555 |
+
},
|
| 556 |
+
{
|
| 557 |
+
"type": "text",
|
| 558 |
+
"text": "4 EXPERIMENT ",
|
| 559 |
+
"text_level": 1,
|
| 560 |
+
"bbox": [
|
| 561 |
+
148,
|
| 562 |
+
496,
|
| 563 |
+
290,
|
| 564 |
+
511
|
| 565 |
+
],
|
| 566 |
+
"page_idx": 4
|
| 567 |
+
},
|
| 568 |
+
{
|
| 569 |
+
"type": "image",
|
| 570 |
+
"img_path": "images/e055e6b40d22d0067714f3e76101f2b2ff58f924492920fd2548f0f2112a06b3.jpg",
|
| 571 |
+
"image_caption": [
|
| 572 |
+
"Figure 1: Goal conditioned ’U’ shaped maze and $\\mathbf { \\vec { \\nabla } } S \\mathbf { \\vec { \\nabla } }$ shaped maze. For each plot pair, the left illustrates a rendering of the maze type and the right shows the associated success rate throughout training for each method. Each line shows results averaged over 5 random initializations; the X-axis corresponds to epoch number and shaded regions show standard deviation. All metrics based on CER reference the performance of agent $A$ . "
|
| 573 |
+
],
|
| 574 |
+
"image_footnote": [],
|
| 575 |
+
"bbox": [
|
| 576 |
+
158,
|
| 577 |
+
530,
|
| 578 |
+
836,
|
| 579 |
+
654
|
| 580 |
+
],
|
| 581 |
+
"page_idx": 4
|
| 582 |
+
},
|
| 583 |
+
{
|
| 584 |
+
"type": "text",
|
| 585 |
+
"text": "4.1 COMBINING COMPETITIVE EXPERIENCE REPLAY WITH EXISTING METHODS ",
|
| 586 |
+
"text_level": 1,
|
| 587 |
+
"bbox": [
|
| 588 |
+
148,
|
| 589 |
+
741,
|
| 590 |
+
705,
|
| 591 |
+
755
|
| 592 |
+
],
|
| 593 |
+
"page_idx": 4
|
| 594 |
+
},
|
| 595 |
+
{
|
| 596 |
+
"type": "text",
|
| 597 |
+
"text": "We start by asking whether CER improves performance and sample efficiency in a sparse reward task. To this end, we constructed two different mazes, an easier ’U’ shaped maze and a more difficult $\\mathbf { \\vec { \\nabla } } S \\mathbf { \\vec { \\nabla } }$ shaped maze (Figure 1). The goal of the ant agent is to reach the target mark by a red sphere, whose location is randomly sampled for each new episode. At each step, the agent obtains a reward of 0 if the goal has been achieved and $- 1$ otherwise. Additional details of the ant maze environments are found in Appendix B. An advantage of this environment is that it can be reset to any given state, facilitating comparison between our two proposed variants of CER (int-CER requires the environment to have this feature). ",
|
| 598 |
+
"bbox": [
|
| 599 |
+
148,
|
| 600 |
+
766,
|
| 601 |
+
851,
|
| 602 |
+
823
|
| 603 |
+
],
|
| 604 |
+
"page_idx": 4
|
| 605 |
+
},
|
| 606 |
+
{
|
| 607 |
+
"type": "text",
|
| 608 |
+
"text": "",
|
| 609 |
+
"bbox": [
|
| 610 |
+
148,
|
| 611 |
+
121,
|
| 612 |
+
851,
|
| 613 |
+
162
|
| 614 |
+
],
|
| 615 |
+
"page_idx": 5
|
| 616 |
+
},
|
| 617 |
+
{
|
| 618 |
+
"type": "text",
|
| 619 |
+
"text": "We compare agents trained with HER, both variants of CER, and both variants of CER with HER. Since each uses DDPG as a backbone algorithm, we also include results from a policy trained using DDPG alone. To confirm that any difficulties are not simply due to DDPG, we include results from a policy trained using Proximal Policy Optimization (PPO) (Schulman et al., 2017). The results for each maze are shown in Figure 1. DDPG and PPO each performs quite poorly by itself, likely due to the sparsity of the reward in this task set up. Adding CER to DDPG partially overcomes this limitation in terms of final success rate, and, notably, reaches this stronger result with many fewer examples. A similar result is seen when adding HER to DDPG. Importantly, adding both HER and CER offers the best improvement of final success rate without requiring any observable increase in the number of episodes, as compared to each of the other baselines. These results support our hypothesis that existing state-of-the-art methods do not sufficiently address the exploration challenge intrinsic to sparse reward environments. Furthermore, these results show that CER improves both the quality and efficiency of learning in such challenging settings, especially when combined with HER. These results also show that int-CER tends to outperform ind-CER. As such, int-CER is considered preferable but has more restrictive technical requirements. ",
|
| 620 |
+
"bbox": [
|
| 621 |
+
148,
|
| 622 |
+
170,
|
| 623 |
+
852,
|
| 624 |
+
363
|
| 625 |
+
],
|
| 626 |
+
"page_idx": 5
|
| 627 |
+
},
|
| 628 |
+
{
|
| 629 |
+
"type": "text",
|
| 630 |
+
"text": "To examine the efficacy of our method on a broader range of tasks, we evaluate the change in performance when ind-CER is added to HER on the challenging multi-goal sparse reward environments introduced in Plappert et al. (2018). (Note: we would prefer to examine int-CER but are prevented by technical issues related to the environment.) Results for each of the 12 tasks we trained on are illustrated in Figure 3. Our method, when used on top of HER, improves performance wherever it is not already saturated. This is especially true on harder tasks, where HER alone achieves only modest success (e.g., HandManipulateEggFull and handManipulatePenRotate). These results further support the conclusion that existing methods often fail to achieve sufficient exploration. Our method, which provides a targeted solution to this challenge, naturally complements HER. ",
|
| 631 |
+
"bbox": [
|
| 632 |
+
147,
|
| 633 |
+
371,
|
| 634 |
+
851,
|
| 635 |
+
494
|
| 636 |
+
],
|
| 637 |
+
"page_idx": 5
|
| 638 |
+
},
|
| 639 |
+
{
|
| 640 |
+
"type": "image",
|
| 641 |
+
"img_path": "images/27e1273067bcfd690c40306cd806da119675b405423efbb3426709f9cc13b946.jpg",
|
| 642 |
+
"image_caption": [
|
| 643 |
+
"Figure 2: Comparing CER and ICM with and without HER. Each line shows task success rate averaged over 5 random initializations. $\\mathrm { X }$ -axis is epoch number; shaded regions denote standard deviation. "
|
| 644 |
+
],
|
| 645 |
+
"image_footnote": [],
|
| 646 |
+
"bbox": [
|
| 647 |
+
158,
|
| 648 |
+
511,
|
| 649 |
+
848,
|
| 650 |
+
630
|
| 651 |
+
],
|
| 652 |
+
"page_idx": 5
|
| 653 |
+
},
|
| 654 |
+
{
|
| 655 |
+
"type": "text",
|
| 656 |
+
"text": "4.2 COMPARING CER WITH CURIOSITY-DRIVEN EXPLORATION ",
|
| 657 |
+
"text_level": 1,
|
| 658 |
+
"bbox": [
|
| 659 |
+
148,
|
| 660 |
+
685,
|
| 661 |
+
596,
|
| 662 |
+
699
|
| 663 |
+
],
|
| 664 |
+
"page_idx": 5
|
| 665 |
+
},
|
| 666 |
+
{
|
| 667 |
+
"type": "text",
|
| 668 |
+
"text": "CER is designed to encourage exploration, but, unlike other methods, uses the behavior of a competitor agent to automatically determine the criteria for exploratory reward. Numerous methods have been proposed for improving exploration; for example, count-based exploration (Bellemare et al., 2016; Tang et al., 2017), VIME (Houthooft et al., 2016), bootstrap DQN (Osband et al., 2016), goal exploration process (Forestier et al., 2017), parameter space noise (Plappert et al., 2017), dynamics curiosity and boredom (Schmidhuber, 1991), and EX2 (Fu et al., 2017). One recent and popular method, intrinsic curiosity module (ICM) (Pathak et al., 2017; Burda et al., 2018), augments task reward with curiosity-driven reward. Much like CER and HER, ICM provides a method to relabel the reward associated with each transition; this reward comes from the error in a jointly trained forward prediction model. We compare how CER and ICM affect task performance and how they interact with HER across 4 tasks where we were able to implement ICM successfully. Figure 2 shows the results on several robotic control and maze tasks. We observe CER to consistently outperform ICM when each is implemented in isolation. In addition, we observe HER to benefit more from the addition of CER than of ICM. Compared to ICM, CER also tends to improve the speed of learning. These results suggest that the underlying problem is not a lack of diversity of states being visited but the size of the state space that the agent must explore (as also discussed in Andrychowicz et al. (2017)). One interpretation is that, since the two CER agents are both learning the task, the dynamics of their competition encourage more task-relevant exploration. From this perspective, CER provides an automatic curriculum for exploration such that visited states are utilized more efficiently. ",
|
| 669 |
+
"bbox": [
|
| 670 |
+
148,
|
| 671 |
+
710,
|
| 672 |
+
851,
|
| 673 |
+
821
|
| 674 |
+
],
|
| 675 |
+
"page_idx": 5
|
| 676 |
+
},
|
| 677 |
+
{
|
| 678 |
+
"type": "image",
|
| 679 |
+
"img_path": "images/3e71c35ab545ef7c2cf7fe70aac3c1b801aeaa9d69edeae00e49c9c58f1ca488.jpg",
|
| 680 |
+
"image_caption": [
|
| 681 |
+
"Figure 3: Evaluation of HER with ind-CER across different robotic control environments. Each line shows results averaged over 5 random initializations. X-axis shows epoch number; shaded regions denote standard deviation. "
|
| 682 |
+
],
|
| 683 |
+
"image_footnote": [],
|
| 684 |
+
"bbox": [
|
| 685 |
+
165,
|
| 686 |
+
117,
|
| 687 |
+
825,
|
| 688 |
+
472
|
| 689 |
+
],
|
| 690 |
+
"page_idx": 6
|
| 691 |
+
},
|
| 692 |
+
{
|
| 693 |
+
"type": "text",
|
| 694 |
+
"text": "",
|
| 695 |
+
"bbox": [
|
| 696 |
+
148,
|
| 697 |
+
515,
|
| 698 |
+
851,
|
| 699 |
+
654
|
| 700 |
+
],
|
| 701 |
+
"page_idx": 6
|
| 702 |
+
},
|
| 703 |
+
{
|
| 704 |
+
"type": "text",
|
| 705 |
+
"text": "4.3 ANALYSIS OF CER ",
|
| 706 |
+
"text_level": 1,
|
| 707 |
+
"bbox": [
|
| 708 |
+
148,
|
| 709 |
+
671,
|
| 710 |
+
320,
|
| 711 |
+
685
|
| 712 |
+
],
|
| 713 |
+
"page_idx": 6
|
| 714 |
+
},
|
| 715 |
+
{
|
| 716 |
+
"type": "text",
|
| 717 |
+
"text": "Figure 4 illustrates the success rates of agents of mini-batch samples whose reward is chang $A$ nd y C $B$ as well as the ‘effect ratio,’ whR during training, calculated as e fractiwhere $\\begin{array} { r } { \\phi = \\frac { N } { M } } \\end{array}$ $N$ $M$ \nstrong correspondence between the success rate and effect ratio, likely reflecting the influence of CER on the \nlearning dynamics. While a deeper analysis would be required to concretely understand the interplay of these \ntwo terms, we point out that CER re-labels a substantial fraction of rewards in the mini-batch. Interestingly, \neven the relatively small effect ratio observed in the first few epochs is enough support rapid learning. We \nspeculate that the sampling strategy used in int-CER provides a more targeted re-labelling, leading to the more \nrapid increase in success rate for agent $A$ . We observe that agent $B$ reaches a lower level of performance. ",
|
| 718 |
+
"bbox": [
|
| 719 |
+
147,
|
| 720 |
+
696,
|
| 721 |
+
851,
|
| 722 |
+
823
|
| 723 |
+
],
|
| 724 |
+
"page_idx": 6
|
| 725 |
+
},
|
| 726 |
+
{
|
| 727 |
+
"type": "image",
|
| 728 |
+
"img_path": "images/d1c163e8a3b024f543bf4bfe9dbdd875881fca86d2b95b586bdff97e6458f9e5.jpg",
|
| 729 |
+
"image_caption": [],
|
| 730 |
+
"image_footnote": [],
|
| 731 |
+
"bbox": [
|
| 732 |
+
160,
|
| 733 |
+
119,
|
| 734 |
+
838,
|
| 735 |
+
220
|
| 736 |
+
],
|
| 737 |
+
"page_idx": 7
|
| 738 |
+
},
|
| 739 |
+
{
|
| 740 |
+
"type": "image",
|
| 741 |
+
"img_path": "images/8899fe9d0a1ef3dcaa5d1a5edf516c162affe6dc3ef72029a5a1bf6c42780dfd.jpg",
|
| 742 |
+
"image_caption": [
|
| 743 |
+
"Figure 4: Illustration of the automatically generated curriculum between $A$ and $B$ on ‘U‘ shaped AntMaze task. From left to right are success rate of ind-CER, effect ratio of ind-CER, success rate of int-CER, and effect ratio of int-CER. Each line shows results averaged over 5 random initializations. $\\mathrm { X }$ -axis is epoch number. ",
|
| 744 |
+
"Figure 5: State visitation frequency on ’U’ maze. Top row is from after 5 epochs; bottom row from after 35. Blue on the colormap denotes no visitation. The start and goal locations are labeled with the blue and green markers, respectively. ICM and CER are trained with HER also. "
|
| 745 |
+
],
|
| 746 |
+
"image_footnote": [],
|
| 747 |
+
"bbox": [
|
| 748 |
+
151,
|
| 749 |
+
263,
|
| 750 |
+
848,
|
| 751 |
+
452
|
| 752 |
+
],
|
| 753 |
+
"page_idx": 7
|
| 754 |
+
},
|
| 755 |
+
{
|
| 756 |
+
"type": "text",
|
| 757 |
+
"text": "This likely results from resetting the parameters of agent $B$ periodically during early training, which we observe to improve the ultimate performance of agent $A$ (see Section D for details). It is also possible that the reward structure of CER asymmetrically benefits agent $A$ with respect to the underlying task. ",
|
| 758 |
+
"bbox": [
|
| 759 |
+
148,
|
| 760 |
+
521,
|
| 761 |
+
851,
|
| 762 |
+
563
|
| 763 |
+
],
|
| 764 |
+
"page_idx": 7
|
| 765 |
+
},
|
| 766 |
+
{
|
| 767 |
+
"type": "text",
|
| 768 |
+
"text": "To gain additional insight into how each method influences the behaviors learned across training, we visualize the frequency with which each location in the ‘U’ maze is visited after the 5th and 35th training epoch (Figure 5). Comparing DDPG and HER shows that the latter clearly helps move the state distribution towards the goal, especially during the early parts of training. When CER is added, states near the goal create a clear mode in the visitation distribution. This is never apparent with DDPG alone and only obvious for HER and $\\mathrm { I C M + H E R }$ later in training. CER also appears to focus the visitation of the agent, as it less frequently gets caught along the outer walls. These disparities are emphasized in Figure 6, where we show the difference in the visitation profiles. The left two plots compare CER $^ +$ HER vs. HER. The right two plots compare Agent A vs Agent B from CER+HER. Interestingly, the Agents A and B exhibit fairly similar aggregate visitation profiles with the exception that Agent A reaches the goal more often later during training. These visitation profiles underscore both the quantitative and qualitative improvements associated with CER. ",
|
| 769 |
+
"bbox": [
|
| 770 |
+
147,
|
| 771 |
+
570,
|
| 772 |
+
851,
|
| 773 |
+
723
|
| 774 |
+
],
|
| 775 |
+
"page_idx": 7
|
| 776 |
+
},
|
| 777 |
+
{
|
| 778 |
+
"type": "text",
|
| 779 |
+
"text": "5 RELATED WORK ",
|
| 780 |
+
"text_level": 1,
|
| 781 |
+
"bbox": [
|
| 782 |
+
150,
|
| 783 |
+
746,
|
| 784 |
+
316,
|
| 785 |
+
762
|
| 786 |
+
],
|
| 787 |
+
"page_idx": 7
|
| 788 |
+
},
|
| 789 |
+
{
|
| 790 |
+
"type": "text",
|
| 791 |
+
"text": "Self-play has a long history in this domain of research (Samuel, 1959; Tesauro, 1995; Heess et al., 2017). Silver et al. (2017) use self-play with deep reinforcement learning techniques to master the game of Go; and self-play has even been applied in Dota 5v5 (OpenAI, 2018). ",
|
| 792 |
+
"bbox": [
|
| 793 |
+
148,
|
| 794 |
+
780,
|
| 795 |
+
852,
|
| 796 |
+
821
|
| 797 |
+
],
|
| 798 |
+
"page_idx": 7
|
| 799 |
+
},
|
| 800 |
+
{
|
| 801 |
+
"type": "image",
|
| 802 |
+
"img_path": "images/b00a3c03ad9575649264d247c87006c0ad2250785265eaac2510a5062afd0688.jpg",
|
| 803 |
+
"image_caption": [
|
| 804 |
+
"Figure 6: State visitation difference on ’U’ maze. Left plots compare CER against HER; right plots compare the two CER agents. Each plot illustrates the difference in visitation, with red indicating more visitation by CER(A). Note: here, the “CER” agent is trained with $_ \\mathrm { C E R + H E R }$ . "
|
| 805 |
+
],
|
| 806 |
+
"image_footnote": [],
|
| 807 |
+
"bbox": [
|
| 808 |
+
168,
|
| 809 |
+
113,
|
| 810 |
+
828,
|
| 811 |
+
224
|
| 812 |
+
],
|
| 813 |
+
"page_idx": 8
|
| 814 |
+
},
|
| 815 |
+
{
|
| 816 |
+
"type": "text",
|
| 817 |
+
"text": "Curriculum learning is widely used for training neural networks (see e.g., Bengio et al., 2009; Graves et al., 2017; Elman, 1993; Olsson, 1995). A general framework for automatic task selection is Powerplay (Schmidhuber, 2013; Srivastava et al., 2013), which proposes an asymptotically optimal way of selecting tasks from a set of tasks with program search, and use replay buffer to avoid catastrophic forgetting. Florensa et al. (2017); Held et al. (2017) propose to automatically adjust task difficulty during training. Forestier et al. (2017) study intrinsically motivated goal for robotic learning. Recently, Sukhbaatar et al. (2017) suggest to use self-play between two agents where reward depends on the time of the other agent to complete to enable implicit curriculum. Our work is similar to theirs, but we propose to use sample-based competitive experience replay, which is not only more readily scalable to high-dimension control but also integrates easily with Hindsight Experience Replay (Andrychowicz et al., 2017). The method of initializing based on a state not sampled from the initial state distribution has been explored in other works. For example, Ivanovic et al. (2018) propose to create a backwards curriculum for continuous control tasks through learning a dynamics model. Resnick et al. (2018b) and Salimans & Chen (2018) propose to train policies on Pommerman (Resnick et al., 2018a) and the Atari game ‘Montezumas Revenge’ by starting each episode from a different point along a demonstration. Recently, Goyal et al. (2018) and Edwards et al. (2018) propose a learned backtracking model to generate traces that lead to high value states in order to obtain higher sample efficiency. ",
|
| 818 |
+
"bbox": [
|
| 819 |
+
147,
|
| 820 |
+
291,
|
| 821 |
+
851,
|
| 822 |
+
513
|
| 823 |
+
],
|
| 824 |
+
"page_idx": 8
|
| 825 |
+
},
|
| 826 |
+
{
|
| 827 |
+
"type": "text",
|
| 828 |
+
"text": "Experience replay has been introduced in (Lin, 1992) and later was a crucial ingredient in learning to master Atari games (Mnih et al., 2013; 2015). Wang et al. (2016) propose truncation with bias correction to reduce variance from using off-policy data in buffer and achieves good performance on continuous and discrete tasks. Different approaches have been proposed to incorporate model-free learning with experience replay(Gu et al., 2016; Feng et al., 2019). Schaul et al. (2015) improve experience replay by assigning priorities to transitions in the buffer to efficiently utilize samples. Horgan et al. (2018) further improve experience replay by proposing a distributed RL system in which experiences are shared between parallel workers and accumulated into a central replay memory and prioritized replay is used to update the policy based on the diverse accumulated experiences. ",
|
| 829 |
+
"bbox": [
|
| 830 |
+
148,
|
| 831 |
+
520,
|
| 832 |
+
852,
|
| 833 |
+
646
|
| 834 |
+
],
|
| 835 |
+
"page_idx": 8
|
| 836 |
+
},
|
| 837 |
+
{
|
| 838 |
+
"type": "text",
|
| 839 |
+
"text": "6 CONCLUSION ",
|
| 840 |
+
"text_level": 1,
|
| 841 |
+
"bbox": [
|
| 842 |
+
148,
|
| 843 |
+
665,
|
| 844 |
+
294,
|
| 845 |
+
681
|
| 846 |
+
],
|
| 847 |
+
"page_idx": 8
|
| 848 |
+
},
|
| 849 |
+
{
|
| 850 |
+
"type": "text",
|
| 851 |
+
"text": "We introduce Competitive Experience Replay, a new and general method for encouraging exploration through implicit curriculum learning in sparse reward settings. We demonstrate an empirical advantage of our technique when combined with existing methods in several challenging RL tasks. In future work, we aim to investigate richer ways to re-label rewards based on intra-agent samples to further harness multi-agent competition, it’s interesting to investigate counterfactual inference to promote efficient re-label off-policy samples. We hope that this will facilitate the application of our method to more open-end environments with even more challenging task structures. In addition, future work will explore integrating our method into approaches more closely related to model-based learning, where adequate exposure to the dynamics of the environment is often crucial. ",
|
| 852 |
+
"bbox": [
|
| 853 |
+
148,
|
| 854 |
+
696,
|
| 855 |
+
851,
|
| 856 |
+
821
|
| 857 |
+
],
|
| 858 |
+
"page_idx": 8
|
| 859 |
+
},
|
| 860 |
+
{
|
| 861 |
+
"type": "text",
|
| 862 |
+
"text": "REFERENCES ",
|
| 863 |
+
"text_level": 1,
|
| 864 |
+
"bbox": [
|
| 865 |
+
148,
|
| 866 |
+
119,
|
| 867 |
+
259,
|
| 868 |
+
135
|
| 869 |
+
],
|
| 870 |
+
"page_idx": 9
|
| 871 |
+
},
|
| 872 |
+
{
|
| 873 |
+
"type": "text",
|
| 874 |
+
"text": "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. In Advances in Neural Information Processing Systems, pp. 5048–5058, 2017. ",
|
| 875 |
+
"bbox": [
|
| 876 |
+
145,
|
| 877 |
+
142,
|
| 878 |
+
854,
|
| 879 |
+
185
|
| 880 |
+
],
|
| 881 |
+
"page_idx": 9
|
| 882 |
+
},
|
| 883 |
+
{
|
| 884 |
+
"type": "text",
|
| 885 |
+
"text": "Marcin Andrychowicz, Bowen Baker, Maciek Chociej, Rafal Jozefowicz, Bob McGrew, Jakub Pachocki, Arthur Petron, Matthias Plappert, Glenn Powell, Alex Ray, Jonas Schneider, Szymon Sidor, Josh Tobin, Peter Welinder, Lilian Weng, and Wojciech Zaremba. Learning dexterous in-hand manipulation. arXiv:1808.00177, 2018a. ",
|
| 886 |
+
"bbox": [
|
| 887 |
+
147,
|
| 888 |
+
194,
|
| 889 |
+
854,
|
| 890 |
+
251
|
| 891 |
+
],
|
| 892 |
+
"page_idx": 9
|
| 893 |
+
},
|
| 894 |
+
{
|
| 895 |
+
"type": "text",
|
| 896 |
+
"text": "Marcin Andrychowicz, Bowen Baker, Maciek Chociej, Rafal Jozefowicz, Bob McGrew, Jakub Pachocki, Arthur Petron, Matthias Plappert, Glenn Powell, Alex Ray, et al. Learning dexterous in-hand manipulation. arXiv preprint arXiv:1808.00177, 2018b. ",
|
| 897 |
+
"bbox": [
|
| 898 |
+
147,
|
| 899 |
+
260,
|
| 900 |
+
854,
|
| 901 |
+
303
|
| 902 |
+
],
|
| 903 |
+
"page_idx": 9
|
| 904 |
+
},
|
| 905 |
+
{
|
| 906 |
+
"type": "text",
|
| 907 |
+
"text": "Marc Bellemare, Sriram Srinivasan, Georg Ostrovski, Tom Schaul, David Saxton, and Remi Munos. Unifying count-based exploration and intrinsic motivation. In Advances in Neural Information Processing Systems, pp. 1471–1479, 2016. ",
|
| 908 |
+
"bbox": [
|
| 909 |
+
147,
|
| 910 |
+
310,
|
| 911 |
+
852,
|
| 912 |
+
354
|
| 913 |
+
],
|
| 914 |
+
"page_idx": 9
|
| 915 |
+
},
|
| 916 |
+
{
|
| 917 |
+
"type": "text",
|
| 918 |
+
"text": "Yoshua Bengio, Jer´ ome Louradour, Ronan Collobert, and Jason Weston. Curriculum learning. In ˆ Proceedings of the 26th annual international conference on machine learning, pp. 41–48. ACM, 2009. ",
|
| 919 |
+
"bbox": [
|
| 920 |
+
150,
|
| 921 |
+
362,
|
| 922 |
+
849,
|
| 923 |
+
392
|
| 924 |
+
],
|
| 925 |
+
"page_idx": 9
|
| 926 |
+
},
|
| 927 |
+
{
|
| 928 |
+
"type": "text",
|
| 929 |
+
"text": "Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym. arXiv preprint arXiv:1606.01540, 2016. ",
|
| 930 |
+
"bbox": [
|
| 931 |
+
148,
|
| 932 |
+
400,
|
| 933 |
+
852,
|
| 934 |
+
430
|
| 935 |
+
],
|
| 936 |
+
"page_idx": 9
|
| 937 |
+
},
|
| 938 |
+
{
|
| 939 |
+
"type": "text",
|
| 940 |
+
"text": "Yuri Burda, Harri Edwards, Deepak Pathak, Amos Storkey, Trevor Darrell, and Alexei A Efros. Large-scale study of curiosity-driven learning. arXiv preprint arXiv:1808.04355, 2018. ",
|
| 941 |
+
"bbox": [
|
| 942 |
+
147,
|
| 943 |
+
438,
|
| 944 |
+
852,
|
| 945 |
+
468
|
| 946 |
+
],
|
| 947 |
+
"page_idx": 9
|
| 948 |
+
},
|
| 949 |
+
{
|
| 950 |
+
"type": "text",
|
| 951 |
+
"text": "Ashley D Edwards, Laura Downs, and James C Davidson. Forward-backward reinforcement learning. arXiv preprint arXiv:1803.10227, 2018. ",
|
| 952 |
+
"bbox": [
|
| 953 |
+
143,
|
| 954 |
+
476,
|
| 955 |
+
851,
|
| 956 |
+
506
|
| 957 |
+
],
|
| 958 |
+
"page_idx": 9
|
| 959 |
+
},
|
| 960 |
+
{
|
| 961 |
+
"type": "text",
|
| 962 |
+
"text": "Jeffrey L Elman. Learning and development in neural networks: The importance of starting small. Cognition, 48(1):71–99, 1993. ",
|
| 963 |
+
"bbox": [
|
| 964 |
+
145,
|
| 965 |
+
513,
|
| 966 |
+
851,
|
| 967 |
+
544
|
| 968 |
+
],
|
| 969 |
+
"page_idx": 9
|
| 970 |
+
},
|
| 971 |
+
{
|
| 972 |
+
"type": "text",
|
| 973 |
+
"text": "Yihao Feng, Hao Liu, Jian Peng, and Qiang Liu. Shrinkage-based bias-variance trade-off for deep reinforcement learning, 2019. URL https://openreview.net/forum?id=S1z9ehAqYX. ",
|
| 974 |
+
"bbox": [
|
| 975 |
+
147,
|
| 976 |
+
551,
|
| 977 |
+
849,
|
| 978 |
+
582
|
| 979 |
+
],
|
| 980 |
+
"page_idx": 9
|
| 981 |
+
},
|
| 982 |
+
{
|
| 983 |
+
"type": "text",
|
| 984 |
+
"text": "Carlos Florensa, David Held, Markus Wulfmeier, Michael Zhang, and Pieter Abbeel. Reverse curriculum generation for reinforcement learning. arXiv preprint arXiv:1707.05300, 2017. ",
|
| 985 |
+
"bbox": [
|
| 986 |
+
147,
|
| 987 |
+
589,
|
| 988 |
+
849,
|
| 989 |
+
621
|
| 990 |
+
],
|
| 991 |
+
"page_idx": 9
|
| 992 |
+
},
|
| 993 |
+
{
|
| 994 |
+
"type": "text",
|
| 995 |
+
"text": "Sebastien Forestier, Yoan Mollard, and Pierre-Yves Oudeyer. Intrinsically motivated goal exploration ´ processes with automatic curriculum learning. arXiv preprint arXiv:1708.02190, 2017. ",
|
| 996 |
+
"bbox": [
|
| 997 |
+
145,
|
| 998 |
+
627,
|
| 999 |
+
849,
|
| 1000 |
+
657
|
| 1001 |
+
],
|
| 1002 |
+
"page_idx": 9
|
| 1003 |
+
},
|
| 1004 |
+
{
|
| 1005 |
+
"type": "text",
|
| 1006 |
+
"text": "Justin Fu, John Co-Reyes, and Sergey Levine. Ex2: Exploration with exemplar models for deep reinforcement learning. In Advances in Neural Information Processing Systems, pp. 2577–2587, 2017. ",
|
| 1007 |
+
"bbox": [
|
| 1008 |
+
147,
|
| 1009 |
+
665,
|
| 1010 |
+
849,
|
| 1011 |
+
695
|
| 1012 |
+
],
|
| 1013 |
+
"page_idx": 9
|
| 1014 |
+
},
|
| 1015 |
+
{
|
| 1016 |
+
"type": "text",
|
| 1017 |
+
"text": "Anirudh Goyal, Philemon Brakel, William Fedus, Timothy Lillicrap, Sergey Levine, Hugo Larochelle, and Yoshua Bengio. Recall traces: Backtracking models for efficient reinforcement learning. arXiv preprint arXiv:1804.00379, 2018. ",
|
| 1018 |
+
"bbox": [
|
| 1019 |
+
148,
|
| 1020 |
+
703,
|
| 1021 |
+
849,
|
| 1022 |
+
747
|
| 1023 |
+
],
|
| 1024 |
+
"page_idx": 9
|
| 1025 |
+
},
|
| 1026 |
+
{
|
| 1027 |
+
"type": "text",
|
| 1028 |
+
"text": "Alex Graves, Marc G Bellemare, Jacob Menick, Remi Munos, and Koray Kavukcuoglu. Automated curriculum learning for neural networks. arXiv preprint arXiv:1704.03003, 2017. ",
|
| 1029 |
+
"bbox": [
|
| 1030 |
+
143,
|
| 1031 |
+
755,
|
| 1032 |
+
849,
|
| 1033 |
+
785
|
| 1034 |
+
],
|
| 1035 |
+
"page_idx": 9
|
| 1036 |
+
},
|
| 1037 |
+
{
|
| 1038 |
+
"type": "text",
|
| 1039 |
+
"text": "Shixiang Gu, Timothy Lillicrap, Ilya Sutskever, and Sergey Levine. Continuous deep q-learning with model-based acceleration. In International Conference on Machine Learning, pp. 2829–2838, 2016. ",
|
| 1040 |
+
"bbox": [
|
| 1041 |
+
148,
|
| 1042 |
+
794,
|
| 1043 |
+
846,
|
| 1044 |
+
823
|
| 1045 |
+
],
|
| 1046 |
+
"page_idx": 9
|
| 1047 |
+
},
|
| 1048 |
+
{
|
| 1049 |
+
"type": "text",
|
| 1050 |
+
"text": "Nicolas Heess, Srinivasan Sriram, Jay Lemmon, Josh Merel, Greg Wayne, Yuval Tassa, Tom Erez, Ziyu Wang, Ali Eslami, Martin Riedmiller, et al. Emergence of locomotion behaviours in rich environments. arXiv preprint arXiv:1707.02286, 2017. ",
|
| 1051 |
+
"bbox": [
|
| 1052 |
+
147,
|
| 1053 |
+
119,
|
| 1054 |
+
852,
|
| 1055 |
+
162
|
| 1056 |
+
],
|
| 1057 |
+
"page_idx": 10
|
| 1058 |
+
},
|
| 1059 |
+
{
|
| 1060 |
+
"type": "text",
|
| 1061 |
+
"text": "David Held, Xinyang Geng, Carlos Florensa, and Pieter Abbeel. Automatic goal generation for reinforcement learning agents. arXiv preprint arXiv:1705.06366, 2017. ",
|
| 1062 |
+
"bbox": [
|
| 1063 |
+
143,
|
| 1064 |
+
171,
|
| 1065 |
+
848,
|
| 1066 |
+
202
|
| 1067 |
+
],
|
| 1068 |
+
"page_idx": 10
|
| 1069 |
+
},
|
| 1070 |
+
{
|
| 1071 |
+
"type": "text",
|
| 1072 |
+
"text": "Dan Horgan, John Quan, David Budden, Gabriel Barth-Maron, Matteo Hessel, Hado Van Hasselt, and David Silver. Distributed prioritized experience replay. arXiv preprint arXiv:1803.00933, 2018. ",
|
| 1073 |
+
"bbox": [
|
| 1074 |
+
148,
|
| 1075 |
+
209,
|
| 1076 |
+
848,
|
| 1077 |
+
241
|
| 1078 |
+
],
|
| 1079 |
+
"page_idx": 10
|
| 1080 |
+
},
|
| 1081 |
+
{
|
| 1082 |
+
"type": "text",
|
| 1083 |
+
"text": "Rein Houthooft, Xi Chen, Yan Duan, John Schulman, Filip De Turck, and Pieter Abbeel. Vime: Variational information maximizing exploration. In Advances in Neural Information Processing Systems, pp. 1109– 1117, 2016. ",
|
| 1084 |
+
"bbox": [
|
| 1085 |
+
147,
|
| 1086 |
+
248,
|
| 1087 |
+
851,
|
| 1088 |
+
291
|
| 1089 |
+
],
|
| 1090 |
+
"page_idx": 10
|
| 1091 |
+
},
|
| 1092 |
+
{
|
| 1093 |
+
"type": "text",
|
| 1094 |
+
"text": "Boris Ivanovic, James Harrison, Apoorva Sharma, Mo Chen, and Marco Pavone. Barc: Backward reachability curriculum for robotic reinforcement learning. arXiv preprint arXiv:1806.06161, 2018. ",
|
| 1095 |
+
"bbox": [
|
| 1096 |
+
145,
|
| 1097 |
+
301,
|
| 1098 |
+
851,
|
| 1099 |
+
330
|
| 1100 |
+
],
|
| 1101 |
+
"page_idx": 10
|
| 1102 |
+
},
|
| 1103 |
+
{
|
| 1104 |
+
"type": "text",
|
| 1105 |
+
"text": "Dmitry Kalashnikov, Alex Irpan, Peter Pastor, Julian Ibarz, Alexander Herzog, Eric Jang, Deirdre Quillen, Ethan Holly, Mrinal Kalakrishnan, Vincent Vanhoucke, et al. Qt-opt: Scalable deep reinforcement learning for vision-based robotic manipulation. arXiv preprint arXiv:1806.10293, 2018. ",
|
| 1106 |
+
"bbox": [
|
| 1107 |
+
148,
|
| 1108 |
+
339,
|
| 1109 |
+
852,
|
| 1110 |
+
383
|
| 1111 |
+
],
|
| 1112 |
+
"page_idx": 10
|
| 1113 |
+
},
|
| 1114 |
+
{
|
| 1115 |
+
"type": "text",
|
| 1116 |
+
"text": "Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. ",
|
| 1117 |
+
"bbox": [
|
| 1118 |
+
147,
|
| 1119 |
+
392,
|
| 1120 |
+
852,
|
| 1121 |
+
421
|
| 1122 |
+
],
|
| 1123 |
+
"page_idx": 10
|
| 1124 |
+
},
|
| 1125 |
+
{
|
| 1126 |
+
"type": "text",
|
| 1127 |
+
"text": "Sergey Levine, Peter Pastor, Alex Krizhevsky, Julian Ibarz, and Deirdre Quillen. Learning hand-eye coordination for robotic grasping with deep learning and large-scale data collection. The International Journal of Robotics Research, 37(4-5):421–436, 2018. ",
|
| 1128 |
+
"bbox": [
|
| 1129 |
+
147,
|
| 1130 |
+
430,
|
| 1131 |
+
851,
|
| 1132 |
+
473
|
| 1133 |
+
],
|
| 1134 |
+
"page_idx": 10
|
| 1135 |
+
},
|
| 1136 |
+
{
|
| 1137 |
+
"type": "text",
|
| 1138 |
+
"text": "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. ",
|
| 1139 |
+
"bbox": [
|
| 1140 |
+
147,
|
| 1141 |
+
482,
|
| 1142 |
+
854,
|
| 1143 |
+
526
|
| 1144 |
+
],
|
| 1145 |
+
"page_idx": 10
|
| 1146 |
+
},
|
| 1147 |
+
{
|
| 1148 |
+
"type": "text",
|
| 1149 |
+
"text": "Long-Ji Lin. Self-improving reactive agents based on reinforcement learning, planning and teaching. Machine learning, 8(3-4):293–321, 1992. ",
|
| 1150 |
+
"bbox": [
|
| 1151 |
+
147,
|
| 1152 |
+
535,
|
| 1153 |
+
851,
|
| 1154 |
+
564
|
| 1155 |
+
],
|
| 1156 |
+
"page_idx": 10
|
| 1157 |
+
},
|
| 1158 |
+
{
|
| 1159 |
+
"type": "text",
|
| 1160 |
+
"text": "Ryan Lowe, Yi Wu, Aviv Tamar, Jean Harb, Pieter Abbeel, and Igor Mordatch. Multi-agent actor-critic for mixed cooperative-competitive environments. In Advances in Neural Information Processing Systems, pp. 6379–6390, 2017. ",
|
| 1161 |
+
"bbox": [
|
| 1162 |
+
147,
|
| 1163 |
+
573,
|
| 1164 |
+
854,
|
| 1165 |
+
616
|
| 1166 |
+
],
|
| 1167 |
+
"page_idx": 10
|
| 1168 |
+
},
|
| 1169 |
+
{
|
| 1170 |
+
"type": "text",
|
| 1171 |
+
"text": "Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wierstra, and Martin Riedmiller. Playing atari with deep reinforcement learning. arXiv preprint arXiv:1312.5602, 2013. ",
|
| 1172 |
+
"bbox": [
|
| 1173 |
+
145,
|
| 1174 |
+
625,
|
| 1175 |
+
851,
|
| 1176 |
+
655
|
| 1177 |
+
],
|
| 1178 |
+
"page_idx": 10
|
| 1179 |
+
},
|
| 1180 |
+
{
|
| 1181 |
+
"type": "text",
|
| 1182 |
+
"text": "Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G Bellemare, Alex Graves, Martin Riedmiller, Andreas K Fidjeland, Georg Ostrovski, et al. Human-level control through deep reinforcement learning. Nature, 518(7540):529, 2015. ",
|
| 1183 |
+
"bbox": [
|
| 1184 |
+
147,
|
| 1185 |
+
664,
|
| 1186 |
+
852,
|
| 1187 |
+
708
|
| 1188 |
+
],
|
| 1189 |
+
"page_idx": 10
|
| 1190 |
+
},
|
| 1191 |
+
{
|
| 1192 |
+
"type": "text",
|
| 1193 |
+
"text": "Andrew Y Ng, Adam Coates, Mark Diel, Varun Ganapathi, Jamie Schulte, Ben Tse, Eric Berger, and Eric Liang. Autonomous inverted helicopter flight via reinforcement learning. In Experimental Robotics IX, pp. 363–372. Springer, 2006. ",
|
| 1194 |
+
"bbox": [
|
| 1195 |
+
147,
|
| 1196 |
+
715,
|
| 1197 |
+
852,
|
| 1198 |
+
760
|
| 1199 |
+
],
|
| 1200 |
+
"page_idx": 10
|
| 1201 |
+
},
|
| 1202 |
+
{
|
| 1203 |
+
"type": "text",
|
| 1204 |
+
"text": "Roland Olsson. Inductive functional programming using incremental program transformation. Artificial intelligence, 74(1):55–81, 1995. ",
|
| 1205 |
+
"bbox": [
|
| 1206 |
+
143,
|
| 1207 |
+
768,
|
| 1208 |
+
851,
|
| 1209 |
+
797
|
| 1210 |
+
],
|
| 1211 |
+
"page_idx": 10
|
| 1212 |
+
},
|
| 1213 |
+
{
|
| 1214 |
+
"type": "text",
|
| 1215 |
+
"text": "OpenAI. Openai five. https://blog.openai.com/openai-five/, 2018. ",
|
| 1216 |
+
"bbox": [
|
| 1217 |
+
147,
|
| 1218 |
+
808,
|
| 1219 |
+
694,
|
| 1220 |
+
823
|
| 1221 |
+
],
|
| 1222 |
+
"page_idx": 10
|
| 1223 |
+
},
|
| 1224 |
+
{
|
| 1225 |
+
"type": "text",
|
| 1226 |
+
"text": "Ian Osband, Charles Blundell, Alexander Pritzel, and Benjamin Van Roy. Deep exploration via bootstrapped dqn. In Advances in neural information processing systems, pp. 4026–4034, 2016. ",
|
| 1227 |
+
"bbox": [
|
| 1228 |
+
143,
|
| 1229 |
+
119,
|
| 1230 |
+
851,
|
| 1231 |
+
150
|
| 1232 |
+
],
|
| 1233 |
+
"page_idx": 11
|
| 1234 |
+
},
|
| 1235 |
+
{
|
| 1236 |
+
"type": "text",
|
| 1237 |
+
"text": "Deepak Pathak, Pulkit Agrawal, Alexei A Efros, and Trevor Darrell. Curiosity-driven exploration by selfsupervised prediction. In International Conference on Machine Learning (ICML), volume 2017, 2017. ",
|
| 1238 |
+
"bbox": [
|
| 1239 |
+
147,
|
| 1240 |
+
159,
|
| 1241 |
+
849,
|
| 1242 |
+
189
|
| 1243 |
+
],
|
| 1244 |
+
"page_idx": 11
|
| 1245 |
+
},
|
| 1246 |
+
{
|
| 1247 |
+
"type": "text",
|
| 1248 |
+
"text": "Matthias Plappert, Rein Houthooft, Prafulla Dhariwal, Szymon Sidor, Richard Y Chen, Xi Chen, Tamim Asfour, Pieter Abbeel, and Marcin Andrychowicz. Parameter space noise for exploration. arXiv preprint arXiv:1706.01905, 2017. ",
|
| 1249 |
+
"bbox": [
|
| 1250 |
+
147,
|
| 1251 |
+
198,
|
| 1252 |
+
856,
|
| 1253 |
+
241
|
| 1254 |
+
],
|
| 1255 |
+
"page_idx": 11
|
| 1256 |
+
},
|
| 1257 |
+
{
|
| 1258 |
+
"type": "text",
|
| 1259 |
+
"text": "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. ",
|
| 1260 |
+
"bbox": [
|
| 1261 |
+
147,
|
| 1262 |
+
251,
|
| 1263 |
+
851,
|
| 1264 |
+
295
|
| 1265 |
+
],
|
| 1266 |
+
"page_idx": 11
|
| 1267 |
+
},
|
| 1268 |
+
{
|
| 1269 |
+
"type": "text",
|
| 1270 |
+
"text": "Ivaylo Popov, Nicolas Heess, Timothy Lillicrap, Roland Hafner, Gabriel Barth-Maron, Matej Vecerik, Thomas Lampe, Yuval Tassa, Tom Erez, and Martin Riedmiller. Data-efficient deep reinforcement learning for dexterous manipulation. arXiv preprint arXiv:1704.03073, 2017. ",
|
| 1271 |
+
"bbox": [
|
| 1272 |
+
151,
|
| 1273 |
+
304,
|
| 1274 |
+
851,
|
| 1275 |
+
348
|
| 1276 |
+
],
|
| 1277 |
+
"page_idx": 11
|
| 1278 |
+
},
|
| 1279 |
+
{
|
| 1280 |
+
"type": "text",
|
| 1281 |
+
"text": "Cinjon Resnick, Wes Eldridge, David Ha, Denny Britz, Jakob Foerster, Julian Togelius, Kyunghyun Cho, and Joan Bruna. Pommerman: A multi-agent playground. arXiv preprint arXiv:1809.07124, 2018a. ",
|
| 1282 |
+
"bbox": [
|
| 1283 |
+
150,
|
| 1284 |
+
358,
|
| 1285 |
+
852,
|
| 1286 |
+
388
|
| 1287 |
+
],
|
| 1288 |
+
"page_idx": 11
|
| 1289 |
+
},
|
| 1290 |
+
{
|
| 1291 |
+
"type": "text",
|
| 1292 |
+
"text": "Cinjon Resnick, Roberta Raileanu, Sanyam Kapoor, Alex Peysakhovich, Kyunghyun Cho, and Joan Bruna. Backplay:” man muss immer umkehren”. arXiv preprint arXiv:1807.06919, 2018b. ",
|
| 1293 |
+
"bbox": [
|
| 1294 |
+
148,
|
| 1295 |
+
397,
|
| 1296 |
+
851,
|
| 1297 |
+
428
|
| 1298 |
+
],
|
| 1299 |
+
"page_idx": 11
|
| 1300 |
+
},
|
| 1301 |
+
{
|
| 1302 |
+
"type": "text",
|
| 1303 |
+
"text": "Tim Salimans and Richard Chen. Learning montezumas revenge from a single demonstration. https://blog.openai.com/ learning-montezumas-revenge-from-a-single-demonstration/, 2018. ",
|
| 1304 |
+
"bbox": [
|
| 1305 |
+
147,
|
| 1306 |
+
436,
|
| 1307 |
+
852,
|
| 1308 |
+
481
|
| 1309 |
+
],
|
| 1310 |
+
"page_idx": 11
|
| 1311 |
+
},
|
| 1312 |
+
{
|
| 1313 |
+
"type": "text",
|
| 1314 |
+
"text": "Arthur L Samuel. Some studies in machine learning using the game of checkers. IBM Journal of research and development, 3(3):210–229, 1959. ",
|
| 1315 |
+
"bbox": [
|
| 1316 |
+
143,
|
| 1317 |
+
489,
|
| 1318 |
+
851,
|
| 1319 |
+
520
|
| 1320 |
+
],
|
| 1321 |
+
"page_idx": 11
|
| 1322 |
+
},
|
| 1323 |
+
{
|
| 1324 |
+
"type": "text",
|
| 1325 |
+
"text": "Tom Schaul, John Quan, Ioannis Antonoglou, and David Silver. Prioritized experience replay. arXiv preprint arXiv:1511.05952, 2015. ",
|
| 1326 |
+
"bbox": [
|
| 1327 |
+
143,
|
| 1328 |
+
529,
|
| 1329 |
+
851,
|
| 1330 |
+
559
|
| 1331 |
+
],
|
| 1332 |
+
"page_idx": 11
|
| 1333 |
+
},
|
| 1334 |
+
{
|
| 1335 |
+
"type": "text",
|
| 1336 |
+
"text": "Jurgen Schmidhuber. A possibility for implementing curiosity and boredom in model-building neural¨ controllers. In Proc. of the international conference on simulation of adaptive behavior: From animals to animats, pp. 222–227, 1991. ",
|
| 1337 |
+
"bbox": [
|
| 1338 |
+
147,
|
| 1339 |
+
569,
|
| 1340 |
+
852,
|
| 1341 |
+
612
|
| 1342 |
+
],
|
| 1343 |
+
"page_idx": 11
|
| 1344 |
+
},
|
| 1345 |
+
{
|
| 1346 |
+
"type": "text",
|
| 1347 |
+
"text": "Jurgen Schmidhuber. Powerplay: Training an increasingly general problem solver by continually searching ¨ for the simplest still unsolvable problem. Frontiers in psychology, 4:313, 2013. ",
|
| 1348 |
+
"bbox": [
|
| 1349 |
+
143,
|
| 1350 |
+
622,
|
| 1351 |
+
851,
|
| 1352 |
+
651
|
| 1353 |
+
],
|
| 1354 |
+
"page_idx": 11
|
| 1355 |
+
},
|
| 1356 |
+
{
|
| 1357 |
+
"type": "text",
|
| 1358 |
+
"text": "John Schulman, Sergey Levine, Philipp Moritz, Michael I. Jordan, and Pieter Abbeel. Trust region policy optimization. In International Conference on Machine Learning, 2015. ",
|
| 1359 |
+
"bbox": [
|
| 1360 |
+
145,
|
| 1361 |
+
661,
|
| 1362 |
+
849,
|
| 1363 |
+
691
|
| 1364 |
+
],
|
| 1365 |
+
"page_idx": 11
|
| 1366 |
+
},
|
| 1367 |
+
{
|
| 1368 |
+
"type": "text",
|
| 1369 |
+
"text": "John Schulman, Philipp Moritz, Sergey Levine, Michael Jordan, and Pieter Abbeel. High-dimensional continuous control using generalized advantage estimation. International Conference of Learning Representations (ICLR), 2016. ",
|
| 1370 |
+
"bbox": [
|
| 1371 |
+
145,
|
| 1372 |
+
700,
|
| 1373 |
+
851,
|
| 1374 |
+
744
|
| 1375 |
+
],
|
| 1376 |
+
"page_idx": 11
|
| 1377 |
+
},
|
| 1378 |
+
{
|
| 1379 |
+
"type": "text",
|
| 1380 |
+
"text": "John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. Advances in Neural Information Processing Systems, 2017. ",
|
| 1381 |
+
"bbox": [
|
| 1382 |
+
142,
|
| 1383 |
+
753,
|
| 1384 |
+
851,
|
| 1385 |
+
784
|
| 1386 |
+
],
|
| 1387 |
+
"page_idx": 11
|
| 1388 |
+
},
|
| 1389 |
+
{
|
| 1390 |
+
"type": "text",
|
| 1391 |
+
"text": "David Silver, Guy Lever, Nicolas Heess, Thomas Degris, Daan Wierstra, and Martin Riedmiller. Deterministic policy gradient algorithms. In ICML, 2014. ",
|
| 1392 |
+
"bbox": [
|
| 1393 |
+
143,
|
| 1394 |
+
792,
|
| 1395 |
+
849,
|
| 1396 |
+
823
|
| 1397 |
+
],
|
| 1398 |
+
"page_idx": 11
|
| 1399 |
+
},
|
| 1400 |
+
{
|
| 1401 |
+
"type": "text",
|
| 1402 |
+
"text": "David Silver, Aja Huang, Chris J Maddison, Arthur Guez, Laurent Sifre, George Van Den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Veda Panneershelvam, Marc Lanctot, et al. Mastering the game of go with deep neural networks and tree search. Nature, 529(7587):484–489, 2016. ",
|
| 1403 |
+
"bbox": [
|
| 1404 |
+
147,
|
| 1405 |
+
119,
|
| 1406 |
+
851,
|
| 1407 |
+
162
|
| 1408 |
+
],
|
| 1409 |
+
"page_idx": 12
|
| 1410 |
+
},
|
| 1411 |
+
{
|
| 1412 |
+
"type": "text",
|
| 1413 |
+
"text": "David Silver, Thomas Hubert, Julian Schrittwieser, Ioannis Antonoglou, Matthew Lai, Arthur Guez, Marc Lanctot, Laurent Sifre, Dharshan Kumaran, Thore Graepel, et al. Mastering chess and shogi by self-play with a general reinforcement learning algorithm. arXiv preprint arXiv:1712.01815, 2017. ",
|
| 1414 |
+
"bbox": [
|
| 1415 |
+
147,
|
| 1416 |
+
171,
|
| 1417 |
+
848,
|
| 1418 |
+
214
|
| 1419 |
+
],
|
| 1420 |
+
"page_idx": 12
|
| 1421 |
+
},
|
| 1422 |
+
{
|
| 1423 |
+
"type": "text",
|
| 1424 |
+
"text": "Rupesh Kumar Srivastava, Bas R Steunebrink, and Jurgen Schmidhuber. First experiments with powerplay.¨ Neural Networks, 41:130–136, 2013. ",
|
| 1425 |
+
"bbox": [
|
| 1426 |
+
143,
|
| 1427 |
+
223,
|
| 1428 |
+
849,
|
| 1429 |
+
252
|
| 1430 |
+
],
|
| 1431 |
+
"page_idx": 12
|
| 1432 |
+
},
|
| 1433 |
+
{
|
| 1434 |
+
"type": "text",
|
| 1435 |
+
"text": "Sainbayar Sukhbaatar, Zeming Lin, Ilya Kostrikov, Gabriel Synnaeve, Arthur Szlam, and Rob Fergus. Intrinsic motivation and automatic curricula via asymmetric self-play. arXiv preprint arXiv:1703.05407, 2017. ",
|
| 1436 |
+
"bbox": [
|
| 1437 |
+
147,
|
| 1438 |
+
261,
|
| 1439 |
+
849,
|
| 1440 |
+
290
|
| 1441 |
+
],
|
| 1442 |
+
"page_idx": 12
|
| 1443 |
+
},
|
| 1444 |
+
{
|
| 1445 |
+
"type": "text",
|
| 1446 |
+
"text": "Richard S Sutton, Andrew G Barto, et al. Reinforcement learning: An introduction. MIT press, 1998. ",
|
| 1447 |
+
"bbox": [
|
| 1448 |
+
147,
|
| 1449 |
+
297,
|
| 1450 |
+
813,
|
| 1451 |
+
314
|
| 1452 |
+
],
|
| 1453 |
+
"page_idx": 12
|
| 1454 |
+
},
|
| 1455 |
+
{
|
| 1456 |
+
"type": "text",
|
| 1457 |
+
"text": "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. In Advances in Neural Information Processing Systems, pp. 2753–2762, 2017. ",
|
| 1458 |
+
"bbox": [
|
| 1459 |
+
147,
|
| 1460 |
+
321,
|
| 1461 |
+
849,
|
| 1462 |
+
366
|
| 1463 |
+
],
|
| 1464 |
+
"page_idx": 12
|
| 1465 |
+
},
|
| 1466 |
+
{
|
| 1467 |
+
"type": "text",
|
| 1468 |
+
"text": "Gerald Tesauro. Temporal difference learning and td-gammon. Communications of the ACM, 38(3):58–68, 1995. ",
|
| 1469 |
+
"bbox": [
|
| 1470 |
+
145,
|
| 1471 |
+
373,
|
| 1472 |
+
851,
|
| 1473 |
+
402
|
| 1474 |
+
],
|
| 1475 |
+
"page_idx": 12
|
| 1476 |
+
},
|
| 1477 |
+
{
|
| 1478 |
+
"type": "text",
|
| 1479 |
+
"text": "Emanuel Todorov, Tom Erez, and Yuval Tassa. Mujoco: A physics engine for model-based control. In Intelligent Robots and Systems (IROS), 2012 IEEE/RSJ International Conference on, pp. 5026–5033. IEEE, 2012. ",
|
| 1480 |
+
"bbox": [
|
| 1481 |
+
147,
|
| 1482 |
+
411,
|
| 1483 |
+
852,
|
| 1484 |
+
454
|
| 1485 |
+
],
|
| 1486 |
+
"page_idx": 12
|
| 1487 |
+
},
|
| 1488 |
+
{
|
| 1489 |
+
"type": "text",
|
| 1490 |
+
"text": "Ziyu Wang, Victor Bapst, Nicolas Heess, Volodymyr Mnih, Remi Munos, Koray Kavukcuoglu, and Nando de Freitas. Sample efficient actor-critic with experience replay. arXiv preprint arXiv:1611.01224, 2016. ",
|
| 1491 |
+
"bbox": [
|
| 1492 |
+
150,
|
| 1493 |
+
463,
|
| 1494 |
+
851,
|
| 1495 |
+
492
|
| 1496 |
+
],
|
| 1497 |
+
"page_idx": 12
|
| 1498 |
+
},
|
| 1499 |
+
{
|
| 1500 |
+
"type": "text",
|
| 1501 |
+
"text": "A ALGORITHM ",
|
| 1502 |
+
"text_level": 1,
|
| 1503 |
+
"bbox": [
|
| 1504 |
+
148,
|
| 1505 |
+
119,
|
| 1506 |
+
290,
|
| 1507 |
+
135
|
| 1508 |
+
],
|
| 1509 |
+
"page_idx": 13
|
| 1510 |
+
},
|
| 1511 |
+
{
|
| 1512 |
+
"type": "text",
|
| 1513 |
+
"text": "We summarize the algorithm for HER with CER in Algorithm 1. ",
|
| 1514 |
+
"bbox": [
|
| 1515 |
+
147,
|
| 1516 |
+
150,
|
| 1517 |
+
570,
|
| 1518 |
+
166
|
| 1519 |
+
],
|
| 1520 |
+
"page_idx": 13
|
| 1521 |
+
},
|
| 1522 |
+
{
|
| 1523 |
+
"type": "table",
|
| 1524 |
+
"img_path": "images/41c030bb667512b63e645f4439dd94c158536b6e1285dc124280366913476cd0.jpg",
|
| 1525 |
+
"table_caption": [],
|
| 1526 |
+
"table_footnote": [],
|
| 1527 |
+
"table_body": "<table><tr><td>Algorithm1HER with CER</td></tr><tr><td>Initialize a random process N for action exploration,max episode length to L Set CER to ind-CER or int-CER</td></tr><tr><td>for episode= 1 to M do</td></tr><tr><td>Receive initial state S A</td></tr><tr><td>Receive a goal rA for this episode</td></tr><tr><td>Initialize episode buffer buffer A</td></tr><tr><td>for t=1to L do</td></tr><tr><td>select action aA = μe(sA) +Nt w.r.t. the current policy and exploration Execute actions αA and observe reward rA and new state s'A</td></tr><tr><td>Store (sA,aA,gA,rA,SA') in buffer A</td></tr><tr><td>SA↑SA</td></tr><tr><td>end for</td></tr><tr><td> Receive initial state SB or Receive initial state SB, where SB is a state sampled from buffer A</td></tr><tr><td>Receive a goal rB for this episode Initialize episode buffer buffer B</td></tr><tr><td>for t=1 to L do</td></tr><tr><td>select action aB = μe(sB)+Nt w.r.t. the current policy and exploration</td></tr><tr><td>Execute actions αB and observe reward rB and new state s'B</td></tr><tr><td>Store (sB,aB,gB,rB,SB') in bufferB</td></tr><tr><td>SB↑SB</td></tr><tr><td>end for</td></tr><tr><td>ConcatenatebuferA and bufferg and store ({si}=1,{ai}T=1,{g}T=1,{ri}=1,{s'i}T=1) in replay buffer D</td></tr><tr><td>// Optimization based on off-policysamples</td></tr><tr><td>fork=1 toKdo // Relabelling off-policy samples</td></tr></table>",
|
| 1528 |
+
"bbox": [
|
| 1529 |
+
145,
|
| 1530 |
+
181,
|
| 1531 |
+
831,
|
| 1532 |
+
617
|
| 1533 |
+
],
|
| 1534 |
+
"page_idx": 13
|
| 1535 |
+
},
|
| 1536 |
+
{
|
| 1537 |
+
"type": "text",
|
| 1538 |
+
"text": "B ENVIRONMENT DETAILS ",
|
| 1539 |
+
"text_level": 1,
|
| 1540 |
+
"bbox": [
|
| 1541 |
+
148,
|
| 1542 |
+
647,
|
| 1543 |
+
385,
|
| 1544 |
+
664
|
| 1545 |
+
],
|
| 1546 |
+
"page_idx": 13
|
| 1547 |
+
},
|
| 1548 |
+
{
|
| 1549 |
+
"type": "text",
|
| 1550 |
+
"text": "Robotic control environments The robotic control environments shown in Figure 7 are part of challenging continuous robotics control suite (Plappert et al., 2018) integrated in OpenAI Gym (Brockman et al., 2016) and based on Mujoco simulation enginge (Todorov et al., 2012). The Fetch environments are based on the 7-DoF Fetch robotics arm, which has a two-fingered parallel gripper. The Hand environments are based on the Shadow Dexterous Hand, which is an anthropomorphic robotic hand with 24 degrees of freedom. In all tasks, rewards are sparse and binary: the agent obtains a reward of 0 if the goal has been achieved and $- 1$ otherwise. For more details please refer to Plappert et al. (2018). ",
|
| 1551 |
+
"bbox": [
|
| 1552 |
+
147,
|
| 1553 |
+
679,
|
| 1554 |
+
852,
|
| 1555 |
+
777
|
| 1556 |
+
],
|
| 1557 |
+
"page_idx": 13
|
| 1558 |
+
},
|
| 1559 |
+
{
|
| 1560 |
+
"type": "text",
|
| 1561 |
+
"text": "Ant maze environments We also construct two maze environments with the re-settable property, rendered in Figure 1, in which walls are placed to construct ”U” or ”S” shaped maze. At the beginning of each episode, the agent is always initialized at position $( 0 , 0 )$ , and can move in any direction as long as it is not obstructed by a wall. The $\\mathbf { X } ^ { - }$ and y-axis locations of the target ball are sampled uniformly from $[ - 5 , 2 0 ]$ , $[ - 5 , 2 0 ]$ , respectively. ",
|
| 1562 |
+
"bbox": [
|
| 1563 |
+
147,
|
| 1564 |
+
794,
|
| 1565 |
+
849,
|
| 1566 |
+
821
|
| 1567 |
+
],
|
| 1568 |
+
"page_idx": 13
|
| 1569 |
+
},
|
| 1570 |
+
{
|
| 1571 |
+
"type": "image",
|
| 1572 |
+
"img_path": "images/18ec610471e417495297d3ada254ce66e758df5b2463d05d5b9be2f597a0bd37.jpg",
|
| 1573 |
+
"image_caption": [
|
| 1574 |
+
"Figure 7: Robotics control environments used in our experiments "
|
| 1575 |
+
],
|
| 1576 |
+
"image_footnote": [],
|
| 1577 |
+
"bbox": [
|
| 1578 |
+
158,
|
| 1579 |
+
117,
|
| 1580 |
+
836,
|
| 1581 |
+
388
|
| 1582 |
+
],
|
| 1583 |
+
"page_idx": 14
|
| 1584 |
+
},
|
| 1585 |
+
{
|
| 1586 |
+
"type": "text",
|
| 1587 |
+
"text": "",
|
| 1588 |
+
"bbox": [
|
| 1589 |
+
147,
|
| 1590 |
+
430,
|
| 1591 |
+
852,
|
| 1592 |
+
473
|
| 1593 |
+
],
|
| 1594 |
+
"page_idx": 14
|
| 1595 |
+
},
|
| 1596 |
+
{
|
| 1597 |
+
"type": "text",
|
| 1598 |
+
"text": "C COMPETITIVE EXPERIENCE REPLAY WITH DIFFERENT ADVERSARIAL AGENTS ",
|
| 1599 |
+
"text_level": 1,
|
| 1600 |
+
"bbox": [
|
| 1601 |
+
147,
|
| 1602 |
+
494,
|
| 1603 |
+
823,
|
| 1604 |
+
508
|
| 1605 |
+
],
|
| 1606 |
+
"page_idx": 14
|
| 1607 |
+
},
|
| 1608 |
+
{
|
| 1609 |
+
"type": "image",
|
| 1610 |
+
"img_path": "images/d5cc5dff820ac51df2323423b6c4f33228df28e6347716f00a1bea69f7c54c77.jpg",
|
| 1611 |
+
"image_caption": [
|
| 1612 |
+
"Figure 8: Performance on FetchSlide (top) and HandManipulatePenFull (bottom) for different batch-size multipliers when training using HER (left columns) or HER $^ +$ CER (middle, right columns). Middle plots show the performance of agent $A$ and, in the right plots, performance of agent $B$ is shown for reference. "
|
| 1613 |
+
],
|
| 1614 |
+
"image_footnote": [],
|
| 1615 |
+
"bbox": [
|
| 1616 |
+
223,
|
| 1617 |
+
529,
|
| 1618 |
+
756,
|
| 1619 |
+
733
|
| 1620 |
+
],
|
| 1621 |
+
"page_idx": 14
|
| 1622 |
+
},
|
| 1623 |
+
{
|
| 1624 |
+
"type": "text",
|
| 1625 |
+
"text": "As Andrychowicz et al. (2017) and Andrychowicz et al. (2018a) observe (and we also observe), performance depends on the batch size. We leverage this observation to tune the relative strengths of Agents $A$ and $B$ by separately manipulating the batch sizes used for updating each. ",
|
| 1626 |
+
"bbox": [
|
| 1627 |
+
148,
|
| 1628 |
+
780,
|
| 1629 |
+
852,
|
| 1630 |
+
823
|
| 1631 |
+
],
|
| 1632 |
+
"page_idx": 14
|
| 1633 |
+
},
|
| 1634 |
+
{
|
| 1635 |
+
"type": "text",
|
| 1636 |
+
"text": "For simplicity, we control the batch size by changing the number of MPI workers devoted to a particular update. Each MPI worker computes the gradients for a batch size of 256; averaging the gradients from each worker results in an effective batch size of $N * 2 5 6$ . For our single-agent baselines, we choose $N = 3 0$ workers, and, when using CER, a default of $N = 1 5$ for each $A$ and $B$ In the following, $A x B y$ denotes, for agent $A$ , $N = x$ and, for agent $B$ , $N = y$ . These results suggest that, while a sufficiently large batch size is important for achieving the best performance, the optimal configuration occurs when the batch sizes used for the two agents are balanced. Interestingly, we observe that batch size imbalance adversely effects both agents trained during CER. ",
|
| 1637 |
+
"bbox": [
|
| 1638 |
+
147,
|
| 1639 |
+
119,
|
| 1640 |
+
852,
|
| 1641 |
+
232
|
| 1642 |
+
],
|
| 1643 |
+
"page_idx": 15
|
| 1644 |
+
},
|
| 1645 |
+
{
|
| 1646 |
+
"type": "text",
|
| 1647 |
+
"text": "D IMPLEMENTATION DETAILS ",
|
| 1648 |
+
"text_level": 1,
|
| 1649 |
+
"bbox": [
|
| 1650 |
+
148,
|
| 1651 |
+
252,
|
| 1652 |
+
410,
|
| 1653 |
+
268
|
| 1654 |
+
],
|
| 1655 |
+
"page_idx": 15
|
| 1656 |
+
},
|
| 1657 |
+
{
|
| 1658 |
+
"type": "text",
|
| 1659 |
+
"text": "In the code for HER (Andrychowicz et al., 2017), the authors use MPI to increase the batch size. MPI is used here to run rollouts in parallel and average gradients over all MPI workers. We found that MPI is crucial for good performance, since training for longer time with a smaller batch size gives sub-optimal performance. This is consistent with the authors’ findings in their code that having a much larger batch size helps a lot. For each experiment, we provide the per-worker batch sizes in Table 1; note that the effective batch size is multiplied by the number of MPI workers $N$ . ",
|
| 1660 |
+
"bbox": [
|
| 1661 |
+
148,
|
| 1662 |
+
284,
|
| 1663 |
+
852,
|
| 1664 |
+
367
|
| 1665 |
+
],
|
| 1666 |
+
"page_idx": 15
|
| 1667 |
+
},
|
| 1668 |
+
{
|
| 1669 |
+
"type": "text",
|
| 1670 |
+
"text": "In our implementation, we do $N$ rollouts in parallel for each agent and have separate optimizers for each. We found that periodically resetting the parameters of agent $B$ in early stage of training helps agent $A$ more consistently reach a high level of performance. This resetting helps to strike an optimal balance between the influences of HER and CER in training agent $A$ . We also add L2 regularization, following the practice of Andrychowicz et al. (2017). ",
|
| 1671 |
+
"bbox": [
|
| 1672 |
+
147,
|
| 1673 |
+
373,
|
| 1674 |
+
852,
|
| 1675 |
+
444
|
| 1676 |
+
],
|
| 1677 |
+
"page_idx": 15
|
| 1678 |
+
},
|
| 1679 |
+
{
|
| 1680 |
+
"type": "text",
|
| 1681 |
+
"text": "For the experiments with neural networks, all parameters are randomly initialized from $\\mathcal { N } ( 0 , 0 . 2 )$ . We use networks with three layers of hidden layer size 256 and Adam (Kingma & Ba, 2014) for optimization. Presented results are averaged over 5 random seeds. We summarize the hyperparameters in Table 1. ",
|
| 1682 |
+
"bbox": [
|
| 1683 |
+
147,
|
| 1684 |
+
450,
|
| 1685 |
+
852,
|
| 1686 |
+
493
|
| 1687 |
+
],
|
| 1688 |
+
"page_idx": 15
|
| 1689 |
+
},
|
| 1690 |
+
{
|
| 1691 |
+
"type": "table",
|
| 1692 |
+
"img_path": "images/12721f8289fc6e8305dc6c8ba83c8d9e44f50e66bde71016c6b12f52add3bb27.jpg",
|
| 1693 |
+
"table_caption": [
|
| 1694 |
+
"Table 1: Hyperparameter values used in experiments. "
|
| 1695 |
+
],
|
| 1696 |
+
"table_footnote": [],
|
| 1697 |
+
"table_body": "<table><tr><td rowspan=1 colspan=1>Hyperparametername</td><td rowspan=1 colspan=1>'U'AntMaze</td><td rowspan=1 colspan=1>'S'AntMaze</td><td rowspan=1 colspan=1>FetchControl</td><td rowspan=1 colspan=1>HandControl</td></tr><tr><td rowspan=1 colspan=1>Buffer size</td><td rowspan=1 colspan=1>1E5</td><td rowspan=1 colspan=1>1E6</td><td rowspan=1 colspan=1>1E6</td><td rowspan=1 colspan=1>1E6</td></tr><tr><td rowspan=1 colspan=1>Batch size</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>256</td></tr><tr><td rowspan=1 colspan=1>Max steps ofepisode</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>100</td></tr><tr><td rowspan=1 colspan=1>Reset epochs</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>5</td></tr><tr><td rowspan=1 colspan=1>Max reset epochs</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>30</td></tr><tr><td rowspan=1 colspan=1>Total epochs</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>100/50</td><td rowspan=1 colspan=1>200</td></tr><tr><td rowspan=1 colspan=1>ActorLearning rate</td><td rowspan=1 colspan=1>0.0004</td><td rowspan=1 colspan=1>0.0004</td><td rowspan=1 colspan=1>0.001</td><td rowspan=1 colspan=1>0.001</td></tr><tr><td rowspan=1 colspan=1>CriticLearning rate</td><td rowspan=1 colspan=1>0.0004</td><td rowspan=1 colspan=1>0.0004</td><td rowspan=1 colspan=1>0.001</td><td rowspan=1 colspan=1>0.001</td></tr><tr><td rowspan=1 colspan=1>ActionL2 regularization</td><td rowspan=1 colspan=1>0.01</td><td rowspan=1 colspan=1>0.01</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>1.00</td></tr><tr><td rowspan=1 colspan=1>Polyak</td><td rowspan=1 colspan=1>0.95</td><td rowspan=1 colspan=1>0.95</td><td rowspan=1 colspan=1>0.95</td><td rowspan=1 colspan=1>0.95</td></tr></table>",
|
| 1698 |
+
"bbox": [
|
| 1699 |
+
274,
|
| 1700 |
+
506,
|
| 1701 |
+
718,
|
| 1702 |
+
738
|
| 1703 |
+
],
|
| 1704 |
+
"page_idx": 15
|
| 1705 |
+
}
|
| 1706 |
+
]
|
parse/train/Sklsm20ctX/Sklsm20ctX_middle.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/Sklsm20ctX/Sklsm20ctX_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/TScOKQW67Mj/TScOKQW67Mj.md
ADDED
|
@@ -0,0 +1,401 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Efficient Softmax Approximation for Deep Neural Networks with Attention Mechanism
|
| 2 |
+
|
| 3 |
+
Anonymous Author(s)
|
| 4 |
+
Affiliation
|
| 5 |
+
Address
|
| 6 |
+
email
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
1 There has been a rapid advance of custom hardware (HW) for accelerating the
|
| 11 |
+
2 inference speed of deep neural networks (DNNs). Previously, the softmax layer
|
| 12 |
+
3 was not a main concern of DNN accelerating HW, because its portion is relatively
|
| 13 |
+
4 small in multi-layer perceptron or convolutional neural networks. However,as the
|
| 14 |
+
5 attention mechanisms are widely used in various modern DNNs,a cost-efficient
|
| 15 |
+
6 implementation of softmax layer is becoming very important. In this paper, we
|
| 16 |
+
7 propose two methods to approximate softmax computation,which are based on
|
| 17 |
+
8 the usage of LookUp Tables (LUTs). The required size of LUT is quite small
|
| 18 |
+
9 (about 7Oo Bytes) because ranges of numerators and denominators of softmax are
|
| 19 |
+
10 stable if normalization is applied to the input. We have validated the proposed
|
| 20 |
+
11 technique over different AI tasks (object detection,machine translation, speech
|
| 21 |
+
12 recognition, semantic equivalence) and DNN models (DETR,Transformer, BERT)
|
| 22 |
+
13 by a variety of benchmarks (COCO17, WMT14, WMT17, GLUE). We showed
|
| 23 |
+
14 that 8-bit approximation allows to obtain acceptable accuracy loss below $1 . 0 \%$
|
| 24 |
+
|
| 25 |
+
# 151Introduction
|
| 26 |
+
|
| 27 |
+
16 After Vaswani et al. had introduced Transformer model in [27] for machine translation task, the
|
| 28 |
+
17 attention based architecture became popular firstly in Natural Language Processng (NLP) appli
|
| 29 |
+
18 cations, e.g.: speech recognition [16], [21], [9]; summarization [7]; language understanding [5],
|
| 30 |
+
19 [33],[15],[18]; and video captioning [3]. Recently attention-based models are used in even wider
|
| 31 |
+
20 practical areas including Computer Vision (CV) tasks for object detection [2]; image transformation
|
| 32 |
+
21 [26]; image classification [6]; and even symbolic integration and solving diferential equations [14].
|
| 33 |
+
22 Despite the attractiveness of transformer-based models, its direct implementation into the platform
|
| 34 |
+
23 with constrained computational power (e.g., mobile SoC,edge devices)1 is very challnging due to
|
| 35 |
+
24 big memory footprint and latency.
|
| 36 |
+
|
| 37 |
+
Therefore, model compresson techniques such as quantization,and distillation are needed for those models. Many approaches have been introduced on quantizing matrix multiplication of transformer architecture.For example,in [22] it was used second order Hessian information, what allows to significantly compress the size of the model up to $1 3 \times$ times,while maintaining at most $2 . 3 \%$ of performance degradation (for the case of ultra-low precision 2-bits quantization). In [35] it was used a quantization-aware training during the fine-tuning phase of BERT, what allows to compress BERT model by $4 \times$ (with 8-bit quantization) with minimal accuracy loss (less than $1 \%$ ). In[1], a machine language translation model was quantized by 8-bit, while maintaining less than $0 . 5 \%$ drop
|
| 38 |
+
|
| 39 |
+
33 in accuracy. Moreover, in [2O] it was shown that 8-bit quantized models provide the same or even
|
| 40 |
+
34 higher accuracy as the full-precision models. Most of the above methods consider the quantization of
|
| 41 |
+
35 matrix multiplications operations only. However,as it is shown in [4],[24] in modern DNNs with
|
| 42 |
+
36 attention mechanism (e.g., Transformer, BERT, GPT-x) the softmax function is also used intensively,
|
| 43 |
+
37 especially at the longer sequence lengths,so it is necessary to optimize its for performance.
|
| 44 |
+
38 In this paper we propose methods for efficient computation of the softmax layer at the HW accelerator.
|
| 45 |
+
39 The method is based on piece-wise-constant approximation and usage of LUTs. To the best of our
|
| 46 |
+
40 knowledge,it is the first paper where softmax quantization of the models with attention mechanism is
|
| 47 |
+
41 tested and verified on a variety of AI tasks.In Section 2 we show why our research is important and
|
| 48 |
+
42 valuable.In Section 3 we consider the drawbacks of existed softmax approximation methods in the
|
| 49 |
+
43 perspective of HW accelerator, and summarize the differentiation of our methods from the previous
|
| 50 |
+
44 arts.In Section 4 we describe the details of the proposed methods. Section 5 shows the experimental
|
| 51 |
+
45 validation over different models and datasets, and Section 6 concludes the paper.
|
| 52 |
+
|
| 53 |
+
# 162 Background and motivation
|
| 54 |
+
|
| 55 |
+
47 Modern GPUs are powerful, but big, expensive, and power-hungry. Therefore, alternative HW
|
| 56 |
+
48 accelerators (e.g., NPU) for on-device inference are under active development by diferent vendors,
|
| 57 |
+
49 especially for Federated Learning and Edge computing. However, such devices mostly are focused on
|
| 58 |
+
50 the acceleration of matrix multiplication operations,and do not include means to compute complex
|
| 59 |
+
51 activation functions. Typically,in such devices the data is sent outside of the accelerator to compute
|
| 60 |
+
52 activations on host CPU.For example,according to the guidelines of Coral (TM),a softmax layer of
|
| 61 |
+
53 DNN model in Edge TPU have to be run on host CPU ², what is acceptable for traditional CV tasks
|
| 62 |
+
54 (which are typically uni-directional, have minimum dependencies, and softmax layer is located at the
|
| 63 |
+
55 end of the computational graph of DNN model), however is very inefficient for NLP tasks (which are
|
| 64 |
+
56 typically more complicated with a lot of dependencies and active employment of softmax layer in the
|
| 65 |
+
57 middle of DNN model). In opposite to traditional logic-centric approach, some researches are trying
|
| 66 |
+
58 to perform computation closer to the memory (so called memory-centric approach). For example
|
| 67 |
+
59 in [23], there is shown a DRAM-based AI accelerator. This approach allows significantly speed-up
|
| 68 |
+
60 the overall computation process, but for the computation of the activations the data should also be
|
| 69 |
+
61 moved to host processor, what is an even bigger issue in the DRAM environment.
|
| 70 |
+
62 The Eq.(1) from [27] describes how attention is computed in the model. This particular form,
|
| 71 |
+
63 named "scaled dot-product attention" takes the matrix multiplication product of queries and keys
|
| 72 |
+
64 of $\mathbf { R } ^ { N \times L \times H }$ as input forthesoftmaxlayer where $N$ means number of heads, $L$ means sequence
|
| 73 |
+
65 length and $H$ means hidden size for the case where batch size equals to 1. In other words, performing
|
| 74 |
+
66 $( N ^ { \mathbf { \bar { \nu } } } \times L \times L )$ softmax operations is required per one attention. Furthermore,encoder in typical
|
| 75 |
+
67 transformer consists of six multi-head attentions which means $6 \times ( N \times L \times L )$ operation is required
|
| 76 |
+
68 for encoder solely. Assuming the number of heads is 8 and sequence length is 128, it already takes
|
| 77 |
+
69 786,432 operations for softmax of the transformer encoder. This overhead increases as number of
|
| 78 |
+
70 heads and sequence length increases which is typical case for high-performing models.
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
A t t e n t i o n ( Q , K , V ) = S o f t m a x \left( \frac { Q K ^ { T } } { \sqrt { d _ { K } } } \right) V
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
71 For example, it requires performing $1 2 \times ( 1 2 \times 1 2 8 \times 1 2 8 ) = 2 , 3 5 9 , 2 9 6$ softmax operations for
|
| 85 |
+
72 one sample inference for typical BERT configuration [5] over sequence of length 128. In the case
|
| 86 |
+
73 when HW accelerator is used for matrix multiplication only, and activation to be computed at the
|
| 87 |
+
74 CPU (what is common case for HW accelerators, optimized for CNN-models), the huge amount of
|
| 88 |
+
75 data must be moved between CPU and the accelerator. Such data movement negatively impacts on
|
| 89 |
+
76 the overallcomputation time and power consumption, which can be critical for on-device inference.
|
| 90 |
+
77 Therefore, HW accelerator must be able to compute softmax layer without CPU involvement.
|
| 91 |
+
|
| 92 |
+
# 78 3Related work and key contributions
|
| 93 |
+
|
| 94 |
+
'9The common equation to compute softmax function over the input $x$ is a fraction as shown below:
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\sigma ( x _ { i } ) = \frac { e ^ { x _ { i } } } { \Sigma e ^ { x _ { i } } } = \frac { e ^ { x _ { i } - m a x ( x ) } } { \Sigma e ^ { x _ { i } - m a x ( x ) } }
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
80 There are different ways to implement it. For example, some approaches straightforwardly compute
|
| 101 |
+
81 the numerator and denominator firstly,and then a division operation is performed. In such case the
|
| 102 |
+
82 HW accelerator should contain a divider, what requires additional HW costs and can also cause
|
| 103 |
+
83 performance degradation, if divider is not fully pipe-lined.
|
| 104 |
+
84 In [25] it is proposed to use basic-split calculation method, which allows to split the exponentiation
|
| 105 |
+
85 calculation of the softmax into several specific basics which are implemented by LUT (ROM). It
|
| 106 |
+
86 allows to simplify the complexity of hardware and signal propagation delay. However, to recover
|
| 107 |
+
87 the whole computed value of exponent some additional multiplications are needed. Moreover, to
|
| 108 |
+
88 obtain the final value of softmax the division is stillused. In [30] it is proposed to add threshold
|
| 109 |
+
89 layers to accelerate the training speed and replace the Euler's base value with a dynamic base value
|
| 110 |
+
90 to improve the network accuracy. Such approach allowed to save up to $15 \%$ of training model
|
| 111 |
+
91 convergence time and also increase by 3 to $5 \%$ the average accuracy. But during the computation
|
| 112 |
+
92 of softmax the divider is still used. In [17] the combination of LUT and multi-segment polynomial
|
| 113 |
+
93 fiting have been used to compute exponential operations of integer and fractional parts in separate.
|
| 114 |
+
94 In addition, they adopt radix-4 Booth-Wallce based multiplier for computing the whole value
|
| 115 |
+
95 of exponent,and modified shift-compare divider for computation of the final value of softmax.
|
| 116 |
+
96 To avoid big area costs for traditional divider, the authors in [8] propose to reduce the operand
|
| 117 |
+
97 bit-width,and approximate exponential and division operations with cost-effective addition and
|
| 118 |
+
98 bit shifts operations. In their design they have approximated the division operation in Eq. (2) by
|
| 119 |
+
99 replacing the denominator with closest $\dot { 2 } ^ { b }$ value, where $b$ is some integer constant. Then division
|
| 120 |
+
100 is implemented just as simple bit shifts operation. In [24] it is proposed to replace the base as
|
| 121 |
+
101 $e ^ { x } \to 2 ^ { x }$ , then all computations are more hardware-friendly, however the division operation is still
|
| 122 |
+
102 required. Also, to restore accuracy a fine-tuning of the model is needed, what is not applicable
|
| 123 |
+
103 for post-training quantization paradigm. Although the methods described above are decreasing the
|
| 124 |
+
104 hardware complexity of softmax computation they all still rely on the division operation.
|
| 125 |
+
105 To avoid division operation at all, some other solutions apply the logarithmic transformation to
|
| 126 |
+
106 the original softmax function,and thus substitute costly division operation by subtraction of the
|
| 127 |
+
107 logarithm. In [34], for example, it is proposed to use a logarithmic operation implemented as a LUT
|
| 128 |
+
108 and a subtractor to replace the division operation, what allows to further decrease the complexity of
|
| 129 |
+
109 hardware,as well critical path of the whole design. In [10] simplified version of Integral Stochastic
|
| 130 |
+
110 Computation is used in order to build FSM-based exponentiation. Division operation is substituted
|
| 131 |
+
111 by LUT-based logarithmic operation and subtraction, similarly to [34]. In [31] the authors are further
|
| 132 |
+
112 developing the method proposed in [34], by applying mathematical transformations and linear fitting.
|
| 133 |
+
113 After optimization,their final design includes only shift operations,leading one detector, and adders.
|
| 134 |
+
114 Finally, there are some extreme approximation cases represented in [13] and [28], where logarithmic
|
| 135 |
+
115 computation and subtraction are skipped at all.
|
| 136 |
+
116 Despite its atractiveness,logarithmic transformation approach can be used only in the cases when
|
| 137 |
+
117 softmax layer is the last layer in DNN and its functionality is simply“scoring”among the candidates
|
| 138 |
+
118 for classification tasks. However,if softmax layer is used inside of computational graph of DNN (e.g.,
|
| 139 |
+
119 DNNs with attention-mechanism) then error caused by quantizations will be accumulated drastically,
|
| 140 |
+
120 directly impacting on the final accuracy.For example,in Table 1 there is shown the averaged accuracy
|
| 141 |
+
121 drop for DETR models caused by a softmax approximation in uint8 precision by some prior arts.
|
| 142 |
+
122 As it can be seen from the Table 1,a straightforward usage of Eq.(2) from [31] causes big accuracy
|
| 143 |
+
123 drop,and even after applying some improvements to the original method (shown as case Eq. $( 2 ) +$ ),
|
| 144 |
+
124 the accuracy drop is still high ( $2 \%$ to $19 \%$ ).For more details of the prior arts experiments please refer
|
| 145 |
+
125 to Appendix A.1. However, if for the same conditions we use the method proposed in Section 4.1, we
|
| 146 |
+
126 can see that accuracy drop reduced by $\times 4$ to $\times 2 0$ times,and it is below $0 . 5 \%$ for plain DETR models
|
| 147 |
+
127 (no DC5 dilation at the last stage).
|
| 148 |
+
128 The work presented in this paper has focused on the development of methods for efficient computation
|
| 149 |
+
129 of softmax layer during the inference at the edge devices, what usually have limited computational
|
| 150 |
+
130 power and suffer from constraints of the bandwidth.
|
| 151 |
+
131 Previous works for HW accelerator of softmax layer are focused on the logic-centric approach and
|
| 152 |
+
132used dedicated hardware for its implementation. In such case the utilization of hardware is low,
|
| 153 |
+
133 performance can be slower, and no reconfigurability is provided. In our paper we have used an
|
| 154 |
+
134 alternative memory-centric approximate computing approach. It keeps accuracy loss small, while
|
| 155 |
+
135 allws computing softmax operation with no divider. The size of the required memory (i.e., LUT) is
|
| 156 |
+
136 reasonably small and can be reconfigured on demand.
|
| 157 |
+
137 The methods proposed in the paper contribute to building the alternative concept of hardware
|
| 158 |
+
138 architecture to accelerate essential operations for AI applications, especially for on-device inference.
|
| 159 |
+
139 To summarize,we have three-fold difference from the previous works:
|
| 160 |
+
|
| 161 |
+
Table 1: Averaged accuracy drop by different methods over DETR models (Average Precision), $\%$
|
| 162 |
+
|
| 163 |
+
<table><tr><td>METHOD</td><td>DETR (R50)</td><td>DETR+DC5(R50)</td><td>DETR (R101)</td><td>DETR+DC5(R101)</td></tr><tr><td>EQ.(2) IN [31]</td><td>7.20</td><td>19.30</td><td>10.25</td><td>25.37</td></tr><tr><td>EQ.(2)+ IN [31]</td><td>2.50</td><td>12.93</td><td>5.38</td><td>18.85</td></tr><tr><td>SECTION 4.1</td><td>0.33</td><td>2.92</td><td>0.22</td><td>2.73</td></tr></table>
|
| 164 |
+
|
| 165 |
+
· Applicability of our methods to DNN with attention mechanism is experimentally proven over variety of the models for different AI applications.All previous methods were used only for the cases when softmax is the last layer in DNN,and is used for“scoring".
|
| 166 |
+
No divider is needed to fully implement the method. Moreover, for 2D LUT method even multiplier is not needed.Thus, hardware overhead is minimal,and is almost free if used in the DRAM-based AI accelerator. Our solutions utilize integer precision, what makes it compatible with traditional HW accelerators used for matrix multiplication,and simplify the integration of methods into full system (all prior methods are based on a fixed point precision).
|
| 167 |
+
|
| 168 |
+
# 1494 Proposed methods
|
| 169 |
+
|
| 170 |
+
150 In this paper we use memory-centric approach to build the accelerator for softmax computation
|
| 171 |
+
151 in hardware platform with limited resources. We propose two LUT-based methods for efficient
|
| 172 |
+
152 computation,which provide high performance and do not require a divider. The details of the
|
| 173 |
+
153 methods are described below and appropriate software models are shown in Appendix A.2.
|
| 174 |
+
|
| 175 |
+
# 4.1Normalization of reciprocal exponentiation
|
| 176 |
+
|
| 177 |
+
In this subsection we consider the method,which is based on the normalization of reciprocal exponentiation, and hereafter we call it REXP for short.
|
| 178 |
+
|
| 179 |
+
157The original reciprocal exponentiation method was proposed in [28], where they used the inverse I58way of max-normalization and the reciprocal of exponential function as below:
|
| 180 |
+
|
| 181 |
+
$$
|
| 182 |
+
\sigma ^ { * } ( x _ { i } ) = \frac { 1 } { e ^ { m a x ( x ) - x _ { i } } }
|
| 183 |
+
$$
|
| 184 |
+
|
| 185 |
+
159And thus,the final value of softmax can be obtained by reading from a simple LUT-table. Content of
|
| 186 |
+
160LUT is computed as shown below:
|
| 187 |
+
|
| 188 |
+
$$
|
| 189 |
+
L U T _ { 1 / e } [ i ] = \left\lfloor \frac { 1 } { e ^ { i } } \cdot ( 2 ^ { w } - 1 ) \right\rceil , \forall i = 0 , 1 , . . . , x _ { q } + 1
|
| 190 |
+
$$
|
| 191 |
+
|
| 192 |
+
161where $w$ is a number of bits for quantization, and $x _ { q } = \lceil l n ( 2 ^ { w } - 1 ) \rceil$ is an efficient quantization
|
| 193 |
+
162boundary.
|
| 194 |
+
|
| 195 |
+
63In addition to very low computational complexity, this method has other desired properties [28]:
|
| 196 |
+
|
| 197 |
+
· bounded and stable ( $\frac { 1 } { e ^ { m a x ( x ) - x _ { i } } } \in ( 0 , 1 ] )$ · and nonlinear $\begin{array} { r } { ( \frac { 1 } { e ^ { \alpha x } } \ne \alpha \frac { 1 } { e ^ { x } } ) } \end{array}$ )
|
| 198 |
+
|
| 199 |
+
167 But due to its aggressive approximation nature, it can be applied only to simple CV tasks, and if
|
| 200 |
+
168 used for attention-based DNN models causes the explosion of accuracy drop (see Appendix A.1 for
|
| 201 |
+
169 details). Thus,in this paper we further develop that method to be applicable for wider class of DNN
|
| 202 |
+
170 models.
|
| 203 |
+
171 During our initial investigations,we have noticed that method described in Eq.( 3) is just scaled
|
| 204 |
+
172 version of real softmax. So, we proposed to normalize it with some probability density function
|
| 205 |
+
173 (PDF) scale,such that $\textstyle { \int } P D F = { \mathrm { \hat { 1 } } }$ . However, if used straight-forwardly, it would need to involve a
|
| 206 |
+
174 division operation, what is strongly un-desirable for devices with constrained computational power.
|
| 207 |
+
175 Therefore, instead of dividing, we propose to substitute division by multiplication with some PDF
|
| 208 |
+
176 normalizing constant as below:
|
| 209 |
+
|
| 210 |
+
$$
|
| 211 |
+
\sigma ( x _ { i } ) = \frac { \sigma ^ { * } ( x _ { i } ) } { P D F n o r m } \sigma ^ { * } ( x _ { i } ) \cdot \alpha
|
| 212 |
+
$$
|
| 213 |
+
|
| 214 |
+
177where $\alpha = e ^ { - l n \left( \Sigma \sigma ^ { \ast } \left( x _ { i } \right) \right) }$ is PDF normalizing constant.
|
| 215 |
+
|
| 216 |
+
178Then final equation to compute softmax approximation by proposed REXP method is shown below:
|
| 217 |
+
|
| 218 |
+
$$
|
| 219 |
+
\sigma ( x _ { i } ) = \frac { e ^ { - l n \left( \Sigma \sigma ^ { * } \left( x _ { i } \right) \right) } } { e ^ { m a x \left( x \right) - x _ { i } } } = \frac { 1 } { e ^ { m a x \left( x \right) - x _ { i } } } \cdot e ^ { - l n \left( \Sigma \sigma ^ { * } \left( x _ { i } \right) \right) }
|
| 220 |
+
$$
|
| 221 |
+
|
| 222 |
+
179 Thus, to compute the softmax value it requires just two LUTs of considerably small size, where
|
| 223 |
+
180 content of the first LUT is computed accordingly to Eq.(4), and the second LUT values can be
|
| 224 |
+
181computed as below:
|
| 225 |
+
|
| 226 |
+
$$
|
| 227 |
+
L U T _ { \alpha } [ j ] = \left\lfloor \frac { 1 } { j } \cdot ( 2 ^ { w } - 1 ) \right\rceil , \forall j = 0 , 1 , . . . , x _ { s } - 1
|
| 228 |
+
$$
|
| 229 |
+
|
| 230 |
+
182where $j = \Sigma \sigma ^ { * } ( x _ { i } )$ $x _ { s }$ is selected quantization boundary, and $L U T _ { \alpha } [ x _ { s } ] = 0$
|
| 231 |
+
|
| 232 |
+
# ;4.22-Dimensional LUT
|
| 233 |
+
|
| 234 |
+
184 In this subsection we propose another method which is based on the substitution of a division
|
| 235 |
+
185 operation in Eq.(2) by 2-Dimensional (2D) LUT to speed-up and simplify the computation, while
|
| 236 |
+
186 maintaining accuracy even for attention-based DNN models. Hereafter we willrefer to this method
|
| 237 |
+
187 as 2D LUT.
|
| 238 |
+
188 For this purpose,we have started with the estimation of distributions of $e ^ { x }$ and $\Sigma e ^ { x }$ terms for typical
|
| 239 |
+
189 inference runs. Our investigation showed that if max-based normalization is applied to the input
|
| 240 |
+
190 values (i.e., $x ( x - \operatorname* { m a x } ( { \bar { x } } ) ) )$ , the distribution of $e ^ { x }$ is stable within range $e ^ { x } \in ( 0 , 1 ]$ regardless of
|
| 241 |
+
191 the input values, and range of $\Sigma e ^ { x }$ term depends on the length of the input $x$ . Thus, it allows us to
|
| 242 |
+
192 have stable computation even within small size of LUT.
|
| 243 |
+
|
| 244 |
+
Generic architecture and concept of the proposed method for efcient softmax implementation as 2D LUT is shown in Figure 1. There are two LUTs used: 1D LUT for approximation of $e ^ { x }$ values, and 2D LUT for storing softmax output values dependent on the values of numerator $e ^ { x }$ (used as the 1-st index in the table),and denominator $\Sigma e ^ { x }$ (used as the 2-nd index) of Eq.(2). As it can be seen from Figure 1(right),to calculate the indexes for corresponded value in 2D LUT table, only most-significant bits (MSB)are needed. Thus,the simplest hardware realization can be done within wiring only (when MSB bits are directly connected to the appropriate address selectors)3. Also, the proposed method can be easily modified to the case where,1-st index of 2D LUT table is calculated not from $e ^ { x }$ but directly from input $x$ . In such case there is no need to store intermediate values of $e ^ { x }$
|
| 245 |
+
|
| 246 |
+
While the content of 1D LUT for approximation of $e ^ { x }$ values is straightforward, 2D LUT contains the family of linear approximations where each row contains the softmax output scaled according tc
|
| 247 |
+
|
| 248 |
+

|
| 249 |
+
Figure 1: Generic concept of the proposed 2D LUT method (left). Reading softmax output value from pre-computed 2D LUT(right). Computational flow consists from two steps: a) obtaining of $e _ { i } ^ { x }$ values by reading from 1D LUT and accumulation of $\Sigma e ^ { x }$ term, b) obtaining $\sigma ( x _ { i } )$ values by reading from 2D LUT.
|
| 250 |
+
|
| 251 |
+
204 $\Sigma e ^ { x }$ term as shown in Eq.(8). The indexes of LUT are computed according to Eq.(9) and Eq.(10), $w$
|
| 252 |
+
205means the number of bits for the value in selected precision.
|
| 253 |
+
|
| 254 |
+
$$
|
| 255 |
+
L U T _ { \sigma } [ i ] [ j ] = \left\lfloor \frac { i \cdot s c a l e _ { e ^ { x } } } { j \cdot s c a l e _ { \Sigma } } \cdot ( 2 ^ { w } - 1 ) \right\rceil
|
| 256 |
+
$$
|
| 257 |
+
|
| 258 |
+
206where
|
| 259 |
+
|
| 260 |
+
$$
|
| 261 |
+
i = 0 , . . . , \left\lfloor \frac { m a x ( e ^ { x } ) } { s c a l e _ { e ^ { x } } } \right\rceil
|
| 262 |
+
$$
|
| 263 |
+
|
| 264 |
+
$$
|
| 265 |
+
j = 1 , . . . , \left\lfloor \frac { m a x ( \Sigma e ^ { x } ) } { s c a l e _ { \Sigma } } \right\rceil
|
| 266 |
+
$$
|
| 267 |
+
|
| 268 |
+
207 Since $x \to ( x - \operatorname* { m a x } ( x ) )$ normalization was used, so $m a x ( e ^ { x } ) = 1 . 0$ ,Therefore, $s c a l e _ { e ^ { x } }$ factor
|
| 269 |
+
208 allows to define the number of columns in LUT to make it small enough for practical applications. In
|
| 270 |
+
209 our experiment we have selected $s c a l e _ { e ^ { x } } = 0 . 1$ for all precisions,what allows us to reduce the size
|
| 271 |
+
210 of LUT significantly (i.e., $i = 0 , . . . , 1 0$ for all versions of $L U T _ { \sigma }$ ). The value of $m a x ( \Sigma e ^ { x } )$ depends
|
| 272 |
+
211 on the distribution of input values. Our experiments showed that $m a x ( \Sigma e ^ { x } ) = 6 0$ is big enough for
|
| 273 |
+
212 the tested NLP applications.We also selected $s c a l e _ { \Sigma } = 1 . 0$ for simplicity of the computations. Thus,
|
| 274 |
+
213 finally, those parameters give us $L U T _ { \sigma }$ of typical size $1 1 \times 6 0$
|
| 275 |
+
|
| 276 |
+
# :145Experimental validation
|
| 277 |
+
|
| 278 |
+
To validate the proposed methods and check how well they generalize we have conducted several experiments with different models (DETR,Transformer,and BERT) for diferent applications (object detection, machine translation,sentiment analysis,and semantic equivalence) over variety of datasets. In all those experiments we have used available pre-trained models, where we applied dynamic posttraining quantization (hereafter we referred to quantized models as PTQ-D) 4. Then we substituted a conventional softmax layer in quantized models with the LUT-based computation as described in Section 4. We did not consider any retraining or fine-tuning of the models after quantization, and the same off-line generated LUTs were used among all models. Our code allows to select LUTs with different precision from int16 down to uint2, what allows to analyze the sensitivity of the model to softmax approximation even for ultra-low 2-bits quantization. The details of experiments are described below,and results are summarized in Figure 2, Figure 3,and Table 2 .For more details please refer to Table 6,and Table 7 in Appendix.As it can be seen from figures, proposed LUT-based softmax computation methods maintain accuracy drop below $1 . 0 \%$ down to 8-bit quantization for all NLP and DETR (no DC5) models.
|
| 279 |
+
|
| 280 |
+
# 5.1 Object detection
|
| 281 |
+
|
| 282 |
+
For our first experiments we have used DEtection TRansofmer (DETR) models for object detection [2], with available pre-trained models 5.As it can be seen from Table 6, we were able to reproduce the same results for original FP32 reference model over COCO dataset. We have used the same IoU metric by Average Precision (AP) as in Table 1 in [2]. Then we run a bunch of experiments to check how accuracy of object detection willbe decreased due to PTQ-D quantization and LUT-based approximation as proposed in REXP method (see Section 4.1). Table 5 in Appendix shows the LUTs size for several pre-selected cases in int16 and uint8 precision. There are three cases selected which are different in the size of $L U T _ { \alpha }$ : it is $1 \times 2 5 6$ for case 1, $1 \times 3 2 0$ for case 2,and $1 \times 5 1 2$ for case 3.
|
| 283 |
+
|
| 284 |
+
Analysis of Figure 2 shows that accuracy drop caused by application of softmax approximation is small $( < 1 \% )$ and acceptable for plain DETR models (no DC5 used). Bigger accuracy drop for $+ \mathrm { D C } 5$ cases is caused by the bigger size of self-atentions of the encoder (see details in Section 5.3). We expect that increasing size ofLUTs will help to solve this issue. The behavior of average recall values is similar to average precision values.
|
| 285 |
+
|
| 286 |
+

|
| 287 |
+
Figure 2: DETR averaged accuracy drop of PTQ-D models with softmax approximations Vs. original FP32 models: average precision (left) and average recall(right). As it can be seen from the figure, for DETR models without dilation at the last stage (no DC5) the accuracy drop for all cases is below $1 \%$ and shows very similar behavior.
|
| 288 |
+
|
| 289 |
+
# 2435.2 NLP tasks
|
| 290 |
+
|
| 291 |
+
Next, we have validated the proposed methods by experimenting with several NLP tasks. Similarly, to DETR case,Table 8 in Appendix shows the LUTs size for several pre-selected cases for those experiments. In Table 2 below there are accumulated values from the experiments with NLP models. The bold values in the table shows highest values per model per method after applying quantization and softmax approximation. As it follows from the analysis of experiment results,about 7Oo Bytes for 2D LUT method, and up to 50 Bytes for REXP method would be enough for practical applications.
|
| 292 |
+
|
| 293 |
+
# 5.2.1Machine Translation
|
| 294 |
+
|
| 295 |
+
Among NLP tasks we have started with machine translation.For our experiments we have used transofmer-base model for En-Ge translation [12] from OpenNMT library, with available pre-trained model 6,configured to replicate the results from original paper. To avoid dependency of the evaluation results on the selected tokenization scheme,we have used spm_decode 7to detokenize the output of translation,and then applied multi - bleu.perl script 8 to calculate BLEU score.
|
| 296 |
+
|
| 297 |
+
Table 2: Experimental validation over different NLP models and datasets
|
| 298 |
+
|
| 299 |
+
<table><tr><td>PRECISION</td><td colspan="4">TRANSFORMER</td><td colspan="4">BERT</td></tr><tr><td></td><td colspan="2">2D LUT</td><td colspan="2">REXP</td><td colspan="2">2D LUT</td><td colspan="2">REXP</td></tr><tr><td></td><td>WMT 2014</td><td>WMT 2017</td><td>WMT 2014</td><td>WMT 2017</td><td>SST-2</td><td>MRPC</td><td>SST-2</td><td>MRPC</td></tr><tr><td>FP32</td><td>(BLEU) 26.98</td><td>(BLEU) 28.09</td><td>(BLEU) 26.98</td><td>(BLEU) 28.09</td><td>(%) 92.32</td><td>(F1) 90.19</td><td>(%) 92.32</td><td>(F1) 90.19</td></tr><tr><td>PTQ-D</td><td>26.86</td><td>27.95</td><td>26.86</td><td>27.95</td><td>91.74</td><td>89.53</td><td>91.74</td><td>89.53</td></tr><tr><td>INT16</td><td>26.87</td><td>28.02</td><td>26.89</td><td>27.64</td><td>91.63</td><td>89.50</td><td>91.74</td><td>89.26</td></tr><tr><td>UINT8</td><td>26.76</td><td>27.9</td><td>26.8</td><td>27.66</td><td>91.63</td><td>89.35</td><td>91.17</td><td>89.34</td></tr><tr><td>UINT4</td><td>26.26</td><td>27.43</td><td>26.68</td><td>28.02</td><td>91.40</td><td>88.01</td><td>91.17</td><td>88.77</td></tr><tr><td>UINT2</td><td>24.42</td><td>25.06</td><td>25.29</td><td>25.86</td><td>89.22</td><td>56.67</td><td>91.63</td><td>86.12</td></tr></table>
|
| 300 |
+
|
| 301 |
+
256 Thus,as it can be seen from Table 2, we were able to reproduce the same BLEU score for FP32
|
| 302 |
+
257 reference model as in original model. Then we run several experiments to check how accuracy of
|
| 303 |
+
258 the translation wil be changed due to LUT-based quantization in different precisions,and we can
|
| 304 |
+
259 confirm that down up to 8-bit quantization the deviation of BLEU score from reference is small for
|
| 305 |
+
260 both datasets $( < 0 . { \bar { 5 } } \% )$ . Also, if we consider impact of the proposed methods only, then we can
|
| 306 |
+
261 see that accuracy drop is much smaller, and sometimes even recovers vs. PTQ-D quantization (see
|
| 307 |
+
262 Figure 3 (right)).
|
| 308 |
+
|
| 309 |
+

|
| 310 |
+
Figure 3: Accuracy drop for NLP experiments: PTQ-D models $^ +$ softmax approximations vs. FP32 models (left),and PTQ-D models $^ +$ softmax approximations vs. plain PTQ-D models (right). As it can be seen from the figure,down to uint8 precision the accuracy drop for all cases is below $1 \%$ and shows very similar behavior. This confirm very good generalization of the proposed method over different models and applications.
|
| 311 |
+
|
| 312 |
+
# 5.2.2Sentiment analysis
|
| 313 |
+
|
| 314 |
+
To extend the variety of NLP applications,we also tested the same LUTs with BERT model [5]. We have used sentiment analysis task from GLUE benchmark [29] to test the model. We have used huggingface library 9,and trained the model with the hyper-parameters described in 10. The results of our experiments showed, that similarly to machine translation, the impact of proposed method (softmax layer approximation by LUTs) is smallr vs. accuracy drop caused by PTQ-D quantization (see Figure 3).
|
| 315 |
+
|
| 316 |
+
# 5.2.3Semantic equivalence
|
| 317 |
+
|
| 318 |
+
For semantic equivalence test we used The Microsoft Research Paraphrase Corpus (MRPC) 11 in GLUE benchmark.As the classes are imbalanced ( $6 8 \%$ positive, $32 \%$ negative), we follow the
|
| 319 |
+
|
| 320 |
+
273 common practice and used F1 score as a metric. We have used huggingface library and followed
|
| 321 |
+
274 the guidelines from PyTorch tutorial 12 to obtain PTQ-D quantized model. Then,similarly to previous
|
| 322 |
+
275 tests we have substituted a conventional softmax layer with the proposed LUT-based methods. The
|
| 323 |
+
276 results of our experiments showed the similar trend with sentiment analysis test.
|
| 324 |
+
|
| 325 |
+
# 2775.3 Ablation study of DETR models experiment
|
| 326 |
+
|
| 327 |
+
As it is stated in [2],to increase the feature resolution for smallobjects,a dilation to the last stage of the backbone was added ( $+ \mathrm { D C } 5$ cases of DETR models). This modification increases the cost in the self-attentions of the encoder, leading to an overall $\times 2$ increase in computational cost. Such changes also reflect on the properties of softmax factors. In Figure 4 there are shown the histogram of $\Sigma e ^ { x }$ values distributions for the first 2OO tensors of DETR model run for bins $= 5 0$ $\mathtt { r a n g e } = ( 0 , 5 0 0 )$ As it can be seen from the figure, the distribution of DETR $+ \mathrm { D C } 5$ (R50) variant is more right-tailed, due to the bigger number of high-magnitude values. This causes the bigger accuracy drop when LUT-based quantization method is used, due to the lack of the discrepancy for those values. Thus, for such models (DETR with added dilation at the last stage) the accuracy of object detection after application of the proposed method can be limited. However, as we can see from Figure 2) increasing of the size of $L U { \bar { T } } _ { \alpha }$ from 256 Bytes to 512 Bytes allows to decrease the accuracy drop from $9 \%$ to $3 \%$ for $\mathrm { D E T R + D C } 5$ (R101) unit8 case. Thus, we expect that further increasing the size of LUTs will help to obtain even more accurate results for DETR models with dilation.
|
| 328 |
+
|
| 329 |
+

|
| 330 |
+
Figure 4: Histogram of $\Sigma e ^ { x }$ values distributions for DETR model variants: plain DETR (R5O) (left), and with dilation I $) \mathrm { E T R } { + } \mathrm { D C } 5$ (R50) (right). Red dot line represents the average of the all values per one run of the inference of DETR model. It is clearly seen from the figure that distribution of DETR $+ \mathrm { D C } 5$ (R50) variant is more flat, having more high-magnitude values. This causes the bigger accuracy drop for the quantized model due to lack of the discrepancy for those values.
|
| 331 |
+
|
| 332 |
+
# 2916Conclusion
|
| 333 |
+
|
| 334 |
+
In this paper two alternative methods for efficient softmax computation for DNN models with atention mechanism are proposed. The methods are memory-centric in contrast to known logiccentric approach and are based on the usage ofLUTs for reading of the pre-computed values, instead of the direct computation. Thus,it allows to build the HW accelerator without usage of costly and power-hungry divider. In turn, it allows to decrease the power consumption and latency of the whole inference,what is crucial for edge computing. All results obtained in the paper were validated over different AI tasks (object detection, machine translation, sentiment analysis, and semantic equivalence) and models (DETR,Transformer, BERT) by variety of benchmarks (COCO2017, WMT14, WMT17, GLUE), showing acceptable accuracy and good generalization of the proposed methods.
|
| 335 |
+
|
| 336 |
+
References
|
| 337 |
+
[1] Aishwarya Bhandare, Vamsi Sripathi, Deepthi Karkada, Vivek Menon, Sun Choi, Kushal Datta, and Vikram Saletore.Eficient 8-bit quantization of transformer neural machine language translation model. CoRR,abs/1906.00532,2019.
|
| 338 |
+
[2] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers, 2020.
|
| 339 |
+
[3] Ming Chen, Yingming_Li, Zhongfei Zhang, and Siyu_Huang. Tvt: Two-view transformer network for video captioning. In Jun Zhu and Ichiro Takeuchi, editors, Proceedings of The l0th Asian Conference on Machine Learning, volume 95 of Proceedings of Machine Learning Research, pages 847-862. PMLR,14-16 Nov 2018.
|
| 340 |
+
[4] Jacek Czaja, Michal Galus, Tomasz Patejko,and Jian Tang. Softmax optimizations for intel xeon processor-based platforms. CoRR,abs/1904.12380,2019.
|
| 341 |
+
[5] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: pre-training of deep bidirectional transformers for language understanding. CoRR,abs/1810.04805, 2018.
|
| 342 |
+
[6] Alexey Dosovitskiy,Lucas Beyer,Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Mathias Minderer, Georg Heigold, Sylvain Gely, Jakob Uszkoreit,and Neil Houlsby.An image is worth 16x16 words: Transformers for image recognition at scale,2020.
|
| 343 |
+
[7] Sebastian Gehrmann, Yuntian Deng, and Alexander Rush. Botom-up abstractive summarization. In Proceedings of the2O18 Conference on Empirical Methods in Natural Language Processing, pages 4098-4109,2018.
|
| 344 |
+
[8] Xue Geng, Jie Lin, Bin Zhao, Anmin Kong, Mohamed M. Sabry Aly, and Vijay Chandrasekhar. Hardware-aware softmax approximation for deep neural networks. In C.V. Jawahar, Hongdong Li, Greg Mori,and Konrad Schindler, editors, Computer Vision- ACCV 2018, pages 107-12, Cham, 2019. Springer International Publishing.
|
| 345 |
+
[9] Yanzhang He, Tara N. Sainath, Rohit Prabhavalkar, Ian McGraw, Raziel Alvarez, Ding Zhao, David Rybach, Anjuli Kannan, Yonghui Wu, Ruoming Pang, Qiao Liang, Deepti Bhatia, Yuan Shangguan, Bo Li, Golan Pundak, Khe Chai Sim, Tom Bagby, Shuo yiin Chang, Kanishka Rao, and Alexander Gruenstein. Streaming end-to-end speech recognition for mobile devices,2018.
|
| 346 |
+
[10] R. Hu, B. Tian, S. Yin,and S. Wei. Efcient hardware architecture of softmax layer in deep neural network. In2018 IEEE23rd International Conference on Digital Signal Procesing (DSP), pages 1-5, Nov 2018.
|
| 347 |
+
[11] Andrey Ignatov, Radu Timofte, Wilim Chou, Ke Wang, Max Wu, Tim Hartley,and Luc Van Gool.AI benchmark: Running deep neural networks on android smartphones. CoRR, abs/1810.01109,2018.
|
| 348 |
+
[12] Guillume Klein, Yoon Kim, Yuntian Deng, Jean Senellart, and Alexander M. Rush. OpenNMT: Open-source toolkit for neural machine translation. In Proc. ACL, 2017.
|
| 349 |
+
[13] Ioannis Kouretas and Vassilis Paliouras. Hardware implementation of a softmax-like function for deep learning. Technologies, 8(3), 2020.
|
| 350 |
+
[14] Guillaume Lample and Frangois Charton. Deep learning for symbolic mathematics. CoRR, abs/1912.01412, 2019.
|
| 351 |
+
[15] Zhenzhong Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel, Piyush Sharma, and Radu Soricut. Albert: A lite bert for self-supervised learning of language representations, 2019.
|
| 352 |
+
[16] Bo Li, Shuo yiin Chang,Tara N. Sainath,Ruoming Pang, Yanzhang He, Trevor Strohman, and Yonghui Wu. Towards fast and accurate streaming end-to-end asr, 2020.
|
| 353 |
+
[17] Z. Li, H. Li, X. Jiang, B. Chen, Y. Zhang, and G. Du.Efficient fpga implementation of softmax function for dnn applications. In 2018 12th IEEE International Conference on Anticounterfeiting, Security, and Identification (ASID), pages 212-216, Nov 2018.
|
| 354 |
+
50[18] Yinhan Liu,Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettemoyer, and Veselin Stoyanov. Roberta: A robustly optimized BERT pretraining approach. CoRR, abs/1907.11692, 2019.
|
| 355 |
+
53[19] M. G. Sarwar Murshed, Christopher Murphy, Daqing Hou, Nazar Khan, Ganesh Ananthanarayanan, and Faraz Hussain. Machine learning at the network edge: A survey, 2019.
|
| 356 |
+
55[20] Gabriele Prato,Ella Charlaix,and Mehdi Rezagholizadeh.Fully quantized transformer for improved translation, 2019. [21] Tara N. Sainath, Yanzhang He, Bo Li, Arun Narayanan,Ruoming Pang, Antoine Bruguier, Shuo yiin Chang, Wei Li, Raziel Alvarez, Zhifeng Chen, Chung-Cheng Chiu, David Garcia, Alex Gruenstein, Ke Hu, Minho Jin, Anjuli Kannan, Qiao Liang, Ian McGraw, Cal Peyser, Rohit Prabhavalkar, Golan Pundak, David Rybach, Yuan Shangguan, Yash Sheth, Trevor Strohman, Mirko Visontai, Yonghui Wu, Yu Zhang,and Ding Zhao. A streaming on-device end-to-end model surpassing server-side conventional model quality and latency, 2020.
|
| 357 |
+
63[22] Sheng Shen, Zhen Dong, Jiayu Ye, Linjian Ma, Zhewei Yao,Amir Gholami, Michael W. Mahoney,and Kurt Keutzer. Q-bert: Hessian based ultra low precision quantization of bert, 2019. [23] Hyunsung Shin, Dongyoung Kim, Eunhyeok Park, Sungho Park, Yongsik Park, and Sungjoo Yoo. Mcdram: Low latency and energy-effcient matrix computations in dram. IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems, 37(11):2613-2622, 2018.
|
| 358 |
+
70[24] Jacob R. Stevens, Rangharajan Venkatesan, Steve Dai, Brucek Khailany,and Anand Raghunathan. Softermax: Hardware/software co-design of an eficient softmax for transformers. CoRR,abs/2103.09301,2021. [25] Q. Sun, Z. Di,Z. Lv, F. Song, Q. Xiang, Q. Feng, Y. Fan, X. Yu,and W. Wang. A high speed softmax vlsi architecture based on basic-split. In 2018 14th IEEE International Conference on Solid-State and Integrated Circuit Technology (ICSICT), pages 1-3, Oct 2018. [26] Hugo Touvron,Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Hervé Jégou. Training data-efficient image transformers distillation through attention, 2021.
|
| 359 |
+
78[27] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,Llion Jones,Aidan N. Gomez, Lukasz Kaiser, and Ilia Polosukhin. Attention is all you need. CoRR,abs/1706.03762, 2017. [28] Ihor Vasyltsov and Wooseok Chang. Lightweight Approximation of Softmax Layer for On-Device Inference. Springer International Publishing, 2021.
|
| 360 |
+
82[29] Alex Wang,Amanpreet Singh, Julian Michael,Felix Hil,Omer Levy,and Samuel R. Bowman. GLUE: A multi-task benchmark and analysis platform for natural language understanding. CoRR,abs/1804.07461,2018.
|
| 361 |
+
85[30] K. Wang, Y. Huang, Y. Ho,and W. Fang. A customized convolutional neural network design using improved softmax layer for real-time human emotion recognition. In 2019 IEEE International Conference on Artificial Intelligence Circuits and Systems (AICAS), pages 102-106, March 2019.
|
| 362 |
+
89[31] M. Wang,S.Lu,D. Zhu, J.Lin,and Z. Wang. A high-speed and low-complexity architecture for softmax function in deep learning. In 2O18 IEEE Asia Pacific Conference on Circuits and Systems (APCCAS), pages 223-226, Oct 2018.
|
| 363 |
+
92[32] Siqi Wang,Anuj Pathania,and Tulika Mitra. Neural network inference on mobile socs. IEEE Design Test, page 1-1,2020.
|
| 364 |
+
94[33] Zhilin_ Yang, Zihang Dai, Yiming Yang, Jaime G. Carbonell,Ruslan Salakhutdinov, and Quoc V. Le. Xlnet: Generalized autoregressive pretraining for language understanding. CoRR, abs/1906.08237,2019.
|
| 365 |
+
[34] B. Yuan. Efcient hardware architecture of softmax layer in deep neural network. In 2016 29th IEEE International System-on-Chip Conference (SOCC), pages 323-326, Sep.2016.
|
| 366 |
+
[35] Ofir Zafrir, Guy Boudoukh,Peter Izsak,and Moshe Wasserblat. Q8bert: Quantized 8bit bert, 2019.
|
| 367 |
+
[36] Xingzhou Zhang, Yifan Wang, Sidi Lu,Liangkai Liu, Lanyu Xu,and Weisong Shi. Openei: An open framework for edge intelligence. CoRR,abs/1906.01864,2019.
|
| 368 |
+
|
| 369 |
+
# Checklist
|
| 370 |
+
|
| 371 |
+
1. For all authors..
|
| 372 |
+
|
| 373 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope?[Yes] See also Section 3,where key contributions were listed.
|
| 374 |
+
(b) Did you describe the limitations of your work?[Yes] See Section 5.3.
|
| 375 |
+
(c) Did you discuss any potential negative societal impacts of your work? [N/A]
|
| 376 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] We read the ethics review guidelines and confirm that content of our paper is not related to any ethics issue, since it is focused on the optimization of computations.
|
| 377 |
+
|
| 378 |
+
2. If you are including theoretical results...
|
| 379 |
+
|
| 380 |
+
(a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A]
|
| 381 |
+
|
| 382 |
+
3. If you ran experiments...
|
| 383 |
+
|
| 384 |
+
(a) Did you include the code,data,and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] See supplemental materials.
|
| 385 |
+
(b) Did you specify all the training details (e.g., data splits,hyperparameters, how they were chosen)? [N/A] In our paper we do not consider any training, or fine-tuning. We focus on the inference only.
|
| 386 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [N/A] Since we did not do any training, we did not need to run experiment multiple times (inference output is deterministic).
|
| 387 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [N/A] Since we did not do any training, it is not related to our work.
|
| 388 |
+
|
| 389 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets..
|
| 390 |
+
|
| 391 |
+
(a) If your work uses existing assets, did you cite the creators?[Yes] Al used assets are cited either as a reference,or by direct URL link in the footnote,or in the body of the paper.
|
| 392 |
+
(b) Did you mention the license of the assets? [Yes] The license of the used assets are noticed either in the appropriate reference,or direct URL link of asset.
|
| 393 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [Yes] Some code and generated LUTs to reproduce our results are provided in supplemental materials.
|
| 394 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you're using/curating? [N/A]
|
| 395 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 396 |
+
|
| 397 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 398 |
+
|
| 399 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 400 |
+
(b) Did you describe any potential participant risks,with links to Institutional Review Board (IRB) approvals,if applicable? [N/A]
|
| 401 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
parse/train/TScOKQW67Mj/TScOKQW67Mj_content_list.json
ADDED
|
@@ -0,0 +1,1132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"type": "text",
|
| 4 |
+
"text": "Efficient Softmax Approximation for Deep Neural Networks with Attention Mechanism ",
|
| 5 |
+
"text_level": 1,
|
| 6 |
+
"bbox": [
|
| 7 |
+
196,
|
| 8 |
+
122,
|
| 9 |
+
805,
|
| 10 |
+
171
|
| 11 |
+
],
|
| 12 |
+
"page_idx": 0
|
| 13 |
+
},
|
| 14 |
+
{
|
| 15 |
+
"type": "text",
|
| 16 |
+
"text": "Anonymous Author(s) \nAffiliation \nAddress \nemail ",
|
| 17 |
+
"bbox": [
|
| 18 |
+
423,
|
| 19 |
+
222,
|
| 20 |
+
580,
|
| 21 |
+
276
|
| 22 |
+
],
|
| 23 |
+
"page_idx": 0
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
"type": "text",
|
| 27 |
+
"text": "Abstract ",
|
| 28 |
+
"text_level": 1,
|
| 29 |
+
"bbox": [
|
| 30 |
+
464,
|
| 31 |
+
314,
|
| 32 |
+
537,
|
| 33 |
+
330
|
| 34 |
+
],
|
| 35 |
+
"page_idx": 0
|
| 36 |
+
},
|
| 37 |
+
{
|
| 38 |
+
"type": "text",
|
| 39 |
+
"text": "1 There has been a rapid advance of custom hardware (HW) for accelerating the \n2 inference speed of deep neural networks (DNNs). Previously, the softmax layer \n3 was not a main concern of DNN accelerating HW, because its portion is relatively \n4 small in multi-layer perceptron or convolutional neural networks. However,as the \n5 attention mechanisms are widely used in various modern DNNs,a cost-efficient \n6 implementation of softmax layer is becoming very important. In this paper, we \n7 propose two methods to approximate softmax computation,which are based on \n8 the usage of LookUp Tables (LUTs). The required size of LUT is quite small \n9 (about 7Oo Bytes) because ranges of numerators and denominators of softmax are \n10 stable if normalization is applied to the input. We have validated the proposed \n11 technique over different AI tasks (object detection,machine translation, speech \n12 recognition, semantic equivalence) and DNN models (DETR,Transformer, BERT) \n13 by a variety of benchmarks (COCO17, WMT14, WMT17, GLUE). We showed \n14 that 8-bit approximation allows to obtain acceptable accuracy loss below $1 . 0 \\%$ ",
|
| 40 |
+
"bbox": [
|
| 41 |
+
148,
|
| 42 |
+
344,
|
| 43 |
+
767,
|
| 44 |
+
540
|
| 45 |
+
],
|
| 46 |
+
"page_idx": 0
|
| 47 |
+
},
|
| 48 |
+
{
|
| 49 |
+
"type": "text",
|
| 50 |
+
"text": "151Introduction ",
|
| 51 |
+
"text_level": 1,
|
| 52 |
+
"bbox": [
|
| 53 |
+
148,
|
| 54 |
+
565,
|
| 55 |
+
312,
|
| 56 |
+
582
|
| 57 |
+
],
|
| 58 |
+
"page_idx": 0
|
| 59 |
+
},
|
| 60 |
+
{
|
| 61 |
+
"type": "text",
|
| 62 |
+
"text": "16 After Vaswani et al. had introduced Transformer model in [27] for machine translation task, the \n17 attention based architecture became popular firstly in Natural Language Processng (NLP) appli \n18 cations, e.g.: speech recognition [16], [21], [9]; summarization [7]; language understanding [5], \n19 [33],[15],[18]; and video captioning [3]. Recently attention-based models are used in even wider \n20 practical areas including Computer Vision (CV) tasks for object detection [2]; image transformation \n21 [26]; image classification [6]; and even symbolic integration and solving diferential equations [14]. \n22 Despite the attractiveness of transformer-based models, its direct implementation into the platform \n23 with constrained computational power (e.g., mobile SoC,edge devices)1 is very challnging due to \n24 big memory footprint and latency. ",
|
| 63 |
+
"bbox": [
|
| 64 |
+
147,
|
| 65 |
+
597,
|
| 66 |
+
826,
|
| 67 |
+
722
|
| 68 |
+
],
|
| 69 |
+
"page_idx": 0
|
| 70 |
+
},
|
| 71 |
+
{
|
| 72 |
+
"type": "text",
|
| 73 |
+
"text": "Therefore, model compresson techniques such as quantization,and distillation are needed for those models. Many approaches have been introduced on quantizing matrix multiplication of transformer architecture.For example,in [22] it was used second order Hessian information, what allows to significantly compress the size of the model up to $1 3 \\times$ times,while maintaining at most $2 . 3 \\%$ of performance degradation (for the case of ultra-low precision 2-bits quantization). In [35] it was used a quantization-aware training during the fine-tuning phase of BERT, what allows to compress BERT model by $4 \\times$ (with 8-bit quantization) with minimal accuracy loss (less than $1 \\%$ ). In[1], a machine language translation model was quantized by 8-bit, while maintaining less than $0 . 5 \\%$ drop ",
|
| 74 |
+
"bbox": [
|
| 75 |
+
171,
|
| 76 |
+
728,
|
| 77 |
+
826,
|
| 78 |
+
839
|
| 79 |
+
],
|
| 80 |
+
"page_idx": 0
|
| 81 |
+
},
|
| 82 |
+
{
|
| 83 |
+
"type": "text",
|
| 84 |
+
"text": "33 in accuracy. Moreover, in [2O] it was shown that 8-bit quantized models provide the same or even \n34 higher accuracy as the full-precision models. Most of the above methods consider the quantization of \n35 matrix multiplications operations only. However,as it is shown in [4],[24] in modern DNNs with \n36 attention mechanism (e.g., Transformer, BERT, GPT-x) the softmax function is also used intensively, \n37 especially at the longer sequence lengths,so it is necessary to optimize its for performance. \n38 In this paper we propose methods for efficient computation of the softmax layer at the HW accelerator. \n39 The method is based on piece-wise-constant approximation and usage of LUTs. To the best of our \n40 knowledge,it is the first paper where softmax quantization of the models with attention mechanism is \n41 tested and verified on a variety of AI tasks.In Section 2 we show why our research is important and \n42 valuable.In Section 3 we consider the drawbacks of existed softmax approximation methods in the \n43 perspective of HW accelerator, and summarize the differentiation of our methods from the previous \n44 arts.In Section 4 we describe the details of the proposed methods. Section 5 shows the experimental \n45 validation over different models and datasets, and Section 6 concludes the paper. ",
|
| 85 |
+
"bbox": [
|
| 86 |
+
147,
|
| 87 |
+
90,
|
| 88 |
+
826,
|
| 89 |
+
161
|
| 90 |
+
],
|
| 91 |
+
"page_idx": 1
|
| 92 |
+
},
|
| 93 |
+
{
|
| 94 |
+
"type": "text",
|
| 95 |
+
"text": "",
|
| 96 |
+
"bbox": [
|
| 97 |
+
147,
|
| 98 |
+
167,
|
| 99 |
+
826,
|
| 100 |
+
279
|
| 101 |
+
],
|
| 102 |
+
"page_idx": 1
|
| 103 |
+
},
|
| 104 |
+
{
|
| 105 |
+
"type": "text",
|
| 106 |
+
"text": "162 Background and motivation ",
|
| 107 |
+
"text_level": 1,
|
| 108 |
+
"bbox": [
|
| 109 |
+
151,
|
| 110 |
+
296,
|
| 111 |
+
441,
|
| 112 |
+
314
|
| 113 |
+
],
|
| 114 |
+
"page_idx": 1
|
| 115 |
+
},
|
| 116 |
+
{
|
| 117 |
+
"type": "text",
|
| 118 |
+
"text": "47 Modern GPUs are powerful, but big, expensive, and power-hungry. Therefore, alternative HW \n48 accelerators (e.g., NPU) for on-device inference are under active development by diferent vendors, \n49 especially for Federated Learning and Edge computing. However, such devices mostly are focused on \n50 the acceleration of matrix multiplication operations,and do not include means to compute complex \n51 activation functions. Typically,in such devices the data is sent outside of the accelerator to compute \n52 activations on host CPU.For example,according to the guidelines of Coral (TM),a softmax layer of \n53 DNN model in Edge TPU have to be run on host CPU ², what is acceptable for traditional CV tasks \n54 (which are typically uni-directional, have minimum dependencies, and softmax layer is located at the \n55 end of the computational graph of DNN model), however is very inefficient for NLP tasks (which are \n56 typically more complicated with a lot of dependencies and active employment of softmax layer in the \n57 middle of DNN model). In opposite to traditional logic-centric approach, some researches are trying \n58 to perform computation closer to the memory (so called memory-centric approach). For example \n59 in [23], there is shown a DRAM-based AI accelerator. This approach allows significantly speed-up \n60 the overall computation process, but for the computation of the activations the data should also be \n61 moved to host processor, what is an even bigger issue in the DRAM environment. \n62 The Eq.(1) from [27] describes how attention is computed in the model. This particular form, \n63 named \"scaled dot-product attention\" takes the matrix multiplication product of queries and keys \n64 of $\\mathbf { R } ^ { N \\times L \\times H }$ as input forthesoftmaxlayer where $N$ means number of heads, $L$ means sequence \n65 length and $H$ means hidden size for the case where batch size equals to 1. In other words, performing \n66 $( N ^ { \\mathbf { \\bar { \\nu } } } \\times L \\times L )$ softmax operations is required per one attention. Furthermore,encoder in typical \n67 transformer consists of six multi-head attentions which means $6 \\times ( N \\times L \\times L )$ operation is required \n68 for encoder solely. Assuming the number of heads is 8 and sequence length is 128, it already takes \n69 786,432 operations for softmax of the transformer encoder. This overhead increases as number of \n70 heads and sequence length increases which is typical case for high-performing models. ",
|
| 119 |
+
"bbox": [
|
| 120 |
+
145,
|
| 121 |
+
328,
|
| 122 |
+
826,
|
| 123 |
+
535
|
| 124 |
+
],
|
| 125 |
+
"page_idx": 1
|
| 126 |
+
},
|
| 127 |
+
{
|
| 128 |
+
"type": "text",
|
| 129 |
+
"text": "",
|
| 130 |
+
"bbox": [
|
| 131 |
+
145,
|
| 132 |
+
541,
|
| 133 |
+
826,
|
| 134 |
+
669
|
| 135 |
+
],
|
| 136 |
+
"page_idx": 1
|
| 137 |
+
},
|
| 138 |
+
{
|
| 139 |
+
"type": "equation",
|
| 140 |
+
"img_path": "images/2181d68a11352a1504787146df9a48b0cf9ff24ed9fa565eb281c5e574c5f139.jpg",
|
| 141 |
+
"text": "$$\nA t t e n t i o n ( Q , K , V ) = S o f t m a x \\left( \\frac { Q K ^ { T } } { \\sqrt { d _ { K } } } \\right) V\n$$",
|
| 142 |
+
"text_format": "latex",
|
| 143 |
+
"bbox": [
|
| 144 |
+
343,
|
| 145 |
+
684,
|
| 146 |
+
658,
|
| 147 |
+
719
|
| 148 |
+
],
|
| 149 |
+
"page_idx": 1
|
| 150 |
+
},
|
| 151 |
+
{
|
| 152 |
+
"type": "text",
|
| 153 |
+
"text": "71 For example, it requires performing $1 2 \\times ( 1 2 \\times 1 2 8 \\times 1 2 8 ) = 2 , 3 5 9 , 2 9 6$ softmax operations for \n72 one sample inference for typical BERT configuration [5] over sequence of length 128. In the case \n73 when HW accelerator is used for matrix multiplication only, and activation to be computed at the \n74 CPU (what is common case for HW accelerators, optimized for CNN-models), the huge amount of \n75 data must be moved between CPU and the accelerator. Such data movement negatively impacts on \n76 the overallcomputation time and power consumption, which can be critical for on-device inference. \n77 Therefore, HW accelerator must be able to compute softmax layer without CPU involvement. ",
|
| 154 |
+
"bbox": [
|
| 155 |
+
147,
|
| 156 |
+
727,
|
| 157 |
+
826,
|
| 158 |
+
825
|
| 159 |
+
],
|
| 160 |
+
"page_idx": 1
|
| 161 |
+
},
|
| 162 |
+
{
|
| 163 |
+
"type": "text",
|
| 164 |
+
"text": "78 3Related work and key contributions ",
|
| 165 |
+
"text_level": 1,
|
| 166 |
+
"bbox": [
|
| 167 |
+
147,
|
| 168 |
+
844,
|
| 169 |
+
506,
|
| 170 |
+
861
|
| 171 |
+
],
|
| 172 |
+
"page_idx": 1
|
| 173 |
+
},
|
| 174 |
+
{
|
| 175 |
+
"type": "text",
|
| 176 |
+
"text": "'9The common equation to compute softmax function over the input $x$ is a fraction as shown below: ",
|
| 177 |
+
"bbox": [
|
| 178 |
+
151,
|
| 179 |
+
875,
|
| 180 |
+
815,
|
| 181 |
+
890
|
| 182 |
+
],
|
| 183 |
+
"page_idx": 1
|
| 184 |
+
},
|
| 185 |
+
{
|
| 186 |
+
"type": "equation",
|
| 187 |
+
"img_path": "images/3ef719ad199ed10bb386f869d510c72f28f844604126e4dc885e5655f56702ff.jpg",
|
| 188 |
+
"text": "$$\n\\sigma ( x _ { i } ) = \\frac { e ^ { x _ { i } } } { \\Sigma e ^ { x _ { i } } } = \\frac { e ^ { x _ { i } - m a x ( x ) } } { \\Sigma e ^ { x _ { i } - m a x ( x ) } }\n$$",
|
| 189 |
+
"text_format": "latex",
|
| 190 |
+
"bbox": [
|
| 191 |
+
393,
|
| 192 |
+
103,
|
| 193 |
+
604,
|
| 194 |
+
136
|
| 195 |
+
],
|
| 196 |
+
"page_idx": 2
|
| 197 |
+
},
|
| 198 |
+
{
|
| 199 |
+
"type": "text",
|
| 200 |
+
"text": "80 There are different ways to implement it. For example, some approaches straightforwardly compute \n81 the numerator and denominator firstly,and then a division operation is performed. In such case the \n82 HW accelerator should contain a divider, what requires additional HW costs and can also cause \n83 performance degradation, if divider is not fully pipe-lined. \n84 In [25] it is proposed to use basic-split calculation method, which allows to split the exponentiation \n85 calculation of the softmax into several specific basics which are implemented by LUT (ROM). It \n86 allows to simplify the complexity of hardware and signal propagation delay. However, to recover \n87 the whole computed value of exponent some additional multiplications are needed. Moreover, to \n88 obtain the final value of softmax the division is stillused. In [30] it is proposed to add threshold \n89 layers to accelerate the training speed and replace the Euler's base value with a dynamic base value \n90 to improve the network accuracy. Such approach allowed to save up to $15 \\%$ of training model \n91 convergence time and also increase by 3 to $5 \\%$ the average accuracy. But during the computation \n92 of softmax the divider is still used. In [17] the combination of LUT and multi-segment polynomial \n93 fiting have been used to compute exponential operations of integer and fractional parts in separate. \n94 In addition, they adopt radix-4 Booth-Wallce based multiplier for computing the whole value \n95 of exponent,and modified shift-compare divider for computation of the final value of softmax. \n96 To avoid big area costs for traditional divider, the authors in [8] propose to reduce the operand \n97 bit-width,and approximate exponential and division operations with cost-effective addition and \n98 bit shifts operations. In their design they have approximated the division operation in Eq. (2) by \n99 replacing the denominator with closest $\\dot { 2 } ^ { b }$ value, where $b$ is some integer constant. Then division \n100 is implemented just as simple bit shifts operation. In [24] it is proposed to replace the base as \n101 $e ^ { x } \\to 2 ^ { x }$ , then all computations are more hardware-friendly, however the division operation is still \n102 required. Also, to restore accuracy a fine-tuning of the model is needed, what is not applicable \n103 for post-training quantization paradigm. Although the methods described above are decreasing the \n104 hardware complexity of softmax computation they all still rely on the division operation. \n105 To avoid division operation at all, some other solutions apply the logarithmic transformation to \n106 the original softmax function,and thus substitute costly division operation by subtraction of the \n107 logarithm. In [34], for example, it is proposed to use a logarithmic operation implemented as a LUT \n108 and a subtractor to replace the division operation, what allows to further decrease the complexity of \n109 hardware,as well critical path of the whole design. In [10] simplified version of Integral Stochastic \n110 Computation is used in order to build FSM-based exponentiation. Division operation is substituted \n111 by LUT-based logarithmic operation and subtraction, similarly to [34]. In [31] the authors are further \n112 developing the method proposed in [34], by applying mathematical transformations and linear fitting. \n113 After optimization,their final design includes only shift operations,leading one detector, and adders. \n114 Finally, there are some extreme approximation cases represented in [13] and [28], where logarithmic \n115 computation and subtraction are skipped at all. \n116 Despite its atractiveness,logarithmic transformation approach can be used only in the cases when \n117 softmax layer is the last layer in DNN and its functionality is simply“scoring”among the candidates \n118 for classification tasks. However,if softmax layer is used inside of computational graph of DNN (e.g., \n119 DNNs with attention-mechanism) then error caused by quantizations will be accumulated drastically, \n120 directly impacting on the final accuracy.For example,in Table 1 there is shown the averaged accuracy \n121 drop for DETR models caused by a softmax approximation in uint8 precision by some prior arts. \n122 As it can be seen from the Table 1,a straightforward usage of Eq.(2) from [31] causes big accuracy \n123 drop,and even after applying some improvements to the original method (shown as case Eq. $( 2 ) +$ ), \n124 the accuracy drop is still high ( $2 \\%$ to $19 \\%$ ).For more details of the prior arts experiments please refer \n125 to Appendix A.1. However, if for the same conditions we use the method proposed in Section 4.1, we \n126 can see that accuracy drop reduced by $\\times 4$ to $\\times 2 0$ times,and it is below $0 . 5 \\%$ for plain DETR models \n127 (no DC5 dilation at the last stage). \n128 The work presented in this paper has focused on the development of methods for efficient computation \n129 of softmax layer during the inference at the edge devices, what usually have limited computational \n130 power and suffer from constraints of the bandwidth. \n131 Previous works for HW accelerator of softmax layer are focused on the logic-centric approach and \n132used dedicated hardware for its implementation. In such case the utilization of hardware is low, \n133 performance can be slower, and no reconfigurability is provided. In our paper we have used an \n134 alternative memory-centric approximate computing approach. It keeps accuracy loss small, while \n135 allws computing softmax operation with no divider. The size of the required memory (i.e., LUT) is \n136 reasonably small and can be reconfigured on demand. \n137 The methods proposed in the paper contribute to building the alternative concept of hardware \n138 architecture to accelerate essential operations for AI applications, especially for on-device inference. \n139 To summarize,we have three-fold difference from the previous works: ",
|
| 201 |
+
"bbox": [
|
| 202 |
+
147,
|
| 203 |
+
146,
|
| 204 |
+
825,
|
| 205 |
+
202
|
| 206 |
+
],
|
| 207 |
+
"page_idx": 2
|
| 208 |
+
},
|
| 209 |
+
{
|
| 210 |
+
"type": "text",
|
| 211 |
+
"text": "",
|
| 212 |
+
"bbox": [
|
| 213 |
+
143,
|
| 214 |
+
207,
|
| 215 |
+
826,
|
| 216 |
+
500
|
| 217 |
+
],
|
| 218 |
+
"page_idx": 2
|
| 219 |
+
},
|
| 220 |
+
{
|
| 221 |
+
"type": "text",
|
| 222 |
+
"text": "",
|
| 223 |
+
"bbox": [
|
| 224 |
+
140,
|
| 225 |
+
505,
|
| 226 |
+
826,
|
| 227 |
+
657
|
| 228 |
+
],
|
| 229 |
+
"page_idx": 2
|
| 230 |
+
},
|
| 231 |
+
{
|
| 232 |
+
"type": "text",
|
| 233 |
+
"text": "",
|
| 234 |
+
"bbox": [
|
| 235 |
+
142,
|
| 236 |
+
662,
|
| 237 |
+
828,
|
| 238 |
+
830
|
| 239 |
+
],
|
| 240 |
+
"page_idx": 2
|
| 241 |
+
},
|
| 242 |
+
{
|
| 243 |
+
"type": "text",
|
| 244 |
+
"text": "",
|
| 245 |
+
"bbox": [
|
| 246 |
+
142,
|
| 247 |
+
835,
|
| 248 |
+
828,
|
| 249 |
+
877
|
| 250 |
+
],
|
| 251 |
+
"page_idx": 2
|
| 252 |
+
},
|
| 253 |
+
{
|
| 254 |
+
"type": "text",
|
| 255 |
+
"text": "",
|
| 256 |
+
"bbox": [
|
| 257 |
+
143,
|
| 258 |
+
883,
|
| 259 |
+
826,
|
| 260 |
+
912
|
| 261 |
+
],
|
| 262 |
+
"page_idx": 2
|
| 263 |
+
},
|
| 264 |
+
{
|
| 265 |
+
"type": "table",
|
| 266 |
+
"img_path": "images/4cfd48b9db0746072b72af0de68b39ab4016c8d335b1958b155742ab3f026d99.jpg",
|
| 267 |
+
"table_caption": [
|
| 268 |
+
"Table 1: Averaged accuracy drop by different methods over DETR models (Average Precision), $\\%$ "
|
| 269 |
+
],
|
| 270 |
+
"table_footnote": [],
|
| 271 |
+
"table_body": "<table><tr><td>METHOD</td><td>DETR (R50)</td><td>DETR+DC5(R50)</td><td>DETR (R101)</td><td>DETR+DC5(R101)</td></tr><tr><td>EQ.(2) IN [31]</td><td>7.20</td><td>19.30</td><td>10.25</td><td>25.37</td></tr><tr><td>EQ.(2)+ IN [31]</td><td>2.50</td><td>12.93</td><td>5.38</td><td>18.85</td></tr><tr><td>SECTION 4.1</td><td>0.33</td><td>2.92</td><td>0.22</td><td>2.73</td></tr></table>",
|
| 272 |
+
"bbox": [
|
| 273 |
+
186,
|
| 274 |
+
116,
|
| 275 |
+
810,
|
| 276 |
+
189
|
| 277 |
+
],
|
| 278 |
+
"page_idx": 3
|
| 279 |
+
},
|
| 280 |
+
{
|
| 281 |
+
"type": "text",
|
| 282 |
+
"text": "",
|
| 283 |
+
"bbox": [
|
| 284 |
+
142,
|
| 285 |
+
222,
|
| 286 |
+
826,
|
| 287 |
+
279
|
| 288 |
+
],
|
| 289 |
+
"page_idx": 3
|
| 290 |
+
},
|
| 291 |
+
{
|
| 292 |
+
"type": "text",
|
| 293 |
+
"text": "",
|
| 294 |
+
"bbox": [
|
| 295 |
+
143,
|
| 296 |
+
284,
|
| 297 |
+
826,
|
| 298 |
+
327
|
| 299 |
+
],
|
| 300 |
+
"page_idx": 3
|
| 301 |
+
},
|
| 302 |
+
{
|
| 303 |
+
"type": "text",
|
| 304 |
+
"text": "· Applicability of our methods to DNN with attention mechanism is experimentally proven over variety of the models for different AI applications.All previous methods were used only for the cases when softmax is the last layer in DNN,and is used for“scoring\". \nNo divider is needed to fully implement the method. Moreover, for 2D LUT method even multiplier is not needed.Thus, hardware overhead is minimal,and is almost free if used in the DRAM-based AI accelerator. Our solutions utilize integer precision, what makes it compatible with traditional HW accelerators used for matrix multiplication,and simplify the integration of methods into full system (all prior methods are based on a fixed point precision). ",
|
| 305 |
+
"bbox": [
|
| 306 |
+
215,
|
| 307 |
+
337,
|
| 308 |
+
826,
|
| 309 |
+
476
|
| 310 |
+
],
|
| 311 |
+
"page_idx": 3
|
| 312 |
+
},
|
| 313 |
+
{
|
| 314 |
+
"type": "text",
|
| 315 |
+
"text": "1494 Proposed methods ",
|
| 316 |
+
"text_level": 1,
|
| 317 |
+
"bbox": [
|
| 318 |
+
143,
|
| 319 |
+
494,
|
| 320 |
+
361,
|
| 321 |
+
512
|
| 322 |
+
],
|
| 323 |
+
"page_idx": 3
|
| 324 |
+
},
|
| 325 |
+
{
|
| 326 |
+
"type": "text",
|
| 327 |
+
"text": "150 In this paper we use memory-centric approach to build the accelerator for softmax computation \n151 in hardware platform with limited resources. We propose two LUT-based methods for efficient \n152 computation,which provide high performance and do not require a divider. The details of the \n153 methods are described below and appropriate software models are shown in Appendix A.2. ",
|
| 328 |
+
"bbox": [
|
| 329 |
+
142,
|
| 330 |
+
526,
|
| 331 |
+
826,
|
| 332 |
+
583
|
| 333 |
+
],
|
| 334 |
+
"page_idx": 3
|
| 335 |
+
},
|
| 336 |
+
{
|
| 337 |
+
"type": "text",
|
| 338 |
+
"text": "4.1Normalization of reciprocal exponentiation ",
|
| 339 |
+
"text_level": 1,
|
| 340 |
+
"bbox": [
|
| 341 |
+
168,
|
| 342 |
+
599,
|
| 343 |
+
513,
|
| 344 |
+
614
|
| 345 |
+
],
|
| 346 |
+
"page_idx": 3
|
| 347 |
+
},
|
| 348 |
+
{
|
| 349 |
+
"type": "text",
|
| 350 |
+
"text": "In this subsection we consider the method,which is based on the normalization of reciprocal exponentiation, and hereafter we call it REXP for short. ",
|
| 351 |
+
"bbox": [
|
| 352 |
+
169,
|
| 353 |
+
626,
|
| 354 |
+
825,
|
| 355 |
+
654
|
| 356 |
+
],
|
| 357 |
+
"page_idx": 3
|
| 358 |
+
},
|
| 359 |
+
{
|
| 360 |
+
"type": "text",
|
| 361 |
+
"text": "157The original reciprocal exponentiation method was proposed in [28], where they used the inverse I58way of max-normalization and the reciprocal of exponential function as below: ",
|
| 362 |
+
"bbox": [
|
| 363 |
+
145,
|
| 364 |
+
660,
|
| 365 |
+
828,
|
| 366 |
+
689
|
| 367 |
+
],
|
| 368 |
+
"page_idx": 3
|
| 369 |
+
},
|
| 370 |
+
{
|
| 371 |
+
"type": "equation",
|
| 372 |
+
"img_path": "images/07a3724823bcd540052ed15c8c366ca29e6a1843d56d7cce4940e24c70fd634b.jpg",
|
| 373 |
+
"text": "$$\n\\sigma ^ { * } ( x _ { i } ) = \\frac { 1 } { e ^ { m a x ( x ) - x _ { i } } }\n$$",
|
| 374 |
+
"text_format": "latex",
|
| 375 |
+
"bbox": [
|
| 376 |
+
424,
|
| 377 |
+
705,
|
| 378 |
+
575,
|
| 379 |
+
736
|
| 380 |
+
],
|
| 381 |
+
"page_idx": 3
|
| 382 |
+
},
|
| 383 |
+
{
|
| 384 |
+
"type": "text",
|
| 385 |
+
"text": "159And thus,the final value of softmax can be obtained by reading from a simple LUT-table. Content of \n160LUT is computed as shown below: ",
|
| 386 |
+
"bbox": [
|
| 387 |
+
137,
|
| 388 |
+
746,
|
| 389 |
+
830,
|
| 390 |
+
775
|
| 391 |
+
],
|
| 392 |
+
"page_idx": 3
|
| 393 |
+
},
|
| 394 |
+
{
|
| 395 |
+
"type": "equation",
|
| 396 |
+
"img_path": "images/67339367399355818951e439e4b03006b2efddb824fe5ef4573766f2b7054a4c.jpg",
|
| 397 |
+
"text": "$$\nL U T _ { 1 / e } [ i ] = \\left\\lfloor \\frac { 1 } { e ^ { i } } \\cdot ( 2 ^ { w } - 1 ) \\right\\rceil , \\forall i = 0 , 1 , . . . , x _ { q } + 1\n$$",
|
| 398 |
+
"text_format": "latex",
|
| 399 |
+
"bbox": [
|
| 400 |
+
328,
|
| 401 |
+
791,
|
| 402 |
+
671,
|
| 403 |
+
827
|
| 404 |
+
],
|
| 405 |
+
"page_idx": 3
|
| 406 |
+
},
|
| 407 |
+
{
|
| 408 |
+
"type": "text",
|
| 409 |
+
"text": "161where $w$ is a number of bits for quantization, and $x _ { q } = \\lceil l n ( 2 ^ { w } - 1 ) \\rceil$ is an efficient quantization \n162boundary. ",
|
| 410 |
+
"bbox": [
|
| 411 |
+
145,
|
| 412 |
+
837,
|
| 413 |
+
830,
|
| 414 |
+
866
|
| 415 |
+
],
|
| 416 |
+
"page_idx": 3
|
| 417 |
+
},
|
| 418 |
+
{
|
| 419 |
+
"type": "text",
|
| 420 |
+
"text": "63In addition to very low computational complexity, this method has other desired properties [28]: ",
|
| 421 |
+
"bbox": [
|
| 422 |
+
147,
|
| 423 |
+
871,
|
| 424 |
+
803,
|
| 425 |
+
887
|
| 426 |
+
],
|
| 427 |
+
"page_idx": 3
|
| 428 |
+
},
|
| 429 |
+
{
|
| 430 |
+
"type": "text",
|
| 431 |
+
"text": "· bounded and stable ( $\\frac { 1 } { e ^ { m a x ( x ) - x _ { i } } } \\in ( 0 , 1 ] )$ · and nonlinear $\\begin{array} { r } { ( \\frac { 1 } { e ^ { \\alpha x } } \\ne \\alpha \\frac { 1 } { e ^ { x } } ) } \\end{array}$ ) ",
|
| 432 |
+
"bbox": [
|
| 433 |
+
215,
|
| 434 |
+
89,
|
| 435 |
+
504,
|
| 436 |
+
130
|
| 437 |
+
],
|
| 438 |
+
"page_idx": 4
|
| 439 |
+
},
|
| 440 |
+
{
|
| 441 |
+
"type": "text",
|
| 442 |
+
"text": "167 But due to its aggressive approximation nature, it can be applied only to simple CV tasks, and if \n168 used for attention-based DNN models causes the explosion of accuracy drop (see Appendix A.1 for \n169 details). Thus,in this paper we further develop that method to be applicable for wider class of DNN \n170 models. \n171 During our initial investigations,we have noticed that method described in Eq.( 3) is just scaled \n172 version of real softmax. So, we proposed to normalize it with some probability density function \n173 (PDF) scale,such that $\\textstyle { \\int } P D F = { \\mathrm { \\hat { 1 } } }$ . However, if used straight-forwardly, it would need to involve a \n174 division operation, what is strongly un-desirable for devices with constrained computational power. \n175 Therefore, instead of dividing, we propose to substitute division by multiplication with some PDF \n176 normalizing constant as below: ",
|
| 443 |
+
"bbox": [
|
| 444 |
+
142,
|
| 445 |
+
138,
|
| 446 |
+
828,
|
| 447 |
+
194
|
| 448 |
+
],
|
| 449 |
+
"page_idx": 4
|
| 450 |
+
},
|
| 451 |
+
{
|
| 452 |
+
"type": "text",
|
| 453 |
+
"text": "",
|
| 454 |
+
"bbox": [
|
| 455 |
+
142,
|
| 456 |
+
200,
|
| 457 |
+
826,
|
| 458 |
+
285
|
| 459 |
+
],
|
| 460 |
+
"page_idx": 4
|
| 461 |
+
},
|
| 462 |
+
{
|
| 463 |
+
"type": "equation",
|
| 464 |
+
"img_path": "images/63b875463223072a756a88240fbb3c990bbfc1acb164be1af730b837f1c16e7d.jpg",
|
| 465 |
+
"text": "$$\n\\sigma ( x _ { i } ) = \\frac { \\sigma ^ { * } ( x _ { i } ) } { P D F n o r m } \\sigma ^ { * } ( x _ { i } ) \\cdot \\alpha\n$$",
|
| 466 |
+
"text_format": "latex",
|
| 467 |
+
"bbox": [
|
| 468 |
+
380,
|
| 469 |
+
299,
|
| 470 |
+
619,
|
| 471 |
+
332
|
| 472 |
+
],
|
| 473 |
+
"page_idx": 4
|
| 474 |
+
},
|
| 475 |
+
{
|
| 476 |
+
"type": "text",
|
| 477 |
+
"text": "177where $\\alpha = e ^ { - l n \\left( \\Sigma \\sigma ^ { \\ast } \\left( x _ { i } \\right) \\right) }$ is PDF normalizing constant. ",
|
| 478 |
+
"bbox": [
|
| 479 |
+
142,
|
| 480 |
+
339,
|
| 481 |
+
534,
|
| 482 |
+
356
|
| 483 |
+
],
|
| 484 |
+
"page_idx": 4
|
| 485 |
+
},
|
| 486 |
+
{
|
| 487 |
+
"type": "text",
|
| 488 |
+
"text": "178Then final equation to compute softmax approximation by proposed REXP method is shown below: ",
|
| 489 |
+
"bbox": [
|
| 490 |
+
142,
|
| 491 |
+
362,
|
| 492 |
+
828,
|
| 493 |
+
378
|
| 494 |
+
],
|
| 495 |
+
"page_idx": 4
|
| 496 |
+
},
|
| 497 |
+
{
|
| 498 |
+
"type": "equation",
|
| 499 |
+
"img_path": "images/d68cc2e28b1b9e274d28ca88c036e9bccaecefb85e19b46d45c093abfa0373c1.jpg",
|
| 500 |
+
"text": "$$\n\\sigma ( x _ { i } ) = \\frac { e ^ { - l n \\left( \\Sigma \\sigma ^ { * } \\left( x _ { i } \\right) \\right) } } { e ^ { m a x \\left( x \\right) - x _ { i } } } = \\frac { 1 } { e ^ { m a x \\left( x \\right) - x _ { i } } } \\cdot e ^ { - l n \\left( \\Sigma \\sigma ^ { * } \\left( x _ { i } \\right) \\right) }\n$$",
|
| 501 |
+
"text_format": "latex",
|
| 502 |
+
"bbox": [
|
| 503 |
+
321,
|
| 504 |
+
392,
|
| 505 |
+
676,
|
| 506 |
+
426
|
| 507 |
+
],
|
| 508 |
+
"page_idx": 4
|
| 509 |
+
},
|
| 510 |
+
{
|
| 511 |
+
"type": "text",
|
| 512 |
+
"text": "179 Thus, to compute the softmax value it requires just two LUTs of considerably small size, where \n180 content of the first LUT is computed accordingly to Eq.(4), and the second LUT values can be \n181computed as below: ",
|
| 513 |
+
"bbox": [
|
| 514 |
+
142,
|
| 515 |
+
434,
|
| 516 |
+
826,
|
| 517 |
+
477
|
| 518 |
+
],
|
| 519 |
+
"page_idx": 4
|
| 520 |
+
},
|
| 521 |
+
{
|
| 522 |
+
"type": "equation",
|
| 523 |
+
"img_path": "images/3e7f965619c868b1860965c878110bc5f1bab3dc23c1ef22b1ae8806227859a2.jpg",
|
| 524 |
+
"text": "$$\nL U T _ { \\alpha } [ j ] = \\left\\lfloor \\frac { 1 } { j } \\cdot ( 2 ^ { w } - 1 ) \\right\\rceil , \\forall j = 0 , 1 , . . . , x _ { s } - 1\n$$",
|
| 525 |
+
"text_format": "latex",
|
| 526 |
+
"bbox": [
|
| 527 |
+
334,
|
| 528 |
+
491,
|
| 529 |
+
665,
|
| 530 |
+
527
|
| 531 |
+
],
|
| 532 |
+
"page_idx": 4
|
| 533 |
+
},
|
| 534 |
+
{
|
| 535 |
+
"type": "text",
|
| 536 |
+
"text": "182where $j = \\Sigma \\sigma ^ { * } ( x _ { i } )$ $x _ { s }$ is selected quantization boundary, and $L U T _ { \\alpha } [ x _ { s } ] = 0$ ",
|
| 537 |
+
"bbox": [
|
| 538 |
+
145,
|
| 539 |
+
535,
|
| 540 |
+
689,
|
| 541 |
+
551
|
| 542 |
+
],
|
| 543 |
+
"page_idx": 4
|
| 544 |
+
},
|
| 545 |
+
{
|
| 546 |
+
"type": "text",
|
| 547 |
+
"text": ";4.22-Dimensional LUT ",
|
| 548 |
+
"text_level": 1,
|
| 549 |
+
"bbox": [
|
| 550 |
+
156,
|
| 551 |
+
565,
|
| 552 |
+
351,
|
| 553 |
+
582
|
| 554 |
+
],
|
| 555 |
+
"page_idx": 4
|
| 556 |
+
},
|
| 557 |
+
{
|
| 558 |
+
"type": "text",
|
| 559 |
+
"text": "184 In this subsection we propose another method which is based on the substitution of a division \n185 operation in Eq.(2) by 2-Dimensional (2D) LUT to speed-up and simplify the computation, while \n186 maintaining accuracy even for attention-based DNN models. Hereafter we willrefer to this method \n187 as 2D LUT. \n188 For this purpose,we have started with the estimation of distributions of $e ^ { x }$ and $\\Sigma e ^ { x }$ terms for typical \n189 inference runs. Our investigation showed that if max-based normalization is applied to the input \n190 values (i.e., $x ( x - \\operatorname* { m a x } ( { \\bar { x } } ) ) )$ , the distribution of $e ^ { x }$ is stable within range $e ^ { x } \\in ( 0 , 1 ]$ regardless of \n191 the input values, and range of $\\Sigma e ^ { x }$ term depends on the length of the input $x$ . Thus, it allows us to \n192 have stable computation even within small size of LUT. ",
|
| 560 |
+
"bbox": [
|
| 561 |
+
142,
|
| 562 |
+
590,
|
| 563 |
+
826,
|
| 564 |
+
647
|
| 565 |
+
],
|
| 566 |
+
"page_idx": 4
|
| 567 |
+
},
|
| 568 |
+
{
|
| 569 |
+
"type": "text",
|
| 570 |
+
"text": "",
|
| 571 |
+
"bbox": [
|
| 572 |
+
142,
|
| 573 |
+
654,
|
| 574 |
+
826,
|
| 575 |
+
723
|
| 576 |
+
],
|
| 577 |
+
"page_idx": 4
|
| 578 |
+
},
|
| 579 |
+
{
|
| 580 |
+
"type": "text",
|
| 581 |
+
"text": "Generic architecture and concept of the proposed method for efcient softmax implementation as 2D LUT is shown in Figure 1. There are two LUTs used: 1D LUT for approximation of $e ^ { x }$ values, and 2D LUT for storing softmax output values dependent on the values of numerator $e ^ { x }$ (used as the 1-st index in the table),and denominator $\\Sigma e ^ { x }$ (used as the 2-nd index) of Eq.(2). As it can be seen from Figure 1(right),to calculate the indexes for corresponded value in 2D LUT table, only most-significant bits (MSB)are needed. Thus,the simplest hardware realization can be done within wiring only (when MSB bits are directly connected to the appropriate address selectors)3. Also, the proposed method can be easily modified to the case where,1-st index of 2D LUT table is calculated not from $e ^ { x }$ but directly from input $x$ . In such case there is no need to store intermediate values of $e ^ { x }$ ",
|
| 582 |
+
"bbox": [
|
| 583 |
+
161,
|
| 584 |
+
729,
|
| 585 |
+
826,
|
| 586 |
+
854
|
| 587 |
+
],
|
| 588 |
+
"page_idx": 4
|
| 589 |
+
},
|
| 590 |
+
{
|
| 591 |
+
"type": "text",
|
| 592 |
+
"text": "While the content of 1D LUT for approximation of $e ^ { x }$ values is straightforward, 2D LUT contains the family of linear approximations where each row contains the softmax output scaled according tc ",
|
| 593 |
+
"bbox": [
|
| 594 |
+
158,
|
| 595 |
+
861,
|
| 596 |
+
821,
|
| 597 |
+
888
|
| 598 |
+
],
|
| 599 |
+
"page_idx": 4
|
| 600 |
+
},
|
| 601 |
+
{
|
| 602 |
+
"type": "image",
|
| 603 |
+
"img_path": "images/a2d0098d330c6217878fa160f5e6520aff0c5f2421a8b03dd2beb0f03f404954.jpg",
|
| 604 |
+
"image_caption": [
|
| 605 |
+
"Figure 1: Generic concept of the proposed 2D LUT method (left). Reading softmax output value from pre-computed 2D LUT(right). Computational flow consists from two steps: a) obtaining of $e _ { i } ^ { x }$ values by reading from 1D LUT and accumulation of $\\Sigma e ^ { x }$ term, b) obtaining $\\sigma ( x _ { i } )$ values by reading from 2D LUT. "
|
| 606 |
+
],
|
| 607 |
+
"image_footnote": [],
|
| 608 |
+
"bbox": [
|
| 609 |
+
171,
|
| 610 |
+
90,
|
| 611 |
+
823,
|
| 612 |
+
280
|
| 613 |
+
],
|
| 614 |
+
"page_idx": 5
|
| 615 |
+
},
|
| 616 |
+
{
|
| 617 |
+
"type": "text",
|
| 618 |
+
"text": "204 $\\Sigma e ^ { x }$ term as shown in Eq.(8). The indexes of LUT are computed according to Eq.(9) and Eq.(10), $w$ \n205means the number of bits for the value in selected precision. ",
|
| 619 |
+
"bbox": [
|
| 620 |
+
138,
|
| 621 |
+
392,
|
| 622 |
+
825,
|
| 623 |
+
422
|
| 624 |
+
],
|
| 625 |
+
"page_idx": 5
|
| 626 |
+
},
|
| 627 |
+
{
|
| 628 |
+
"type": "equation",
|
| 629 |
+
"img_path": "images/3eeb6aa7e389a3166d9eb880eac8e3c7c21890d6008716eb8a28ac7dc995876d.jpg",
|
| 630 |
+
"text": "$$\nL U T _ { \\sigma } [ i ] [ j ] = \\left\\lfloor \\frac { i \\cdot s c a l e _ { e ^ { x } } } { j \\cdot s c a l e _ { \\Sigma } } \\cdot ( 2 ^ { w } - 1 ) \\right\\rceil\n$$",
|
| 631 |
+
"text_format": "latex",
|
| 632 |
+
"bbox": [
|
| 633 |
+
369,
|
| 634 |
+
438,
|
| 635 |
+
630,
|
| 636 |
+
473
|
| 637 |
+
],
|
| 638 |
+
"page_idx": 5
|
| 639 |
+
},
|
| 640 |
+
{
|
| 641 |
+
"type": "text",
|
| 642 |
+
"text": "206where ",
|
| 643 |
+
"bbox": [
|
| 644 |
+
140,
|
| 645 |
+
483,
|
| 646 |
+
217,
|
| 647 |
+
497
|
| 648 |
+
],
|
| 649 |
+
"page_idx": 5
|
| 650 |
+
},
|
| 651 |
+
{
|
| 652 |
+
"type": "equation",
|
| 653 |
+
"img_path": "images/fd92bf06428cd0ba128ceffac2f7b143f36c94a058964482dce4b6205b8af4d2.jpg",
|
| 654 |
+
"text": "$$\ni = 0 , . . . , \\left\\lfloor \\frac { m a x ( e ^ { x } ) } { s c a l e _ { e ^ { x } } } \\right\\rceil\n$$",
|
| 655 |
+
"text_format": "latex",
|
| 656 |
+
"bbox": [
|
| 657 |
+
423,
|
| 658 |
+
493,
|
| 659 |
+
575,
|
| 660 |
+
529
|
| 661 |
+
],
|
| 662 |
+
"page_idx": 5
|
| 663 |
+
},
|
| 664 |
+
{
|
| 665 |
+
"type": "equation",
|
| 666 |
+
"img_path": "images/780a766770dcd8458dab8aa7254aaca93fb9a45f81584481cc5375bc6ed8a884.jpg",
|
| 667 |
+
"text": "$$\nj = 1 , . . . , \\left\\lfloor \\frac { m a x ( \\Sigma e ^ { x } ) } { s c a l e _ { \\Sigma } } \\right\\rceil\n$$",
|
| 668 |
+
"text_format": "latex",
|
| 669 |
+
"bbox": [
|
| 670 |
+
416,
|
| 671 |
+
540,
|
| 672 |
+
583,
|
| 673 |
+
575
|
| 674 |
+
],
|
| 675 |
+
"page_idx": 5
|
| 676 |
+
},
|
| 677 |
+
{
|
| 678 |
+
"type": "text",
|
| 679 |
+
"text": "207 Since $x \\to ( x - \\operatorname* { m a x } ( x ) )$ normalization was used, so $m a x ( e ^ { x } ) = 1 . 0$ ,Therefore, $s c a l e _ { e ^ { x } }$ factor \n208 allows to define the number of columns in LUT to make it small enough for practical applications. In \n209 our experiment we have selected $s c a l e _ { e ^ { x } } = 0 . 1$ for all precisions,what allows us to reduce the size \n210 of LUT significantly (i.e., $i = 0 , . . . , 1 0$ for all versions of $L U T _ { \\sigma }$ ). The value of $m a x ( \\Sigma e ^ { x } )$ depends \n211 on the distribution of input values. Our experiments showed that $m a x ( \\Sigma e ^ { x } ) = 6 0$ is big enough for \n212 the tested NLP applications.We also selected $s c a l e _ { \\Sigma } = 1 . 0$ for simplicity of the computations. Thus, \n213 finally, those parameters give us $L U T _ { \\sigma }$ of typical size $1 1 \\times 6 0$ ",
|
| 680 |
+
"bbox": [
|
| 681 |
+
140,
|
| 682 |
+
585,
|
| 683 |
+
826,
|
| 684 |
+
684
|
| 685 |
+
],
|
| 686 |
+
"page_idx": 5
|
| 687 |
+
},
|
| 688 |
+
{
|
| 689 |
+
"type": "text",
|
| 690 |
+
"text": ":145Experimental validation ",
|
| 691 |
+
"text_level": 1,
|
| 692 |
+
"bbox": [
|
| 693 |
+
147,
|
| 694 |
+
703,
|
| 695 |
+
408,
|
| 696 |
+
720
|
| 697 |
+
],
|
| 698 |
+
"page_idx": 5
|
| 699 |
+
},
|
| 700 |
+
{
|
| 701 |
+
"type": "text",
|
| 702 |
+
"text": "To validate the proposed methods and check how well they generalize we have conducted several experiments with different models (DETR,Transformer,and BERT) for diferent applications (object detection, machine translation,sentiment analysis,and semantic equivalence) over variety of datasets. In all those experiments we have used available pre-trained models, where we applied dynamic posttraining quantization (hereafter we referred to quantized models as PTQ-D) 4. Then we substituted a conventional softmax layer in quantized models with the LUT-based computation as described in Section 4. We did not consider any retraining or fine-tuning of the models after quantization, and the same off-line generated LUTs were used among all models. Our code allows to select LUTs with different precision from int16 down to uint2, what allows to analyze the sensitivity of the model to softmax approximation even for ultra-low 2-bits quantization. The details of experiments are described below,and results are summarized in Figure 2, Figure 3,and Table 2 .For more details please refer to Table 6,and Table 7 in Appendix.As it can be seen from figures, proposed LUT-based softmax computation methods maintain accuracy drop below $1 . 0 \\%$ down to 8-bit quantization for all NLP and DETR (no DC5) models. ",
|
| 703 |
+
"bbox": [
|
| 704 |
+
171,
|
| 705 |
+
734,
|
| 706 |
+
826,
|
| 707 |
+
887
|
| 708 |
+
],
|
| 709 |
+
"page_idx": 5
|
| 710 |
+
},
|
| 711 |
+
{
|
| 712 |
+
"type": "text",
|
| 713 |
+
"text": "",
|
| 714 |
+
"bbox": [
|
| 715 |
+
165,
|
| 716 |
+
90,
|
| 717 |
+
825,
|
| 718 |
+
133
|
| 719 |
+
],
|
| 720 |
+
"page_idx": 6
|
| 721 |
+
},
|
| 722 |
+
{
|
| 723 |
+
"type": "text",
|
| 724 |
+
"text": "5.1 Object detection ",
|
| 725 |
+
"text_level": 1,
|
| 726 |
+
"bbox": [
|
| 727 |
+
173,
|
| 728 |
+
150,
|
| 729 |
+
328,
|
| 730 |
+
164
|
| 731 |
+
],
|
| 732 |
+
"page_idx": 6
|
| 733 |
+
},
|
| 734 |
+
{
|
| 735 |
+
"type": "text",
|
| 736 |
+
"text": "For our first experiments we have used DEtection TRansofmer (DETR) models for object detection [2], with available pre-trained models 5.As it can be seen from Table 6, we were able to reproduce the same results for original FP32 reference model over COCO dataset. We have used the same IoU metric by Average Precision (AP) as in Table 1 in [2]. Then we run a bunch of experiments to check how accuracy of object detection willbe decreased due to PTQ-D quantization and LUT-based approximation as proposed in REXP method (see Section 4.1). Table 5 in Appendix shows the LUTs size for several pre-selected cases in int16 and uint8 precision. There are three cases selected which are different in the size of $L U T _ { \\alpha }$ : it is $1 \\times 2 5 6$ for case 1, $1 \\times 3 2 0$ for case 2,and $1 \\times 5 1 2$ for case 3. ",
|
| 737 |
+
"bbox": [
|
| 738 |
+
173,
|
| 739 |
+
174,
|
| 740 |
+
826,
|
| 741 |
+
286
|
| 742 |
+
],
|
| 743 |
+
"page_idx": 6
|
| 744 |
+
},
|
| 745 |
+
{
|
| 746 |
+
"type": "text",
|
| 747 |
+
"text": "Analysis of Figure 2 shows that accuracy drop caused by application of softmax approximation is small $( < 1 \\% )$ and acceptable for plain DETR models (no DC5 used). Bigger accuracy drop for $+ \\mathrm { D C } 5$ cases is caused by the bigger size of self-atentions of the encoder (see details in Section 5.3). We expect that increasing size ofLUTs will help to solve this issue. The behavior of average recall values is similar to average precision values. ",
|
| 748 |
+
"bbox": [
|
| 749 |
+
173,
|
| 750 |
+
292,
|
| 751 |
+
826,
|
| 752 |
+
362
|
| 753 |
+
],
|
| 754 |
+
"page_idx": 6
|
| 755 |
+
},
|
| 756 |
+
{
|
| 757 |
+
"type": "image",
|
| 758 |
+
"img_path": "images/18032ac4c37b6c2eb1a06638b0da073beea2c546e17d030f4ad490a25ab947a5.jpg",
|
| 759 |
+
"image_caption": [
|
| 760 |
+
"Figure 2: DETR averaged accuracy drop of PTQ-D models with softmax approximations Vs. original FP32 models: average precision (left) and average recall(right). As it can be seen from the figure, for DETR models without dilation at the last stage (no DC5) the accuracy drop for all cases is below $1 \\%$ and shows very similar behavior. "
|
| 761 |
+
],
|
| 762 |
+
"image_footnote": [],
|
| 763 |
+
"bbox": [
|
| 764 |
+
184,
|
| 765 |
+
391,
|
| 766 |
+
792,
|
| 767 |
+
531
|
| 768 |
+
],
|
| 769 |
+
"page_idx": 6
|
| 770 |
+
},
|
| 771 |
+
{
|
| 772 |
+
"type": "text",
|
| 773 |
+
"text": "2435.2 NLP tasks ",
|
| 774 |
+
"text_level": 1,
|
| 775 |
+
"bbox": [
|
| 776 |
+
145,
|
| 777 |
+
631,
|
| 778 |
+
284,
|
| 779 |
+
645
|
| 780 |
+
],
|
| 781 |
+
"page_idx": 6
|
| 782 |
+
},
|
| 783 |
+
{
|
| 784 |
+
"type": "text",
|
| 785 |
+
"text": "Next, we have validated the proposed methods by experimenting with several NLP tasks. Similarly, to DETR case,Table 8 in Appendix shows the LUTs size for several pre-selected cases for those experiments. In Table 2 below there are accumulated values from the experiments with NLP models. The bold values in the table shows highest values per model per method after applying quantization and softmax approximation. As it follows from the analysis of experiment results,about 7Oo Bytes for 2D LUT method, and up to 50 Bytes for REXP method would be enough for practical applications. ",
|
| 786 |
+
"bbox": [
|
| 787 |
+
173,
|
| 788 |
+
656,
|
| 789 |
+
826,
|
| 790 |
+
741
|
| 791 |
+
],
|
| 792 |
+
"page_idx": 6
|
| 793 |
+
},
|
| 794 |
+
{
|
| 795 |
+
"type": "text",
|
| 796 |
+
"text": "5.2.1Machine Translation ",
|
| 797 |
+
"text_level": 1,
|
| 798 |
+
"bbox": [
|
| 799 |
+
174,
|
| 800 |
+
753,
|
| 801 |
+
370,
|
| 802 |
+
768
|
| 803 |
+
],
|
| 804 |
+
"page_idx": 6
|
| 805 |
+
},
|
| 806 |
+
{
|
| 807 |
+
"type": "text",
|
| 808 |
+
"text": "Among NLP tasks we have started with machine translation.For our experiments we have used transofmer-base model for En-Ge translation [12] from OpenNMT library, with available pre-trained model 6,configured to replicate the results from original paper. To avoid dependency of the evaluation results on the selected tokenization scheme,we have used spm_decode 7to detokenize the output of translation,and then applied multi - bleu.perl script 8 to calculate BLEU score. ",
|
| 809 |
+
"bbox": [
|
| 810 |
+
174,
|
| 811 |
+
777,
|
| 812 |
+
826,
|
| 813 |
+
848
|
| 814 |
+
],
|
| 815 |
+
"page_idx": 6
|
| 816 |
+
},
|
| 817 |
+
{
|
| 818 |
+
"type": "table",
|
| 819 |
+
"img_path": "images/6bf2f1e1e7866cae718c8f6238665f93e6a3f031263848f929f44aedbeb5fb88.jpg",
|
| 820 |
+
"table_caption": [
|
| 821 |
+
"Table 2: Experimental validation over different NLP models and datasets "
|
| 822 |
+
],
|
| 823 |
+
"table_footnote": [],
|
| 824 |
+
"table_body": "<table><tr><td>PRECISION</td><td colspan=\"4\">TRANSFORMER</td><td colspan=\"4\">BERT</td></tr><tr><td></td><td colspan=\"2\">2D LUT</td><td colspan=\"2\">REXP</td><td colspan=\"2\">2D LUT</td><td colspan=\"2\">REXP</td></tr><tr><td></td><td>WMT 2014</td><td>WMT 2017</td><td>WMT 2014</td><td>WMT 2017</td><td>SST-2</td><td>MRPC</td><td>SST-2</td><td>MRPC</td></tr><tr><td>FP32</td><td>(BLEU) 26.98</td><td>(BLEU) 28.09</td><td>(BLEU) 26.98</td><td>(BLEU) 28.09</td><td>(%) 92.32</td><td>(F1) 90.19</td><td>(%) 92.32</td><td>(F1) 90.19</td></tr><tr><td>PTQ-D</td><td>26.86</td><td>27.95</td><td>26.86</td><td>27.95</td><td>91.74</td><td>89.53</td><td>91.74</td><td>89.53</td></tr><tr><td>INT16</td><td>26.87</td><td>28.02</td><td>26.89</td><td>27.64</td><td>91.63</td><td>89.50</td><td>91.74</td><td>89.26</td></tr><tr><td>UINT8</td><td>26.76</td><td>27.9</td><td>26.8</td><td>27.66</td><td>91.63</td><td>89.35</td><td>91.17</td><td>89.34</td></tr><tr><td>UINT4</td><td>26.26</td><td>27.43</td><td>26.68</td><td>28.02</td><td>91.40</td><td>88.01</td><td>91.17</td><td>88.77</td></tr><tr><td>UINT2</td><td>24.42</td><td>25.06</td><td>25.29</td><td>25.86</td><td>89.22</td><td>56.67</td><td>91.63</td><td>86.12</td></tr></table>",
|
| 825 |
+
"bbox": [
|
| 826 |
+
184,
|
| 827 |
+
116,
|
| 828 |
+
812,
|
| 829 |
+
277
|
| 830 |
+
],
|
| 831 |
+
"page_idx": 7
|
| 832 |
+
},
|
| 833 |
+
{
|
| 834 |
+
"type": "text",
|
| 835 |
+
"text": "256 Thus,as it can be seen from Table 2, we were able to reproduce the same BLEU score for FP32 \n257 reference model as in original model. Then we run several experiments to check how accuracy of \n258 the translation wil be changed due to LUT-based quantization in different precisions,and we can \n259 confirm that down up to 8-bit quantization the deviation of BLEU score from reference is small for \n260 both datasets $( < 0 . { \\bar { 5 } } \\% )$ . Also, if we consider impact of the proposed methods only, then we can \n261 see that accuracy drop is much smaller, and sometimes even recovers vs. PTQ-D quantization (see \n262 Figure 3 (right)). ",
|
| 836 |
+
"bbox": [
|
| 837 |
+
140,
|
| 838 |
+
309,
|
| 839 |
+
826,
|
| 840 |
+
406
|
| 841 |
+
],
|
| 842 |
+
"page_idx": 7
|
| 843 |
+
},
|
| 844 |
+
{
|
| 845 |
+
"type": "image",
|
| 846 |
+
"img_path": "images/e3fbfc3ced46fcebe16d429cac63ce9d30373f76281f3704a14ef61faf0c4aae.jpg",
|
| 847 |
+
"image_caption": [
|
| 848 |
+
"Figure 3: Accuracy drop for NLP experiments: PTQ-D models $^ +$ softmax approximations vs. FP32 models (left),and PTQ-D models $^ +$ softmax approximations vs. plain PTQ-D models (right). As it can be seen from the figure,down to uint8 precision the accuracy drop for all cases is below $1 \\%$ and shows very similar behavior. This confirm very good generalization of the proposed method over different models and applications. "
|
| 849 |
+
],
|
| 850 |
+
"image_footnote": [],
|
| 851 |
+
"bbox": [
|
| 852 |
+
194,
|
| 853 |
+
435,
|
| 854 |
+
790,
|
| 855 |
+
583
|
| 856 |
+
],
|
| 857 |
+
"page_idx": 7
|
| 858 |
+
},
|
| 859 |
+
{
|
| 860 |
+
"type": "text",
|
| 861 |
+
"text": "5.2.2Sentiment analysis ",
|
| 862 |
+
"text_level": 1,
|
| 863 |
+
"bbox": [
|
| 864 |
+
173,
|
| 865 |
+
688,
|
| 866 |
+
354,
|
| 867 |
+
702
|
| 868 |
+
],
|
| 869 |
+
"page_idx": 7
|
| 870 |
+
},
|
| 871 |
+
{
|
| 872 |
+
"type": "text",
|
| 873 |
+
"text": "To extend the variety of NLP applications,we also tested the same LUTs with BERT model [5]. We have used sentiment analysis task from GLUE benchmark [29] to test the model. We have used huggingface library 9,and trained the model with the hyper-parameters described in 10. The results of our experiments showed, that similarly to machine translation, the impact of proposed method (softmax layer approximation by LUTs) is smallr vs. accuracy drop caused by PTQ-D quantization (see Figure 3). ",
|
| 874 |
+
"bbox": [
|
| 875 |
+
173,
|
| 876 |
+
710,
|
| 877 |
+
826,
|
| 878 |
+
795
|
| 879 |
+
],
|
| 880 |
+
"page_idx": 7
|
| 881 |
+
},
|
| 882 |
+
{
|
| 883 |
+
"type": "text",
|
| 884 |
+
"text": "5.2.3Semantic equivalence ",
|
| 885 |
+
"text_level": 1,
|
| 886 |
+
"bbox": [
|
| 887 |
+
174,
|
| 888 |
+
809,
|
| 889 |
+
375,
|
| 890 |
+
824
|
| 891 |
+
],
|
| 892 |
+
"page_idx": 7
|
| 893 |
+
},
|
| 894 |
+
{
|
| 895 |
+
"type": "text",
|
| 896 |
+
"text": "For semantic equivalence test we used The Microsoft Research Paraphrase Corpus (MRPC) 11 in GLUE benchmark.As the classes are imbalanced ( $6 8 \\%$ positive, $32 \\%$ negative), we follow the ",
|
| 897 |
+
"bbox": [
|
| 898 |
+
165,
|
| 899 |
+
833,
|
| 900 |
+
823,
|
| 901 |
+
861
|
| 902 |
+
],
|
| 903 |
+
"page_idx": 7
|
| 904 |
+
},
|
| 905 |
+
{
|
| 906 |
+
"type": "text",
|
| 907 |
+
"text": "273 common practice and used F1 score as a metric. We have used huggingface library and followed \n274 the guidelines from PyTorch tutorial 12 to obtain PTQ-D quantized model. Then,similarly to previous \n275 tests we have substituted a conventional softmax layer with the proposed LUT-based methods. The \n276 results of our experiments showed the similar trend with sentiment analysis test. ",
|
| 908 |
+
"bbox": [
|
| 909 |
+
142,
|
| 910 |
+
92,
|
| 911 |
+
826,
|
| 912 |
+
147
|
| 913 |
+
],
|
| 914 |
+
"page_idx": 8
|
| 915 |
+
},
|
| 916 |
+
{
|
| 917 |
+
"type": "text",
|
| 918 |
+
"text": "2775.3 Ablation study of DETR models experiment ",
|
| 919 |
+
"text_level": 1,
|
| 920 |
+
"bbox": [
|
| 921 |
+
142,
|
| 922 |
+
172,
|
| 923 |
+
519,
|
| 924 |
+
189
|
| 925 |
+
],
|
| 926 |
+
"page_idx": 8
|
| 927 |
+
},
|
| 928 |
+
{
|
| 929 |
+
"type": "text",
|
| 930 |
+
"text": "As it is stated in [2],to increase the feature resolution for smallobjects,a dilation to the last stage of the backbone was added ( $+ \\mathrm { D C } 5$ cases of DETR models). This modification increases the cost in the self-attentions of the encoder, leading to an overall $\\times 2$ increase in computational cost. Such changes also reflect on the properties of softmax factors. In Figure 4 there are shown the histogram of $\\Sigma e ^ { x }$ values distributions for the first 2OO tensors of DETR model run for bins $= 5 0$ $\\mathtt { r a n g e } = ( 0 , 5 0 0 )$ As it can be seen from the figure, the distribution of DETR $+ \\mathrm { D C } 5$ (R50) variant is more right-tailed, due to the bigger number of high-magnitude values. This causes the bigger accuracy drop when LUT-based quantization method is used, due to the lack of the discrepancy for those values. Thus, for such models (DETR with added dilation at the last stage) the accuracy of object detection after application of the proposed method can be limited. However, as we can see from Figure 2) increasing of the size of $L U { \\bar { T } } _ { \\alpha }$ from 256 Bytes to 512 Bytes allows to decrease the accuracy drop from $9 \\%$ to $3 \\%$ for $\\mathrm { D E T R + D C } 5$ (R101) unit8 case. Thus, we expect that further increasing the size of LUTs will help to obtain even more accurate results for DETR models with dilation. ",
|
| 931 |
+
"bbox": [
|
| 932 |
+
140,
|
| 933 |
+
203,
|
| 934 |
+
828,
|
| 935 |
+
383
|
| 936 |
+
],
|
| 937 |
+
"page_idx": 8
|
| 938 |
+
},
|
| 939 |
+
{
|
| 940 |
+
"type": "image",
|
| 941 |
+
"img_path": "images/2450ef698b17c3ee11267e5b440cbba24aa7840aadfa0ceacde0176d198accc9.jpg",
|
| 942 |
+
"image_caption": [
|
| 943 |
+
"Figure 4: Histogram of $\\Sigma e ^ { x }$ values distributions for DETR model variants: plain DETR (R5O) (left), and with dilation I $) \\mathrm { E T R } { + } \\mathrm { D C } 5$ (R50) (right). Red dot line represents the average of the all values per one run of the inference of DETR model. It is clearly seen from the figure that distribution of DETR $+ \\mathrm { D C } 5$ (R50) variant is more flat, having more high-magnitude values. This causes the bigger accuracy drop for the quantized model due to lack of the discrepancy for those values. "
|
| 944 |
+
],
|
| 945 |
+
"image_footnote": [],
|
| 946 |
+
"bbox": [
|
| 947 |
+
192,
|
| 948 |
+
419,
|
| 949 |
+
790,
|
| 950 |
+
561
|
| 951 |
+
],
|
| 952 |
+
"page_idx": 8
|
| 953 |
+
},
|
| 954 |
+
{
|
| 955 |
+
"type": "text",
|
| 956 |
+
"text": "2916Conclusion ",
|
| 957 |
+
"text_level": 1,
|
| 958 |
+
"bbox": [
|
| 959 |
+
142,
|
| 960 |
+
698,
|
| 961 |
+
299,
|
| 962 |
+
714
|
| 963 |
+
],
|
| 964 |
+
"page_idx": 8
|
| 965 |
+
},
|
| 966 |
+
{
|
| 967 |
+
"type": "text",
|
| 968 |
+
"text": "In this paper two alternative methods for efficient softmax computation for DNN models with atention mechanism are proposed. The methods are memory-centric in contrast to known logiccentric approach and are based on the usage ofLUTs for reading of the pre-computed values, instead of the direct computation. Thus,it allows to build the HW accelerator without usage of costly and power-hungry divider. In turn, it allows to decrease the power consumption and latency of the whole inference,what is crucial for edge computing. All results obtained in the paper were validated over different AI tasks (object detection, machine translation, sentiment analysis, and semantic equivalence) and models (DETR,Transformer, BERT) by variety of benchmarks (COCO2017, WMT14, WMT17, GLUE), showing acceptable accuracy and good generalization of the proposed methods. ",
|
| 969 |
+
"bbox": [
|
| 970 |
+
173,
|
| 971 |
+
734,
|
| 972 |
+
826,
|
| 973 |
+
873
|
| 974 |
+
],
|
| 975 |
+
"page_idx": 8
|
| 976 |
+
},
|
| 977 |
+
{
|
| 978 |
+
"type": "text",
|
| 979 |
+
"text": "References \n[1] Aishwarya Bhandare, Vamsi Sripathi, Deepthi Karkada, Vivek Menon, Sun Choi, Kushal Datta, and Vikram Saletore.Eficient 8-bit quantization of transformer neural machine language translation model. CoRR,abs/1906.00532,2019. \n[2] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers, 2020. \n[3] Ming Chen, Yingming_Li, Zhongfei Zhang, and Siyu_Huang. Tvt: Two-view transformer network for video captioning. In Jun Zhu and Ichiro Takeuchi, editors, Proceedings of The l0th Asian Conference on Machine Learning, volume 95 of Proceedings of Machine Learning Research, pages 847-862. PMLR,14-16 Nov 2018. \n[4] Jacek Czaja, Michal Galus, Tomasz Patejko,and Jian Tang. Softmax optimizations for intel xeon processor-based platforms. CoRR,abs/1904.12380,2019. \n[5] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: pre-training of deep bidirectional transformers for language understanding. CoRR,abs/1810.04805, 2018. \n[6] Alexey Dosovitskiy,Lucas Beyer,Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Mathias Minderer, Georg Heigold, Sylvain Gely, Jakob Uszkoreit,and Neil Houlsby.An image is worth 16x16 words: Transformers for image recognition at scale,2020. \n[7] Sebastian Gehrmann, Yuntian Deng, and Alexander Rush. Botom-up abstractive summarization. In Proceedings of the2O18 Conference on Empirical Methods in Natural Language Processing, pages 4098-4109,2018. \n[8] Xue Geng, Jie Lin, Bin Zhao, Anmin Kong, Mohamed M. Sabry Aly, and Vijay Chandrasekhar. Hardware-aware softmax approximation for deep neural networks. In C.V. Jawahar, Hongdong Li, Greg Mori,and Konrad Schindler, editors, Computer Vision- ACCV 2018, pages 107-12, Cham, 2019. Springer International Publishing. \n[9] Yanzhang He, Tara N. Sainath, Rohit Prabhavalkar, Ian McGraw, Raziel Alvarez, Ding Zhao, David Rybach, Anjuli Kannan, Yonghui Wu, Ruoming Pang, Qiao Liang, Deepti Bhatia, Yuan Shangguan, Bo Li, Golan Pundak, Khe Chai Sim, Tom Bagby, Shuo yiin Chang, Kanishka Rao, and Alexander Gruenstein. Streaming end-to-end speech recognition for mobile devices,2018. \n[10] R. Hu, B. Tian, S. Yin,and S. Wei. Efcient hardware architecture of softmax layer in deep neural network. In2018 IEEE23rd International Conference on Digital Signal Procesing (DSP), pages 1-5, Nov 2018. \n[11] Andrey Ignatov, Radu Timofte, Wilim Chou, Ke Wang, Max Wu, Tim Hartley,and Luc Van Gool.AI benchmark: Running deep neural networks on android smartphones. CoRR, abs/1810.01109,2018. \n[12] Guillume Klein, Yoon Kim, Yuntian Deng, Jean Senellart, and Alexander M. Rush. OpenNMT: Open-source toolkit for neural machine translation. In Proc. ACL, 2017. \n[13] Ioannis Kouretas and Vassilis Paliouras. Hardware implementation of a softmax-like function for deep learning. Technologies, 8(3), 2020. \n[14] Guillaume Lample and Frangois Charton. Deep learning for symbolic mathematics. CoRR, abs/1912.01412, 2019. \n[15] Zhenzhong Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel, Piyush Sharma, and Radu Soricut. Albert: A lite bert for self-supervised learning of language representations, 2019. \n[16] Bo Li, Shuo yiin Chang,Tara N. Sainath,Ruoming Pang, Yanzhang He, Trevor Strohman, and Yonghui Wu. Towards fast and accurate streaming end-to-end asr, 2020. \n[17] Z. Li, H. Li, X. Jiang, B. Chen, Y. Zhang, and G. Du.Efficient fpga implementation of softmax function for dnn applications. In 2018 12th IEEE International Conference on Anticounterfeiting, Security, and Identification (ASID), pages 212-216, Nov 2018. \n50[18] Yinhan Liu,Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettemoyer, and Veselin Stoyanov. Roberta: A robustly optimized BERT pretraining approach. CoRR, abs/1907.11692, 2019. \n53[19] M. G. Sarwar Murshed, Christopher Murphy, Daqing Hou, Nazar Khan, Ganesh Ananthanarayanan, and Faraz Hussain. Machine learning at the network edge: A survey, 2019. \n55[20] Gabriele Prato,Ella Charlaix,and Mehdi Rezagholizadeh.Fully quantized transformer for improved translation, 2019. [21] Tara N. Sainath, Yanzhang He, Bo Li, Arun Narayanan,Ruoming Pang, Antoine Bruguier, Shuo yiin Chang, Wei Li, Raziel Alvarez, Zhifeng Chen, Chung-Cheng Chiu, David Garcia, Alex Gruenstein, Ke Hu, Minho Jin, Anjuli Kannan, Qiao Liang, Ian McGraw, Cal Peyser, Rohit Prabhavalkar, Golan Pundak, David Rybach, Yuan Shangguan, Yash Sheth, Trevor Strohman, Mirko Visontai, Yonghui Wu, Yu Zhang,and Ding Zhao. A streaming on-device end-to-end model surpassing server-side conventional model quality and latency, 2020. \n63[22] Sheng Shen, Zhen Dong, Jiayu Ye, Linjian Ma, Zhewei Yao,Amir Gholami, Michael W. Mahoney,and Kurt Keutzer. Q-bert: Hessian based ultra low precision quantization of bert, 2019. [23] Hyunsung Shin, Dongyoung Kim, Eunhyeok Park, Sungho Park, Yongsik Park, and Sungjoo Yoo. Mcdram: Low latency and energy-effcient matrix computations in dram. IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems, 37(11):2613-2622, 2018. \n70[24] Jacob R. Stevens, Rangharajan Venkatesan, Steve Dai, Brucek Khailany,and Anand Raghunathan. Softermax: Hardware/software co-design of an eficient softmax for transformers. CoRR,abs/2103.09301,2021. [25] Q. Sun, Z. Di,Z. Lv, F. Song, Q. Xiang, Q. Feng, Y. Fan, X. Yu,and W. Wang. A high speed softmax vlsi architecture based on basic-split. In 2018 14th IEEE International Conference on Solid-State and Integrated Circuit Technology (ICSICT), pages 1-3, Oct 2018. [26] Hugo Touvron,Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Hervé Jégou. Training data-efficient image transformers distillation through attention, 2021. \n78[27] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,Llion Jones,Aidan N. Gomez, Lukasz Kaiser, and Ilia Polosukhin. Attention is all you need. CoRR,abs/1706.03762, 2017. [28] Ihor Vasyltsov and Wooseok Chang. Lightweight Approximation of Softmax Layer for On-Device Inference. Springer International Publishing, 2021. \n82[29] Alex Wang,Amanpreet Singh, Julian Michael,Felix Hil,Omer Levy,and Samuel R. Bowman. GLUE: A multi-task benchmark and analysis platform for natural language understanding. CoRR,abs/1804.07461,2018. \n85[30] K. Wang, Y. Huang, Y. Ho,and W. Fang. A customized convolutional neural network design using improved softmax layer for real-time human emotion recognition. In 2019 IEEE International Conference on Artificial Intelligence Circuits and Systems (AICAS), pages 102-106, March 2019. \n89[31] M. Wang,S.Lu,D. Zhu, J.Lin,and Z. Wang. A high-speed and low-complexity architecture for softmax function in deep learning. In 2O18 IEEE Asia Pacific Conference on Circuits and Systems (APCCAS), pages 223-226, Oct 2018. \n92[32] Siqi Wang,Anuj Pathania,and Tulika Mitra. Neural network inference on mobile socs. IEEE Design Test, page 1-1,2020. \n94[33] Zhilin_ Yang, Zihang Dai, Yiming Yang, Jaime G. Carbonell,Ruslan Salakhutdinov, and Quoc V. Le. Xlnet: Generalized autoregressive pretraining for language understanding. CoRR, abs/1906.08237,2019. \n[34] B. Yuan. Efcient hardware architecture of softmax layer in deep neural network. In 2016 29th IEEE International System-on-Chip Conference (SOCC), pages 323-326, Sep.2016. \n[35] Ofir Zafrir, Guy Boudoukh,Peter Izsak,and Moshe Wasserblat. Q8bert: Quantized 8bit bert, 2019. \n[36] Xingzhou Zhang, Yifan Wang, Sidi Lu,Liangkai Liu, Lanyu Xu,and Weisong Shi. Openei: An open framework for edge intelligence. CoRR,abs/1906.01864,2019. ",
|
| 980 |
+
"bbox": [
|
| 981 |
+
165,
|
| 982 |
+
65,
|
| 983 |
+
830,
|
| 984 |
+
917
|
| 985 |
+
],
|
| 986 |
+
"page_idx": 9
|
| 987 |
+
},
|
| 988 |
+
{
|
| 989 |
+
"type": "text",
|
| 990 |
+
"text": "",
|
| 991 |
+
"bbox": [
|
| 992 |
+
148,
|
| 993 |
+
47,
|
| 994 |
+
830,
|
| 995 |
+
924
|
| 996 |
+
],
|
| 997 |
+
"page_idx": 10
|
| 998 |
+
},
|
| 999 |
+
{
|
| 1000 |
+
"type": "text",
|
| 1001 |
+
"text": "",
|
| 1002 |
+
"bbox": [
|
| 1003 |
+
174,
|
| 1004 |
+
90,
|
| 1005 |
+
828,
|
| 1006 |
+
193
|
| 1007 |
+
],
|
| 1008 |
+
"page_idx": 11
|
| 1009 |
+
},
|
| 1010 |
+
{
|
| 1011 |
+
"type": "text",
|
| 1012 |
+
"text": "Checklist ",
|
| 1013 |
+
"text_level": 1,
|
| 1014 |
+
"bbox": [
|
| 1015 |
+
171,
|
| 1016 |
+
214,
|
| 1017 |
+
254,
|
| 1018 |
+
231
|
| 1019 |
+
],
|
| 1020 |
+
"page_idx": 11
|
| 1021 |
+
},
|
| 1022 |
+
{
|
| 1023 |
+
"type": "text",
|
| 1024 |
+
"text": "1. For all authors.. ",
|
| 1025 |
+
"bbox": [
|
| 1026 |
+
214,
|
| 1027 |
+
239,
|
| 1028 |
+
341,
|
| 1029 |
+
253
|
| 1030 |
+
],
|
| 1031 |
+
"page_idx": 11
|
| 1032 |
+
},
|
| 1033 |
+
{
|
| 1034 |
+
"type": "text",
|
| 1035 |
+
"text": "(a) Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope?[Yes] See also Section 3,where key contributions were listed. \n(b) Did you describe the limitations of your work?[Yes] See Section 5.3. \n(c) Did you discuss any potential negative societal impacts of your work? [N/A] \n(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] We read the ethics review guidelines and confirm that content of our paper is not related to any ethics issue, since it is focused on the optimization of computations. ",
|
| 1036 |
+
"bbox": [
|
| 1037 |
+
238,
|
| 1038 |
+
258,
|
| 1039 |
+
828,
|
| 1040 |
+
359
|
| 1041 |
+
],
|
| 1042 |
+
"page_idx": 11
|
| 1043 |
+
},
|
| 1044 |
+
{
|
| 1045 |
+
"type": "text",
|
| 1046 |
+
"text": "2. If you are including theoretical results... ",
|
| 1047 |
+
"bbox": [
|
| 1048 |
+
215,
|
| 1049 |
+
363,
|
| 1050 |
+
493,
|
| 1051 |
+
377
|
| 1052 |
+
],
|
| 1053 |
+
"page_idx": 11
|
| 1054 |
+
},
|
| 1055 |
+
{
|
| 1056 |
+
"type": "text",
|
| 1057 |
+
"text": "(a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A] ",
|
| 1058 |
+
"bbox": [
|
| 1059 |
+
236,
|
| 1060 |
+
381,
|
| 1061 |
+
738,
|
| 1062 |
+
411
|
| 1063 |
+
],
|
| 1064 |
+
"page_idx": 11
|
| 1065 |
+
},
|
| 1066 |
+
{
|
| 1067 |
+
"type": "text",
|
| 1068 |
+
"text": "3. If you ran experiments... ",
|
| 1069 |
+
"bbox": [
|
| 1070 |
+
214,
|
| 1071 |
+
415,
|
| 1072 |
+
393,
|
| 1073 |
+
429
|
| 1074 |
+
],
|
| 1075 |
+
"page_idx": 11
|
| 1076 |
+
},
|
| 1077 |
+
{
|
| 1078 |
+
"type": "text",
|
| 1079 |
+
"text": "(a) Did you include the code,data,and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] See supplemental materials. \n(b) Did you specify all the training details (e.g., data splits,hyperparameters, how they were chosen)? [N/A] In our paper we do not consider any training, or fine-tuning. We focus on the inference only. \n(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [N/A] Since we did not do any training, we did not need to run experiment multiple times (inference output is deterministic). \n(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [N/A] Since we did not do any training, it is not related to our work. ",
|
| 1080 |
+
"bbox": [
|
| 1081 |
+
238,
|
| 1082 |
+
433,
|
| 1083 |
+
826,
|
| 1084 |
+
603
|
| 1085 |
+
],
|
| 1086 |
+
"page_idx": 11
|
| 1087 |
+
},
|
| 1088 |
+
{
|
| 1089 |
+
"type": "text",
|
| 1090 |
+
"text": "4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets.. ",
|
| 1091 |
+
"bbox": [
|
| 1092 |
+
214,
|
| 1093 |
+
607,
|
| 1094 |
+
825,
|
| 1095 |
+
622
|
| 1096 |
+
],
|
| 1097 |
+
"page_idx": 11
|
| 1098 |
+
},
|
| 1099 |
+
{
|
| 1100 |
+
"type": "text",
|
| 1101 |
+
"text": "(a) If your work uses existing assets, did you cite the creators?[Yes] Al used assets are cited either as a reference,or by direct URL link in the footnote,or in the body of the paper. \n(b) Did you mention the license of the assets? [Yes] The license of the used assets are noticed either in the appropriate reference,or direct URL link of asset. \n(c) Did you include any new assets either in the supplemental material or as a URL? [Yes] Some code and generated LUTs to reproduce our results are provided in supplemental materials. \n(d) Did you discuss whether and how consent was obtained from people whose data you're using/curating? [N/A] \n(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A] ",
|
| 1102 |
+
"bbox": [
|
| 1103 |
+
238,
|
| 1104 |
+
625,
|
| 1105 |
+
826,
|
| 1106 |
+
797
|
| 1107 |
+
],
|
| 1108 |
+
"page_idx": 11
|
| 1109 |
+
},
|
| 1110 |
+
{
|
| 1111 |
+
"type": "text",
|
| 1112 |
+
"text": "5. If you used crowdsourcing or conducted research with human subjects... ",
|
| 1113 |
+
"bbox": [
|
| 1114 |
+
214,
|
| 1115 |
+
801,
|
| 1116 |
+
705,
|
| 1117 |
+
815
|
| 1118 |
+
],
|
| 1119 |
+
"page_idx": 11
|
| 1120 |
+
},
|
| 1121 |
+
{
|
| 1122 |
+
"type": "text",
|
| 1123 |
+
"text": "(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A] \n(b) Did you describe any potential participant risks,with links to Institutional Review Board (IRB) approvals,if applicable? [N/A] \n(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A] ",
|
| 1124 |
+
"bbox": [
|
| 1125 |
+
238,
|
| 1126 |
+
819,
|
| 1127 |
+
826,
|
| 1128 |
+
906
|
| 1129 |
+
],
|
| 1130 |
+
"page_idx": 11
|
| 1131 |
+
}
|
| 1132 |
+
]
|
parse/train/TScOKQW67Mj/TScOKQW67Mj_middle.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/TScOKQW67Mj/TScOKQW67Mj_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/lQdXeXDoWtI/lQdXeXDoWtI.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/lQdXeXDoWtI/lQdXeXDoWtI_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/lQdXeXDoWtI/lQdXeXDoWtI_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
vlm/train/-xEk43f_EO6/0.png
ADDED
|
Git LFS Details
|
vlm/train/-xEk43f_EO6/1.png
ADDED
|
Git LFS Details
|
vlm/train/-xEk43f_EO6/10.png
ADDED
|
Git LFS Details
|
vlm/train/-xEk43f_EO6/11.png
ADDED
|
Git LFS Details
|
vlm/train/-xEk43f_EO6/2.png
ADDED
|
Git LFS Details
|
vlm/train/-xEk43f_EO6/3.png
ADDED
|
Git LFS Details
|
vlm/train/-xEk43f_EO6/4.png
ADDED
|
Git LFS Details
|
vlm/train/-xEk43f_EO6/5.png
ADDED
|
Git LFS Details
|
vlm/train/-xEk43f_EO6/6.png
ADDED
|
Git LFS Details
|
vlm/train/-xEk43f_EO6/7.png
ADDED
|
Git LFS Details
|
vlm/train/-xEk43f_EO6/8.png
ADDED
|
Git LFS Details
|
vlm/train/-xEk43f_EO6/9.png
ADDED
|
Git LFS Details
|
vlm/train/2-0wS9-cSL/0.png
ADDED
|
Git LFS Details
|
vlm/train/2-0wS9-cSL/1.png
ADDED
|
Git LFS Details
|
vlm/train/2-0wS9-cSL/10.png
ADDED
|
Git LFS Details
|
vlm/train/2-0wS9-cSL/11.png
ADDED
|
Git LFS Details
|
vlm/train/2-0wS9-cSL/2.png
ADDED
|
Git LFS Details
|
vlm/train/2-0wS9-cSL/3.png
ADDED
|
Git LFS Details
|
vlm/train/2-0wS9-cSL/4.png
ADDED
|
Git LFS Details
|
vlm/train/2-0wS9-cSL/5.png
ADDED
|
Git LFS Details
|
vlm/train/2-0wS9-cSL/6.png
ADDED
|
Git LFS Details
|
vlm/train/2-0wS9-cSL/7.png
ADDED
|
Git LFS Details
|
vlm/train/2-0wS9-cSL/8.png
ADDED
|
Git LFS Details
|