Chelsea707's picture
Add Batch af0b9ad0-6f08-44fb-b739-e63bb181a6a1 data
3651b78 verified
Raw
History Blame Contribute Delete
479 kB
{
"pdf_info": [
{
"para_blocks": [
{
"bbox": [
177,
76,
416,
94
],
"type": "title",
"angle": 0,
"lines": [
{
"bbox": [
177,
76,
416,
94
],
"spans": [
{
"bbox": [
177,
76,
416,
94
],
"type": "text",
"content": "A Length-Extrapolatable Transformer"
}
]
}
],
"index": 0
},
{
"bbox": [
120,
109,
477,
138
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
120,
109,
477,
138
],
"spans": [
{
"bbox": [
120,
109,
477,
138
],
"type": "text",
"content": "Yutao Sun"
},
{
"bbox": [
120,
109,
477,
138
],
"type": "inline_equation",
"content": "^{1*}"
},
{
"bbox": [
120,
109,
477,
138
],
"type": "text",
"content": ", Li Dong"
},
{
"bbox": [
120,
109,
477,
138
],
"type": "inline_equation",
"content": "^{2}"
},
{
"bbox": [
120,
109,
477,
138
],
"type": "text",
"content": ", Barun Patra"
},
{
"bbox": [
120,
109,
477,
138
],
"type": "inline_equation",
"content": "^{2}"
},
{
"bbox": [
120,
109,
477,
138
],
"type": "text",
"content": ", Shuming Ma"
},
{
"bbox": [
120,
109,
477,
138
],
"type": "inline_equation",
"content": "^{2}"
},
{
"bbox": [
120,
109,
477,
138
],
"type": "text",
"content": ", Shaohan Huang"
},
{
"bbox": [
120,
109,
477,
138
],
"type": "inline_equation",
"content": "^{2}"
},
{
"bbox": [
120,
109,
477,
138
],
"type": "text",
"content": ", Alon Benhaim"
},
{
"bbox": [
120,
109,
477,
138
],
"type": "inline_equation",
"content": "^{2}"
},
{
"bbox": [
120,
109,
477,
138
],
"type": "text",
"content": ", Vishrav Chaudhary"
},
{
"bbox": [
120,
109,
477,
138
],
"type": "inline_equation",
"content": "^{2}"
},
{
"bbox": [
120,
109,
477,
138
],
"type": "text",
"content": ", Xia Song"
},
{
"bbox": [
120,
109,
477,
138
],
"type": "inline_equation",
"content": "^{2}"
},
{
"bbox": [
120,
109,
477,
138
],
"type": "text",
"content": ", Furu Wei"
},
{
"bbox": [
120,
109,
477,
138
],
"type": "inline_equation",
"content": "^{2}"
}
]
}
],
"index": 1
},
{
"bbox": [
246,
139,
349,
153
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
246,
139,
349,
153
],
"spans": [
{
"bbox": [
246,
139,
349,
153
],
"type": "text",
"content": "Tsinghua University"
}
]
}
],
"index": 2
},
{
"bbox": [
271,
153,
324,
165
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
271,
153,
324,
165
],
"spans": [
{
"bbox": [
271,
153,
324,
165
],
"type": "text",
"content": "Microsoft2"
}
]
}
],
"index": 3
},
{
"bbox": [
180,
167,
416,
180
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
180,
167,
416,
180
],
"spans": [
{
"bbox": [
180,
167,
416,
180
],
"type": "text",
"content": "https://github.com/microsoft/torchscale"
}
]
}
],
"index": 4
},
{
"bbox": [
155,
212,
202,
224
],
"type": "title",
"angle": 0,
"lines": [
{
"bbox": [
155,
212,
202,
224
],
"spans": [
{
"bbox": [
155,
212,
202,
224
],
"type": "text",
"content": "Abstract"
}
]
}
],
"index": 5
},
{
"bbox": [
84,
236,
274,
464
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
84,
236,
274,
464
],
"spans": [
{
"bbox": [
84,
236,
274,
464
],
"type": "text",
"content": "Position modeling plays a critical role in Transformers. In this paper, we focus on length extrapolation, i.e., training on short texts while evaluating longer sequences. We define attention resolution as an indicator of extrapolation. Then we propose two designs to improve the above metric of Transformers. Specifically, we introduce a relative position embedding to explicitly maximize attention resolution. Moreover, we use blockwise causal attention during inference for better efficiency. The proposed architecture is named Length-Extrapolatable (LEX) Transformer. We evaluate different Transformer variants on language modeling. Experimental results show that our model achieves better performance in both interpolation and extrapolation settings. The code will be available at https://aka.ms/LeX-Transformer."
}
]
}
],
"index": 6
},
{
"bbox": [
68,
475,
154,
487
],
"type": "title",
"angle": 0,
"lines": [
{
"bbox": [
68,
475,
154,
487
],
"spans": [
{
"bbox": [
68,
475,
154,
487
],
"type": "text",
"content": "1 Introduction"
}
]
}
],
"index": 7
},
{
"bbox": [
67,
497,
291,
659
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
67,
497,
291,
659
],
"spans": [
{
"bbox": [
67,
497,
291,
659
],
"type": "text",
"content": "Transformer (Vaswani et al., 2017) has shown strong performance in NLP and become a de-facto backbone (Dosovitskiy et al., 2020; Radford et al., 2021; Wang et al., 2022). However, most of them have a crucial shortcoming: they can only deal with the in-distribution size of inputs. Figure 1 shows that the perplexity of previous Transformers increases rapidly when the input sequence is getting longer. It is usually infeasible to train a model with all possible input lengths. Therefore, a length-extrapolatable Transformer is essential for wider usage."
}
]
}
],
"index": 8
},
{
"bbox": [
67,
660,
291,
754
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
67,
660,
291,
754
],
"spans": [
{
"bbox": [
67,
660,
291,
754
],
"type": "text",
"content": "In sequence modeling, position information plays a crucial role in building the correct representation and understanding of the latent meaning. For Recurrent Neural Networks such as LSTM (Hochreiter and Schmidhuber, 1997), the calculation is done along the sequence order in O(N) time. However, the parallel attention module"
}
]
}
],
"index": 9
},
{
"type": "image",
"bbox": [
306,
212,
523,
391
],
"blocks": [
{
"bbox": [
306,
212,
523,
391
],
"lines": [
{
"bbox": [
306,
212,
523,
391
],
"spans": [
{
"bbox": [
306,
212,
523,
391
],
"type": "image",
"image_path": "cf69420cc077829381fd28b5cbedda8a3a92404b62a1e93b44e0b0ba8444c3e8.jpg"
}
]
}
],
"index": 10,
"angle": 0,
"type": "image_body"
},
{
"bbox": [
302,
398,
527,
423
],
"lines": [
{
"bbox": [
302,
398,
527,
423
],
"spans": [
{
"bbox": [
302,
398,
527,
423
],
"type": "text",
"content": "Figure 1: The perplexity of different Transformer designs with various input lengths."
}
]
}
],
"index": 11,
"angle": 0,
"type": "image_caption"
}
],
"index": 10
},
{
"bbox": [
301,
446,
526,
623
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
301,
446,
526,
623
],
"spans": [
{
"bbox": [
301,
446,
526,
623
],
"type": "text",
"content": "makes it hard to encode position effectively. First, Vaswani et al. (2017) proposes absolute sinusoidal position embedding, and Devlin et al. (2019) adjusts it to a learnable one. The absolute design is computation-efficient, but not comparable with subsequent relative ones (Shaw et al., 2018; Su et al., 2021; Press et al., 2021). Among many relative position embeddings, RoPE (Su et al., 2021) shows better performance and is used to many PLMs such as PaLM (Chowdhery et al., 2022). However, it can't deal with sequences with exceeding length. Alibi (Press et al., 2021) mitigates the extrapolation problem but sacrifices the general performance."
}
]
}
],
"index": 12
},
{
"bbox": [
302,
624,
525,
772
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
302,
624,
525,
772
],
"spans": [
{
"bbox": [
302,
624,
525,
772
],
"type": "text",
"content": "Since different strategies concentrate on some part of the position feature, it is essential to build a comprehensive view and guide the Transformer's design systematically. First, a Transformer should be sensitive to order. Otherwise, it will degenerate into a bag-of-word model which confuses the whole meaning. Then, position translation can't hurt the representation, especially, when a prefix is added to the target sentence, the representation should stay the same with an attention mask on the prefix. After that, a good sequence model needs to"
}
]
}
],
"index": 13
}
],
"discarded_blocks": [
{
"bbox": [
84,
761,
278,
772
],
"type": "page_footnote",
"angle": 0,
"lines": [
{
"bbox": [
84,
761,
278,
772
],
"spans": [
{
"bbox": [
84,
761,
278,
772
],
"type": "text",
"content": "*Work done during internship at Microsoft Research."
}
]
}
],
"index": 14
},
{
"bbox": [
283,
780,
313,
791
],
"type": "page_number",
"angle": 0,
"lines": [
{
"bbox": [
283,
780,
313,
791
],
"spans": [
{
"bbox": [
283,
780,
313,
791
],
"type": "text",
"content": "14590"
}
]
}
],
"index": 15
},
{
"bbox": [
135,
795,
458,
805
],
"type": "footer",
"angle": 0,
"lines": [
{
"bbox": [
135,
795,
458,
805
],
"spans": [
{
"bbox": [
135,
795,
458,
805
],
"type": "text",
"content": "Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics"
}
]
}
],
"index": 16
},
{
"bbox": [
215,
806,
379,
817
],
"type": "footer",
"angle": 0,
"lines": [
{
"bbox": [
215,
806,
379,
817
],
"spans": [
{
"bbox": [
215,
806,
379,
817
],
"type": "text",
"content": "Volume 1: Long Papers, pages 14590-14604"
}
]
}
],
"index": 17
},
{
"bbox": [
176,
818,
417,
829
],
"type": "footer",
"angle": 0,
"lines": [
{
"bbox": [
176,
818,
417,
829
],
"spans": [
{
"bbox": [
176,
818,
417,
829
],
"type": "text",
"content": "July 9-14, 2023 ©2023 Association for Computational Linguistics"
}
]
}
],
"index": 18
}
],
"page_size": [
595,
841
],
"page_idx": 0
},
{
"para_blocks": [
{
"type": "table",
"bbox": [
118,
68,
476,
211
],
"blocks": [
{
"bbox": [
118,
68,
476,
211
],
"lines": [
{
"bbox": [
118,
68,
476,
211
],
"spans": [
{
"bbox": [
118,
68,
476,
211
],
"type": "table",
"html": "<table><tr><td>Models</td><td>Translation Invariance</td><td>Length Extrapolation</td></tr><tr><td colspan=\"3\">Absolute Position Modeling</td></tr><tr><td>Transformer (Sinusoidal)</td><td>×</td><td>××</td></tr><tr><td>GPT-2 (Learnable)</td><td>×</td><td>××</td></tr><tr><td colspan=\"3\">Relative Position Modeling</td></tr><tr><td>PaLM / Roformer (RoPE)</td><td>✓</td><td>×</td></tr><tr><td>T5</td><td>✓</td><td>×</td></tr><tr><td>BLOOM / Alibi</td><td>✓</td><td>✓</td></tr><tr><td>LEX Transformer (Ours)</td><td>✓</td><td>✓✓</td></tr></table>",
"image_path": "360d5aacfeea0a48aabacce38ce5d65a4c8ce7cf260c2f9d90cf294b0e1e99ee.jpg"
}
]
}
],
"index": 0,
"angle": 0,
"type": "table_body"
}
],
"index": 0
},
{
"bbox": [
120,
219,
472,
232
],
"lines": [
{
"bbox": [
120,
219,
472,
232
],
"spans": [
{
"bbox": [
120,
219,
472,
232
],
"type": "text",
"content": "Table 1: Position modeling capabilities of Transformer variants for language modeling."
}
]
}
],
"index": 1,
"angle": 0,
"type": "text"
},
{
"bbox": [
66,
253,
291,
374
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
66,
253,
291,
374
],
"spans": [
{
"bbox": [
66,
253,
291,
374
],
"type": "text",
"content": "deal with any input length. As illustrated before, the length problem is not universal but special for Transformer. Especially, when a Transformer is pre-trained under a maximal length, it is not affordable to re-train for applying to tasks with longer sequences. Finally, when a Transformer satisfies the principles above, we evaluate its performance, which requires thorough experiments and empirical analysis."
}
]
}
],
"index": 2
},
{
"bbox": [
66,
375,
291,
577
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
66,
375,
291,
577
],
"spans": [
{
"bbox": [
66,
375,
291,
577
],
"type": "text",
"content": "Considering all the properties above, we propose Extrapolatable Position Embedding (xPos), which is a universal-good design for Transformers. Based on RoPE's design, we propose attention resolution as a metric to measure position monotonicity. Then, we generalize its mathematical form, where an exponential decay is added to the rotation matrix. xPos preserves the advantage of RoPE, and behaves stably at long-term dependency. Besides, inspired by sparse attention methods (Child et al., 2019; Beltagy et al., 2020; Zaheer et al., 2020; Xiong et al., 2021), we choose blockwise causal attention to increase attention resolution, which improves the performance of length extrapolation for language modeling."
}
]
}
],
"index": 3
},
{
"bbox": [
67,
578,
291,
725
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
67,
578,
291,
725
],
"spans": [
{
"bbox": [
67,
578,
291,
725
],
"type": "text",
"content": "We train different Transformers from scratch. We evaluate models on PG22 and QMSum (Zhong et al., 2021) with various input lengths. On the interpolation experiments, LEX Transformer reaches minimal perplexity. In the extrapolation experiments, our methods can continue decreasing the perplexity while other methods either can't extrapolate (i.e., perplexity increases) when the input length is very long. Figure 1 shows clearly that LEX Transformer has an opposite tendency compared with others."
}
]
}
],
"index": 4
},
{
"bbox": [
79,
727,
274,
740
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
79,
727,
274,
740
],
"spans": [
{
"bbox": [
79,
727,
274,
740
],
"type": "text",
"content": "We summarize our contributions as follows:"
}
]
}
],
"index": 5
},
{
"bbox": [
80,
746,
291,
772
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
80,
746,
291,
772
],
"spans": [
{
"bbox": [
80,
746,
291,
772
],
"type": "text",
"content": "- We summarize the design principles of Transformers for position modeling."
}
]
}
],
"index": 6
},
{
"bbox": [
316,
253,
525,
408
],
"type": "list",
"angle": 0,
"index": 10,
"blocks": [
{
"bbox": [
316,
253,
525,
291
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
316,
253,
525,
291
],
"spans": [
{
"bbox": [
316,
253,
525,
291
],
"type": "text",
"content": "- We define attention resolution to indicate a Transformer's capability on encoding position."
}
]
}
],
"index": 7
},
{
"bbox": [
316,
304,
525,
344
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
316,
304,
525,
344
],
"spans": [
{
"bbox": [
316,
304,
525,
344
],
"type": "text",
"content": "- We propose an extrapolatable position embedding and use blockwise causal attention to improve length extrapolation."
}
]
}
],
"index": 8
},
{
"bbox": [
316,
354,
525,
408
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
316,
354,
525,
408
],
"spans": [
{
"bbox": [
316,
354,
525,
408
],
"type": "text",
"content": "- We conduct experiments on language modeling and show that the proposed LEX Transformer achieves strong performance on both short and long texts."
}
]
}
],
"index": 9
}
],
"sub_type": "text"
},
{
"bbox": [
302,
419,
518,
448
],
"type": "title",
"angle": 0,
"lines": [
{
"bbox": [
302,
419,
518,
448
],
"spans": [
{
"bbox": [
302,
419,
518,
448
],
"type": "text",
"content": "2 Design Principles of Transformers for Position Modeling"
}
]
}
],
"index": 11
},
{
"bbox": [
302,
455,
405,
467
],
"type": "title",
"angle": 0,
"lines": [
{
"bbox": [
302,
455,
405,
467
],
"spans": [
{
"bbox": [
302,
455,
405,
467
],
"type": "text",
"content": "2.1 Order Variance"
}
]
}
],
"index": 12
},
{
"bbox": [
301,
474,
526,
677
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
301,
474,
526,
677
],
"spans": [
{
"bbox": [
301,
474,
526,
677
],
"type": "text",
"content": "A transformer without position information is actually a bag-of-word model. Although bag-of-words models can achieve comparable performance for some tasks (Wang et al., 2020a), position information is essential for sequence modeling. Most of the existing position modeling satisfies this goal (Vaswani et al., 2017; Devlin et al., 2019; Shaw et al., 2018; Wang et al., 2020a; Raffel et al., 2020; Su et al., 2021). With effective position information, Transformer models should be variant with permuting the order (Dufter et al., 2022). Give a permutation function "
},
{
"bbox": [
301,
474,
526,
677
],
"type": "inline_equation",
"content": "P_{\\pi}(X): [x_1, x_2, \\dots, x_n] \\rightarrow [x_{\\pi_1}, x_{\\pi_2}, \\dots, x_{\\pi_n}]"
},
{
"bbox": [
301,
474,
526,
677
],
"type": "text",
"content": ", where "
},
{
"bbox": [
301,
474,
526,
677
],
"type": "inline_equation",
"content": "[\\pi_1, \\pi_2, \\dots, \\pi_n]"
},
{
"bbox": [
301,
474,
526,
677
],
"type": "text",
"content": " is a random order, a Transformer model "
},
{
"bbox": [
301,
474,
526,
677
],
"type": "inline_equation",
"content": "f(input)"
},
{
"bbox": [
301,
474,
526,
677
],
"type": "text",
"content": " should satisfy:"
}
]
}
],
"index": 13
},
{
"bbox": [
358,
677,
525,
692
],
"type": "interline_equation",
"angle": 0,
"lines": [
{
"bbox": [
358,
677,
525,
692
],
"spans": [
{
"bbox": [
358,
677,
525,
692
],
"type": "interline_equation",
"content": "f \\left(P _ {\\pi} (X)\\right) \\neq P _ {\\pi} (f (X)) \\tag {1}",
"image_path": "93f7fa6d7165e736ac79b2fb8085084adfc31e4af55000678288f6c286d8551d.jpg"
}
]
}
],
"index": 14
},
{
"bbox": [
302,
701,
437,
713
],
"type": "title",
"angle": 0,
"lines": [
{
"bbox": [
302,
701,
437,
713
],
"spans": [
{
"bbox": [
302,
701,
437,
713
],
"type": "text",
"content": "2.2 Translation Invariance"
}
]
}
],
"index": 15
},
{
"bbox": [
302,
719,
525,
772
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
302,
719,
525,
772
],
"spans": [
{
"bbox": [
302,
719,
525,
772
],
"type": "text",
"content": "The representation of a sequence should be robust with the translation of its positions. For instance, a sentence's meaning is invariant with padding before or after the whole sentence. Similar"
}
]
}
],
"index": 16
}
],
"discarded_blocks": [
{
"bbox": [
284,
780,
311,
791
],
"type": "page_number",
"angle": 0,
"lines": [
{
"bbox": [
284,
780,
311,
791
],
"spans": [
{
"bbox": [
284,
780,
311,
791
],
"type": "text",
"content": "14591"
}
]
}
],
"index": 17
}
],
"page_size": [
595,
841
],
"page_idx": 1
},
{
"para_blocks": [
{
"bbox": [
67,
71,
291,
139
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
67,
71,
291,
139
],
"spans": [
{
"bbox": [
67,
71,
291,
139
],
"type": "text",
"content": "to (Wang et al., 2020a), we give a general form for translation invariance: given a Transformer model "
},
{
"bbox": [
67,
71,
291,
139
],
"type": "inline_equation",
"content": "f(\\mathrm{input},\\mathrm{mask})"
},
{
"bbox": [
67,
71,
291,
139
],
"type": "text",
"content": ", any input sequence "
},
{
"bbox": [
67,
71,
291,
139
],
"type": "inline_equation",
"content": "X = [x_0,x_1,\\dots,x_n]"
},
{
"bbox": [
67,
71,
291,
139
],
"type": "text",
"content": " with mask "
},
{
"bbox": [
67,
71,
291,
139
],
"type": "inline_equation",
"content": "M = [m_0,m_1,\\dots,m_n]"
},
{
"bbox": [
67,
71,
291,
139
],
"type": "text",
"content": ", the output should be same with the padding ones:"
}
]
}
],
"index": 0
},
{
"bbox": [
117,
155,
222,
169
],
"type": "interline_equation",
"angle": 0,
"lines": [
{
"bbox": [
117,
155,
222,
169
],
"spans": [
{
"bbox": [
117,
155,
222,
169
],
"type": "interline_equation",
"content": "X _ {\\text {p a d}} = [ 0 ] _ {i} \\oplus X \\oplus [ 0 ] _ {j}",
"image_path": "e7ffd988879676176e25a8f7c97f3af74953e9ea77f450fd17ef1d860765957f.jpg"
}
]
}
],
"index": 1
},
{
"bbox": [
117,
171,
290,
185
],
"type": "interline_equation",
"angle": 0,
"lines": [
{
"bbox": [
117,
171,
290,
185
],
"spans": [
{
"bbox": [
117,
171,
290,
185
],
"type": "interline_equation",
"content": "M _ {\\text {p a d}} = [ 0 ] _ {i} \\oplus M \\oplus [ 0 ] _ {j} \\tag {2}",
"image_path": "500a05871d65acf3d909fda8fd43ea0e6c2419b9045d10a038c272ad42fbff80.jpg"
}
]
}
],
"index": 2
},
{
"bbox": [
98,
188,
260,
202
],
"type": "interline_equation",
"angle": 0,
"lines": [
{
"bbox": [
98,
188,
260,
202
],
"spans": [
{
"bbox": [
98,
188,
260,
202
],
"type": "interline_equation",
"content": "f (X, M) = f \\left(X _ {\\text {p a d}}, M _ {\\text {p a d}}\\right) [ i: i + n ]",
"image_path": "13eed3c2da62e464ef89af3a67d4b0452c7b2f9a1ea70f7f550cc97c80b1d93c.jpg"
}
]
}
],
"index": 3
},
{
"bbox": [
67,
218,
291,
367
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
67,
218,
291,
367
],
"spans": [
{
"bbox": [
67,
218,
291,
367
],
"type": "text",
"content": "Relative positions (Shaw et al., 2018; Raffel et al., 2020; Wang et al., 2020a; Su et al., 2021) satisfy this condition, while most of the absolute positions do not (Vaswani et al., 2017; Devlin et al., 2019). Although sinusoidal embedding has a similar property (Vaswani et al., 2017): "
},
{
"bbox": [
67,
218,
291,
367
],
"type": "inline_equation",
"content": "PE_{pos + k}"
},
{
"bbox": [
67,
218,
291,
367
],
"type": "text",
"content": " can be represented as a linear function of "
},
{
"bbox": [
67,
218,
291,
367
],
"type": "inline_equation",
"content": "PE_{pos}"
},
{
"bbox": [
67,
218,
291,
367
],
"type": "text",
"content": ", the addition operation in the initial word embedding messes the attention weight, where the spread form of "
},
{
"bbox": [
67,
218,
291,
367
],
"type": "inline_equation",
"content": "QK^T"
},
{
"bbox": [
67,
218,
291,
367
],
"type": "text",
"content": " has 4 components whose geometric connection with position is unclear."
}
]
}
],
"index": 4
},
{
"bbox": [
68,
383,
197,
396
],
"type": "title",
"angle": 0,
"lines": [
{
"bbox": [
68,
383,
197,
396
],
"spans": [
{
"bbox": [
68,
383,
197,
396
],
"type": "text",
"content": "2.3 Length Extrapolation"
}
]
}
],
"index": 5
},
{
"bbox": [
67,
404,
290,
471
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
67,
404,
290,
471
],
"spans": [
{
"bbox": [
67,
404,
290,
471
],
"type": "text",
"content": "As the cost of pre-training is getting bigger due to the larger model size and corpus, it is infeasible to retrain a model for a longer context. A Transformer model with a suitable design should be capable of dealing with any input length."
}
]
}
],
"index": 6
},
{
"bbox": [
67,
474,
291,
676
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
67,
474,
291,
676
],
"spans": [
{
"bbox": [
67,
474,
291,
676
],
"type": "text",
"content": "First, learnable absolute position embedding (Devlin et al., 2019) is not able to extrapolate because it does not have any pre-defined position knowledge. With the evaluation of perplexity on different lengths (Press et al., 2021), almost every position embedding's performance drops significantly (Vaswani et al., 2017; Raffel et al., 2020; Su et al., 2021). Alibi (Press et al., 2021) solves this problem by adding an exponential decay on the attention matrix, which lower the influence of out-of-distribution position like a soft sliding window. However, the absence of long-term dependency contributes to a performance drop compared with other relative strategies. Table 2 shows that Alibi's perplexity is larger than ROPE by about 0.3."
}
]
}
],
"index": 7
},
{
"bbox": [
67,
678,
291,
772
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
67,
678,
291,
772
],
"spans": [
{
"bbox": [
67,
678,
291,
772
],
"type": "text",
"content": "However, the extrapolation ability needs a systematic design where position embedding is a crucial but not only component. With the proper attention mask, the relative position can deal with long text. The ideal situation is to use the long context in the right way, in that case, the perplexity should decrease as the input length increases."
}
]
}
],
"index": 8
},
{
"bbox": [
302,
70,
521,
84
],
"type": "title",
"angle": 0,
"lines": [
{
"bbox": [
302,
70,
521,
84
],
"spans": [
{
"bbox": [
302,
70,
521,
84
],
"type": "text",
"content": "3 A Length-Extrapolatable Transformer"
}
]
}
],
"index": 9
},
{
"bbox": [
302,
92,
526,
227
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
302,
92,
526,
227
],
"spans": [
{
"bbox": [
302,
92,
526,
227
],
"type": "text",
"content": "We define attention resolution as the indicator of the Transformer's capability on encoding position in Section 3.1. Then we propose two ways to maximize the resolution metric, i.e., improve the length interpolation and extrapolation of Transformers. First, we introduce a relative position encoding method (Section 3.2) to explicitly maximize attention resolution. Second, we propose to use blockwise causal masking (Section 3.3) during extrapolation inference for improved resolution."
}
]
}
],
"index": 10
},
{
"bbox": [
302,
229,
525,
284
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
302,
229,
525,
284
],
"spans": [
{
"bbox": [
302,
229,
525,
284
],
"type": "text",
"content": "In the following section, we denote "
},
{
"bbox": [
302,
229,
525,
284
],
"type": "inline_equation",
"content": "d"
},
{
"bbox": [
302,
229,
525,
284
],
"type": "text",
"content": " as the hidden dimension and "
},
{
"bbox": [
302,
229,
525,
284
],
"type": "inline_equation",
"content": "l"
},
{
"bbox": [
302,
229,
525,
284
],
"type": "text",
"content": " as the input length. For each attention layer, query, key, and value are calculated by input "
},
{
"bbox": [
302,
229,
525,
284
],
"type": "inline_equation",
"content": "x"
},
{
"bbox": [
302,
229,
525,
284
],
"type": "text",
"content": ": "
},
{
"bbox": [
302,
229,
525,
284
],
"type": "inline_equation",
"content": "q = W_{Q}x"
},
{
"bbox": [
302,
229,
525,
284
],
"type": "text",
"content": ", "
},
{
"bbox": [
302,
229,
525,
284
],
"type": "inline_equation",
"content": "k = W_{K}x"
},
{
"bbox": [
302,
229,
525,
284
],
"type": "text",
"content": ", "
},
{
"bbox": [
302,
229,
525,
284
],
"type": "inline_equation",
"content": "v = W_{V}x"
},
{
"bbox": [
302,
229,
525,
284
],
"type": "text",
"content": "."
}
]
}
],
"index": 11
},
{
"bbox": [
302,
294,
428,
305
],
"type": "title",
"angle": 0,
"lines": [
{
"bbox": [
302,
294,
428,
305
],
"spans": [
{
"bbox": [
302,
294,
428,
305
],
"type": "text",
"content": "3.1 Attention Resolution"
}
]
}
],
"index": 12
},
{
"bbox": [
302,
312,
525,
378
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
302,
312,
525,
378
],
"spans": [
{
"bbox": [
302,
312,
525,
378
],
"type": "text",
"content": "The monotonicity of attention scores is essential to represent distance in language models. In an attention layer of the vanilla Transformer, we measure the attention score expectation as "
},
{
"bbox": [
302,
312,
525,
378
],
"type": "inline_equation",
"content": "s[n]"
},
{
"bbox": [
302,
312,
525,
378
],
"type": "text",
"content": " when the distance of two tokens is "
},
{
"bbox": [
302,
312,
525,
378
],
"type": "inline_equation",
"content": "n"
},
{
"bbox": [
302,
312,
525,
378
],
"type": "text",
"content": ":"
}
]
}
],
"index": 13
},
{
"bbox": [
360,
387,
525,
417
],
"type": "interline_equation",
"angle": 0,
"lines": [
{
"bbox": [
360,
387,
525,
417
],
"spans": [
{
"bbox": [
360,
387,
525,
417
],
"type": "interline_equation",
"content": "s [ n ] = \\underset {0 \\leq i \\leq N} {\\mathbb {E}} \\left(\\frac {q _ {i + n} k _ {i} ^ {T}}{\\sqrt {d}}\\right) \\tag {3}",
"image_path": "46da24832985b4c12eefd887927ca3a1182e1401401d8e34564c6a5740552d34.jpg"
}
]
}
],
"index": 14
},
{
"bbox": [
302,
428,
525,
455
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
302,
428,
525,
455
],
"spans": [
{
"bbox": [
302,
428,
525,
455
],
"type": "text",
"content": "We define attention resolution "
},
{
"bbox": [
302,
428,
525,
455
],
"type": "inline_equation",
"content": "R(s)"
},
{
"bbox": [
302,
428,
525,
455
],
"type": "text",
"content": " as a metric to evaluate attention's ability to recognize position:"
}
]
}
],
"index": 15
},
{
"bbox": [
342,
467,
525,
502
],
"type": "interline_equation",
"angle": 0,
"lines": [
{
"bbox": [
342,
467,
525,
502
],
"spans": [
{
"bbox": [
342,
467,
525,
502
],
"type": "interline_equation",
"content": "R (s) = \\sum_ {i = 0} ^ {N} \\frac {e ^ {s [ i ]} \\left(e ^ {s [ i ]} - e ^ {s [ i + 1 ]}\\right)}{\\left(\\sum_ {i = 0} ^ {N} e ^ {s [ i ]}\\right) ^ {2}} \\tag {4}",
"image_path": "e52b9736b3c8e9e3be1dd9f11e849a3decf59dccc811eb27f7f12655b8fa9bb4.jpg"
}
]
}
],
"index": 16
},
{
"bbox": [
302,
513,
525,
596
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
302,
513,
525,
596
],
"spans": [
{
"bbox": [
302,
513,
525,
596
],
"type": "text",
"content": "First, "
},
{
"bbox": [
302,
513,
525,
596
],
"type": "inline_equation",
"content": "s[i] > s[i + 1]"
},
{
"bbox": [
302,
513,
525,
596
],
"type": "text",
"content": " is preferred to ensure monotonicity. Besides, we implement softmax operation on "
},
{
"bbox": [
302,
513,
525,
596
],
"type": "inline_equation",
"content": "s[n]"
},
{
"bbox": [
302,
513,
525,
596
],
"type": "text",
"content": " to simulate the attention probability. To mitigate the influence of long-tail distribution, the factor "
},
{
"bbox": [
302,
513,
525,
596
],
"type": "inline_equation",
"content": "e^{s[i]}"
},
{
"bbox": [
302,
513,
525,
596
],
"type": "text",
"content": " is multiplied. We can estimate "
},
{
"bbox": [
302,
513,
525,
596
],
"type": "inline_equation",
"content": "s[n]"
},
{
"bbox": [
302,
513,
525,
596
],
"type": "text",
"content": " and "
},
{
"bbox": [
302,
513,
525,
596
],
"type": "inline_equation",
"content": "R(s)"
},
{
"bbox": [
302,
513,
525,
596
],
"type": "text",
"content": " quantitatively when we design Transformers."
}
]
}
],
"index": 17
},
{
"bbox": [
302,
605,
524,
619
],
"type": "title",
"angle": 0,
"lines": [
{
"bbox": [
302,
605,
524,
619
],
"spans": [
{
"bbox": [
302,
605,
524,
619
],
"type": "text",
"content": "3.2 Improve Resolution by Position Encoding"
}
]
}
],
"index": 18
},
{
"bbox": [
302,
624,
525,
704
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
302,
624,
525,
704
],
"spans": [
{
"bbox": [
302,
624,
525,
704
],
"type": "text",
"content": "Su et al. (2021) propose that by adding absolute position embedding on query and key, the attention matrix is actually encoded with relative position information. ROPE shows a strong performance in interpolation tasks, but its "
},
{
"bbox": [
302,
624,
525,
704
],
"type": "inline_equation",
"content": "s[n]"
},
{
"bbox": [
302,
624,
525,
704
],
"type": "text",
"content": " oscillates dramatically in Figure 2, which harms the resolution."
}
]
}
],
"index": 19
},
{
"bbox": [
302,
706,
525,
772
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
302,
706,
525,
772
],
"spans": [
{
"bbox": [
302,
706,
525,
772
],
"type": "text",
"content": "We use a similar but generalized strategy to improve resolution. First, a pseudo inner product is defined as "
},
{
"bbox": [
302,
706,
525,
772
],
"type": "inline_equation",
"content": "\\langle x,y\\rangle = \\sum Re(x_i\\cdot y_i^*)"
},
{
"bbox": [
302,
706,
525,
772
],
"type": "text",
"content": " , which is consistent with the exact inner product's definition when we map "
},
{
"bbox": [
302,
706,
525,
772
],
"type": "inline_equation",
"content": "\\mathbb{C}^{d / 2}\\to \\mathbb{R}^d"
},
{
"bbox": [
302,
706,
525,
772
],
"type": "text",
"content": " . Before calculating attention,"
}
]
}
],
"index": 20
}
],
"discarded_blocks": [
{
"bbox": [
284,
780,
312,
791
],
"type": "page_number",
"angle": 0,
"lines": [
{
"bbox": [
284,
780,
312,
791
],
"spans": [
{
"bbox": [
284,
780,
312,
791
],
"type": "text",
"content": "14592"
}
]
}
],
"index": 21
}
],
"page_size": [
595,
841
],
"page_idx": 2
},
{
"para_blocks": [
{
"bbox": [
67,
71,
291,
111
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
67,
71,
291,
111
],
"spans": [
{
"bbox": [
67,
71,
291,
111
],
"type": "text",
"content": "the query and key are encoded with position information. Generally, the attention function is as follows:"
}
]
}
],
"index": 0
},
{
"bbox": [
119,
116,
238,
143
],
"type": "interline_equation",
"angle": 0,
"lines": [
{
"bbox": [
119,
116,
238,
143
],
"spans": [
{
"bbox": [
119,
116,
238,
143
],
"type": "interline_equation",
"content": "a _ {i j} = \\frac {\\langle f _ {q} (q _ {i} , i) , f _ {k} (k _ {j} , j) \\rangle}{\\sqrt {d}}",
"image_path": "0b830acadec9cb5927dd8c98f3476271e2213fa6118e467f68aafd18459c9e2f.jpg"
}
]
}
],
"index": 1
},
{
"bbox": [
123,
146,
289,
183
],
"type": "interline_equation",
"angle": 0,
"lines": [
{
"bbox": [
123,
146,
289,
183
],
"spans": [
{
"bbox": [
123,
146,
289,
183
],
"type": "interline_equation",
"content": "o _ {i} = \\sum_ {j = 0} ^ {i} \\frac {e ^ {a _ {i j}}}{\\sum_ {j = 0} ^ {i} e ^ {a _ {i j}}} v _ {j} \\tag {5}",
"image_path": "be4fa30bda1a7be618777f0c95d40b57f4d3f53ecd4437a02f09f26de792db80.jpg"
}
]
}
],
"index": 2
},
{
"bbox": [
78,
190,
241,
203
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
78,
190,
241,
203
],
"spans": [
{
"bbox": [
78,
190,
241,
203
],
"type": "text",
"content": "Formally, the encoding must satisfy:"
}
]
}
],
"index": 3
},
{
"bbox": [
74,
211,
290,
227
],
"type": "interline_equation",
"angle": 0,
"lines": [
{
"bbox": [
74,
211,
290,
227
],
"spans": [
{
"bbox": [
74,
211,
290,
227
],
"type": "interline_equation",
"content": "\\left\\langle f _ {q} (q, n + r), f _ {k} (k, n) \\right\\rangle = \\left\\langle f _ {q} (q, r), f _ {k} (k, 0) \\right\\rangle \\tag {6}",
"image_path": "3b1c3dbb437aac6f0738412cd5c8976f15aff72f8ca8092c4a73d9d7536165d7.jpg"
}
]
}
],
"index": 4
},
{
"bbox": [
79,
233,
220,
246
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
79,
233,
220,
246
],
"spans": [
{
"bbox": [
79,
233,
220,
246
],
"type": "text",
"content": "A simple solution is as follows:"
}
]
}
],
"index": 5
},
{
"bbox": [
129,
253,
216,
268
],
"type": "interline_equation",
"angle": 0,
"lines": [
{
"bbox": [
129,
253,
216,
268
],
"spans": [
{
"bbox": [
129,
253,
216,
268
],
"type": "interline_equation",
"content": "f _ {q} (q, n) = A _ {q} q e ^ {\\lambda n}",
"image_path": "c5f970c2763e3e0d79bb7923830ce6dacce14d095d209ff63c026b7eb6c3598f.jpg"
}
]
}
],
"index": 6
},
{
"bbox": [
129,
267,
289,
286
],
"type": "interline_equation",
"angle": 0,
"lines": [
{
"bbox": [
129,
267,
289,
286
],
"spans": [
{
"bbox": [
129,
267,
289,
286
],
"type": "interline_equation",
"content": "f _ {k} (k, n) = A _ {k} k e ^ {- \\lambda^ {*} n} \\tag {7}",
"image_path": "e41e87461a728780e24d2fa8b2bd95f661ad50a8c07362708fb1b9962e4c8e20.jpg"
}
]
}
],
"index": 7
},
{
"bbox": [
67,
294,
291,
348
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
67,
294,
291,
348
],
"spans": [
{
"bbox": [
67,
294,
291,
348
],
"type": "text",
"content": "The scaling factor "
},
{
"bbox": [
67,
294,
291,
348
],
"type": "inline_equation",
"content": "A_{q}, A_{k}"
},
{
"bbox": [
67,
294,
291,
348
],
"type": "text",
"content": " is unnecessary because "
},
{
"bbox": [
67,
294,
291,
348
],
"type": "inline_equation",
"content": "q, k"
},
{
"bbox": [
67,
294,
291,
348
],
"type": "text",
"content": " is obtained by a linear transformation. Since "
},
{
"bbox": [
67,
294,
291,
348
],
"type": "inline_equation",
"content": "\\lambda \\in \\mathbb{C}^{d/2}"
},
{
"bbox": [
67,
294,
291,
348
],
"type": "text",
"content": ", it can be represented as "
},
{
"bbox": [
67,
294,
291,
348
],
"type": "inline_equation",
"content": "\\lambda = \\xi + i\\theta"
},
{
"bbox": [
67,
294,
291,
348
],
"type": "text",
"content": " where "
},
{
"bbox": [
67,
294,
291,
348
],
"type": "inline_equation",
"content": "\\xi, \\theta \\in \\mathbb{R}^{d/2}"
},
{
"bbox": [
67,
294,
291,
348
],
"type": "text",
"content": ":"
}
]
}
],
"index": 8
},
{
"bbox": [
129,
354,
221,
370
],
"type": "interline_equation",
"angle": 0,
"lines": [
{
"bbox": [
129,
354,
221,
370
],
"spans": [
{
"bbox": [
129,
354,
221,
370
],
"type": "interline_equation",
"content": "f _ {q} (q, n) = q e ^ {\\xi n + i \\theta n}",
"image_path": "ca8c558e290c1a0a82e3ed196b36a46ce76942fd7372603c0e0cb5292482a031.jpg"
}
]
}
],
"index": 9
},
{
"bbox": [
129,
366,
289,
387
],
"type": "interline_equation",
"angle": 0,
"lines": [
{
"bbox": [
129,
366,
289,
387
],
"spans": [
{
"bbox": [
129,
366,
289,
387
],
"type": "interline_equation",
"content": "f _ {k} (k, n) = k e ^ {- \\xi n + i \\theta n} \\tag {8}",
"image_path": "e5e9bedcebd364b79413fbac3f7e6b287d3efcb0b8b3f436e1f54d469e6f602c.jpg"
}
]
}
],
"index": 10
},
{
"bbox": [
67,
395,
291,
584
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
67,
395,
291,
584
],
"spans": [
{
"bbox": [
67,
395,
291,
584
],
"type": "text",
"content": "If "
},
{
"bbox": [
67,
395,
291,
584
],
"type": "inline_equation",
"content": "\\xi = 0"
},
{
"bbox": [
67,
395,
291,
584
],
"type": "text",
"content": ", the form is the same as RoPE (Su et al., 2021). Geometrically, the transformation provides a rotation on vectors. If the relative angle between "
},
{
"bbox": [
67,
395,
291,
584
],
"type": "inline_equation",
"content": "q"
},
{
"bbox": [
67,
395,
291,
584
],
"type": "text",
"content": " and "
},
{
"bbox": [
67,
395,
291,
584
],
"type": "inline_equation",
"content": "k"
},
{
"bbox": [
67,
395,
291,
584
],
"type": "text",
"content": " is larger, the inner product is smaller. However, the cosine function is not monotonic if the rotating angle is large than "
},
{
"bbox": [
67,
395,
291,
584
],
"type": "inline_equation",
"content": "\\pi"
},
{
"bbox": [
67,
395,
291,
584
],
"type": "text",
"content": ", which causes an unstable phenomenon in that the expectation of the inner product oscillates dramatically with the growth of relative distance. Following the parameters (Vaswani et al., 2017; Su et al., 2021) "
},
{
"bbox": [
67,
395,
291,
584
],
"type": "inline_equation",
"content": "\\theta = \\{\\theta_{i} = 10000^{-2i / d}, i \\in [0,1,\\dots,d / 2]\\}"
},
{
"bbox": [
67,
395,
291,
584
],
"type": "text",
"content": ", we will calculate the expectation as follows. For generative models, we assume "
},
{
"bbox": [
67,
395,
291,
584
],
"type": "inline_equation",
"content": "\\mathbb{E}(\\angle q) \\leq \\mathbb{E}(\\angle k)"
},
{
"bbox": [
67,
395,
291,
584
],
"type": "text",
"content": " to ensure the monotonicity:"
}
]
}
],
"index": 11
},
{
"bbox": [
85,
591,
289,
726
],
"type": "interline_equation",
"angle": 0,
"lines": [
{
"bbox": [
85,
591,
289,
726
],
"spans": [
{
"bbox": [
85,
591,
289,
726
],
"type": "interline_equation",
"content": "\\begin{array}{l} \\mathbb {E} \\left[ \\left\\langle q e ^ {m \\xi + i m \\theta}, k e ^ {- n \\xi + i n \\theta} \\right\\rangle \\right] \\\\ = \\sum_ {x = 0} ^ {d / 2} \\mathbb {E} \\left[ R e \\left(\\boldsymbol {q} _ {x} \\boldsymbol {k} _ {x} e ^ {(m - n) \\xi_ {x} + i (m - n) \\theta_ {x}}\\right) \\right] \\\\ \\leq \\sum_ {x = 0} ^ {d / 2} R e \\left(\\mathbb {E} \\left[ \\left| \\boldsymbol {q} _ {x} \\boldsymbol {k} _ {x} \\right| \\right] e ^ {(m - n) \\xi_ {x} + i (m - n) \\theta_ {x}}\\right) \\tag {9} \\\\ \\propto \\sum_ {x = 0} ^ {d / 2} \\cos (m - n) \\theta_ {x} e ^ {(m - n) \\xi_ {x}} \\\\ \\end{array}",
"image_path": "ac79ba29736cc068a51c84c624533ff34d9656036bdc3738f719bd6b132273bc.jpg"
}
]
}
],
"index": 12
},
{
"bbox": [
67,
732,
291,
773
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
67,
732,
291,
773
],
"spans": [
{
"bbox": [
67,
732,
291,
773
],
"type": "text",
"content": "The inference here is different from (Su et al., 2021) because of two reasons: 1) there is an additional assumption brought by generative language"
}
]
}
],
"index": 13
},
{
"bbox": [
302,
71,
525,
125
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
302,
71,
525,
125
],
"spans": [
{
"bbox": [
302,
71,
525,
125
],
"type": "text",
"content": "models where "
},
{
"bbox": [
302,
71,
525,
125
],
"type": "inline_equation",
"content": "\\mathbb{E}(\\angle q) \\leq \\mathbb{E}(\\angle k)"
},
{
"bbox": [
302,
71,
525,
125
],
"type": "text",
"content": "; 2) the inequality scaling of (Su et al., 2021) is too strong to lose generality. We calculate expectation instead of the upper bound."
}
]
}
],
"index": 14
},
{
"bbox": [
302,
126,
525,
153
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
302,
126,
525,
153
],
"spans": [
{
"bbox": [
302,
126,
525,
153
],
"type": "text",
"content": "Now we define a function to represent the property of relative position:"
}
]
}
],
"index": 15
},
{
"bbox": [
363,
165,
525,
202
],
"type": "interline_equation",
"angle": 0,
"lines": [
{
"bbox": [
363,
165,
525,
202
],
"spans": [
{
"bbox": [
363,
165,
525,
202
],
"type": "interline_equation",
"content": "g _ {\\zeta} [ n ] = \\sum_ {i = 0} ^ {d / 2} \\cos n \\theta_ {i} \\zeta_ {i} ^ {n} \\tag {10}",
"image_path": "cf8aa45eb3b502262265bb6eac5a651cfe13e0358a9d698ae93c48fb7df41d7f.jpg"
}
]
}
],
"index": 16
},
{
"bbox": [
302,
216,
525,
297
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
302,
216,
525,
297
],
"spans": [
{
"bbox": [
302,
216,
525,
297
],
"type": "inline_equation",
"content": "g[n]"
},
{
"bbox": [
302,
216,
525,
297
],
"type": "text",
"content": " simplifies Equation 9 by defining "
},
{
"bbox": [
302,
216,
525,
297
],
"type": "inline_equation",
"content": "\\zeta_{i} = e^{\\xi_{i}}"
},
{
"bbox": [
302,
216,
525,
297
],
"type": "text",
"content": ". Stabilizing the "
},
{
"bbox": [
302,
216,
525,
297
],
"type": "inline_equation",
"content": "g[n]"
},
{
"bbox": [
302,
216,
525,
297
],
"type": "text",
"content": " curve is intuitive. Although attention bias can achieve this goal, we try to avoid additional position calculations. Instead, we can accomplish this goal using a good "
},
{
"bbox": [
302,
216,
525,
297
],
"type": "inline_equation",
"content": "\\zeta"
},
{
"bbox": [
302,
216,
525,
297
],
"type": "text",
"content": " to maximize "
},
{
"bbox": [
302,
216,
525,
297
],
"type": "inline_equation",
"content": "R(g_{\\zeta})"
},
{
"bbox": [
302,
216,
525,
297
],
"type": "text",
"content": "."
}
]
}
],
"index": 17
},
{
"bbox": [
302,
298,
524,
325
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
302,
298,
524,
325
],
"spans": [
{
"bbox": [
302,
298,
524,
325
],
"type": "text",
"content": "Obviously, the oscillation mainly comes from large "
},
{
"bbox": [
302,
298,
524,
325
],
"type": "inline_equation",
"content": "\\theta_{i}"
},
{
"bbox": [
302,
298,
524,
325
],
"type": "text",
"content": ". Manually setting "
},
{
"bbox": [
302,
298,
524,
325
],
"type": "inline_equation",
"content": "\\zeta"
},
{
"bbox": [
302,
298,
524,
325
],
"type": "text",
"content": " can achieve this goal:"
}
]
}
],
"index": 18
},
{
"bbox": [
355,
336,
525,
364
],
"type": "interline_equation",
"angle": 0,
"lines": [
{
"bbox": [
355,
336,
525,
364
],
"spans": [
{
"bbox": [
355,
336,
525,
364
],
"type": "interline_equation",
"content": "\\widetilde {\\zeta} _ {i} = \\frac {i / (d / 2) + \\gamma}{1 + \\gamma} \\in [ 0, 1 ] \\tag {11}",
"image_path": "36d5d62cfd6a5b0f10d05d6f426989532180ad189aad6040b15ba669374fdcd6.jpg"
}
]
}
],
"index": 19
},
{
"bbox": [
302,
377,
525,
417
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
302,
377,
525,
417
],
"spans": [
{
"bbox": [
302,
377,
525,
417
],
"type": "text",
"content": "where "
},
{
"bbox": [
302,
377,
525,
417
],
"type": "inline_equation",
"content": "\\widetilde{\\zeta}_i"
},
{
"bbox": [
302,
377,
525,
417
],
"type": "text",
"content": " becomes smaller when "
},
{
"bbox": [
302,
377,
525,
417
],
"type": "inline_equation",
"content": "\\theta_{i}"
},
{
"bbox": [
302,
377,
525,
417
],
"type": "text",
"content": " is larger. In this way, we punish the oscillation of unstable dimensions and keep the distribution of stable ones."
}
]
}
],
"index": 20
},
{
"bbox": [
302,
420,
525,
608
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
302,
420,
525,
608
],
"spans": [
{
"bbox": [
302,
420,
525,
608
],
"type": "text",
"content": "Numerical optimization methods are tried to find optimal values for "
},
{
"bbox": [
302,
420,
525,
608
],
"type": "inline_equation",
"content": "\\zeta"
},
{
"bbox": [
302,
420,
525,
608
],
"type": "text",
"content": ". However, the results rely on the initial value and lack control when the hidden dimension changes. Besides, the numerical precision should be considered because of fp16's range. Finally, we find a sub-optimal solution by manually setting "
},
{
"bbox": [
302,
420,
525,
608
],
"type": "inline_equation",
"content": "\\gamma"
},
{
"bbox": [
302,
420,
525,
608
],
"type": "text",
"content": " to both satisfy the resolution is recognizable "
},
{
"bbox": [
302,
420,
525,
608
],
"type": "inline_equation",
"content": "(R(g_{\\zeta})"
},
{
"bbox": [
302,
420,
525,
608
],
"type": "text",
"content": " is partially optimized) and "
},
{
"bbox": [
302,
420,
525,
608
],
"type": "inline_equation",
"content": "\\zeta_i^n"
},
{
"bbox": [
302,
420,
525,
608
],
"type": "text",
"content": " can be represented by fp16 when "
},
{
"bbox": [
302,
420,
525,
608
],
"type": "inline_equation",
"content": "n"
},
{
"bbox": [
302,
420,
525,
608
],
"type": "text",
"content": " is big (8192 in our setting). Besides, in implementation, the position is re-scaled with base "
},
{
"bbox": [
302,
420,
525,
608
],
"type": "inline_equation",
"content": "B"
},
{
"bbox": [
302,
420,
525,
608
],
"type": "text",
"content": " in the exponential calculation to avoid overflow and underflow ("
},
{
"bbox": [
302,
420,
525,
608
],
"type": "inline_equation",
"content": "e^{\\xi n} \\to e^{\\xi n / B}"
},
{
"bbox": [
302,
420,
525,
608
],
"type": "text",
"content": " in Equation (8)). We use "
},
{
"bbox": [
302,
420,
525,
608
],
"type": "inline_equation",
"content": "\\gamma = 0.4"
},
{
"bbox": [
302,
420,
525,
608
],
"type": "text",
"content": " and "
},
{
"bbox": [
302,
420,
525,
608
],
"type": "inline_equation",
"content": "B = 512"
},
{
"bbox": [
302,
420,
525,
608
],
"type": "text",
"content": " as the final implementation in LEX Transformer."
}
]
}
],
"index": 21
},
{
"bbox": [
302,
610,
526,
758
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
302,
610,
526,
758
],
"spans": [
{
"bbox": [
302,
610,
526,
758
],
"type": "text",
"content": "The curves of "
},
{
"bbox": [
302,
610,
526,
758
],
"type": "inline_equation",
"content": "\\zeta = 1, \\hat{\\zeta}"
},
{
"bbox": [
302,
610,
526,
758
],
"type": "text",
"content": " are shown in Figure 2. The default rotary embedding contributes to a dramatic oscillation, especially in the large relative distance, which causes bad extrapolation performance and restricts the model's convergence speed. After adding a decay, the curve is almost stable, especially on long-term dependency. What's more, it does not hurt pure rotation's fitting ability because "
},
{
"bbox": [
302,
610,
526,
758
],
"type": "inline_equation",
"content": "\\zeta_i^n \\approx 1"
},
{
"bbox": [
302,
610,
526,
758
],
"type": "text",
"content": " when "
},
{
"bbox": [
302,
610,
526,
758
],
"type": "inline_equation",
"content": "i"
},
{
"bbox": [
302,
610,
526,
758
],
"type": "text",
"content": " is large or "
},
{
"bbox": [
302,
610,
526,
758
],
"type": "inline_equation",
"content": "n"
},
{
"bbox": [
302,
610,
526,
758
],
"type": "text",
"content": " is small. In that way, short-term and long-term dependencies are divided continuously."
}
]
}
],
"index": 22
},
{
"bbox": [
314,
760,
525,
772
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
314,
760,
525,
772
],
"spans": [
{
"bbox": [
314,
760,
525,
772
],
"type": "text",
"content": "Finally, we have Extrapolatable Position Embed"
}
]
}
],
"index": 23
}
],
"discarded_blocks": [
{
"bbox": [
284,
780,
312,
791
],
"type": "page_number",
"angle": 0,
"lines": [
{
"bbox": [
284,
780,
312,
791
],
"spans": [
{
"bbox": [
284,
780,
312,
791
],
"type": "text",
"content": "14593"
}
]
}
],
"index": 24
}
],
"page_size": [
595,
841
],
"page_idx": 3
},
{
"para_blocks": [
{
"type": "image",
"bbox": [
70,
71,
290,
237
],
"blocks": [
{
"bbox": [
70,
71,
290,
237
],
"lines": [
{
"bbox": [
70,
71,
290,
237
],
"spans": [
{
"bbox": [
70,
71,
290,
237
],
"type": "image",
"image_path": "6053c95e9ca5d5bbbd5379ba47b6bb6051a2f57ed55d955fda2c794dabc8847a.jpg"
}
]
}
],
"index": 0,
"angle": 0,
"type": "image_body"
},
{
"bbox": [
67,
248,
291,
297
],
"lines": [
{
"bbox": [
67,
248,
291,
297
],
"spans": [
{
"bbox": [
67,
248,
291,
297
],
"type": "text",
"content": "Figure 2: The long dependency curve of attention expectation. ROPE's dramatic oscillation confuses the attention resolution at long distances. In contrast, xPos provides stable and accurate position modeling."
}
]
}
],
"index": 1,
"angle": 0,
"type": "image_caption"
}
],
"index": 0
},
{
"type": "code",
"bbox": [
77,
327,
289,
505
],
"blocks": [
{
"bbox": [
74,
312,
232,
324
],
"lines": [
{
"bbox": [
74,
312,
232,
324
],
"spans": [
{
"bbox": [
74,
312,
232,
324
],
"type": "text",
"content": "Algorithm 1: Attention with xPOS"
}
]
}
],
"index": 2,
"angle": 0,
"type": "code_caption"
},
{
"bbox": [
77,
327,
289,
505
],
"lines": [
{
"bbox": [
77,
327,
289,
505
],
"spans": [
{
"bbox": [
77,
327,
289,
505
],
"type": "text",
"content": "def rot(x): return "
},
{
"bbox": [
77,
327,
289,
505
],
"type": "inline_equation",
"content": "[-x_{1},x_{0}, - x_{3},x_{2},\\dots ]"
},
{
"bbox": [
77,
327,
289,
505
],
"type": "text",
"content": " \nInitialization: \n"
},
{
"bbox": [
77,
327,
289,
505
],
"type": "inline_equation",
"content": "\\theta_{i} = 1 / 10000^{2\\lfloor i / 2\\rfloor /d}"
},
{
"bbox": [
77,
327,
289,
505
],
"type": "inline_equation",
"content": "\\theta \\in \\mathbb{R}^d"
},
{
"bbox": [
77,
327,
289,
505
],
"type": "inline_equation",
"content": "\\hat{\\zeta}_i = (2\\lfloor i / 2\\rfloor /d + \\gamma) / (1 + \\gamma)"
},
{
"bbox": [
77,
327,
289,
505
],
"type": "inline_equation",
"content": "\\hat{\\zeta}\\in \\mathbb{R}^{d}"
},
{
"bbox": [
77,
327,
289,
505
],
"type": "text",
"content": " \nInput: "
},
{
"bbox": [
77,
327,
289,
505
],
"type": "inline_equation",
"content": "Q,K,V\\in \\mathbb{R}^{h\\times l\\times d}"
},
{
"bbox": [
77,
327,
289,
505
],
"type": "inline_equation",
"content": "M\\in \\mathbb{R}^{d\\times d}"
},
{
"bbox": [
77,
327,
289,
505
],
"type": "inline_equation",
"content": "C_{mn} = \\cos m\\theta_n,C\\in \\mathbb{R}^{l\\times d}"
},
{
"bbox": [
77,
327,
289,
505
],
"type": "inline_equation",
"content": "S_{mn} = \\sin m\\theta_n,S\\in \\mathbb{R}^{l\\times d}"
},
{
"bbox": [
77,
327,
289,
505
],
"type": "inline_equation",
"content": "T_{mn} = \\hat{\\zeta}_n^m,T\\in \\mathbb{R}^{l\\times d}"
},
{
"bbox": [
77,
327,
289,
505
],
"type": "inline_equation",
"content": "Q = Q\\odot (C\\odot T) + \\mathrm{rot}(Q)\\odot (S\\odot T)"
},
{
"bbox": [
77,
327,
289,
505
],
"type": "inline_equation",
"content": "K = K\\odot (C\\odot T^{-1}) + \\mathrm{rot}(K)\\odot (S\\odot T^{-1})"
},
{
"bbox": [
77,
327,
289,
505
],
"type": "text",
"content": " \noutput "
},
{
"bbox": [
77,
327,
289,
505
],
"type": "inline_equation",
"content": "="
},
{
"bbox": [
77,
327,
289,
505
],
"type": "text",
"content": " softmax( "
},
{
"bbox": [
77,
327,
289,
505
],
"type": "inline_equation",
"content": "\\frac{QK^T}{\\sqrt{d}}\\cdot M)V"
},
{
"bbox": [
77,
327,
289,
505
],
"type": "text",
"content": " \nreturn output"
}
]
}
],
"index": 3,
"angle": 0,
"type": "code_body"
}
],
"index": 3,
"sub_type": "algorithm"
},
{
"bbox": [
67,
528,
129,
541
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
67,
528,
129,
541
],
"spans": [
{
"bbox": [
67,
528,
129,
541
],
"type": "text",
"content": "ding (xPos):"
}
]
}
],
"index": 4
},
{
"bbox": [
67,
550,
291,
704
],
"type": "interline_equation",
"angle": 0,
"lines": [
{
"bbox": [
67,
550,
291,
704
],
"spans": [
{
"bbox": [
67,
550,
291,
704
],
"type": "interline_equation",
"content": "\\begin{array}{l} f _ {q} (q, n) = \\left( \\begin{array}{c} q _ {1} \\cos n \\theta_ {1} \\hat {\\zeta} _ {1} ^ {n / B} - q _ {2} \\sin n \\theta_ {1} \\hat {\\zeta} _ {1} ^ {n / B} \\\\ q _ {2} \\cos n \\theta_ {1} \\hat {\\zeta} _ {1} ^ {n / B} + q _ {1} \\sin n \\theta_ {1} \\hat {\\zeta} _ {1} ^ {n / B} \\\\ \\vdots \\\\ q _ {n - 1} \\cos n \\theta_ {d / 2} \\hat {\\zeta} _ {d / 2} ^ {n / B} - q _ {n} \\sin n \\theta_ {d / 2} \\hat {\\zeta} _ {d / 2} ^ {n / B} \\\\ q _ {n} \\cos n \\theta_ {d / 2} \\hat {\\zeta} _ {d / 2} ^ {n / B} + q _ {n - 1} \\sin n \\theta_ {d / 2} \\hat {\\zeta} _ {d / 2} ^ {n / B} \\end{array} \\right) \\\\ f _ {k} (k, n) = \\left( \\begin{array}{c} k _ {1} \\cos n \\theta_ {1} \\hat {\\zeta} _ {1} ^ {- n / B} - k _ {2} \\sin n \\theta_ {1} \\hat {\\zeta} _ {1} ^ {- n / B} \\\\ k _ {2} \\cos n \\theta_ {1} \\hat {\\zeta} _ {1} ^ {- n / B} + k _ {1} \\sin n \\theta_ {1} \\hat {\\zeta} _ {1} ^ {- n / B} \\\\ \\vdots \\\\ k _ {n - 1} \\cos n \\theta_ {d / 2} \\hat {\\zeta} _ {d / 2} ^ {- n / B} - k _ {n} \\sin n \\theta_ {d / 2} \\hat {\\zeta} _ {d / 2} ^ {- n / B} \\\\ k _ {n} \\cos n \\theta_ {d / 2} \\hat {\\zeta} _ {d / 2} ^ {- n / B} + k _ {n - 1} \\sin n \\theta_ {d / 2} \\hat {\\zeta} _ {d / 2} ^ {- n / B} \\end{array} \\right) \\tag {12} \\\\ \\end{array}",
"image_path": "f0780ce2fbd527107caf0a9621b63fc83139914c0ce0830f16cd1ec01296463c.jpg"
}
]
}
],
"index": 5
},
{
"bbox": [
67,
706,
291,
772
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
67,
706,
291,
772
],
"spans": [
{
"bbox": [
67,
706,
291,
772
],
"type": "text",
"content": "In the implementation, the transformation for key and value can be easily calculated by parallel addition and multiplication as shown in Algorithm 1. Since position embedding's size "
},
{
"bbox": [
67,
706,
291,
772
],
"type": "inline_equation",
"content": "C, S, T \\in \\mathbb{R}^{l \\times d}"
},
{
"bbox": [
67,
706,
291,
772
],
"type": "text",
"content": " is much smaller than batched multi-head at"
}
]
}
],
"index": 6
},
{
"type": "image",
"bbox": [
305,
67,
524,
211
],
"blocks": [
{
"bbox": [
305,
67,
524,
211
],
"lines": [
{
"bbox": [
305,
67,
524,
211
],
"spans": [
{
"bbox": [
305,
67,
524,
211
],
"type": "image",
"image_path": "849908a883f6156c28f2d331a8b5aaf2ebebb562ecfa20b85f127f2b74cc6cf1.jpg"
}
]
}
],
"index": 7,
"angle": 0,
"type": "image_body"
},
{
"bbox": [
302,
220,
525,
280
],
"lines": [
{
"bbox": [
302,
220,
525,
280
],
"spans": [
{
"bbox": [
302,
220,
525,
280
],
"type": "text",
"content": "Figure 3: Our language model is trained on shorter texts in the same way as vanilla Transformers, i.e., using causal masking. During inference, we use blockwise causal attention for longer sequences, which recurrently reuses the overlapped parts (i.e., key and value vectors)."
}
]
}
],
"index": 8,
"angle": 0,
"type": "image_caption"
}
],
"index": 7
},
{
"bbox": [
302,
302,
524,
342
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
302,
302,
524,
342
],
"spans": [
{
"bbox": [
302,
302,
524,
342
],
"type": "text",
"content": "tention matrix and doesn't require gradients, the cost is almost the same with ROPE and bigger than Absolute Position with "
},
{
"bbox": [
302,
302,
524,
342
],
"type": "inline_equation",
"content": "6\\%"
},
{
"bbox": [
302,
302,
524,
342
],
"type": "text",
"content": " additional time."
}
]
}
],
"index": 9
},
{
"bbox": [
302,
353,
460,
364
],
"type": "title",
"angle": 0,
"lines": [
{
"bbox": [
302,
353,
460,
364
],
"spans": [
{
"bbox": [
302,
353,
460,
364
],
"type": "text",
"content": "3.3 Blockwise Causal Attention"
}
]
}
],
"index": 10
},
{
"bbox": [
301,
370,
526,
491
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
301,
370,
526,
491
],
"spans": [
{
"bbox": [
301,
370,
526,
491
],
"type": "text",
"content": "To deal with length extrapolation, a simple way to improve attention resolution (Section 3.1) is using windowed attention. During inference, we use blockwise masking (Dai et al., 2019; Zaheer et al., 2020; Xiong et al., 2021) for self-attention. Notice that other window strategies, such as sliding window (Child et al., 2019), also work. We use blockwise causal attention because it is cache-friendly and easy to implement."
}
]
}
],
"index": 11
},
{
"bbox": [
302,
492,
525,
587
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
302,
492,
525,
587
],
"spans": [
{
"bbox": [
302,
492,
525,
587
],
"type": "text",
"content": "As shown in Figure 3, if the pre-training length is "
},
{
"bbox": [
302,
492,
525,
587
],
"type": "inline_equation",
"content": "l"
},
{
"bbox": [
302,
492,
525,
587
],
"type": "text",
"content": ", we divide the query as blocks with "
},
{
"bbox": [
302,
492,
525,
587
],
"type": "inline_equation",
"content": "l/2"
},
{
"bbox": [
302,
492,
525,
587
],
"type": "text",
"content": " length, and each query interacts with its own block and the last block. In this way, the context information can be delivered by the reuse of key and value. The window constraint helps models encode longer input with improved resolution."
}
]
}
],
"index": 12
},
{
"bbox": [
302,
587,
525,
682
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
302,
587,
525,
682
],
"spans": [
{
"bbox": [
302,
587,
525,
682
],
"type": "text",
"content": "Different from training a long-sequence model with a stop gradient, we use vanilla attention in the training phase, because the pre-training corpus is not very long on average. However, during the inference phase, when dealing with long sequences, we directly implement BCA to help the model to be more position-recognizable."
}
]
}
],
"index": 13
},
{
"bbox": [
302,
692,
389,
706
],
"type": "title",
"angle": 0,
"lines": [
{
"bbox": [
302,
692,
389,
706
],
"spans": [
{
"bbox": [
302,
692,
389,
706
],
"type": "text",
"content": "4 Experiments"
}
]
}
],
"index": 14
},
{
"bbox": [
302,
714,
389,
728
],
"type": "title",
"angle": 0,
"lines": [
{
"bbox": [
302,
714,
389,
728
],
"spans": [
{
"bbox": [
302,
714,
389,
728
],
"type": "text",
"content": "4.1 Pre-training"
}
]
}
],
"index": 15
},
{
"bbox": [
302,
732,
525,
772
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
302,
732,
525,
772
],
"spans": [
{
"bbox": [
302,
732,
525,
772
],
"type": "text",
"content": "To fairly evaluate different Transformer variants, we pre-train the Transformer from scratch. We use 1024 hidden dimensions, 16 heads, and 24 layers,"
}
]
}
],
"index": 16
}
],
"discarded_blocks": [
{
"bbox": [
284,
780,
312,
791
],
"type": "page_number",
"angle": 0,
"lines": [
{
"bbox": [
284,
780,
312,
791
],
"spans": [
{
"bbox": [
284,
780,
312,
791
],
"type": "text",
"content": "14594"
}
]
}
],
"index": 17
}
],
"page_size": [
595,
841
],
"page_idx": 4
},
{
"para_blocks": [
{
"bbox": [
67,
71,
293,
287
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
67,
71,
293,
287
],
"spans": [
{
"bbox": [
67,
71,
293,
287
],
"type": "text",
"content": "i.e., comparable to medium-size GPT-3 (Brown et al., 2020). The training corpus includes a subset of the Pile (Gao et al., 2020): Books3, OpenText2, Stack Exchange, PubMed Abstracts, Wikipedia, Gutenberg (PG-19), BookCorpus2, NIH ExPorter, and Pile-CC datasets. The training procedure is performed on "
},
{
"bbox": [
67,
71,
293,
287
],
"type": "inline_equation",
"content": "16 \\times V100"
},
{
"bbox": [
67,
71,
293,
287
],
"type": "text",
"content": " GPUs. We use the tokenizer from GPT2 (Radford et al., 2019). The maximal length is 1024 for saving memory and extrapolation evaluation. The learning rate is "
},
{
"bbox": [
67,
71,
293,
287
],
"type": "inline_equation",
"content": "3 \\times 10^{-4}"
},
{
"bbox": [
67,
71,
293,
287
],
"type": "text",
"content": " and polynomial decay is used to adjust the learning rate. The global batch size is 512 to follow GPT-3 (Brown et al., 2020), i.e., 0.5M token size. We use Adam (Kingma and Ba, 2015) optimizer with "
},
{
"bbox": [
67,
71,
293,
287
],
"type": "inline_equation",
"content": "\\beta_{1} = 0.9"
},
{
"bbox": [
67,
71,
293,
287
],
"type": "text",
"content": ", "
},
{
"bbox": [
67,
71,
293,
287
],
"type": "inline_equation",
"content": "\\beta_{2} = 0.98"
},
{
"bbox": [
67,
71,
293,
287
],
"type": "text",
"content": ", "
},
{
"bbox": [
67,
71,
293,
287
],
"type": "inline_equation",
"content": "\\epsilon = 10^{-6}"
},
{
"bbox": [
67,
71,
293,
287
],
"type": "text",
"content": ". The code is based on TorchScale (Ma et al., 2022a)."
}
]
}
],
"index": 0
},
{
"bbox": [
67,
301,
189,
314
],
"type": "title",
"angle": 0,
"lines": [
{
"bbox": [
67,
301,
189,
314
],
"spans": [
{
"bbox": [
67,
301,
189,
314
],
"type": "text",
"content": "4.2 Language Modeling"
}
]
}
],
"index": 1
},
{
"bbox": [
67,
322,
291,
498
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
67,
322,
291,
498
],
"spans": [
{
"bbox": [
67,
322,
291,
498
],
"type": "text",
"content": "We measure perplexity on long document datasets, which can show the model's ability for long-dependency modeling. We use books from Project Gutenberg whose years are later than 2019 to ensure no overlap with PG19, and we name it as PG22. Besides, we pick QMSum (Zhong et al., 2021) from SCROLLS (Shaham et al., 2022) with above 9k length on average. We care about the performance on different input lengths to evaluate the model's interpolation and extrapolation capability. For experiment results in Table 2, we divide the same input into the target length to fairly compare the perplexity of different lengths."
}
]
}
],
"index": 2
},
{
"bbox": [
67,
500,
291,
607
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
67,
500,
291,
607
],
"spans": [
{
"bbox": [
67,
500,
291,
607
],
"type": "text",
"content": "For interpolation capability, we analyze the results where the length is no more than 1024. Since the validation distribution is very similar to training data, all Transformers' generalization capabilities are also close. xPos have a stable advantage on others with a 0.09 perplexity drop on PG22, and 0.27 on QMSum, which proves that xPos increases the interpolation ability."
}
]
}
],
"index": 3
},
{
"bbox": [
67,
609,
291,
745
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
67,
609,
291,
745
],
"spans": [
{
"bbox": [
67,
609,
291,
745
],
"type": "text",
"content": "For extrapolation lengths, we do not use BCA in other Transformers, and the following ablation study will discuss the performance with that. Press et al. (2021)'s experiment shows that most of the position strategies can't deal with input length longer than pre-training directly. xPos shows a stable decrease when the sequence length increases, which satisfies the assumption that a longer context makes the prediction better. While others' perplexity increases when the input length is 4096."
}
]
}
],
"index": 4
},
{
"bbox": [
67,
746,
291,
773
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
67,
746,
291,
773
],
"spans": [
{
"bbox": [
67,
746,
291,
773
],
"type": "text",
"content": "To illustrate the tendency of perplexities, Figure 1 visualizes the relation between input length"
}
]
}
],
"index": 5
},
{
"bbox": [
302,
71,
526,
125
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
302,
71,
526,
125
],
"spans": [
{
"bbox": [
302,
71,
526,
125
],
"type": "text",
"content": "and perplexity. When the length is larger than 4096, Alibi's perplexity increases gradually. However, LEX's perplexity decreases continuously when the length extends to 8192."
}
]
}
],
"index": 6
},
{
"bbox": [
302,
126,
527,
233
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
302,
126,
527,
233
],
"spans": [
{
"bbox": [
302,
126,
527,
233
],
"type": "text",
"content": "The experiment shows that xPOS gets better performance on language modeling. With the stable advantage of any length, users can input any sentence freely without the concern of position. Besides, results also indicate that is not essential to build an explicit decay on the attention matrix. Instead, a proper design for an attention mask is actually better to deal with long-context tasks."
}
]
}
],
"index": 7
},
{
"bbox": [
302,
243,
434,
254
],
"type": "title",
"angle": 0,
"lines": [
{
"bbox": [
302,
243,
434,
254
],
"spans": [
{
"bbox": [
302,
243,
434,
254
],
"type": "text",
"content": "4.3 Measuring Resolution"
}
]
}
],
"index": 8
},
{
"bbox": [
302,
259,
526,
327
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
302,
259,
526,
327
],
"spans": [
{
"bbox": [
302,
259,
526,
327
],
"type": "text",
"content": "We empirically evaluate the resolution of different Transformer variants. In the previous section, we define attention resolution as a quality indicator of position modeling in Transformers. The expectation of "
},
{
"bbox": [
302,
259,
526,
327
],
"type": "inline_equation",
"content": "s[n]"
},
{
"bbox": [
302,
259,
526,
327
],
"type": "text",
"content": " is computed as:"
}
]
}
],
"index": 9
},
{
"bbox": [
340,
333,
525,
370
],
"type": "interline_equation",
"angle": 0,
"lines": [
{
"bbox": [
340,
333,
525,
370
],
"spans": [
{
"bbox": [
340,
333,
525,
370
],
"type": "interline_equation",
"content": "\\mathbb {E} [ s [ n ] ] = \\frac {1}{N - n} \\mathbb {E} [ \\sum_ {i = n} ^ {N - 1} a _ {i (i - n)} ] \\tag {13}",
"image_path": "170246e628c14a3b0b7cca0da1e712a5b41301b9476cee826c579af36ece89d3.jpg"
}
]
}
],
"index": 10
},
{
"bbox": [
302,
375,
511,
388
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
302,
375,
511,
388
],
"spans": [
{
"bbox": [
302,
375,
511,
388
],
"type": "text",
"content": "where "
},
{
"bbox": [
302,
375,
511,
388
],
"type": "inline_equation",
"content": "a_{ij}"
},
{
"bbox": [
302,
375,
511,
388
],
"type": "text",
"content": " has the same meaning in Equation 5."
}
]
}
],
"index": 11
},
{
"bbox": [
302,
388,
525,
442
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
302,
388,
525,
442
],
"spans": [
{
"bbox": [
302,
388,
525,
442
],
"type": "text",
"content": "Then the attention resolution can be calculated by combining Equation (4) and Equation (13). The final expectation is averaged over input texts and different layers."
}
]
}
],
"index": 12
},
{
"bbox": [
302,
443,
526,
590
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
302,
443,
526,
590
],
"spans": [
{
"bbox": [
302,
443,
526,
590
],
"type": "text",
"content": "Table 3 reports the average resolution of various Transformer variants. The results show that xPos makes the position more recognizable in both 1024 (i.e., training length) and 2048 (i.e., length extrapolation). For Alibi (Press et al., 2021), the stable resolution comes from explicit decay, but it prevents the model from learning position dependency itself. In addition, we ablate BCA in 1024 and 2048. The results support that BCA helps the model distinguish positions better, achieving higher attention resolution."
}
]
}
],
"index": 13
},
{
"bbox": [
302,
599,
409,
611
],
"type": "title",
"angle": 0,
"lines": [
{
"bbox": [
302,
599,
409,
611
],
"spans": [
{
"bbox": [
302,
599,
409,
611
],
"type": "text",
"content": "4.4 Ablation Studies"
}
]
}
],
"index": 14
},
{
"bbox": [
302,
617,
444,
630
],
"type": "title",
"angle": 0,
"lines": [
{
"bbox": [
302,
617,
444,
630
],
"spans": [
{
"bbox": [
302,
617,
444,
630
],
"type": "text",
"content": "4.4.1 Rotation Computation"
}
]
}
],
"index": 15
},
{
"bbox": [
302,
633,
525,
687
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
302,
633,
525,
687
],
"spans": [
{
"bbox": [
302,
633,
525,
687
],
"type": "text",
"content": "As shown in Table 4, we discuss the necessity of the combination of vector rotation and exponential decay. XPOS without rotation means Equation (12) degenerates to "
},
{
"bbox": [
302,
633,
525,
687
],
"type": "inline_equation",
"content": "\\theta_{i} = 0"
},
{
"bbox": [
302,
633,
525,
687
],
"type": "text",
"content": ":"
}
]
}
],
"index": 16
},
{
"bbox": [
302,
692,
524,
777
],
"type": "interline_equation",
"angle": 0,
"lines": [
{
"bbox": [
302,
692,
524,
777
],
"spans": [
{
"bbox": [
302,
692,
524,
777
],
"type": "interline_equation",
"content": "\\dot {f} _ {q} (q, n) = \\left( \\begin{array}{c} q _ {1} \\hat {\\zeta} _ {1} ^ {n} \\\\ q _ {2} \\hat {\\zeta} _ {1} ^ {n} \\\\ \\vdots \\\\ q _ {n - 1} \\hat {\\zeta} _ {d / 2} ^ {n} \\\\ q _ {n} \\hat {\\zeta} _ {d / 2} ^ {n} \\end{array} \\right) \\dot {f} _ {k} (k, n) = \\left( \\begin{array}{c} k _ {1} \\hat {\\zeta} _ {1} ^ {- n} \\\\ k _ {2} \\hat {\\zeta} _ {1} ^ {- n} \\\\ \\vdots \\\\ k _ {n - 1} \\hat {\\zeta} _ {d / 2} ^ {- n} \\\\ k _ {n} \\hat {\\zeta} _ {d / 2} ^ {- n} \\end{array} \\right)",
"image_path": "25263d49c90baabd6ea400d4a1577e365f87374423f6d16dac48d252eb83aa64.jpg"
}
]
}
],
"index": 17
}
],
"discarded_blocks": [
{
"bbox": [
284,
780,
312,
791
],
"type": "page_number",
"angle": 0,
"lines": [
{
"bbox": [
284,
780,
312,
791
],
"spans": [
{
"bbox": [
284,
780,
312,
791
],
"type": "text",
"content": "14595"
}
]
}
],
"index": 18
}
],
"page_size": [
595,
841
],
"page_idx": 5
},
{
"para_blocks": [
{
"type": "table",
"bbox": [
110,
68,
483,
263
],
"blocks": [
{
"bbox": [
110,
68,
483,
263
],
"lines": [
{
"bbox": [
110,
68,
483,
263
],
"spans": [
{
"bbox": [
110,
68,
483,
263
],
"type": "table",
"html": "<table><tr><td rowspan=\"2\">Length</td><td>256</td><td>512</td><td>1024</td><td>2048</td><td>4096</td><td>8192</td></tr><tr><td colspan=\"3\">Interpolation</td><td colspan=\"3\">Extrapolation</td></tr><tr><td colspan=\"7\">PG22</td></tr><tr><td>Transformer</td><td>38.1</td><td>33.5</td><td>30.54</td><td>132.46</td><td>1446.95</td><td>12747.41</td></tr><tr><td>Alibi</td><td>34.25</td><td>30.01</td><td>27.34</td><td>26.01</td><td>28.46</td><td>32.8</td></tr><tr><td>Roformer</td><td>33.27</td><td>29.2</td><td>26.68</td><td>68.86</td><td>235.71</td><td>458.83</td></tr><tr><td>LEX Transformer (Ours)</td><td>33.18</td><td>29.11</td><td>26.59</td><td>25.53</td><td>25.07</td><td>24.89</td></tr><tr><td colspan=\"7\">QMSum</td></tr><tr><td>Transformer</td><td>24.25</td><td>18.81</td><td>16.05</td><td>86.56</td><td>1196.92</td><td>10781.38</td></tr><tr><td>Alibi</td><td>22.85</td><td>17.74</td><td>15.17</td><td>13.97</td><td>15.36</td><td>18.37</td></tr><tr><td>Roformer</td><td>22.66</td><td>17.65</td><td>15.12</td><td>36.54</td><td>146.61</td><td>331.56</td></tr><tr><td>LEX Transformer (Ours)</td><td>22.01</td><td>17.24</td><td>14.85</td><td>13.92</td><td>13.56</td><td>13.48</td></tr></table>",
"image_path": "98246ce3b522d071e4da157e30d241354c63282855c4d5dc0c18dacc85357ea2.jpg"
}
]
}
],
"index": 0,
"angle": 0,
"type": "table_body"
}
],
"index": 0
},
{
"type": "table",
"bbox": [
74,
338,
283,
448
],
"blocks": [
{
"bbox": [
67,
271,
525,
320
],
"lines": [
{
"bbox": [
67,
271,
525,
320
],
"spans": [
{
"bbox": [
67,
271,
525,
320
],
"type": "text",
"content": "Table 2: Results of perplexity with different lengths. The language models are trained with a length of 1024 and then evaluated on various lengths. LEX obtains better performance not only on shorter texts (i.e., interpolation) but also on longer texts (i.e., extrapolation). The red color indicates that the perplexity begins increasing compared with the shorter length. LEX is the only method that has lower perplexity along with increased evaluation length."
}
]
}
],
"index": 1,
"angle": 0,
"type": "table_caption"
},
{
"bbox": [
74,
338,
283,
448
],
"lines": [
{
"bbox": [
74,
338,
283,
448
],
"spans": [
{
"bbox": [
74,
338,
283,
448
],
"type": "table",
"html": "<table><tr><td>Length</td><td>1024 \nInterpolation</td><td>2048 \nExtrapolation</td></tr><tr><td>Transformer</td><td>0.87</td><td>0.28</td></tr><tr><td>Alibi</td><td>0.81</td><td>0.88</td></tr><tr><td>Roformer</td><td>0.91</td><td>0.08</td></tr><tr><td>LEX (Ours)</td><td>0.98</td><td>1.08</td></tr><tr><td>- BCA</td><td>0.98</td><td>0.54</td></tr></table>",
"image_path": "8cfc28d99c7702eebb595c7c3831ec8b3d6a55eceb0bb25639a7f7434246a729.jpg"
}
]
}
],
"index": 2,
"angle": 0,
"type": "table_body"
}
],
"index": 2
},
{
"bbox": [
67,
528,
290,
595
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
67,
528,
290,
595
],
"spans": [
{
"bbox": [
67,
528,
290,
595
],
"type": "text",
"content": "Moreover, the setting of "
},
{
"bbox": [
67,
528,
290,
595
],
"type": "inline_equation",
"content": "\\zeta = 0"
},
{
"bbox": [
67,
528,
290,
595
],
"type": "text",
"content": " is RoPE (Su et al., 2021), which can be viewed as a special case of our method. Besides, we discuss the situation when "
},
{
"bbox": [
67,
528,
290,
595
],
"type": "inline_equation",
"content": "\\zeta"
},
{
"bbox": [
67,
528,
290,
595
],
"type": "text",
"content": " is a scalar instead of a vector, where we choose "
},
{
"bbox": [
67,
528,
290,
595
],
"type": "inline_equation",
"content": "\\zeta = \\gamma /(1 + \\gamma)"
},
{
"bbox": [
67,
528,
290,
595
],
"type": "text",
"content": " as the value."
}
]
}
],
"index": 4
},
{
"bbox": [
67,
597,
291,
705
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
67,
597,
291,
705
],
"spans": [
{
"bbox": [
67,
597,
291,
705
],
"type": "text",
"content": "After pre-training on 1024, we evaluate the perplexity of PG22 with 1024 and 8192 lengths. Table 4 shows that simple scaling operation cannot match the performance of LEX. The vector "
},
{
"bbox": [
67,
597,
291,
705
],
"type": "inline_equation",
"content": "\\zeta"
},
{
"bbox": [
67,
597,
291,
705
],
"type": "text",
"content": " also performs better than "
},
{
"bbox": [
67,
597,
291,
705
],
"type": "inline_equation",
"content": "\\zeta = 0"
},
{
"bbox": [
67,
597,
291,
705
],
"type": "text",
"content": " and "
},
{
"bbox": [
67,
597,
291,
705
],
"type": "inline_equation",
"content": "\\gamma / (1 + \\gamma)"
},
{
"bbox": [
67,
597,
291,
705
],
"type": "text",
"content": ". Therefore, the combination of rotation and decay means the combination of in-distribution and out-of-distribution capability in terms of length."
}
]
}
],
"index": 5
},
{
"bbox": [
67,
715,
233,
727
],
"type": "title",
"angle": 0,
"lines": [
{
"bbox": [
67,
715,
233,
727
],
"spans": [
{
"bbox": [
67,
715,
233,
727
],
"type": "text",
"content": "4.4.2 Blockwise Causal Attention"
}
]
}
],
"index": 6
},
{
"bbox": [
67,
733,
291,
772
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
67,
733,
291,
772
],
"spans": [
{
"bbox": [
67,
733,
291,
772
],
"type": "text",
"content": "As shown in Table 5, we run the evaluation using different position embeddings (i.e., Absolute, Alibi, RoPE, and xPos) with or without blockwise"
}
]
}
],
"index": 7
},
{
"type": "table",
"bbox": [
306,
338,
523,
434
],
"blocks": [
{
"bbox": [
67,
455,
291,
504
],
"lines": [
{
"bbox": [
67,
455,
291,
504
],
"spans": [
{
"bbox": [
67,
455,
291,
504
],
"type": "text",
"content": "Table 3: Results of resolution with different Transformer variants. Higher resolution indicates that the architecture tends to better distinguish context tokens. \"BCA\" is short for blockwise causal attention."
}
]
}
],
"index": 3,
"angle": 0,
"type": "table_caption"
},
{
"bbox": [
306,
338,
523,
434
],
"lines": [
{
"bbox": [
306,
338,
523,
434
],
"spans": [
{
"bbox": [
306,
338,
523,
434
],
"type": "table",
"html": "<table><tr><td>Methods</td><td>1024 \nInterpolation</td><td>8192 \nExtrapolation</td></tr><tr><td>LEX</td><td>26.59</td><td>24.89</td></tr><tr><td>w/o Rotation</td><td>37.11</td><td>34.5</td></tr><tr><td>ζ = 0</td><td>26.68</td><td>26.16</td></tr><tr><td>Scalar ζ</td><td>26.85</td><td>25.1</td></tr></table>",
"image_path": "1f0b71cd7cc7a512b448a840d920deecbd44b44da25f87a3899c38e81fa616ec.jpg"
}
]
}
],
"index": 8,
"angle": 0,
"type": "table_body"
}
],
"index": 8
},
{
"bbox": [
302,
443,
524,
467
],
"lines": [
{
"bbox": [
302,
443,
524,
467
],
"spans": [
{
"bbox": [
302,
443,
524,
467
],
"type": "text",
"content": "Table 4: Ablation results on the PG22 set show that rotation of XPos is necessary for strong performance."
}
]
}
],
"index": 9,
"angle": 0,
"type": "text"
},
{
"bbox": [
302,
490,
377,
501
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
302,
490,
377,
501
],
"spans": [
{
"bbox": [
302,
490,
377,
501
],
"type": "text",
"content": "causal attention."
}
]
}
],
"index": 10
},
{
"bbox": [
302,
502,
525,
650
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
302,
502,
525,
650
],
"spans": [
{
"bbox": [
302,
502,
525,
650
],
"type": "text",
"content": "First, Blockwise Causal Attention works for RoPE whose perplexity will explode without that. Alibi performs well without windowed attention because its \"soft window\" is broader than a hard block window. However, when the sequence length increases to 8192, windowed attention outperforms vanilla attention again (also shown in Figure 1). XPos's perplexity without BCA increases by about 1.5 in 2048, and 40 in 8192. However, with its high resolution, XPos can recognize position with BCA's constraint."
}
]
}
],
"index": 11
},
{
"bbox": [
302,
651,
526,
772
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
302,
651,
526,
772
],
"spans": [
{
"bbox": [
302,
651,
526,
772
],
"type": "text",
"content": "Besides, we compare BCA with Sliding Attention (Child et al., 2019). In this experiment, we set the window size as 1024 to align with pre-training. Sliding Attention performs better as shown in the last row of Table 5 because its interaction range is broader than Block Causal Attention. The reason to use block windows instead of sliding windows is efficiency. According to (Xiong et al., 2021), the training speed of Blockwise Attention is "
},
{
"bbox": [
302,
651,
526,
772
],
"type": "inline_equation",
"content": "1.5\\mathrm{x}"
}
]
}
],
"index": 12
}
],
"discarded_blocks": [
{
"bbox": [
284,
780,
312,
791
],
"type": "page_number",
"angle": 0,
"lines": [
{
"bbox": [
284,
780,
312,
791
],
"spans": [
{
"bbox": [
284,
780,
312,
791
],
"type": "text",
"content": "14596"
}
]
}
],
"index": 13
}
],
"page_size": [
595,
841
],
"page_idx": 6
},
{
"para_blocks": [
{
"type": "table",
"bbox": [
70,
68,
289,
249
],
"blocks": [
{
"bbox": [
70,
68,
289,
249
],
"lines": [
{
"bbox": [
70,
68,
289,
249
],
"spans": [
{
"bbox": [
70,
68,
289,
249
],
"type": "table",
"html": "<table><tr><td rowspan=\"2\">Methods</td><td>2048</td><td>8192</td></tr><tr><td colspan=\"2\">Extrapolation</td></tr><tr><td>Absolute</td><td>132.46</td><td>12747.41</td></tr><tr><td>Absolute + BCA</td><td>322.73</td><td>28787.01</td></tr><tr><td>RoPE</td><td>68.86</td><td>458.83</td></tr><tr><td>RoPE + BCA</td><td>26.37</td><td>26.16</td></tr><tr><td>Alibi</td><td>26.01</td><td>32.8</td></tr><tr><td>Alibi + BCA</td><td>27.53</td><td>31.82</td></tr><tr><td>xPos</td><td>27.29</td><td>63.99</td></tr><tr><td>xPos + BCA</td><td>25.53</td><td>24.89</td></tr><tr><td>xPos + Sliding Window</td><td>25.33</td><td>24.61</td></tr></table>",
"image_path": "9d53e2282718d90b35ba9c8802dafbd8b68688fe570bf3f72e5055dd1a4cbd96.jpg"
}
]
}
],
"index": 0,
"angle": 0,
"type": "table_body"
}
],
"index": 0
},
{
"bbox": [
67,
257,
291,
283
],
"lines": [
{
"bbox": [
67,
257,
291,
283
],
"spans": [
{
"bbox": [
67,
257,
291,
283
],
"type": "text",
"content": "Table 5: Results of perplexity on PG22 dataset. \"BCA\" is short for blockwise causal attention."
}
]
}
],
"index": 1,
"angle": 0,
"type": "text"
},
{
"bbox": [
67,
303,
291,
371
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
67,
303,
291,
371
],
"spans": [
{
"bbox": [
67,
303,
291,
371
],
"type": "text",
"content": "faster than using sliding windows. Therefore, LEX makes a trade-off and uses BCA in our implementation. Without losing generality, our method is also compatible with Sliding Attention and other local attention variants."
}
]
}
],
"index": 2
},
{
"bbox": [
67,
381,
161,
394
],
"type": "title",
"angle": 0,
"lines": [
{
"bbox": [
67,
381,
161,
394
],
"spans": [
{
"bbox": [
67,
381,
161,
394
],
"type": "text",
"content": "5 Related Work"
}
]
}
],
"index": 3
},
{
"bbox": [
67,
403,
234,
417
],
"type": "title",
"angle": 0,
"lines": [
{
"bbox": [
67,
403,
234,
417
],
"spans": [
{
"bbox": [
67,
403,
234,
417
],
"type": "text",
"content": "5.1 Long-Sequence Transformers"
}
]
}
],
"index": 4
},
{
"bbox": [
67,
421,
291,
488
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
67,
421,
291,
488
],
"spans": [
{
"bbox": [
67,
421,
291,
488
],
"type": "text",
"content": "Long-sequence Transformers aim to solve two key problems. First, the computation or memory consumption is not efficient enough for long sequences. Second, there is a trade-off between performance and efficiency."
}
]
}
],
"index": 5
},
{
"bbox": [
67,
489,
291,
665
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
67,
489,
291,
665
],
"spans": [
{
"bbox": [
67,
489,
291,
665
],
"type": "text",
"content": "One popular solution (Wang et al., 2020b; Katharopoulos et al., 2020; Choromanski et al., 2020) is linear attention, i.e., using a kernel-based or low-rank approximation to replace vanilla attention. The methods typically target efficiency while underperforming vanilla Transformers for regular length. Another strand is sparse attention (Child et al., 2019; Beltagy et al., 2020; Zaheer et al., 2020; Xiong et al., 2021), which usually leverages structured sparsity to reduce computation. For causal sequence modeling, the recurrent-style designs (Dai et al., 2019; Hutchins et al., 2022; Ma et al., 2022b) are also competitive."
}
]
}
],
"index": 6
},
{
"bbox": [
67,
666,
291,
773
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
67,
666,
291,
773
],
"spans": [
{
"bbox": [
67,
666,
291,
773
],
"type": "text",
"content": "In comparison, we focus on length extrapolation (Press et al., 2021) for language modeling, i.e., training on short texts while evaluating long texts. The training process is kept the same as vanilla Transformers. The capability of long-sequence modeling is given for free during inference. So training efficiency (which is typically expensive for large-scale language models) is not affected"
}
]
}
],
"index": 7
},
{
"bbox": [
302,
71,
526,
113
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
302,
71,
526,
113
],
"spans": [
{
"bbox": [
302,
71,
526,
113
],
"type": "text",
"content": "compared with previous work. Moreover, the performance on regular length is perfectly retained, without trade-offs for long-sequence modeling."
}
]
}
],
"index": 8
},
{
"bbox": [
302,
121,
417,
134
],
"type": "title",
"angle": 0,
"lines": [
{
"bbox": [
302,
121,
417,
134
],
"spans": [
{
"bbox": [
302,
121,
417,
134
],
"type": "text",
"content": "5.2 Position Modeling"
}
]
}
],
"index": 9
},
{
"bbox": [
302,
138,
478,
152
],
"type": "title",
"angle": 0,
"lines": [
{
"bbox": [
302,
138,
478,
152
],
"spans": [
{
"bbox": [
302,
138,
478,
152
],
"type": "text",
"content": "5.2.1 Absolute Position Embedding"
}
]
}
],
"index": 10
},
{
"bbox": [
302,
153,
526,
221
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
302,
153,
526,
221
],
"spans": [
{
"bbox": [
302,
153,
526,
221
],
"type": "text",
"content": "Absolute sinusoidal position embedding is proposed by Vaswani et al. (2017), which is the initial design of the Transformer. For each dimension, different frequencies are encoded from "
},
{
"bbox": [
302,
153,
526,
221
],
"type": "inline_equation",
"content": "2\\pi"
},
{
"bbox": [
302,
153,
526,
221
],
"type": "text",
"content": " to "
},
{
"bbox": [
302,
153,
526,
221
],
"type": "inline_equation",
"content": "10000 \\times 2\\pi"
},
{
"bbox": [
302,
153,
526,
221
],
"type": "text",
"content": ":"
}
]
}
],
"index": 11
},
{
"bbox": [
326,
227,
524,
250
],
"type": "interline_equation",
"angle": 0,
"lines": [
{
"bbox": [
326,
227,
524,
250
],
"spans": [
{
"bbox": [
326,
227,
524,
250
],
"type": "interline_equation",
"content": "\\mathrm {P E} _ {(p o s, 2 i)} = \\cos (p o s / 1 0 0 0 0 ^ {2 i / d _ {\\text {m o d e l}}}) \\tag {14}",
"image_path": "098b7bb5eb6c125bf510c6c020438e7934c582f790cc015a46d337d1df23ede8.jpg"
}
]
}
],
"index": 12
},
{
"bbox": [
320,
248,
490,
264
],
"type": "interline_equation",
"angle": 0,
"lines": [
{
"bbox": [
320,
248,
490,
264
],
"spans": [
{
"bbox": [
320,
248,
490,
264
],
"type": "interline_equation",
"content": "\\mathrm {P E} _ {(p o s, 2 i + 1)} = \\sin (p o s / 1 0 0 0 0 ^ {2 i / d _ {\\mathrm {m o d e l}}})",
"image_path": "87068f830821ede20f6be91301842786ea7c1386310f365ad0f461d2552889f9.jpg"
}
]
}
],
"index": 13
},
{
"bbox": [
302,
272,
524,
299
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
302,
272,
524,
299
],
"spans": [
{
"bbox": [
302,
272,
524,
299
],
"type": "text",
"content": "where "
},
{
"bbox": [
302,
272,
524,
299
],
"type": "inline_equation",
"content": "\\mathrm{PE}_{pos + k}"
},
{
"bbox": [
302,
272,
524,
299
],
"type": "text",
"content": " is represented as a linear function of "
},
{
"bbox": [
302,
272,
524,
299
],
"type": "inline_equation",
"content": "\\mathrm{PE}_{pos}"
},
{
"bbox": [
302,
272,
524,
299
],
"type": "text",
"content": " to restore a relative-position property."
}
]
}
],
"index": 14
},
{
"bbox": [
302,
306,
475,
319
],
"type": "title",
"angle": 0,
"lines": [
{
"bbox": [
302,
306,
475,
319
],
"spans": [
{
"bbox": [
302,
306,
475,
319
],
"type": "text",
"content": "5.2.2 Relative Position Embedding"
}
]
}
],
"index": 15
},
{
"bbox": [
302,
322,
526,
375
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
302,
322,
526,
375
],
"spans": [
{
"bbox": [
302,
322,
526,
375
],
"type": "text",
"content": "Shaw et al. (2018) propose relative position embedding as an alternative approach. Denote "
},
{
"bbox": [
302,
322,
526,
375
],
"type": "inline_equation",
"content": "a_{ij}"
},
{
"bbox": [
302,
322,
526,
375
],
"type": "text",
"content": " as attention weight, "
},
{
"bbox": [
302,
322,
526,
375
],
"type": "inline_equation",
"content": "\\alpha_{ij} = \\mathrm{softmax}(a_{ij})"
},
{
"bbox": [
302,
322,
526,
375
],
"type": "text",
"content": ", "
},
{
"bbox": [
302,
322,
526,
375
],
"type": "inline_equation",
"content": "o_i"
},
{
"bbox": [
302,
322,
526,
375
],
"type": "text",
"content": " as output, we have:"
}
]
}
],
"index": 16
},
{
"bbox": [
326,
381,
525,
417
],
"type": "interline_equation",
"angle": 0,
"lines": [
{
"bbox": [
326,
381,
525,
417
],
"spans": [
{
"bbox": [
326,
381,
525,
417
],
"type": "interline_equation",
"content": "a _ {i j} = \\frac {\\boldsymbol {q} _ {i} \\cdot \\boldsymbol {k} _ {j}}{\\sqrt {d}} \\Longrightarrow \\frac {\\boldsymbol {q} _ {i} \\cdot \\left(\\boldsymbol {k} _ {j} + \\boldsymbol {p} _ {i j} ^ {K}\\right)}{\\sqrt {d}} \\tag {15}",
"image_path": "50d74e2e9ffb8f9077fc4562ae9f56811e1262c3aa05403f27c589bfe91c748a.jpg"
}
]
}
],
"index": 17
},
{
"bbox": [
321,
415,
490,
443
],
"type": "interline_equation",
"angle": 0,
"lines": [
{
"bbox": [
321,
415,
490,
443
],
"spans": [
{
"bbox": [
321,
415,
490,
443
],
"type": "interline_equation",
"content": "o _ {i} = \\sum_ {j} \\alpha_ {i j} \\boldsymbol {v} _ {j} \\Longrightarrow \\sum_ {j} \\alpha_ {i j} (\\boldsymbol {v} _ {j} + \\boldsymbol {p} _ {i j} ^ {V})",
"image_path": "7197a16d47f19db510bdadd3bf9766b2ba48757e18e87e2d452eb8e3d829885f.jpg"
}
]
}
],
"index": 18
},
{
"bbox": [
302,
452,
525,
565
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
302,
452,
525,
565
],
"spans": [
{
"bbox": [
302,
452,
525,
565
],
"type": "text",
"content": "where "
},
{
"bbox": [
302,
452,
525,
565
],
"type": "inline_equation",
"content": "\\pmb{p}_{ij}^{K} = \\omega_{\\min (i - j,k)}^{K},\\pmb{p}_{ij}^{V} = \\omega_{\\min (i - j,k)}^{V}"
},
{
"bbox": [
302,
452,
525,
565
],
"type": "text",
"content": ", and "
},
{
"bbox": [
302,
452,
525,
565
],
"type": "inline_equation",
"content": "\\omega^K"
},
{
"bbox": [
302,
452,
525,
565
],
"type": "text",
"content": " and "
},
{
"bbox": [
302,
452,
525,
565
],
"type": "inline_equation",
"content": "\\omega^V"
},
{
"bbox": [
302,
452,
525,
565
],
"type": "text",
"content": " are learnable parameters. The clipping strategy helps length generalization but cannot distinguish the positions that are larger than "
},
{
"bbox": [
302,
452,
525,
565
],
"type": "inline_equation",
"content": "k"
},
{
"bbox": [
302,
452,
525,
565
],
"type": "text",
"content": ". Yang et al. (2019) and He et al. (2020) further reparameterize the relative position vectors for better performance. T5 (Raffel et al., 2020) uses a simpler strategy to encode relative position:"
}
]
}
],
"index": 19
},
{
"bbox": [
351,
572,
525,
601
],
"type": "interline_equation",
"angle": 0,
"lines": [
{
"bbox": [
351,
572,
525,
601
],
"spans": [
{
"bbox": [
351,
572,
525,
601
],
"type": "interline_equation",
"content": "a _ {i j} = \\frac {\\boldsymbol {q} _ {i} \\cdot \\boldsymbol {k} _ {j}}{\\sqrt {d}} + p _ {\\text {b u c k e t} (i - j)} \\tag {16}",
"image_path": "bb42d68c981e5af072e3a2b4e390d3bac70ef1220e125776bca279954bfe274f.jpg"
}
]
}
],
"index": 20
},
{
"bbox": [
302,
608,
525,
689
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
302,
608,
525,
689
],
"spans": [
{
"bbox": [
302,
608,
525,
689
],
"type": "text",
"content": "where log-bucket scalars are added to attention scores. Recently, pre-defined position embedding is brought back by RoPE (Su et al., 2021). Alibi (Press et al., 2021) proposes to explicitly build an exponential decay on the attention matrix, which contributes to length extrapolation:"
}
]
}
],
"index": 21
},
{
"bbox": [
319,
697,
525,
724
],
"type": "interline_equation",
"angle": 0,
"lines": [
{
"bbox": [
319,
697,
525,
724
],
"spans": [
{
"bbox": [
319,
697,
525,
724
],
"type": "interline_equation",
"content": "a _ {i j} = \\frac {\\boldsymbol {q} _ {i} \\cdot \\boldsymbol {k} _ {j}}{\\sqrt {d}} - \\mathrm {m} (i - j), \\quad \\mathrm {m} (\\cdot) > 0 \\tag {17}",
"image_path": "479fc17b9c16b7accf4f67d07421174478cb327100b3f87d928bd2841a02ca25.jpg"
}
]
}
],
"index": 22
},
{
"bbox": [
302,
733,
525,
772
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
302,
733,
525,
772
],
"spans": [
{
"bbox": [
302,
733,
525,
772
],
"type": "text",
"content": "where the values of "
},
{
"bbox": [
302,
733,
525,
772
],
"type": "inline_equation",
"content": "\\mathrm{m}(\\cdot)"
},
{
"bbox": [
302,
733,
525,
772
],
"type": "text",
"content": " are manually defined. However, Alibi (Press et al., 2021)'s performance tends to be inferior to ROPE for the context whose"
}
]
}
],
"index": 23
}
],
"discarded_blocks": [
{
"bbox": [
284,
780,
312,
791
],
"type": "page_number",
"angle": 0,
"lines": [
{
"bbox": [
284,
780,
312,
791
],
"spans": [
{
"bbox": [
284,
780,
312,
791
],
"type": "text",
"content": "14597"
}
]
}
],
"index": 24
}
],
"page_size": [
595,
841
],
"page_idx": 7
},
{
"para_blocks": [
{
"bbox": [
67,
71,
291,
153
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
67,
71,
291,
153
],
"spans": [
{
"bbox": [
67,
71,
291,
153
],
"type": "text",
"content": "length is shorter than the pre-training length. In this work, we propose a theoretically derived relative position embedding xPOS that optimizes the attention resolution between tokens. The xPOS method not only has the nice property of length extrapolation but also achieves strong performance."
}
]
}
],
"index": 0
},
{
"bbox": [
67,
163,
147,
176
],
"type": "title",
"angle": 0,
"lines": [
{
"bbox": [
67,
163,
147,
176
],
"spans": [
{
"bbox": [
67,
163,
147,
176
],
"type": "text",
"content": "6 Conclusion"
}
]
}
],
"index": 1
},
{
"bbox": [
67,
186,
292,
349
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
67,
186,
292,
349
],
"spans": [
{
"bbox": [
67,
186,
292,
349
],
"type": "text",
"content": "We propose LEX Transformer to accurately capture position information for Transformers. We define attention resolution as the metric of length extrapolation and design a solution to improve the modeling. Extensive experiments on language modeling show that our method achieves lower perplexity on longer sequences while training on short texts. The simplicity also makes the method a go-to augmentation for Transformer-based language models. In addition, attention resolution provides a more principled view for position modeling, which sheds light on future architecture design."
}
]
}
],
"index": 2
},
{
"bbox": [
68,
359,
131,
372
],
"type": "title",
"angle": 0,
"lines": [
{
"bbox": [
68,
359,
131,
372
],
"spans": [
{
"bbox": [
68,
359,
131,
372
],
"type": "text",
"content": "Limitations"
}
]
}
],
"index": 3
},
{
"bbox": [
67,
382,
291,
476
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
67,
382,
291,
476
],
"spans": [
{
"bbox": [
67,
382,
291,
476
],
"type": "text",
"content": "In this work, we focus on causal language modeling. It needs additional efforts to integrate the proposed methods into bidirectional attention, such as masked language modeling (Devlin et al., 2019). Moreover, xPos introduces about "
},
{
"bbox": [
67,
382,
291,
476
],
"type": "inline_equation",
"content": "6\\%"
},
{
"bbox": [
67,
382,
291,
476
],
"type": "text",
"content": " inference cost compared with absolute position embeddings, although it accelerates training convergence."
}
]
}
],
"index": 4
},
{
"bbox": [
68,
500,
127,
513
],
"type": "title",
"angle": 0,
"lines": [
{
"bbox": [
68,
500,
127,
513
],
"spans": [
{
"bbox": [
68,
500,
127,
513
],
"type": "text",
"content": "References"
}
]
}
],
"index": 5
},
{
"bbox": [
69,
520,
291,
772
],
"type": "list",
"angle": 0,
"index": 9,
"blocks": [
{
"bbox": [
69,
520,
290,
555
],
"type": "ref_text",
"angle": 0,
"lines": [
{
"bbox": [
69,
520,
290,
555
],
"spans": [
{
"bbox": [
69,
520,
290,
555
],
"type": "text",
"content": "Iz Beltagy, Matthew E Peters, and Arman Cohan. 2020. Longformer: The long-document transformer. arXiv preprint arXiv:2004.05150."
}
]
}
],
"index": 6
},
{
"bbox": [
69,
564,
291,
717
],
"type": "ref_text",
"angle": 0,
"lines": [
{
"bbox": [
69,
564,
291,
717
],
"spans": [
{
"bbox": [
69,
564,
291,
717
],
"type": "text",
"content": "Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel Ziegler, Jeffrey Wu, Clemens Winter, Chris Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. 2020. Language models are few-shot learners. In Advances in Neural Information Processing Systems, volume 33, pages 1877-1901. Curran Associates, Inc."
}
]
}
],
"index": 7
},
{
"bbox": [
69,
728,
291,
772
],
"type": "ref_text",
"angle": 0,
"lines": [
{
"bbox": [
69,
728,
291,
772
],
"spans": [
{
"bbox": [
69,
728,
291,
772
],
"type": "text",
"content": "Ta-Chung Chi, Ting-Han Fan, Peter J Ramadge, and Alexander I Rudnicky. 2022a. Kerple: Kernelized relative positional embedding for length extrapolation. arXiv preprint arXiv:2205.09921."
}
]
}
],
"index": 8
}
],
"sub_type": "ref_text"
},
{
"bbox": [
303,
72,
526,
772
],
"type": "list",
"angle": 0,
"index": 17,
"blocks": [
{
"bbox": [
304,
72,
526,
116
],
"type": "ref_text",
"angle": 0,
"lines": [
{
"bbox": [
304,
72,
526,
116
],
"spans": [
{
"bbox": [
304,
72,
526,
116
],
"type": "text",
"content": "Ta-Chung Chi, Ting-Han Fan, and Alexander I Rudnicky. 2022b. Receptive field alignment enables transformer length extrapolation. arXiv preprint arXiv:2212.10356."
}
]
}
],
"index": 10
},
{
"bbox": [
304,
126,
526,
171
],
"type": "ref_text",
"angle": 0,
"lines": [
{
"bbox": [
304,
126,
526,
171
],
"spans": [
{
"bbox": [
304,
126,
526,
171
],
"type": "text",
"content": "Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. 2019. Generating long sequences with sparse transformers. URL https://openai.com/blog/sparse-transformers."
}
]
}
],
"index": 11
},
{
"bbox": [
304,
181,
526,
237
],
"type": "ref_text",
"angle": 0,
"lines": [
{
"bbox": [
304,
181,
526,
237
],
"spans": [
{
"bbox": [
304,
181,
526,
237
],
"type": "text",
"content": "Krzysztof Choromanski, Valerii Likhosherstov, David Dohan, Xingyou Song, Andreea Gane, Tamas Sarlos, Peter Hawkins, Jared Davis, Afroz Mohiuddin, Lukasz Kaiser, et al. 2020. Rethinking attention with performers. arXiv preprint arXiv:2009.14794."
}
]
}
],
"index": 12
},
{
"bbox": [
304,
247,
526,
509
],
"type": "ref_text",
"angle": 0,
"lines": [
{
"bbox": [
304,
247,
526,
509
],
"spans": [
{
"bbox": [
304,
247,
526,
509
],
"type": "text",
"content": "Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam Roberts, Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, Parker Schuh, Kensen Shi, Sasha Tsvyashchenko, Joshua Maynez, Abhishek B Rao, Parker Barnes, Yi Tay, Noam M. Shazeer, Vinodkumar Prabhakaran, Emily Reif, Nan Du, Benton C. Hutchinson, Reiner Pope, James Bradbury, Jacob Austin, Michael Isard, Guy Gur-Ari, Pengcheng Yin, Toju Duke, Anselm Levskaya, Sanjay Ghemawat, Sunipa Dev, Henryk Michalewski, Xavier Garcia, Vedant Misra, Kevin Robinson, Liam Fedus, Denny Zhou, Daphne Ippolito, David Luan, Hyeontaek Lim, Barret Zoph, Alexander Spiridonov, Ryan Sepassi, David Dohan, Shivani Agrawal, Mark Omernick, Andrew M. Dai, Thanumalayan Sankaranarayana Pillai, Marie Pellat, Aitor Lewkowycz, Erica Oliveira Moreira, Rewon Child, Oleksandr Polozov, Katherine Lee, Zongwei Zhou, Xuezhi Wang, Brennan Saeta, Mark Diazorhan Firdat, Michele Catasta, Jason Wei, Kathleen S. Meier-Hellstern, Douglas Eck, Jeff Dean, Slav Petrov, and Noah Fiedel. 2022. PaLM: Scaling language modeling with pathways. ArXiv, abs/2204.02311."
}
]
}
],
"index": 13
},
{
"bbox": [
304,
520,
526,
575
],
"type": "ref_text",
"angle": 0,
"lines": [
{
"bbox": [
304,
520,
526,
575
],
"spans": [
{
"bbox": [
304,
520,
526,
575
],
"type": "text",
"content": "Zihang Dai, Zhilin Yang, Yiming Yang, Jaime Carbonell, Quoc V Le, and Ruslan Salakhutdinov. 2019. Transformer-xl: Attentive language models beyond a fixed-length context. arXiv preprint arXiv:1901.02860."
}
]
}
],
"index": 14
},
{
"bbox": [
303,
586,
526,
685
],
"type": "ref_text",
"angle": 0,
"lines": [
{
"bbox": [
303,
586,
526,
685
],
"spans": [
{
"bbox": [
303,
586,
526,
685
],
"type": "text",
"content": "Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 4171-4186, Minneapolis, Minnesota. Association for Computational Linguistics."
}
]
}
],
"index": 15
},
{
"bbox": [
304,
695,
526,
772
],
"type": "ref_text",
"angle": 0,
"lines": [
{
"bbox": [
304,
695,
526,
772
],
"spans": [
{
"bbox": [
304,
695,
526,
772
],
"type": "text",
"content": "Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. 2020. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929."
}
]
}
],
"index": 16
}
],
"sub_type": "ref_text"
}
],
"discarded_blocks": [
{
"bbox": [
284,
781,
312,
791
],
"type": "page_number",
"angle": 0,
"lines": [
{
"bbox": [
284,
781,
312,
791
],
"spans": [
{
"bbox": [
284,
781,
312,
791
],
"type": "text",
"content": "14598"
}
]
}
],
"index": 18
}
],
"page_size": [
595,
841
],
"page_idx": 8
},
{
"para_blocks": [
{
"bbox": [
69,
72,
291,
771
],
"type": "list",
"angle": 0,
"index": 12,
"blocks": [
{
"bbox": [
69,
72,
291,
116
],
"type": "ref_text",
"angle": 0,
"lines": [
{
"bbox": [
69,
72,
291,
116
],
"spans": [
{
"bbox": [
69,
72,
291,
116
],
"type": "text",
"content": "Philipp Dufter, Martin Schmitt, and Hinrich Schütze. 2022. Position information in transformers: An overview. Computational Linguistics, 48(3):733-763."
}
]
}
],
"index": 0
},
{
"bbox": [
69,
125,
291,
180
],
"type": "ref_text",
"angle": 0,
"lines": [
{
"bbox": [
69,
125,
291,
180
],
"spans": [
{
"bbox": [
69,
125,
291,
180
],
"type": "text",
"content": "Leo Gao, Stella Biderman, Sid Black, Laurence Golding, Travis Hoppe, Charles Foster, Jason Phang, Horace He, Anish Thite, Noa Nabeshima, et al. 2020. The pile: An 800gb dataset of diverse text for language modeling. arXiv preprint arXiv:2101.00027."
}
]
}
],
"index": 1
},
{
"bbox": [
69,
189,
289,
232
],
"type": "ref_text",
"angle": 0,
"lines": [
{
"bbox": [
69,
189,
289,
232
],
"spans": [
{
"bbox": [
69,
189,
289,
232
],
"type": "text",
"content": "Pengcheng He, Xiaodong Liu, Jianfeng Gao, and Weizhu Chen. 2020. Deberta: Decoding-enhanced bert with disentangled attention. arXiv preprint arXiv:2006.03654."
}
]
}
],
"index": 2
},
{
"bbox": [
69,
241,
290,
273
],
"type": "ref_text",
"angle": 0,
"lines": [
{
"bbox": [
69,
241,
290,
273
],
"spans": [
{
"bbox": [
69,
241,
290,
273
],
"type": "text",
"content": "Sepp Hochreiter and Jürgen Schmidhuber. 1997. Long short-term memory. *Neural Computation*, 9:1735-1780."
}
]
}
],
"index": 3
},
{
"bbox": [
69,
283,
289,
327
],
"type": "ref_text",
"angle": 0,
"lines": [
{
"bbox": [
69,
283,
289,
327
],
"spans": [
{
"bbox": [
69,
283,
289,
327
],
"type": "text",
"content": "DeLesley Hutchins, Imanol Schlag, Yuhuai Wu, Ethan Dyer, and Behnam Neyshabur. 2022. Block-recurrent Transformers. In Advances in Neural Information Processing Systems."
}
]
}
],
"index": 4
},
{
"bbox": [
69,
336,
289,
390
],
"type": "ref_text",
"angle": 0,
"lines": [
{
"bbox": [
69,
336,
289,
390
],
"spans": [
{
"bbox": [
69,
336,
289,
390
],
"type": "text",
"content": "Angelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, and François Fleuret. 2020. Transformers are rnns: Fast autoregressive transformers with linear attention. In International Conference on Machine Learning, pages 5156-5165. PMLR."
}
]
}
],
"index": 5
},
{
"bbox": [
69,
399,
289,
443
],
"type": "ref_text",
"angle": 0,
"lines": [
{
"bbox": [
69,
399,
289,
443
],
"spans": [
{
"bbox": [
69,
399,
289,
443
],
"type": "text",
"content": "Diederik P. Kingma and Jimmy Ba. 2015. Adam: A method for stochastic optimization. In 3rd International Conference on Learning Representations, San Diego, CA."
}
]
}
],
"index": 6
},
{
"bbox": [
69,
452,
289,
507
],
"type": "ref_text",
"angle": 0,
"lines": [
{
"bbox": [
69,
452,
289,
507
],
"spans": [
{
"bbox": [
69,
452,
289,
507
],
"type": "text",
"content": "Tomáš Kocisky, Jonathan Schwarz, Phil Blunsom, Chris Dyer, Karl Moritz Hermann, Gábor Melis, and Edward Grefenstette. 2018. The narrativeqa reading comprehension challenge. Transactions of the Association for Computational Linguistics, 6:317-328."
}
]
}
],
"index": 7
},
{
"bbox": [
69,
515,
289,
570
],
"type": "ref_text",
"angle": 0,
"lines": [
{
"bbox": [
69,
515,
289,
570
],
"spans": [
{
"bbox": [
69,
515,
289,
570
],
"type": "text",
"content": "Shuming Ma, Hongyu Wang, Shaohan Huang, Wenhui Wang, Zewen Chi, Li Dong, Alon Benhaim, Barun Patra, Vishrav Chaudhary, Xia Song, and Furu Wei. 2022a. TorchScale: Transformers at scale. CoRR, abs/2211.13184."
}
]
}
],
"index": 8
},
{
"bbox": [
69,
578,
289,
633
],
"type": "ref_text",
"angle": 0,
"lines": [
{
"bbox": [
69,
578,
289,
633
],
"spans": [
{
"bbox": [
69,
578,
289,
633
],
"type": "text",
"content": "Xuezhe Ma, Chunting Zhou, Xiang Kong, Junxian He, Liangke Gui, Graham Neubig, Jonathan May, and Luke Zettlemoyer. 2022b. Mega: Moving average equipped gated attention. arXiv preprint arXiv:2209.10655."
}
]
}
],
"index": 9
},
{
"bbox": [
69,
642,
289,
685
],
"type": "ref_text",
"angle": 0,
"lines": [
{
"bbox": [
69,
642,
289,
685
],
"spans": [
{
"bbox": [
69,
642,
289,
685
],
"type": "text",
"content": "Ofir Press, Noah A Smith, and Mike Lewis. 2021. Train short, test long: Attention with linear biases enables input length extrapolation. arXiv preprint arXiv:2108.12409."
}
]
}
],
"index": 10
},
{
"bbox": [
69,
694,
289,
771
],
"type": "ref_text",
"angle": 0,
"lines": [
{
"bbox": [
69,
694,
289,
771
],
"spans": [
{
"bbox": [
69,
694,
289,
771
],
"type": "text",
"content": "Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. 2021. Learning transferable visual models from natural language supervision. In International Conference on Machine Learning, pages 8748-8763. PMLR."
}
]
}
],
"index": 11
}
],
"sub_type": "ref_text"
},
{
"bbox": [
304,
72,
524,
771
],
"type": "list",
"angle": 0,
"index": 24,
"blocks": [
{
"bbox": [
304,
72,
524,
105
],
"type": "ref_text",
"angle": 0,
"lines": [
{
"bbox": [
304,
72,
524,
105
],
"spans": [
{
"bbox": [
304,
72,
524,
105
],
"type": "text",
"content": "Alec Radford, Jeff Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. 2019. Language models are unsupervised multitask learners."
}
]
}
],
"index": 13
},
{
"bbox": [
304,
117,
524,
182
],
"type": "ref_text",
"angle": 0,
"lines": [
{
"bbox": [
304,
117,
524,
182
],
"spans": [
{
"bbox": [
304,
117,
524,
182
],
"type": "text",
"content": "Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. 2020. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 21(140):1-67."
}
]
}
],
"index": 14
},
{
"bbox": [
304,
195,
524,
249
],
"type": "ref_text",
"angle": 0,
"lines": [
{
"bbox": [
304,
195,
524,
249
],
"spans": [
{
"bbox": [
304,
195,
524,
249
],
"type": "text",
"content": "Uri Shaham, Elad Segal, Maor Ivgi, Avia Efrat, Ori Yoran, Adi Haviv, Ankit Gupta, Wenhan Xiong, Mor Geva, Jonathan Berant, et al. 2022. Scrlows: Standardized comparison over long language sequences. arXiv preprint arXiv:2201.03533."
}
]
}
],
"index": 15
},
{
"bbox": [
304,
261,
524,
294
],
"type": "ref_text",
"angle": 0,
"lines": [
{
"bbox": [
304,
261,
524,
294
],
"spans": [
{
"bbox": [
304,
261,
524,
294
],
"type": "text",
"content": "Peter Shaw, Jakob Uszkoreit, and Ashish Vaswani. 2018. Self-attention with relative position representations. arXiv preprint arXiv:1803.02155."
}
]
}
],
"index": 16
},
{
"bbox": [
304,
306,
524,
349
],
"type": "ref_text",
"angle": 0,
"lines": [
{
"bbox": [
304,
306,
524,
349
],
"spans": [
{
"bbox": [
304,
306,
524,
349
],
"type": "text",
"content": "Jianlin Su, Yu Lu, Shengfeng Pan, Bo Wen, and Yunfeng Liu. 2021. Roformer: Enhanced transformer with rotary position embedding. arXiv preprint arXiv:2104.09864."
}
]
}
],
"index": 17
},
{
"bbox": [
304,
361,
524,
439
],
"type": "ref_text",
"angle": 0,
"lines": [
{
"bbox": [
304,
361,
524,
439
],
"spans": [
{
"bbox": [
304,
361,
524,
439
],
"type": "text",
"content": "Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, 4-9 December 2017, Long Beach, CA, USA, pages 6000-6010."
}
]
}
],
"index": 18
},
{
"bbox": [
304,
450,
524,
504
],
"type": "ref_text",
"angle": 0,
"lines": [
{
"bbox": [
304,
450,
524,
504
],
"spans": [
{
"bbox": [
304,
450,
524,
504
],
"type": "text",
"content": "Benyou Wang, Lifeng Shang, Christina Lioma, Xin Jiang, Hao Yang, Qun Liu, and Jakob Grue Simonsen. 2020a. On position embeddings in bert. In International Conference on Learning Representations."
}
]
}
],
"index": 19
},
{
"bbox": [
304,
517,
524,
550
],
"type": "ref_text",
"angle": 0,
"lines": [
{
"bbox": [
304,
517,
524,
550
],
"spans": [
{
"bbox": [
304,
517,
524,
550
],
"type": "text",
"content": "Sinong Wang, Belinda Z Li, Madian Khabsa, Han Fang, and Hao Ma. 2020b. Linformer: Self-attention with linear complexity. arXiv preprint arXiv:2006.04768."
}
]
}
],
"index": 20
},
{
"bbox": [
304,
561,
524,
628
],
"type": "ref_text",
"angle": 0,
"lines": [
{
"bbox": [
304,
561,
524,
628
],
"spans": [
{
"bbox": [
304,
561,
524,
628
],
"type": "text",
"content": "Wenhui Wang, Hangbo Bao, Li Dong, Johan Bjorck, Zhiliang Peng, Qiang Liu, Kriti Aggarwal, Owais Khan Mohammed, Saksham Singhal, Subhojit Som, et al. 2022. Image as a foreign language: BEiT pretraining for all vision and vision-language tasks. arXiv preprint arXiv:2208.10442."
}
]
}
],
"index": 21
},
{
"bbox": [
304,
640,
524,
694
],
"type": "ref_text",
"angle": 0,
"lines": [
{
"bbox": [
304,
640,
524,
694
],
"spans": [
{
"bbox": [
304,
640,
524,
694
],
"type": "text",
"content": "Wenhan Xiong, Barlas Oğuz, Anchit Gupta, Xilun Chen, Diana Liskovich, Omer Levy, Wen-tau Yih, and Yashar Mehdad. 2021. Simple local attentions remain competitive for long-context tasks. arXiv preprint arXiv:2112.07210."
}
]
}
],
"index": 22
},
{
"bbox": [
304,
706,
524,
771
],
"type": "ref_text",
"angle": 0,
"lines": [
{
"bbox": [
304,
706,
524,
771
],
"spans": [
{
"bbox": [
304,
706,
524,
771
],
"type": "text",
"content": "Zhilin Yang, Zihang Dai, Yiming Yang, Jaime Carbonell, Russ R Salakhutdinov, and Quoc V Le. 2019. XLNet: Generalized autoregressive pretraining for language understanding. In Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc."
}
]
}
],
"index": 23
}
],
"sub_type": "ref_text"
}
],
"discarded_blocks": [
{
"bbox": [
284,
781,
312,
791
],
"type": "page_number",
"angle": 0,
"lines": [
{
"bbox": [
284,
781,
312,
791
],
"spans": [
{
"bbox": [
284,
781,
312,
791
],
"type": "text",
"content": "14599"
}
]
}
],
"index": 25
}
],
"page_size": [
595,
841
],
"page_idx": 9
},
{
"para_blocks": [
{
"bbox": [
69,
72,
291,
212
],
"type": "list",
"angle": 0,
"index": 2,
"blocks": [
{
"bbox": [
69,
72,
291,
138
],
"type": "ref_text",
"angle": 0,
"lines": [
{
"bbox": [
69,
72,
291,
138
],
"spans": [
{
"bbox": [
69,
72,
291,
138
],
"type": "text",
"content": "Manzil Zaheer, Guru Guruganesh, Kumar Avinava Dubey, Joshua Ainslie, Chris Alberti, Santiago Ontanon, Philip Pham, Anirudh Ravula, Qifan Wang, Li Yang, et al. 2020. Big bird: Transformers for longer sequences. Advances in Neural Information Processing Systems, 33:17283-17297."
}
]
}
],
"index": 0
},
{
"bbox": [
69,
147,
291,
212
],
"type": "ref_text",
"angle": 0,
"lines": [
{
"bbox": [
69,
147,
291,
212
],
"spans": [
{
"bbox": [
69,
147,
291,
212
],
"type": "text",
"content": "Ming Zhong, Da Yin, Tao Yu, Ahmad Zaidi, Mutethia Mutuma, Rahul Jha, Ahmed Hassan Awadallah, Asli Celikyilmaz, Yang Liu, Xipeng Qiu, et al. 2021. Qsum: A new benchmark for query-based multi-domain meeting summarization. arXiv preprint arXiv:2104.05938."
}
]
}
],
"index": 1
}
],
"sub_type": "ref_text"
}
],
"discarded_blocks": [
{
"bbox": [
285,
781,
312,
791
],
"type": "page_number",
"angle": 0,
"lines": [
{
"bbox": [
285,
781,
312,
791
],
"spans": [
{
"bbox": [
285,
781,
312,
791
],
"type": "text",
"content": "14600"
}
]
}
],
"index": 3
}
],
"page_size": [
595,
841
],
"page_idx": 10
},
{
"para_blocks": [
{
"bbox": [
69,
70,
214,
84
],
"type": "title",
"angle": 0,
"lines": [
{
"bbox": [
69,
70,
214,
84
],
"spans": [
{
"bbox": [
69,
70,
214,
84
],
"type": "text",
"content": "A Additional Experiments"
}
]
}
],
"index": 0
},
{
"bbox": [
67,
92,
291,
213
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
67,
92,
291,
213
],
"spans": [
{
"bbox": [
67,
92,
291,
213
],
"type": "text",
"content": "Besides the experiments in Section 4, we run language modeling evaluation on Arxiv and NarrativeQA (Kočisky et al., 2018). The results are shown in Table 6. These datasets have their shortcomings. The article length of Arxiv is usually less than 8192, and part of NarrativeQA's corpus is sampled from PG19, which is in the training dataset. Therefore, we show them in the appendix instead of the main content."
}
]
}
],
"index": 1
},
{
"bbox": [
68,
224,
269,
238
],
"type": "title",
"angle": 0,
"lines": [
{
"bbox": [
68,
224,
269,
238
],
"spans": [
{
"bbox": [
68,
224,
269,
238
],
"type": "text",
"content": "B Hyperparameters for Pre-Training"
}
]
}
],
"index": 2
},
{
"bbox": [
67,
245,
291,
393
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
67,
245,
291,
393
],
"spans": [
{
"bbox": [
67,
245,
291,
393
],
"type": "text",
"content": "As shown in Table 7, we present the hyperparameters for pre-training. The setting keeps the same among all Transformer variants. We follow medium-size GPT3 (Brown et al., 2020), 24 layers, 1024 hidden size, 4096 FFN inner hidden size, and 16 attention heads. The number of batch tokens is "
},
{
"bbox": [
67,
245,
291,
393
],
"type": "inline_equation",
"content": "0.5\\mathrm{M}"
},
{
"bbox": [
67,
245,
291,
393
],
"type": "text",
"content": " for pre-training 1024, and the number of batch sentences is 512. We use Adam (Kingma and Ba, 2015) optimizer with "
},
{
"bbox": [
67,
245,
291,
393
],
"type": "inline_equation",
"content": "\\beta_{1} = 0.9, \\beta_{2} = 0.98, \\epsilon = 10^{-6}"
},
{
"bbox": [
67,
245,
291,
393
],
"type": "text",
"content": ". The warmup steps are "
},
{
"bbox": [
67,
245,
291,
393
],
"type": "inline_equation",
"content": "20\\mathrm{k}"
},
{
"bbox": [
67,
245,
291,
393
],
"type": "text",
"content": ", and we use "
},
{
"bbox": [
67,
245,
291,
393
],
"type": "inline_equation",
"content": "50\\mathrm{k}"
},
{
"bbox": [
67,
245,
291,
393
],
"type": "text",
"content": " checkpoints for evaluation."
}
]
}
],
"index": 3
}
],
"discarded_blocks": [
{
"bbox": [
284,
781,
311,
791
],
"type": "page_number",
"angle": 0,
"lines": [
{
"bbox": [
284,
781,
311,
791
],
"spans": [
{
"bbox": [
284,
781,
311,
791
],
"type": "text",
"content": "14601"
}
]
}
],
"index": 4
}
],
"page_size": [
595,
841
],
"page_idx": 11
},
{
"para_blocks": [
{
"type": "table",
"bbox": [
137,
68,
456,
263
],
"blocks": [
{
"bbox": [
137,
68,
456,
263
],
"lines": [
{
"bbox": [
137,
68,
456,
263
],
"spans": [
{
"bbox": [
137,
68,
456,
263
],
"type": "table",
"html": "<table><tr><td rowspan=\"2\">Length</td><td>256</td><td>512</td><td>1024</td><td>2048</td><td>4096</td></tr><tr><td colspan=\"3\">Interpolation</td><td colspan=\"2\">Extrapolation</td></tr><tr><td colspan=\"6\">arXiv</td></tr><tr><td>Transformer</td><td>29.74</td><td>23.6</td><td>19.59</td><td>102.09</td><td>1240.77</td></tr><tr><td>Alibi</td><td>26.53</td><td>21.07</td><td>17.53</td><td>15.38</td><td>16.88</td></tr><tr><td>Roformer</td><td>25.89</td><td>20.6</td><td>17.24</td><td>49.29</td><td>199.25</td></tr><tr><td>LEX Transformer (Ours)</td><td>25.73</td><td>20.48</td><td>17.14</td><td>15.81</td><td>15.19</td></tr><tr><td colspan=\"6\">NarrativeQA</td></tr><tr><td>Transformer</td><td>16.74</td><td>14.42</td><td>13.02</td><td>58.95</td><td>574.91</td></tr><tr><td>Alibi</td><td>15.58</td><td>13.45</td><td>12.15</td><td>11.4</td><td>12.09</td></tr><tr><td>Roformer</td><td>15.21</td><td>13.16</td><td>11.93</td><td>20.72</td><td>35.14</td></tr><tr><td>LEX Transformer (Ours)</td><td>14.82</td><td>12.86</td><td>11.67</td><td>11.14</td><td>10.93</td></tr></table>",
"image_path": "0e123cf8b4239ea2bbd1737d2c3978d1f2be2ea3e01dfb5b5647ef4dfc3e4b8c.jpg"
}
]
}
],
"index": 0,
"angle": 0,
"type": "table_body"
}
],
"index": 0
},
{
"type": "table",
"bbox": [
96,
435,
262,
640
],
"blocks": [
{
"bbox": [
67,
271,
526,
321
],
"lines": [
{
"bbox": [
67,
271,
526,
321
],
"spans": [
{
"bbox": [
67,
271,
526,
321
],
"type": "text",
"content": "Table 6: Results of perplexity with different lengths. The language models are trained with a length of 1024 and then evaluated on various lengths. LEX obtains better performance not only on shorter texts (i.e., interpolation) but also on longer texts (i.e., extrapolation). The red color indicates that the perplexity begins increasing compared with the shorter length. LEX is the only method that has lower perplexity along with increased evaluation length."
}
]
}
],
"index": 1,
"angle": 0,
"type": "table_caption"
},
{
"bbox": [
96,
435,
262,
640
],
"lines": [
{
"bbox": [
96,
435,
262,
640
],
"spans": [
{
"bbox": [
96,
435,
262,
640
],
"type": "table",
"html": "<table><tr><td>Hyperparameters</td><td>Value</td></tr><tr><td>Layers</td><td>24</td></tr><tr><td>Hidden size</td><td>1024</td></tr><tr><td>FFN inner hidden size</td><td>4096</td></tr><tr><td>Attention heads</td><td>16</td></tr><tr><td>Training steps</td><td>50K</td></tr><tr><td>Batch tokens per task</td><td>0.5M</td></tr><tr><td>Adam ε</td><td>1e-6</td></tr><tr><td>Adam β</td><td>(0.9, 0.98)</td></tr><tr><td>Learning rate</td><td>3e-4</td></tr><tr><td>Learning rate schedule</td><td>Polynomial</td></tr><tr><td>Warmup steps</td><td>20,000</td></tr><tr><td>Gradient clipping</td><td>2.0</td></tr><tr><td>Weight decay</td><td>0.01</td></tr></table>",
"image_path": "c9ec05d098608391db62960fb76585f0cdcd7e24edbbaf97c47f46cf4e81d668.jpg"
}
]
}
],
"index": 2,
"angle": 0,
"type": "table_body"
}
],
"index": 2
},
{
"bbox": [
67,
647,
291,
673
],
"lines": [
{
"bbox": [
67,
647,
291,
673
],
"spans": [
{
"bbox": [
67,
647,
291,
673
],
"type": "text",
"content": "Table 7: Hyperparameters used for language model pretraining."
}
]
}
],
"index": 3,
"angle": 0,
"type": "text"
}
],
"discarded_blocks": [
{
"bbox": [
284,
781,
312,
791
],
"type": "page_number",
"angle": 0,
"lines": [
{
"bbox": [
284,
781,
312,
791
],
"spans": [
{
"bbox": [
284,
781,
312,
791
],
"type": "text",
"content": "14602"
}
]
}
],
"index": 4
}
],
"page_size": [
595,
841
],
"page_idx": 12
},
{
"para_blocks": [
{
"bbox": [
68,
90,
192,
103
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
68,
90,
192,
103
],
"spans": [
{
"bbox": [
68,
90,
192,
103
],
"type": "text",
"content": "A For every submission:"
}
]
}
],
"index": 1
},
{
"bbox": [
77,
106,
317,
121
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
77,
106,
317,
121
],
"spans": [
{
"bbox": [
77,
106,
317,
121
],
"type": "text",
"content": "A1. Did you describe the limitations of your work?"
}
]
}
],
"index": 2
},
{
"bbox": [
89,
121,
234,
134
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
89,
121,
234,
134
],
"spans": [
{
"bbox": [
89,
121,
234,
134
],
"type": "text",
"content": "In the final part after conclusion"
}
]
}
],
"index": 3
},
{
"bbox": [
76,
143,
329,
157
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
76,
143,
329,
157
],
"spans": [
{
"bbox": [
76,
143,
329,
157
],
"type": "text",
"content": "A2. Did you discuss any potential risks of your work?"
}
]
}
],
"index": 4
},
{
"bbox": [
89,
157,
448,
170
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
89,
157,
448,
170
],
"spans": [
{
"bbox": [
89,
157,
448,
170
],
"type": "text",
"content": "Not applicable. It is fundamental research and not tied to particular applications."
}
]
}
],
"index": 5
},
{
"bbox": [
77,
178,
414,
193
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
77,
178,
414,
193
],
"spans": [
{
"bbox": [
77,
178,
414,
193
],
"type": "text",
"content": "A3. Do the abstract and introduction summarize the paper's main claims?"
}
]
}
],
"index": 6
},
{
"bbox": [
89,
193,
190,
206
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
89,
193,
190,
206
],
"spans": [
{
"bbox": [
89,
193,
190,
206
],
"type": "text",
"content": "Abstract and Section 1"
}
]
}
],
"index": 7
},
{
"bbox": [
77,
215,
398,
229
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
77,
215,
398,
229
],
"spans": [
{
"bbox": [
77,
215,
398,
229
],
"type": "text",
"content": "A4. Have you used AI writing assistants when working on this paper?"
}
]
}
],
"index": 8
},
{
"bbox": [
89,
230,
138,
243
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
89,
230,
138,
243
],
"spans": [
{
"bbox": [
89,
230,
138,
243
],
"type": "text",
"content": "Left blank."
}
]
}
],
"index": 9
},
{
"bbox": [
68,
252,
290,
266
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
68,
252,
290,
266
],
"spans": [
{
"bbox": [
68,
252,
290,
266
],
"type": "text",
"content": "B Did you use or create scientific artifacts?"
}
]
}
],
"index": 10
},
{
"bbox": [
79,
270,
123,
282
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
79,
270,
123,
282
],
"spans": [
{
"bbox": [
79,
270,
123,
282
],
"type": "text",
"content": "Section 4"
}
]
}
],
"index": 11
},
{
"bbox": [
77,
291,
315,
306
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
77,
291,
315,
306
],
"spans": [
{
"bbox": [
77,
291,
315,
306
],
"type": "text",
"content": "B1. Did you cite the creators of artifacts you used?"
}
]
}
],
"index": 12
},
{
"bbox": [
90,
306,
133,
317
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
90,
306,
133,
317
],
"spans": [
{
"bbox": [
90,
306,
133,
317
],
"type": "text",
"content": "Section 4"
}
]
}
],
"index": 13
},
{
"bbox": [
76,
328,
464,
342
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
76,
328,
464,
342
],
"spans": [
{
"bbox": [
76,
328,
464,
342
],
"type": "text",
"content": "B2. Did you discuss the license or terms for use and / or distribution of any artifacts?"
}
]
}
],
"index": 14
},
{
"bbox": [
89,
343,
525,
356
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
89,
343,
525,
356
],
"spans": [
{
"bbox": [
89,
343,
525,
356
],
"type": "text",
"content": "Not applicable. These tools and models are publicly available and free of use for research purposes."
}
]
}
],
"index": 15
},
{
"bbox": [
77,
364,
524,
417
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
77,
364,
524,
417
],
"spans": [
{
"bbox": [
77,
364,
524,
417
],
"type": "text",
"content": "B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)?"
}
]
}
],
"index": 16
},
{
"bbox": [
89,
419,
286,
431
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
89,
419,
286,
431
],
"spans": [
{
"bbox": [
89,
419,
286,
431
],
"type": "text",
"content": "The use is consistent with their intended use."
}
]
}
],
"index": 17
},
{
"bbox": [
77,
440,
524,
481
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
77,
440,
524,
481
],
"spans": [
{
"bbox": [
77,
440,
524,
481
],
"type": "text",
"content": "B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it?"
}
]
}
],
"index": 18
},
{
"bbox": [
90,
482,
133,
493
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
90,
482,
133,
493
],
"spans": [
{
"bbox": [
90,
482,
133,
493
],
"type": "text",
"content": "Section 4"
}
]
}
],
"index": 19
},
{
"bbox": [
77,
503,
524,
531
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
77,
503,
524,
531
],
"spans": [
{
"bbox": [
77,
503,
524,
531
],
"type": "text",
"content": "B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.?"
}
]
}
],
"index": 20
},
{
"bbox": [
90,
532,
133,
544
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
90,
532,
133,
544
],
"spans": [
{
"bbox": [
90,
532,
133,
544
],
"type": "text",
"content": "Section 4"
}
]
}
],
"index": 21
},
{
"bbox": [
77,
553,
524,
622
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
77,
553,
524,
622
],
"spans": [
{
"bbox": [
77,
553,
524,
622
],
"type": "text",
"content": "B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be."
}
]
}
],
"index": 22
},
{
"bbox": [
90,
623,
133,
634
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
90,
623,
133,
634
],
"spans": [
{
"bbox": [
90,
623,
133,
634
],
"type": "text",
"content": "Section 4"
}
]
}
],
"index": 23
},
{
"bbox": [
68,
643,
293,
657
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
68,
643,
293,
657
],
"spans": [
{
"bbox": [
68,
643,
293,
657
],
"type": "text",
"content": "C Did you run computational experiments?"
}
]
}
],
"index": 24
},
{
"bbox": [
79,
662,
123,
673
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
79,
662,
123,
673
],
"spans": [
{
"bbox": [
79,
662,
123,
673
],
"type": "text",
"content": "Section 4"
}
]
}
],
"index": 25
},
{
"bbox": [
77,
683,
524,
711
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
77,
683,
524,
711
],
"spans": [
{
"bbox": [
77,
683,
524,
711
],
"type": "text",
"content": "C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used?"
}
]
}
],
"index": 26
},
{
"bbox": [
90,
712,
211,
724
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
90,
712,
211,
724
],
"spans": [
{
"bbox": [
90,
712,
211,
724
],
"type": "text",
"content": "Section4.1 and Appendix B"
}
]
}
],
"index": 27
},
{
"bbox": [
67,
730,
522,
751
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
67,
730,
522,
751
],
"spans": [
{
"bbox": [
67,
730,
522,
751
],
"type": "text",
"content": "The Responsible NLP Checklist used at ACL 2023 is adopted from NAACL 2022, with the addition of a question on AI writing assistance."
}
]
}
],
"index": 28
}
],
"discarded_blocks": [
{
"bbox": [
79,
71,
258,
84
],
"type": "header",
"angle": 0,
"lines": [
{
"bbox": [
79,
71,
258,
84
],
"spans": [
{
"bbox": [
79,
71,
258,
84
],
"type": "text",
"content": "ACL 2023 Responsible NLP Checklist"
}
]
}
],
"index": 0
},
{
"bbox": [
284,
781,
312,
791
],
"type": "page_number",
"angle": 0,
"lines": [
{
"bbox": [
284,
781,
312,
791
],
"spans": [
{
"bbox": [
284,
781,
312,
791
],
"type": "text",
"content": "14603"
}
]
}
],
"index": 29
}
],
"page_size": [
595,
841
],
"page_idx": 13
},
{
"para_blocks": [
{
"bbox": [
77,
70,
523,
97
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
77,
70,
523,
97
],
"spans": [
{
"bbox": [
77,
70,
523,
97
],
"type": "text",
"content": "C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values?"
}
]
}
],
"index": 0
},
{
"bbox": [
89,
99,
211,
111
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
89,
99,
211,
111
],
"spans": [
{
"bbox": [
89,
99,
211,
111
],
"type": "text",
"content": "Section4.1 and Appendix B"
}
]
}
],
"index": 1
},
{
"bbox": [
77,
120,
525,
160
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
77,
120,
525,
160
],
"spans": [
{
"bbox": [
77,
120,
525,
160
],
"type": "text",
"content": "C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run?"
}
]
}
],
"index": 2
},
{
"bbox": [
89,
162,
133,
173
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
89,
162,
133,
173
],
"spans": [
{
"bbox": [
89,
162,
133,
173
],
"type": "text",
"content": "Section 4"
}
]
}
],
"index": 3
},
{
"bbox": [
77,
183,
525,
223
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
77,
183,
525,
223
],
"spans": [
{
"bbox": [
77,
183,
525,
223
],
"type": "text",
"content": "C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)?"
}
]
}
],
"index": 4
},
{
"bbox": [
89,
225,
140,
236
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
89,
225,
140,
236
],
"spans": [
{
"bbox": [
89,
225,
140,
236
],
"type": "text",
"content": "Section 4.1"
}
]
}
],
"index": 5
},
{
"bbox": [
67,
247,
522,
260
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
67,
247,
522,
260
],
"spans": [
{
"bbox": [
67,
247,
522,
260
],
"type": "text",
"content": "D Did you use human annotators (e.g., crowdworkers) or research with human participants?"
}
]
}
],
"index": 6
},
{
"bbox": [
79,
264,
127,
277
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
79,
264,
127,
277
],
"spans": [
{
"bbox": [
79,
264,
127,
277
],
"type": "text",
"content": "Left blank."
}
]
}
],
"index": 7
},
{
"bbox": [
76,
286,
525,
313
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
76,
286,
525,
313
],
"spans": [
{
"bbox": [
76,
286,
525,
313
],
"type": "text",
"content": "D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.?"
}
]
}
],
"index": 8
},
{
"bbox": [
89,
315,
148,
327
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
89,
315,
148,
327
],
"spans": [
{
"bbox": [
89,
315,
148,
327
],
"type": "text",
"content": "No response."
}
]
}
],
"index": 9
},
{
"bbox": [
76,
336,
525,
376
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
76,
336,
525,
376
],
"spans": [
{
"bbox": [
76,
336,
525,
376
],
"type": "text",
"content": "D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants' demographic (e.g., country of residence)?"
}
]
}
],
"index": 10
},
{
"bbox": [
89,
378,
148,
390
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
89,
378,
148,
390
],
"spans": [
{
"bbox": [
89,
378,
148,
390
],
"type": "text",
"content": "No response."
}
]
}
],
"index": 11
},
{
"bbox": [
76,
400,
525,
439
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
76,
400,
525,
439
],
"spans": [
{
"bbox": [
76,
400,
525,
439
],
"type": "text",
"content": "D3. Did you discuss whether and how consent was obtained from people whose data you're using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used?"
}
]
}
],
"index": 12
},
{
"bbox": [
89,
441,
148,
454
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
89,
441,
148,
454
],
"spans": [
{
"bbox": [
89,
441,
148,
454
],
"type": "text",
"content": "No response."
}
]
}
],
"index": 13
},
{
"bbox": [
76,
462,
520,
476
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
76,
462,
520,
476
],
"spans": [
{
"bbox": [
76,
462,
520,
476
],
"type": "text",
"content": "D4. Was the data collection protocol approved (or determined exempt) by an ethics review board?"
}
]
}
],
"index": 14
},
{
"bbox": [
89,
477,
148,
489
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
89,
477,
148,
489
],
"spans": [
{
"bbox": [
89,
477,
148,
489
],
"type": "text",
"content": "No response."
}
]
}
],
"index": 15
},
{
"bbox": [
76,
498,
524,
524
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
76,
498,
524,
524
],
"spans": [
{
"bbox": [
76,
498,
524,
524
],
"type": "text",
"content": "D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data?"
}
]
}
],
"index": 16
},
{
"bbox": [
89,
527,
148,
539
],
"type": "text",
"angle": 0,
"lines": [
{
"bbox": [
89,
527,
148,
539
],
"spans": [
{
"bbox": [
89,
527,
148,
539
],
"type": "text",
"content": "No response."
}
]
}
],
"index": 17
}
],
"discarded_blocks": [
{
"bbox": [
284,
780,
312,
791
],
"type": "page_number",
"angle": 0,
"lines": [
{
"bbox": [
284,
780,
312,
791
],
"spans": [
{
"bbox": [
284,
780,
312,
791
],
"type": "text",
"content": "14604"
}
]
}
],
"index": 18
}
],
"page_size": [
595,
841
],
"page_idx": 14
}
],
"_backend": "vlm",
"_version_name": "2.6.4"
}