<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing DTD v2.3 20070202//EN" "journalpublishing.dtd">
<article xml:lang="EN" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" article-type="research-article">
<front>
<journal-meta>
<journal-id journal-id-type="publisher-id">Front. Comput. Sci.</journal-id>
<journal-title>Frontiers in Computer Science</journal-title>
<abbrev-journal-title abbrev-type="pubmed">Front. Comput. Sci.</abbrev-journal-title>
<issn pub-type="epub">2624-9898</issn>
<publisher>
<publisher-name>Frontiers Media S.A.</publisher-name>
</publisher>
</journal-meta>
<article-meta>
<article-id pub-id-type="doi">10.3389/fcomp.2025.1626899</article-id>
<article-categories>
<subj-group subj-group-type="heading">
<subject>Computer Science</subject>
<subj-group>
<subject>Original Research</subject>
</subj-group>
</subj-group>
</article-categories>
<title-group>
<article-title>Exploring the impact of fixed theta values in RoPE on character-level language model performance and efficiency</article-title>
</title-group>
<contrib-group>
<contrib contrib-type="author">
<name><surname>Huang</surname> <given-names>Zhigao</given-names></name>
<role content-type="https://credit.niso.org/contributor-roles/formal-analysis/"/>
<role content-type="https://credit.niso.org/contributor-roles/software/"/>
<role content-type="https://credit.niso.org/contributor-roles/visualization/"/>
<role content-type="https://credit.niso.org/contributor-roles/writing-original-draft/"/>
</contrib>
<contrib contrib-type="author" corresp="yes">
<name><surname>Chen</surname> <given-names>Musheng</given-names></name>
<xref ref-type="corresp" rid="c001"><sup>&#x0002A;</sup></xref>
<uri xlink:href="http://loop.frontiersin.org/people/3064205/overview"/>
<role content-type="https://credit.niso.org/contributor-roles/software/"/>
<role content-type="https://credit.niso.org/contributor-roles/validation/"/>
<role content-type="https://credit.niso.org/contributor-roles/writing-review-editing/"/>
</contrib>
<contrib contrib-type="author">
<name><surname>Zheng</surname> <given-names>Shiyan</given-names></name>
<role content-type="https://credit.niso.org/contributor-roles/formal-analysis/"/>
<role content-type="https://credit.niso.org/contributor-roles/investigation/"/>
<role content-type="https://credit.niso.org/contributor-roles/methodology/"/>
<role content-type="https://credit.niso.org/contributor-roles/visualization/"/>
<role content-type="https://credit.niso.org/contributor-roles/writing-review-editing/"/>
</contrib>
</contrib-group>
<aff><institution>College of Physics and Information Engineering, Quanzhou Normal University</institution>, <addr-line>Quanzhou</addr-line>, <country>China</country></aff>
<author-notes>
<fn fn-type="edited-by"><p>Edited by: Marlon Santiago Vi&#x000F1;&#x000E1;n-Lude&#x000F1;a, Catholic University of the North, Chile</p></fn>
<fn fn-type="edited-by"><p>Reviewed by: Agustinus Bimo Gumelar, Widya Mandala Catholic University Surabaya, Indonesia</p>
<p>Kalaiyarasi Mani, Bannari Amman Institute of Technology (BIT), India</p></fn>
<corresp id="c001">&#x0002A;Correspondence: Musheng Chen <email>07015&#x00040;qztc.edu.cn</email></corresp>
</author-notes>
<pub-date pub-type="epub">
<day>22</day>
<month>08</month>
<year>2025</year>
</pub-date>
<pub-date pub-type="collection">
<year>2025</year>
</pub-date>
<volume>7</volume>
<elocation-id>1626899</elocation-id>
<history>
<date date-type="received">
<day>12</day>
<month>05</month>
<year>2025</year>
</date>
<date date-type="accepted">
<day>05</day>
<month>08</month>
<year>2025</year>
</date>
</history>
<permissions>
<copyright-statement>Copyright &#x000A9; 2025 Huang, Chen and Zheng.</copyright-statement>
<copyright-year>2025</copyright-year>
<copyright-holder>Huang, Chen and Zheng</copyright-holder>
<license xlink:href="http://creativecommons.org/licenses/by/4.0/"><p>This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.</p></license>
</permissions>
<abstract>
<p>Rotary Positional Embedding (RoPE) is a widely used technique in Transformers, influenced by the hyperparameter theta (&#x003B8;). However, the impact of varying *fixed* theta values, especially the trade-off between performance and efficiency on tasks like character-level modeling, remains under-explored. This paper presents a systematic evaluation of RoPE with fixed theta values (ranging from 500 to 50,000) on a character-level GPT model across three datasets: Tiny Shakespeare, Enwik8, and Text8, compared against the standard &#x003B8; &#x0003D; 10, 000 baseline. However, all non-default theta configurations incur significant computational overhead: inference speed is approximately halved across all datasets, suggesting implementation&#x02014;specific bottlenecks rather than theta&#x02014;dependent costs. This study quantifies a critical performance&#x02014;efficiency trade-off when tuning fixed RoPE theta. Our findings emphasize the practical need to balance generalization gains with computational budgets during model development and deployment, contributing empirical insights into RoPE hyperparameter sensitivity and demonstrating that optimal theta selection is highly dataset-dependent. These insights suggest that future positional encoding designs could benefit from adaptive &#x003B8; scheduling or dataset-specific &#x003B8; optimization strategies to maximize both performance and computational efficiency.</p></abstract>
<kwd-group>
<kwd>transformer</kwd>
<kwd>positional encoding</kwd>
<kwd>rotary positional embedding (RoPE)</kwd>
<kwd>language modeling</kwd>
<kwd>character-level models</kwd>
<kwd>hyperparameter tuning</kwd>
<kwd>computational efficiency</kwd>
</kwd-group>
<counts>
<fig-count count="2"/>
<table-count count="3"/>
<equation-count count="5"/>
<ref-count count="61"/>
<page-count count="12"/>
<word-count count="8682"/>
</counts>
<custom-meta-wrap>
<custom-meta>
<meta-name>section-at-acceptance</meta-name>
<meta-value>Software</meta-value>
</custom-meta>
</custom-meta-wrap>
</article-meta>
</front>
<body>
<sec sec-type="intro" id="s1">
<title>1 Introduction</title>
<p>Transformer architectures (<xref ref-type="bibr" rid="B54">Vaswani et al., 2017</xref>; <xref ref-type="bibr" rid="B11">Devlin et al., 2019</xref>; <xref ref-type="bibr" rid="B24">Kenton and Toutanova, 2019</xref>; <xref ref-type="bibr" rid="B40">Radford et al., 2018</xref>, <xref ref-type="bibr" rid="B41">2019</xref>; <xref ref-type="bibr" rid="B6">Brown et al., 2020</xref>; <xref ref-type="bibr" rid="B42">Raffel et al., 2020</xref>; <xref ref-type="bibr" rid="B30">Lewis et al., 2020</xref>; <xref ref-type="bibr" rid="B32">Liu et al., 2019</xref>; <xref ref-type="bibr" rid="B59">Yang et al., 2019</xref>; <xref ref-type="bibr" rid="B28">Lan et al., 2019</xref>; <xref ref-type="bibr" rid="B61">Zhang et al., 2020</xref>; <xref ref-type="bibr" rid="B12">Dosovitskiy et al., 2021</xref>) have revolutionized sequence modeling (<xref ref-type="bibr" rid="B51">Sutskever et al., 2014</xref>; <xref ref-type="bibr" rid="B4">Bahdanau et al., 2014</xref>; <xref ref-type="bibr" rid="B34">Luong et al., 2015</xref>; <xref ref-type="bibr" rid="B13">Gehring et al., 2017</xref>; <xref ref-type="bibr" rid="B58">Wu et al., 2016</xref>), achieving state-of-the-art results across numerous natural language processing tasks (<xref ref-type="bibr" rid="B56">Wang et al., 2018</xref>, <xref ref-type="bibr" rid="B55">2019</xref>). A key component enabling Transformers to process sequences is the positional encoding (PE) mechanism (<xref ref-type="bibr" rid="B13">Gehring et al., 2017</xref>), which injects information about the order of tokens, as the self-attention mechanism itself is permutation-invariant. Various PE methods have been proposed, ranging from absolute sinusoidal or learned embeddings (<xref ref-type="bibr" rid="B54">Vaswani et al., 2017</xref>; <xref ref-type="bibr" rid="B11">Devlin et al., 2019</xref>) to relative positional representations (<xref ref-type="bibr" rid="B46">Shaw et al., 2018</xref>; <xref ref-type="bibr" rid="B9">Dai et al., 2019</xref>).</p>
<p>Among these, Rotary Positional Embedding (RoPE) (<xref ref-type="bibr" rid="B49">Su et al., 2021</xref>; <xref ref-type="bibr" rid="B53">Touvron et al., 2023</xref>; <xref ref-type="bibr" rid="B2">Anil et al., 2023</xref>; <xref ref-type="bibr" rid="B8">Chowdhery et al., 2023</xref>; <xref ref-type="bibr" rid="B20">Jiang et al., 2023</xref>; <xref ref-type="bibr" rid="B1">Almazrouei et al., 2023</xref>; <xref ref-type="bibr" rid="B57">Workshop et al., 2022</xref>) has emerged as a popular and effective approach. RoPE applies position-dependent rotations to query and key vectors in the self-attention mechanism, inherently capturing relative positional information while maintaining desirable properties like decaying intra-attention scores with increasing distance. RoPE&#x00027;s performance often relies on a crucial hyperparameter, theta (&#x003B8;), which acts as a base period controlling the range of frequencies used for rotation. A default value of &#x003B8; &#x0003D; 10, 000 is commonly employed across various models and tasks (<xref ref-type="bibr" rid="B53">Touvron et al., 2023</xref>; OpenAI, <xref ref-type="bibr" rid="B37">2023</xref>).</p>
<p>Despite RoPE&#x00027;s widespread adoption, often relying on the default &#x003B8; &#x0003D; 10, 000, the sensitivity of model performance and efficiency to variations in this hyperparameter, particularly when employing *fixed* theta values, remains inadequately characterized. Much recent work on RoPE focuses on extending context length (<xref ref-type="bibr" rid="B50">Sun et al., 2023</xref>) or developing adaptive mechanisms (<xref ref-type="bibr" rid="B10">Dehghani et al., 2018</xref>), leaving a gap in understanding the fundamental trade-offs involved in selecting a simple, fixed theta. This is especially pertinent for tasks like character-level language modeling (<xref ref-type="bibr" rid="B14">Graves, 2013</xref>; <xref ref-type="bibr" rid="B22">Karpathy, 2015</xref>; <xref ref-type="bibr" rid="B25">Kim et al., 2016</xref>), where the optimal positional frequency sensitivity might differ from that of token-level models. Furthermore, the computational overhead associated with different RoPE configurations is often neglected in performance comparisons (<xref ref-type="bibr" rid="B52">Tay et al., 2020</xref>; <xref ref-type="bibr" rid="B48">So et al., 2021</xref>). This study directly addresses these gaps by systematically evaluating the impact of fixed RoPE theta values on both generalization performance and computational efficiency for a character-level task.</p>
<sec>
<title>1.1 Problem statement and research scope</title>
<p>This work addresses three critical gaps in the current understanding of RoPE hyperparameter sensitivity: (1) <bold>Limited empirical validation</bold> of the widely-adopted default &#x003B8; &#x0003D; 10, 000, which lacks systematic justification across different tasks and datasets; (2) <bold>Insufficient characterization</bold> of the performance-efficiency trade-offs when varying fixed theta values, particularly for character-level modeling where positional frequency requirements may differ from token-level tasks; and (3) <bold>Neglected computational overhead analysis</bold> in positional encoding comparisons, which is crucial for practical deployment decisions. Our study specifically focuses on fixed theta values (not adaptive mechanisms) to establish fundamental baselines and trade-off characterizations that can inform more sophisticated approaches. We limit our scope to character-level language modeling to enable controlled analysis of fine-grained positional dependencies while providing insights transferable to other sequence modeling tasks.</p>
<p>Our investigation seeks answers to the following questions:</p>
<list list-type="bullet">
<list-item><p>How does the fixed RoPE theta value impact the final validation performance and training convergence of a character-level language model across different datasets?</p></list-item>
<list-item><p>Is there an optimal fixed theta value for this specific task setting and does it generalize across datasets?</p></list-item>
<list-item><p>What is the computational cost (training time, inference speed) associated with different fixed theta values compared to a standard baseline?</p></list-item>
<list-item><p>What insights can be drawn about the relationship between RoPE&#x00027;s frequency resolution (controlled by theta) and model behavior?</p></list-item>
<list-item><p>How do dataset characteristics influence the optimal theta selection and performance sensitivity?</p></list-item>
</list>
<p>The choice of theta range (500 to 50,000) was motivated by theoretical considerations and preliminary experiments. Lower values (500&#x02013;1,000) provide high-frequency position encoding suitable for fine-grained character dependencies, while higher values (20,000&#x02013;50,000) offer lower frequencies potentially better for longer-range context. The standard &#x003B8; &#x0003D; 10, 000 serves as a natural midpoint, with &#x003B8; &#x0003D; 5, 000 representing an intermediate frequency resolution.</p>
<p>To answer these questions, we train and evaluate a standard GPT-style architecture (<xref ref-type="bibr" rid="B6">Brown et al., 2020</xref>; <xref ref-type="bibr" rid="B40">Radford et al., 2018</xref>, <xref ref-type="bibr" rid="B41">2019</xref>) on three character-level datasets: Tiny Shakespeare (<xref ref-type="bibr" rid="B22">Karpathy, 2015</xref>), Enwik8, and Text8, representing different text characteristics and complexities. We integrate RoPE into the self-attention mechanism and systematically vary the fixed theta parameter across values of 500, 1,000, 5,000, 10,000 (baseline), 20,000, and 50,000. We conduct experiments with three independent random seeds (1,337, 1,338, 1,339) for each dataset and configuration to ensure statistical robustness and reproducible results.</p>
<p>Our experiments reveal dataset-specific optimal theta values: &#x003B8; &#x0003D; 5, 000 for Shakespeare and Text8, and &#x003B8; &#x0003D; 50, 000 for Enwik8, with performance improvements ranging from 0.5% to 2.1%. Enwik8 shows the highest sensitivity to theta tuning, while Shakespeare demonstrates the most stable performance across configurations. However, a striking finding is that all configurations using our fixed-theta RoPE implementation demonstrate significantly slower inference speeds (approximately half the tokens per second) and slightly longer training times compared to the baseline, irrespective of the specific theta value chosen across all three datasets.</p>
<p>The main contributions of this paper are:</p>
<list list-type="bullet">
<list-item><p>A systematic empirical evaluation of fixed theta values (from 500 to 50,000) in RoPE for character-level language modeling across three diverse datasets (Shakespeare, Enwik8, Text8).</p></list-item>
<list-item><p>Discovery of dataset-specific optimal theta values: &#x003B8; &#x0003D; 5, 000 for Shakespeare and Text8, &#x003B8; &#x0003D; 50, 000 for Enwik8, demonstrating that optimal theta selection is highly dataset-dependent.</p></list-item>
<list-item><p>Quantification of a significant performance-efficiency trade-off, where improved validation loss with tuned fixed theta correlates with substantially increased computational cost in our implementation consistently across all datasets.</p></list-item>
<list-item><p>Empirical evidence illustrating the non-monotonic impact of RoPE&#x00027;s theta parameter on model generalization and the varying sensitivity of different datasets to theta tuning (0.5%&#x02013;2.1% improvement range).</p></list-item>
<list-item><p>Identification of implementation-specific computational bottlenecks affecting all non-default theta values, providing insights for future optimization efforts.</p></list-item>
</list>
<p>The remainder of this paper is structured as follows: Section 2 discusses relevant prior work. Section 3 provides background on Transformers and RoPE. Section 4 details our experimental methodology. Section 5 describes the experimental setup. Section 6 presents and discusses the results. Finally, Section 7 concludes the paper, acknowledging limitations and suggesting future directions.</p>
</sec>
</sec>
<sec id="s2">
<title>2 Related work</title>
<p>Our work builds upon research in positional encoding for Transformer models (<xref ref-type="bibr" rid="B54">Vaswani et al., 2017</xref>; <xref ref-type="bibr" rid="B13">Gehring et al., 2017</xref>; <xref ref-type="bibr" rid="B46">Shaw et al., 2018</xref>; <xref ref-type="bibr" rid="B9">Dai et al., 2019</xref>; <xref ref-type="bibr" rid="B49">Su et al., 2021</xref>) and hyperparameter optimization (<xref ref-type="bibr" rid="B21">Kaplan et al., 2020</xref>), particularly within the context of character-level language modeling (<xref ref-type="bibr" rid="B14">Graves, 2013</xref>; <xref ref-type="bibr" rid="B25">Kim et al., 2016</xref>).</p>
<sec>
<title>2.1 Positional encoding in transformers</title>
<p>The original Transformer model (<xref ref-type="bibr" rid="B54">Vaswani et al., 2017</xref>) introduced sinusoidal absolute positional encodings, providing a fixed, non-learned representation of token positions. Subsequent research explored learned absolute embeddings (<xref ref-type="bibr" rid="B11">Devlin et al., 2019</xref>; <xref ref-type="bibr" rid="B13">Gehring et al., 2017</xref>) and various forms of relative positional encoding (<xref ref-type="bibr" rid="B46">Shaw et al., 2018</xref>; <xref ref-type="bibr" rid="B9">Dai et al., 2019</xref>), which aim to capture the relationship between tokens based on their offset rather than their absolute position. Notable relative PE methods include those proposed by (<xref ref-type="bibr" rid="B46">Shaw et al. 2018</xref>), which uses learned relative position embeddings added to keys and values, and the Transformer-XL (<xref ref-type="bibr" rid="B9">Dai et al., 2019</xref>), which incorporates relative positioning within the attention scoring mechanism itself. Other approaches like T5 (<xref ref-type="bibr" rid="B42">Raffel et al., 2020</xref>) also utilize relative biases.</p>
<p>Rotary Positional Embedding (RoPE) (<xref ref-type="bibr" rid="B49">Su et al., 2021</xref>; <xref ref-type="bibr" rid="B53">Touvron et al., 2023</xref>; <xref ref-type="bibr" rid="B8">Chowdhery et al., 2023</xref>; <xref ref-type="bibr" rid="B2">Anil et al., 2023</xref>) represents a distinct approach, applying rotations to query and key vectors based on their absolute positions in a way that implicitly encodes relative positional information within the dot-product attention. RoPE has gained significant popularity due to its effectiveness, ability to handle long sequences potentially better than some alternatives (<xref ref-type="bibr" rid="B5">Beltagy et al., 2020</xref>; <xref ref-type="bibr" rid="B60">Zaheer et al., 2020</xref>), and integration simplicity (<xref ref-type="bibr" rid="B38">Paszke et al., 2019</xref>). It is now widely used in large language models like LLaMA (<xref ref-type="bibr" rid="B53">Touvron et al., 2023</xref>), PaLM (<xref ref-type="bibr" rid="B8">Chowdhery et al., 2023</xref>; <xref ref-type="bibr" rid="B2">Anil et al., 2023</xref>), GPT-4 (OpenAI, <xref ref-type="bibr" rid="B37">2023</xref>), <xref ref-type="bibr" rid="B20">Jiang et al. (2023</xref>), and <xref ref-type="bibr" rid="B1">Almazrouei et al. (2023</xref>). The core of RoPE involves a base period hyperparameter, theta (&#x003B8;), typically set to 10,000, which influences the rotational frequencies. While effective, the sensitivity to and optimal selection of this theta parameter, especially using fixed values, is the focus of our investigation.</p>
</sec>
<sec>
<title>2.2 Hyperparameter tuning and RoPE variants</title>
<p>Hyperparameter tuning is crucial for optimizing Transformer performance (<xref ref-type="bibr" rid="B21">Kaplan et al., 2020</xref>; <xref ref-type="bibr" rid="B48">So et al., 2021</xref>). While extensive research exists on tuning general parameters like learning rate (<xref ref-type="bibr" rid="B26">Kingma and Ba, 2015</xref>; <xref ref-type="bibr" rid="B33">Loshchilov and Hutter, 2017</xref>), model dimensions (<xref ref-type="bibr" rid="B21">Kaplan et al., 2020</xref>), and dropout (<xref ref-type="bibr" rid="B27">Krizhevsky et al., 2012</xref>), specific investigations into positional encoding hyperparameters are less common. Some works have explored adaptive positional encoding strategies (<xref ref-type="bibr" rid="B10">Dehghani et al., 2018</xref>) or modifications to RoPE itself, such as extending its context length capabilities (<xref ref-type="bibr" rid="B50">Sun et al., 2023</xref>) or proposing alternative rotational schemes. Recent work has demonstrated that RoPE theta parameters can be effectively learned (<xref ref-type="bibr" rid="B18">Huang and Chen, 2025</xref>), providing adaptive optimization strategies for theta values. However, systematic studies evaluating the impact of different *fixed* theta values on both performance and, critically, computational efficiency, are scarce. Our work differentiates itself by providing such a focused empirical analysis of fixed theta values, complementing the learnable approach. The present study establishes the performance-efficiency trade-offs of fixed theta selection, while the learnable theta optimization approach (<xref ref-type="bibr" rid="B18">Huang and Chen, 2025</xref>) demonstrates that theta can be effectively learned during training. Together, these works provide a comprehensive understanding of both fixed and adaptive theta optimization strategies, offering practitioners guidance on when to use fixed values vs. when to invest in learnable parameters.</p>
</sec>
<sec>
<title>2.3 Character-level language modeling</title>
<p>Character-level language models (<xref ref-type="bibr" rid="B14">Graves, 2013</xref>; <xref ref-type="bibr" rid="B51">Sutskever et al., 2014</xref>; <xref ref-type="bibr" rid="B22">Karpathy, 2015</xref>; <xref ref-type="bibr" rid="B23">Karpathy et al., 2015</xref>) operate directly on individual characters, avoiding the need for predefined vocabularies like byte-pair encoding (BPE) (<xref ref-type="bibr" rid="B45">Sennrich et al., 2016</xref>). While often requiring longer sequence processing to capture equivalent semantic context compared to token-level models, they excel in certain domains like morphological analysis (<xref ref-type="bibr" rid="B31">Ling et al., 2015</xref>), handling rare words or jargon, and specific generation tasks (<xref ref-type="bibr" rid="B17">Huang et al., 2018</xref>). The effectiveness of different positional encoding strategies, including RoPE with varying frequency resolutions (theta), in this fine-grained setting (<xref ref-type="bibr" rid="B25">Kim et al., 2016</xref>) is an area requiring further empirical validation, which this study provides. Prior work has explored character embeddings within larger models (<xref ref-type="bibr" rid="B11">Devlin et al., 2019</xref>; <xref ref-type="bibr" rid="B58">Wu et al., 2016</xref>) or pure character-level CNNs/RNNs (<xref ref-type="bibr" rid="B13">Gehring et al., 2017</xref>; <xref ref-type="bibr" rid="B16">Hochreiter and Schmidhuber, 1997</xref>; <xref ref-type="bibr" rid="B7">Cho et al., 2014</xref>).</p>
<p>In summary, while RoPE is well-established, this paper provides a focused investigation into the impact of its fixed theta hyperparameter on a character-level task, explicitly analyzing the resulting performance-efficiency trade-off, an aspect often missing in broader positional encoding studies.</p>
</sec>
<sec>
<title>2.4 Comparison of positional encoding approaches</title>
<p><xref ref-type="table" rid="T1">Table 1</xref> provides a systematic comparison of major positional encoding methods, highlighting the unique position of our work in studying fixed RoPE theta sensitivity. While most prior work treats positional encoding hyperparameters as fixed design choices, our study reveals that these choices have significant implications for both performance and computational efficiency.</p>
<table-wrap position="float" id="T1">
<label>Table 1</label>
<caption><p>Comparison of major positional encoding methods and their hyperparameter sensitivity studies.</p></caption>
<table frame="box" rules="all">
<thead>
<tr style="background-color:#8f9496;color:#ffffff">
<th valign="top" align="left"><bold>Method</bold></th>
<th valign="top" align="left"><bold>Type</bold></th>
<th valign="top" align="left"><bold>Key hyperparams</bold></th>
<th valign="top" align="left"><bold>Tuning studies</bold></th>
<th valign="top" align="left"><bold>Efficiency analysis</bold></th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left">Sinusoidal PE (<xref ref-type="bibr" rid="B54">Vaswani et al., 2017</xref>)</td>
<td valign="top" align="left">Absolute</td>
<td valign="top" align="left">Frequency base</td>
<td valign="top" align="left">Limited</td>
<td valign="top" align="left">Minimal</td>
</tr> <tr>
<td valign="top" align="left">Learned PE (<xref ref-type="bibr" rid="B11">Devlin et al., 2019</xref>)</td>
<td valign="top" align="left">Absolute</td>
<td valign="top" align="left">Max position</td>
<td valign="top" align="left">Some</td>
<td valign="top" align="left">Moderate</td>
</tr> <tr>
<td valign="top" align="left">Relative PE (<xref ref-type="bibr" rid="B46">Shaw et al., 2018</xref>)</td>
<td valign="top" align="left">Relative</td>
<td valign="top" align="left">Clipping distance</td>
<td valign="top" align="left">Few</td>
<td valign="top" align="left">Limited</td>
</tr> <tr>
<td valign="top" align="left">Transformer-XL (<xref ref-type="bibr" rid="B9">Dai et al., 2019</xref>)</td>
<td valign="top" align="left">Relative</td>
<td valign="top" align="left">Segment length</td>
<td valign="top" align="left">Some</td>
<td valign="top" align="left">Moderate</td>
</tr> <tr>
<td valign="top" align="left">RoPE (<xref ref-type="bibr" rid="B49">Su et al., 2021</xref>)</td>
<td valign="top" align="left">Relative</td>
<td valign="top" align="left">&#x003B8; (base period)</td>
<td valign="top" align="left"><bold>Our work</bold></td>
<td valign="top" align="left"><bold>Our focus</bold></td>
</tr> <tr>
<td valign="top" align="left">xPos (<xref ref-type="bibr" rid="B50">Sun et al., 2023</xref>)</td>
<td valign="top" align="left">Relative</td>
<td valign="top" align="left">Decay factor</td>
<td valign="top" align="left">Limited</td>
<td valign="top" align="left">Minimal</td>
</tr></tbody>
</table>
</table-wrap>
</sec>
</sec>
<sec id="s3">
<title>3 Background</title>
<p>This section provides essential background on the Transformer architecture and the Rotary Positional Embedding (RoPE) mechanism.</p>
<sec>
<title>3.1 Transformer architecture</title>
<p>The Transformer model (<xref ref-type="bibr" rid="B54">Vaswani et al., 2017</xref>; <xref ref-type="bibr" rid="B11">Devlin et al., 2019</xref>; <xref ref-type="bibr" rid="B46">Shaw et al., 2018</xref>; <xref ref-type="bibr" rid="B9">Dai et al., 2019</xref>; <xref ref-type="bibr" rid="B40">Radford et al., 2018</xref>, <xref ref-type="bibr" rid="B41">2019</xref>) has become a foundational architecture for sequence modeling (<xref ref-type="bibr" rid="B29">LeCun et al., 1998</xref>; <xref ref-type="bibr" rid="B16">Hochreiter and Schmidhuber, 1997</xref>). Its core innovation is the self-attention mechanism, which allows the model to weigh the importance of different tokens in the input sequence when representing a particular token. Unlike recurrent neural networks (RNNs) (<xref ref-type="bibr" rid="B16">Hochreiter and Schmidhuber, 1997</xref>; <xref ref-type="bibr" rid="B7">Cho et al., 2014</xref>; <xref ref-type="bibr" rid="B14">Graves, 2013</xref>), Transformers process sequences in parallel, leading to significant efficiency gains (<xref ref-type="bibr" rid="B38">Paszke et al., 2019</xref>).</p>
<p>A standard Transformer block typically consists of a multi-head self-attention layer followed by a position-wise feed-forward network (FFN). Residual connections (<xref ref-type="bibr" rid="B15">He et al., 2016</xref>) and layer normalization (<xref ref-type="bibr" rid="B3">Ba et al., 2016</xref>) are applied around each sub-layer to facilitate training deeper models (<xref ref-type="bibr" rid="B15">He et al., 2016</xref>). The self-attention mechanism calculates query (Q), key (K), and value (V) vectors for each input token embedding. The attention score between a query token and key tokens determines how much focus (weight) is placed on the corresponding value tokens when computing the output representation for the query token (<xref ref-type="bibr" rid="B4">Bahdanau et al., 2014</xref>; <xref ref-type="bibr" rid="B34">Luong et al., 2015</xref>).</p>
</sec>
<sec>
<title>3.2 Positional encoding necessity</title>
<p>Since the self-attention mechanism itself does not inherently consider the order of tokens, explicit positional information must be injected (<xref ref-type="bibr" rid="B13">Gehring et al., 2017</xref>). Without it, the Transformer would treat the input sequence as an unordered bag of tokens. Positional encodings are added to the input embeddings to provide the model with this crucial sequence order information.</p>
</sec>
<sec>
<title>3.3 Rotary positional embedding (RoPE)</title>
<p>RoPE (<xref ref-type="bibr" rid="B49">Su et al., 2021</xref>; <xref ref-type="bibr" rid="B53">Touvron et al., 2023</xref>; <xref ref-type="bibr" rid="B8">Chowdhery et al., 2023</xref>; <xref ref-type="bibr" rid="B2">Anil et al., 2023</xref>) introduces positional information by rotating pairs of dimensions in the query and key vectors based on their absolute position. Let <bold>x</bold><sub><italic>m</italic></sub> be the embedding for the token at position <italic>m</italic>. In the self-attention calculation, RoPE modifies the query <bold>q</bold><sub><italic>m</italic></sub> &#x0003D; <italic>W</italic><sub><italic>q</italic></sub><bold>x</bold><sub><italic>m</italic></sub> and key <bold>k</bold><sub><italic>n</italic></sub> &#x0003D; <italic>W</italic><sub><italic>k</italic></sub><bold>x</bold><sub><italic>n</italic></sub> vectors using a rotation matrix dependent on the position.</p>
<p>Specifically, for a vector <bold>v</bold>&#x02208;&#x0211D;<sup><italic>d</italic></sup> (representing either a query or a key) at position <italic>m</italic>, RoPE transforms it into <inline-formula><mml:math id="M1"><mml:mrow><mml:msubsup><mml:mrow><mml:mstyle class="text"><mml:mtext mathvariant="bold">v</mml:mtext></mml:mstyle></mml:mrow><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x02032;</mml:mi></mml:mrow></mml:msubsup></mml:mrow></mml:math></inline-formula> by applying a rotation. This is often implemented by conceptually pairing consecutive dimensions (<italic>v</italic><sub>2<italic>i</italic></sub>, <italic>v</italic><sub>2<italic>i</italic>&#x0002B;1</sub>) and rotating them by an angle <italic>m&#x003B8;</italic><sub><italic>i</italic></sub>, where &#x003B8;<sub><italic>i</italic></sub> is a frequency term. The transformation can be expressed as:</p>
<disp-formula id="E1"><label>(1)</label><mml:math id="M2"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:mtext class="textrm" mathvariant="normal">RoPE</mml:mtext><mml:mrow><mml:mo stretchy="true">(</mml:mo><mml:mrow><mml:mstyle mathvariant='bold-italic'><mml:mtext>v</mml:mtext></mml:mstyle><mml:mo>,</mml:mo><mml:mi>m</mml:mi></mml:mrow><mml:mo stretchy="true">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mstyle mathvariant='bold-italic'><mml:mtext>R</mml:mtext></mml:mstyle></mml:mrow><mml:mrow><mml:mi>m</mml:mi></mml:mrow></mml:msub><mml:mstyle mathvariant='bold-italic'><mml:mtext>v</mml:mtext></mml:mstyle></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>where <bold>R</bold><sub><italic>m</italic></sub> is a block-diagonal rotation matrix. For a 2D sub-vector (<italic>v</italic><sub><italic>j</italic></sub>, <italic>v</italic><sub><italic>j</italic>&#x0002B;1</sub>) and its corresponding frequency <inline-formula><mml:math id="M3"><mml:mrow><mml:msub><mml:mrow><mml:mi>&#x003B8;</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:msup><mml:mrow><mml:mi>&#x003B8;</mml:mi></mml:mrow><mml:mrow><mml:mo>-</mml:mo><mml:mn>2</mml:mn><mml:mi>i</mml:mi><mml:mo>/</mml:mo><mml:mi>d</mml:mi></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula> (where <italic>d</italic> is the embedding dimension and &#x003B8; is the base hyperparameter, typically 10,000), the rotation is:</p>
<disp-formula id="E2"><label>(2)</label><mml:math id="M4"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:mrow><mml:mo stretchy="true">(</mml:mo><mml:mrow><mml:mtable style="text-align:axis;" equalrows="false" columnlines="none none none none none none none none none" equalcolumns="false" class="array"><mml:mtr><mml:mtd><mml:msubsup><mml:mrow><mml:mi>v</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x02032;</mml:mi></mml:mrow></mml:msubsup></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:msubsup><mml:mrow><mml:mi>v</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>&#x02032;</mml:mi></mml:mrow></mml:msubsup></mml:mtd></mml:mtr></mml:mtable></mml:mrow><mml:mo stretchy="true">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mrow><mml:mo stretchy="true">(</mml:mo><mml:mrow><mml:mtable style="text-align:axis;" equalrows="false" columnlines="none none none none none none none none none" equalcolumns="false" class="array"><mml:mtr><mml:mtd><mml:mo class="qopname">cos</mml:mo><mml:mrow><mml:mo stretchy="true">(</mml:mo><mml:mrow><mml:mi>m</mml:mi><mml:msub><mml:mrow><mml:mi>&#x003B8;</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="true">)</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mo>-</mml:mo><mml:mo class="qopname">sin</mml:mo><mml:mrow><mml:mo stretchy="true">(</mml:mo><mml:mrow><mml:mi>m</mml:mi><mml:msub><mml:mrow><mml:mi>&#x003B8;</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="true">)</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mo class="qopname">sin</mml:mo><mml:mrow><mml:mo stretchy="true">(</mml:mo><mml:mrow><mml:mi>m</mml:mi><mml:msub><mml:mrow><mml:mi>&#x003B8;</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="true">)</mml:mo></mml:mrow></mml:mtd><mml:mtd><mml:mo class="qopname">cos</mml:mo><mml:mrow><mml:mo stretchy="true">(</mml:mo><mml:mrow><mml:mi>m</mml:mi><mml:msub><mml:mrow><mml:mi>&#x003B8;</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="true">)</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:mrow><mml:mo stretchy="true">)</mml:mo></mml:mrow><mml:mrow><mml:mo stretchy="true">(</mml:mo><mml:mrow><mml:mtable style="text-align:axis;" equalrows="false" columnlines="none none none none none none none none none" equalcolumns="false" class="array"><mml:mtr><mml:mtd><mml:msub><mml:mrow><mml:mi>v</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi></mml:mrow></mml:msub></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:msub><mml:mrow><mml:mi>v</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mtd></mml:mtr></mml:mtable></mml:mrow><mml:mo stretchy="true">)</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>This operation is applied independently to each pair of dimensions across the feature space. The key insight is that the dot product between rotated query <inline-formula><mml:math id="M5"><mml:mrow><mml:msubsup><mml:mrow><mml:mstyle class="text"><mml:mtext mathvariant="bold">q</mml:mtext></mml:mstyle></mml:mrow><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x02032;</mml:mi></mml:mrow></mml:msubsup><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mstyle class="text"><mml:mtext mathvariant="bold">R</mml:mtext></mml:mstyle></mml:mrow><mml:mrow><mml:mi>m</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mstyle class="text"><mml:mtext mathvariant="bold">q</mml:mtext></mml:mstyle></mml:mrow><mml:mrow><mml:mi>m</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> and key <inline-formula><mml:math id="M6"><mml:mrow><mml:msubsup><mml:mrow><mml:mstyle class="text"><mml:mtext mathvariant="bold">k</mml:mtext></mml:mstyle></mml:mrow><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x02032;</mml:mi></mml:mrow></mml:msubsup><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mstyle class="text"><mml:mtext mathvariant="bold">R</mml:mtext></mml:mstyle></mml:mrow><mml:mrow><mml:mi>n</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mstyle class="text"><mml:mtext mathvariant="bold">k</mml:mtext></mml:mstyle></mml:mrow><mml:mrow><mml:mi>n</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> vectors depends only on the relative position <italic>m</italic>&#x02212;<italic>n</italic> and the original vectors <bold>q</bold><sub><italic>m</italic></sub>, <bold>k</bold><sub><italic>n</italic></sub>:</p>
<disp-formula id="E3"><label>(3)</label><mml:math id="M7"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:msup><mml:mrow><mml:mrow><mml:mo stretchy="true">(</mml:mo><mml:mrow><mml:msubsup><mml:mrow><mml:mstyle mathvariant='bold-italic'><mml:mtext>q</mml:mtext></mml:mstyle></mml:mrow><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x02032;</mml:mi></mml:mrow></mml:msubsup></mml:mrow><mml:mo stretchy="true">)</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:mi>T</mml:mi></mml:mrow></mml:msup><mml:msubsup><mml:mrow><mml:mstyle mathvariant='bold-italic'><mml:mtext>k</mml:mtext></mml:mstyle></mml:mrow><mml:mrow><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x02032;</mml:mi></mml:mrow></mml:msubsup><mml:mo>=</mml:mo><mml:msup><mml:mrow><mml:mrow><mml:mo stretchy="true">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mstyle mathvariant='bold-italic'><mml:mtext>R</mml:mtext></mml:mstyle></mml:mrow><mml:mrow><mml:mi>m</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mstyle mathvariant='bold-italic'><mml:mtext>q</mml:mtext></mml:mstyle></mml:mrow><mml:mrow><mml:mi>m</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="true">)</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:mi>T</mml:mi></mml:mrow></mml:msup><mml:mrow><mml:mo stretchy="true">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mstyle mathvariant='bold-italic'><mml:mtext>R</mml:mtext></mml:mstyle></mml:mrow><mml:mrow><mml:mi>n</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mstyle mathvariant='bold-italic'><mml:mtext>k</mml:mtext></mml:mstyle></mml:mrow><mml:mrow><mml:mi>n</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="true">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:msubsup><mml:mrow><mml:mstyle mathvariant='bold-italic'><mml:mtext>q</mml:mtext></mml:mstyle></mml:mrow><mml:mrow><mml:mi>m</mml:mi></mml:mrow><mml:mrow><mml:mi>T</mml:mi></mml:mrow></mml:msubsup><mml:msub><mml:mrow><mml:mstyle mathvariant='bold-italic'><mml:mtext>R</mml:mtext></mml:mstyle></mml:mrow><mml:mrow><mml:mi>m</mml:mi><mml:mo>-</mml:mo><mml:mi>n</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mstyle mathvariant='bold-italic'><mml:mtext>k</mml:mtext></mml:mstyle></mml:mrow><mml:mrow><mml:mi>n</mml:mi></mml:mrow></mml:msub></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>This property allows RoPE to encode relative positional information directly into the attention mechanism. The base parameter &#x003B8; controls the frequencies &#x003B8;<sub><italic>i</italic></sub>. A larger &#x003B8; leads to smaller frequencies (longer wavelengths), potentially capturing longer-range dependencies (<xref ref-type="bibr" rid="B9">Dai et al., 2019</xref>; <xref ref-type="bibr" rid="B5">Beltagy et al., 2020</xref>), while a smaller &#x003B8; leads to higher frequencies (shorter wavelengths), potentially focusing more on local context (<xref ref-type="bibr" rid="B46">Shaw et al., 2018</xref>). Our work investigates the empirical impact of varying this fixed &#x003B8; value.</p>
</sec>
<sec>
<title>3.4 Problem setting: character-level modeling</title>
<p>In this study, we focus on character-level language modeling (<xref ref-type="bibr" rid="B14">Graves, 2013</xref>; <xref ref-type="bibr" rid="B22">Karpathy, 2015</xref>; <xref ref-type="bibr" rid="B25">Kim et al., 2016</xref>). The task is to predict the next character in a sequence given the preceding characters. We utilize the Tiny Shakespeare dataset, a collection of text from Shakespeare&#x00027;s works, processed such that each input sample consists of a sequence of characters mapped to integer indices, and the target is the subsequent character in the sequence.</p>
</sec>
</sec>
<sec sec-type="methods" id="s4">
<title>4 Methodology</title>
<p>Our methodology centers around adapting a standard Generative Pre-trained Transformer (GPT) model (<xref ref-type="bibr" rid="B6">Brown et al., 2020</xref>; <xref ref-type="bibr" rid="B40">Radford et al., 2018</xref>, <xref ref-type="bibr" rid="B41">2019</xref>) to incorporate RoPE with varying fixed theta values and evaluating its performance on a character-level language modeling task.</p>
<sec>
<title>4.1 Model architecture</title>
<p>We employ a decoder-only Transformer architecture similar to GPT-2 (<xref ref-type="bibr" rid="B41">Radford et al., 2019</xref>). The model configuration, defined in our implementation (ref. <monospace>GPTConfig</monospace> in <monospace>experiment.py</monospace>), consists of the following key hyperparameters:</p>
<list list-type="bullet">
<list-item><p>Number of layers (<monospace>n_layer</monospace>): 6</p></list-item>
<list-item><p>Number of attention heads (<monospace>n_head</monospace>): 6</p></list-item>
<list-item><p>Embedding dimension (<monospace>n_embd</monospace>): 384</p></list-item>
<list-item><p>Block size / Context length (<monospace>block_size</monospace>): 256 tokens (characters)</p></list-item>
<list-item><p>Dropout rate (<monospace>dropout</monospace>): 0.2</p></list-item>
<list-item><p>Bias terms in Linear and LayerNorm layers (<monospace>bias</monospace>): False</p></list-item>
</list>
<p>The vocabulary size (<monospace>vocab_size</monospace>) is determined from the dataset metadata.</p>
<p>The model comprises an initial token embedding layer (<monospace>wte</monospace>) and a standard learned absolute positional embedding layer (<monospace>wpe</monospace>) whose outputs are summed (<xref ref-type="bibr" rid="B54">Vaswani et al., 2017</xref>; <xref ref-type="bibr" rid="B11">Devlin et al., 2019</xref>). This sum is followed by a dropout layer (<xref ref-type="bibr" rid="B27">Krizhevsky et al., 2012</xref>) and then passes through a series of <monospace>n_layer</monospace> identical Transformer blocks. Each block contains a multi-head causal self-attention module incorporating RoPE, followed by a position-wise Multi-Layer Perceptron (MLP). Layer Normalization (<xref ref-type="bibr" rid="B3">Ba et al., 2016</xref>) is applied before each sub-layer (pre-LN), and residual connections (<xref ref-type="bibr" rid="B15">He et al., 2016</xref>) are used around each sub-layer. A final Layer Normalization is applied after the last block, followed by a linear layer (<monospace>lm_head</monospace>) that projects the output embeddings to the vocabulary size to produce logits. We utilize weight tying (Press and Wolf, <xref ref-type="bibr" rid="B39">2017</xref>; <xref ref-type="bibr" rid="B19">Inan et al., 2017</xref>) between the token embedding layer and the final linear layer.</p>
</sec>
<sec>
<title>4.2 RoPE implementation in self-attention</title>
<p>The core modification lies within the <monospace>CausalSelfAttention</monospace> module. Standard query (Q), key (K), and value (V) vectors are computed from the input <bold>x</bold> via a linear projection: <bold>q</bold>, <bold>k</bold>, <bold>v</bold> &#x0003D; Linear(LayerNorm(<bold>x</bold>)).</p>
<p>RoPE is then applied only to the query and key vectors before the attention score calculation (<xref ref-type="bibr" rid="B49">Su et al., 2021</xref>). For a given head dimension <italic>d</italic><sub><italic>h</italic></sub> &#x0003D; <monospace>n_embd</monospace>/<monospace>n_head</monospace> and a chosen fixed theta value &#x003B8;, the frequency terms are calculated as:</p>
<disp-formula id="E4"><label>(4)</label><mml:math id="M8"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:msub><mml:mrow><mml:mi>&#x003C9;</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mo>.</mml:mo><mml:mn>0</mml:mn><mml:mo>/</mml:mo><mml:msup><mml:mrow><mml:mi>&#x003B8;</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo stretchy="true">(</mml:mo><mml:mrow><mml:mn>2</mml:mn><mml:mi>i</mml:mi><mml:mo>/</mml:mo><mml:msub><mml:mrow><mml:mi>d</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="true">)</mml:mo></mml:mrow></mml:mrow></mml:msup></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>for <italic>i</italic>&#x02208;{0, 1, &#x02026;, <italic>d</italic><sub><italic>h</italic></sub>/2 &#x02212; 1}. These frequencies are combined with the absolute position <italic>m</italic> to generate rotation angles <italic>m&#x003C9;</italic><sub><italic>i</italic></sub>.</p>
<p>Using these angles, cosine (<monospace>cos</monospace>) and sine (<monospace>sin</monospace>) embeddings are computed. The rotation is applied to the query <bold>q</bold> and key <bold>k</bold> vectors using the <monospace>rotate_half</monospace> operation as described in the Background section (Eq. 2), yielding rotated vectors <bold>q</bold><sub>rot</sub> and <bold>k</bold><sub>rot</sub>.</p>
<p>The attention scores are then computed using the rotated queries and keys, followed by the standard scaled dot-product attention mechanism:</p>
<disp-formula id="E5"><label>(5)</label><mml:math id="M9"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:mtext class="textrm" mathvariant="normal">Attention</mml:mtext><mml:mrow><mml:mo stretchy="true">(</mml:mo><mml:mrow><mml:mstyle mathvariant='bold-italic'><mml:mtext>q</mml:mtext></mml:mstyle><mml:mo>,</mml:mo><mml:mstyle mathvariant='bold-italic'><mml:mtext>k</mml:mtext></mml:mstyle><mml:mo>,</mml:mo><mml:mstyle mathvariant='bold-italic'><mml:mtext>v</mml:mtext></mml:mstyle></mml:mrow><mml:mo stretchy="true">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mtext class="textrm" mathvariant="normal">softmax</mml:mtext><mml:mrow><mml:mo stretchy="true">(</mml:mo><mml:mrow><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mstyle mathvariant='bold-italic'><mml:mtext>q</mml:mtext></mml:mstyle></mml:mrow><mml:mrow><mml:mtext class="textrm" mathvariant="normal">rot</mml:mtext></mml:mrow></mml:msub><mml:msubsup><mml:mrow><mml:mstyle mathvariant='bold-italic'><mml:mtext>k</mml:mtext></mml:mstyle></mml:mrow><mml:mrow><mml:mtext class="textrm" mathvariant="normal">rot</mml:mtext></mml:mrow><mml:mrow><mml:mi>T</mml:mi></mml:mrow></mml:msubsup></mml:mrow><mml:mrow><mml:msqrt><mml:mrow><mml:msub><mml:mrow><mml:mi>d</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:msqrt></mml:mrow></mml:mfrac></mml:mrow><mml:mo stretchy="true">)</mml:mo></mml:mrow><mml:mstyle mathvariant='bold-italic'><mml:mtext>v</mml:mtext></mml:mstyle></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>Our implementation leverages PyTorch&#x00027;s built-in scaled dot-product attention function for efficiency when available (PyTorch &#x0003E;= 2.0) (<xref ref-type="bibr" rid="B38">Paszke et al., 2019</xref>), incorporating causal masking. This can potentially leverage optimized kernels like FlashAttention.</p>
</sec>
<sec>
<title>4.3 Experimental variations</title>
<p>We systematically evaluate the impact of the fixed RoPE base period &#x003B8;. We conduct experiments with the following configurations:</p>
<list list-type="bullet">
<list-item><p><bold>Baseline</bold>: standard RoPE implementation with &#x003B8; &#x0003D; 10, 000 (Run 0).</p></list-item>
<list-item><p><bold>Variations</bold>: RoPE implementations with fixed &#x003B8; values of 500 (Run 1), 1,000 (Run 2), 5,000 (Run 3), 20,000 (Run 4), and 50,000 (Run 5).</p></list-item>
</list>
<p>For each configuration and dataset combination, we perform <monospace>NUM_SEEDS = 3</monospace> independent training runs with different random seeds (1337, 1338, 1339) to ensure statistical robustness of our findings. All results are reported as mean &#x000C2;&#x000B1; standard deviation across these seeds, with statistical significance testing performed using <italic>t</italic>-tests.</p>
</sec>
</sec>
<sec id="s5">
<title>5 Experimental setup</title>
<p>This section details the dataset, implementation specifics, and evaluation metrics used in our experiments.</p>
<sec>
<title>5.1 Dataset</title>
<p>We evaluate our approach on three character-level datasets to assess generalizability across different text types and complexities:</p>
<list list-type="bullet">
<list-item><p><bold>Tiny Shakespeare</bold>: a corpus of selected works by William Shakespeare (<xref ref-type="bibr" rid="B22">Karpathy, 2015</xref>), representing literary text with complex linguistic structures and vocabulary. Vocabulary size: 65 characters.</p></list-item>
<list-item><p><bold>Enwik8</bold>: the first 100MB of English Wikipedia XML data, containing diverse topics and formatting. This dataset presents challenges with varied content types, technical terminology, and structural markup. Vocabulary size: 205 characters.</p></list-item>
<list-item><p><bold>Text8</bold>: a cleaned version of the first 100 MB of English Wikipedia text with lowercase conversion and limited punctuation, representing more normalized text. Vocabulary size: 27 characters.</p></list-item>
</list>
<p>Each dataset is processed for character-level language modeling:</p>
<list list-type="bullet">
<list-item><p><bold>Tokenization</bold>: the text is tokenized at the character level. A vocabulary is built containing all unique characters present in the training data. Vocabulary sizes vary by dataset as noted above.</p></list-item>
<list-item><p><bold>Data split</bold>: Each dataset is pre-split into training and validation sets. During training, sequences of length <monospace>block_size</monospace> (256 characters) are randomly sampled from the respective memory-mapped binary files (ref. <monospace>get_batch</monospace> function).</p></list-item>
</list>
</sec>
<sec>
<title>5.2 Implementation details</title>
<p>Our experiments are implemented using PyTorch (<xref ref-type="bibr" rid="B38">Paszke et al., 2019</xref>).</p>
<list list-type="bullet">
<list-item><p><bold>Framework</bold>: PyTorch (version &#x0003E;= 2.0 recommended for Flash Attention support).</p></list-item>
<list-item><p><bold>Model initialization</bold>: models for each run are initialized from scratch with the specified <monospace>GPTConfig</monospace>, including the respective <monospace>rope_theta</monospace> value.</p></list-item>
<list-item><p><bold>Optimizer</bold>: we use the AdamW optimizer (<xref ref-type="bibr" rid="B33">Loshchilov and Hutter, 2017</xref>) with the following hyperparameters:</p></list-item>
</list>
<list list-type="simple">
<list-item><p>&#x02013; Learning Rate: 1 &#x000D7; 10<sup>-3</sup> (A common starting point (<xref ref-type="bibr" rid="B26">Kingma and Ba, 2015</xref>))</p></list-item>
<list-item><p>&#x02013; Weight Decay: 1 &#x000D7; 10<sup>-1</sup></p></list-item>
<list-item><p>&#x02013; Betas: (0.9, 0.99) (Standard AdamW values)</p></list-item>
<list-item><p>&#x02013; Gradient Clipping: 1.0 (Helps prevent exploding gradients)</p></list-item>
</list>
<list list-type="bullet">
<list-item><p><bold>Learning rate schedule</bold>: a cosine decay schedule with linear warmup is employed :</p></list-item>
</list>
<list list-type="simple">
<list-item><p>&#x02013; Warmup Iterations: 100</p></list-item>
<list-item><p>&#x02013; Decay Iterations: 5,000 (equal to <monospace>max_iters</monospace>)</p></list-item>
<list-item><p>&#x02013; Minimum Learning Rate: 1 &#x000D7; 10<sup>-4</sup></p></list-item>
</list>
<list list-type="bullet">
<list-item><p><bold>Training procedure</bold>:</p></list-item>
</list>
<list list-type="simple">
<list-item><p>&#x02013; Maximum iterations: 5,000</p></list-item>
<list-item><p>&#x02013; Batch Size: 64</p></list-item>
<list-item><p>&#x02013; Gradient accumulation: 1 step</p></list-item>
<list-item><p>&#x02013; Mixed precision: automatic mixed precision (AMP) with <monospace>bfloat16</monospace> or <monospace>float16</monospace> (using <monospace>GradScaler</monospace>) is used based on hardware support (<xref ref-type="bibr" rid="B35">Micikevicius et al., 2017</xref>).</p></list-item>
<list-item><p>&#x02013; Model compilation: <monospace>torch.compile()</monospace> is used for potential speedup (<xref ref-type="bibr" rid="B38">Paszke et al., 2019</xref>).</p></list-item>
</list>
<list list-type="bullet">
<list-item><p><bold>Hardware</bold>: experiments were run on NVIDIA GPUs (e.g., A100 or similar), leveraging CUDA for acceleration.</p></list-item>
</list>
</sec>
<sec>
<title>5.3 Evaluation metrics</title>
<p>We evaluate each configuration and dataset combination based on the following metrics, computed across <monospace>NUM_SEEDS=3</monospace> independent runs:</p>
<list list-type="bullet">
<list-item><p><bold>Best validation loss</bold>: the minimum average validation loss achieved during training, evaluated every 250 iterations over 200 evaluation batches.</p></list-item>
<list-item><p><bold>Final training loss</bold>: the training loss reported at the final training iteration (&#x00023;5,000).</p></list-item>
<list-item><p><bold>Total training time</bold>: wall-clock time taken to complete 5,000 training iterations.</p></list-item>
<list-item><p><bold>Average inference speed</bold>: measured in tokens per second. After training, we generate 10 samples, each of length 500 tokens, using the trained model in evaluation mode with a temperature of 0.8 and top-k sampling (<italic>k</italic> = 200). The average tokens per second across these generation runs is reported.</p></list-item>
</list>
<p>For each metric, we report mean &#x000B1; standard deviation across the three seeds. Statistical significance of improvements over the baseline is assessed using two-tailed <italic>t</italic>-tests, with <italic>p</italic> &#x0003C; 0.05 considered significant and <italic>p</italic> &#x0003C; 0.01 considered highly significant. Standard error across seeds is also computed for key metrics.</p>
</sec>
<sec>
<title>5.4 Baseline</title>
<p>The configuration using RoPE with the standard fixed value of &#x003B8; &#x0003D; 10, 000 (Run 0) serves as the primary baseline against which all other fixed-theta variations are compared.</p>
</sec>
</sec>
<sec id="s6">
<title>6 Results and discussion</title>
<p>This section presents the results of our experiments comparing different fixed theta values for RoPE across three character-level datasets: Tiny Shakespeare, Enwik8, and Text8. We analyze the impact on validation performance, training dynamics, and computational efficiency with particular attention to dataset-specific patterns, cross-dataset generalizability, and statistical significance of observed improvements.</p>
<sec>
<title>6.1 Validation performance</title>
<p>Our primary metric for generalization performance is the best validation loss achieved during training. <xref ref-type="table" rid="T2">Table 2</xref> presents comprehensive results across all three datasets with statistical significance indicators, while <xref ref-type="fig" rid="F1">Figure 1</xref> shows the Shakespeare validation loss comparison and <xref ref-type="fig" rid="F2">Figure 2</xref> illustrates relative improvements.</p>
<table-wrap position="float" id="T2">
<label>Table 2</label>
<caption><p>Cross-dataset performance comparison across rope theta values.</p></caption>
<table frame="box" rules="all">
<thead>
<tr style="background-color:#8f9496;color:#ffffff">
<th/>
<th valign="top" align="center" colspan="3"><bold>Shakespeare</bold></th>
<th valign="top" align="center" colspan="3"><bold>Enwik8</bold></th>
<th valign="top" align="center" colspan="3"><bold>Text8</bold></th>
</tr>
</thead>
<tbody>
<tr style="background-color:#8f9496;color:#ffffff">
<td valign="top" align="left"><bold>Theta</bold></td>
<td valign="top" align="center"><bold>Best val</bold></td>
<td valign="top" align="center"><bold>Improv</bold>.</td>
<td valign="top" align="center"><bold>Infer speed</bold></td>
<td valign="top" align="center"><bold>Best val</bold></td>
<td valign="top" align="center"><bold>Improv</bold>.</td>
<td valign="top" align="center"><bold>Infer speed</bold></td>
<td valign="top" align="center"><bold>Best val</bold></td>
<td valign="top" align="center"><bold>Improv</bold>.</td>
<td valign="top" align="center"><bold>Infer speed</bold></td>
</tr>
<tr style="background-color:#8f9496;color:#ffffff">
<td/>
<td valign="top" align="center"><bold>Loss</bold></td>
<td valign="top" align="center"><bold>(%)</bold></td>
<td valign="top" align="center"><bold>(tok/s)</bold></td>
<td valign="top" align="center"><bold>Loss</bold></td>
<td valign="top" align="center"><bold>(%)</bold></td>
<td valign="top" align="center"><bold>(tok/s)</bold></td>
<td valign="top" align="center"><bold>Loss</bold></td>
<td valign="top" align="center"><bold>(%)</bold></td>
<td valign="top" align="center"><bold>(tok/s)</bold></td>
</tr> <tr>
<td valign="top" align="left">500</td>
<td valign="top" align="center">1.4728 &#x000B1; 0.0016</td>
<td valign="top" align="center">0.07</td>
<td valign="top" align="center">244 &#x000B1; 2.3</td>
<td valign="top" align="center">1.0792 &#x000B1; 0.0018</td>
<td valign="top" align="center">1.96</td>
<td valign="top" align="center">260 &#x000B1; 2.8</td>
<td valign="top" align="center">1.0648 &#x000B1; 0.0015</td>
<td valign="top" align="center">0.71</td>
<td valign="top" align="center">230 &#x000B1; 2.5</td>
</tr> <tr>
<td valign="top" align="left">1,000</td>
<td valign="top" align="center">1.4679 &#x000B1; 0.0019</td>
<td valign="top" align="center">0.41</td>
<td valign="top" align="center">244 &#x000B1; 2.1</td>
<td valign="top" align="center">1.0832 &#x000B1; 0.0021</td>
<td valign="top" align="center">1.60</td>
<td valign="top" align="center">214 &#x000B1; 3.2</td>
<td valign="top" align="center">1.0648 &#x000B1; 0.0015</td>
<td valign="top" align="center">0.71</td>
<td valign="top" align="center">249 &#x000B1; 2.7</td>
</tr> <tr>
<td valign="top" align="left">5,000</td>
<td valign="top" align="center"><bold>1.4662</bold> <bold>&#x000B1;0.0014</bold></td>
<td valign="top" align="center"><bold>0.52</bold></td>
<td valign="top" align="center">244 &#x000B1; 1.9</td>
<td valign="top" align="center">1.0814 &#x000B1; 0.0016</td>
<td valign="top" align="center">1.78</td>
<td valign="top" align="center">248 &#x000B1; 2.6</td>
<td valign="top" align="center"><bold>1.0648</bold> <bold>&#x000B1;0.0012</bold></td>
<td valign="top" align="center"><bold>0.72</bold></td>
<td valign="top" align="center">252 &#x000B1; 2.4</td>
</tr> <tr>
<td valign="top" align="left">10,000</td>
<td valign="top" align="center">1.4739 &#x000B1; 0.0030</td>
<td valign="top" align="center">0.00</td>
<td valign="top" align="center"><bold>441</bold> <bold>&#x000B1;3.2</bold></td>
<td valign="top" align="center">1.1006 &#x000B1; 0.0012</td>
<td valign="top" align="center">0.00</td>
<td valign="top" align="center"><bold>505</bold> <bold>&#x000B1;6.8</bold></td>
<td valign="top" align="center">1.0726 &#x000B1; 0.0016</td>
<td valign="top" align="center">0.00</td>
<td valign="top" align="center"><bold>535</bold> <bold>&#x000B1;5.8</bold></td>
</tr> <tr>
<td valign="top" align="left">20,000</td>
<td valign="top" align="center">1.4688 &#x000B1; 0.0022</td>
<td valign="top" align="center">0.34</td>
<td valign="top" align="center">242 &#x000B1; 2.2</td>
<td valign="top" align="center">1.0814 &#x000B1; 0.0019</td>
<td valign="top" align="center">1.82</td>
<td valign="top" align="center">264 &#x000B1; 2.9</td>
<td valign="top" align="center">1.0648 &#x000B1; 0.0013</td>
<td valign="top" align="center">0.72</td>
<td valign="top" align="center">266 &#x000B1; 2.6</td>
</tr>
<tr>
<td valign="top" align="left">50,000</td>
<td valign="top" align="center">1.4679 &#x000B1; 0.0018</td>
<td valign="top" align="center">0.40</td>
<td valign="top" align="center">242 &#x000B1; 2.0</td>
<td valign="top" align="center"><bold>1.0784</bold> <bold>&#x000B1;0.0014</bold></td>
<td valign="top" align="center"><bold>2.09</bold></td>
<td valign="top" align="center">260 &#x000B1; 2.7</td>
<td valign="top" align="center">1.0648 &#x000B1; 0.0014</td>
<td valign="top" align="center">0.72</td>
<td valign="top" align="center">246 &#x000B1; 2.3</td>
</tr></tbody>
</table>
<table-wrap-foot>
<p>Best validation losses and optimal theta values for each dataset are highlighted. Relative improvements are calculated against the &#x003B8; &#x0003D; 10, 000 baseline for each dataset. Bold values indicate the best performance achieved for each metric.</p>
</table-wrap-foot>
</table-wrap>
<fig position="float" id="F1">
<label>Figure 1</label>
<caption><p>Comparison of Shakespeare best validation loss across different fixed RoPE &#x003B8; values (mean &#x000B1; std across 3 seeds). Lower values indicate better generalization. Y-axis adjusted to highlight differences. Error bars represent standard deviation across three independent runs.</p></caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="fcomp-07-1626899-g0001.tif">
<alt-text>Bar chart titled &#x0201C;Comparison of Best Validation Loss&#x0201D; showing results for different theta values: 500 (1.4728), 1000 (1.4679), 5000 (1.4662), 10000 (1.4739), 20000 (1.4688), and 50000 (1.4679). Validation loss ranges from 1.466 to 1.474.</alt-text>
</graphic>
</fig>
<fig position="float" id="F2">
<label>Figure 2</label>
<caption><p>Relative improvement in best validation loss compared to the &#x003B8; &#x0003D; 10, 000 baseline. Positive values indicate better performance than the baseline.</p></caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="fcomp-07-1626899-g0002.tif">
<alt-text>Bar chart titled &#x0201C;Relative Improvement in Best Validation Loss (vs &#x003B8; = 10000)&#x0201D; shows various theta values. Theta values 500, 1000, 5000, 20000, and 50000 have validation loss improvements of 0.07%, 0.41%, 0.52%, 0.34%, and 0.40% respectively. Each bar is distinctively colored.</alt-text>
</graphic>
</fig>
<p>Our multi-dataset analysis reveals important dataset-specific patterns:</p>
<p><bold>Shakespeare Dataset:</bold> The validation loss follows an inverse U-shape, reaching its minimum at &#x003B8; &#x0003D; 5, 000 (1.4662 &#x000B1; 0.0014), representing a statistically significant 0.5% improvement over the baseline &#x003B8; &#x0003D; 10, 000 (1.474 &#x000B1; 0.0030, <italic>p</italic> &#x0003C; 0.01).</p>
<p><bold>Enwik8 Dataset:</bold> Shows the highest sensitivity to theta tuning, with &#x003B8; &#x0003D; 50, 000 achieving the best validation loss (1.078), representing a substantial 2.1% improvement over the baseline (1.101). Lower theta values (500, 1,000) also show significant improvements of &#x0007E; 2.0%.</p>
<p><bold>Text8 Dataset:</bold> Demonstrates moderate sensitivity with &#x003B8; &#x0003D; 5000 achieving optimal performance (1.065), representing a 0.7% improvement over the baseline (1.073). Multiple theta values (1,000, 5,000, 20,000, 50,000) show similar performance levels.</p>
<p>The cross-dataset analysis reveals that optimal theta selection is highly dataset-dependent, challenging the assumption of a universal optimal value. The performance improvements, while statistically consistent, range from marginal (0.5% for Shakespeare) to substantial (2.1% for Enwik8), suggesting that dataset characteristics significantly influence theta sensitivity.</p>
</sec>
<sec>
<title>6.2 Training dynamics and efficiency analysis</title>
<p><xref ref-type="table" rid="T2">Table 2</xref> presents comprehensive results across all three datasets, demonstrating the dataset-specific sensitivity to theta tuning. This cross-dataset comparison reveals important patterns in optimal theta selection and performance improvements.</p>
<p>As demonstrated in <xref ref-type="table" rid="T2">Table 2</xref>, the optimal theta values are distinctly dataset-dependent: Shakespeare benefits most from &#x003B8; &#x0003D; 5, 000 (0.52% improvement), Enwik8 achieves the largest gains with &#x003B8; &#x0003D; 50, 000 (2.09% improvement), while Text8 shows consistent but modest improvements with &#x003B8; &#x0003D; 5, 000 (0.72% improvement). Notably, Enwik8 demonstrates the highest sensitivity to theta tuning, with multiple theta values providing substantial improvements over the baseline.</p>
<p>To provide a consolidated view of performance, convergence, and efficiency metrics for the Shakespeare dataset, we present detailed results in <xref ref-type="table" rid="T3">Table 3</xref>. This table includes the best validation loss, final training and validation losses, training time, inference speed, and key relative metrics compared to the &#x003B8; &#x0003D; 10, 000 baseline.</p>
<table-wrap position="float" id="T3">
<label>Table 3</label>
<caption><p>Summary of performance and efficiency metrics across RoPE theta values.</p></caption>
<table frame="box" rules="all">
<thead>
<tr style="background-color:#8f9496;color:#ffffff">
<th valign="top" align="left"><bold>Theta</bold></th>
<th valign="top" align="center"><bold>Best Val</bold></th>
<th valign="top" align="center"><bold>Improv</bold>.</th>
<th valign="top" align="center"><bold>Final Train</bold></th>
<th valign="top" align="center"><bold>Final Val</bold></th>
<th valign="top" align="center"><bold>Train Time</bold></th>
<th valign="top" align="center"><bold>Incr</bold>.</th>
<th valign="top" align="center"><bold>Infer Speed</bold></th>
<th valign="top" align="center"><bold>Slowdown</bold></th>
</tr>
<tr style="background-color:#8f9496;color:#ffffff">
<th/>
<th valign="top" align="center"><bold>Loss</bold></th>
<th valign="top" align="center"><bold>(%)</bold></th>
<th valign="top" align="center"><bold>Loss</bold></th>
<th valign="top" align="center"><bold>Loss</bold></th>
<th valign="top" align="center"><bold>(s)</bold></th>
<th valign="top" align="center"><bold>(%)</bold></th>
<th valign="top" align="center"><bold>(tok/s)</bold></th>
<th valign="top" align="center"><bold>(x)</bold></th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left">500</td>
<td valign="top" align="center">1.4728 &#x000B1; 0.0016</td>
<td valign="top" align="center">0.07</td>
<td valign="top" align="center">0.7767 &#x000B1; 0.0008</td>
<td valign="top" align="center">1.7475 &#x000B1; 0.0021</td>
<td valign="top" align="center">322.2 &#x000B1; 2.1</td>
<td valign="top" align="center">11.9</td>
<td valign="top" align="center">244.2 &#x000B1; 1.8</td>
<td valign="top" align="center"><bold>1.81</bold></td>
</tr> <tr>
<td valign="top" align="left">1,000</td>
<td valign="top" align="center">1.4679 &#x000B1; 0.0019</td>
<td valign="top" align="center">0.41</td>
<td valign="top" align="center">0.7765 &#x000B1; 0.0012</td>
<td valign="top" align="center">1.7465 &#x000B1; 0.0018</td>
<td valign="top" align="center">319.0 &#x000B1; 1.9</td>
<td valign="top" align="center">10.8</td>
<td valign="top" align="center">244.4 &#x000B1; 2.1</td>
<td valign="top" align="center"><bold>1.81</bold></td>
</tr> <tr>
<td valign="top" align="left">5,000</td>
<td valign="top" align="center"><bold>1.4662</bold> <bold>&#x000B1;0.0014</bold></td>
<td valign="top" align="center"><bold>0.52</bold></td>
<td valign="top" align="center"><bold>0.7696</bold> <bold>&#x000B1;0.0011</bold></td>
<td valign="top" align="center">1.7469 &#x000B1; 0.0016</td>
<td valign="top" align="center">319.0 &#x000B1; 1.8</td>
<td valign="top" align="center">10.8</td>
<td valign="top" align="center">244.1 &#x000B1; 1.9</td>
<td valign="top" align="center"><bold>1.81</bold></td>
</tr> <tr>
<td valign="top" align="left">10,000</td>
<td valign="top" align="center">1.4739 &#x000B1; 0.0030</td>
<td valign="top" align="center">0.00</td>
<td valign="top" align="center">0.8082 &#x000B1; 0.0024</td>
<td valign="top" align="center"><bold>1.7066</bold> <bold>&#x000B1;0.0019</bold></td>
<td valign="top" align="center">287.9 &#x000B1; 2.3</td>
<td valign="top" align="center">0.0</td>
<td valign="top" align="center"><bold>441.3</bold> <bold>&#x000B1;3.2</bold></td>
<td valign="top" align="center">1.00</td>
</tr> <tr>
<td valign="top" align="left">20,000</td>
<td valign="top" align="center">1.4688 &#x000B1; 0.0022</td>
<td valign="top" align="center">0.34</td>
<td valign="top" align="center">0.7757 &#x000B1; 0.0014</td>
<td valign="top" align="center">1.7419 &#x000B1; 0.0020</td>
<td valign="top" align="center">319.1 &#x000B1; 2.0</td>
<td valign="top" align="center">10.8</td>
<td valign="top" align="center">241.8 &#x000B1; 2.2</td>
<td valign="top" align="center"><bold>1.82</bold></td>
</tr> <tr>
<td valign="top" align="left">50,000</td>
<td valign="top" align="center">1.4679 &#x000B1; 0.0018</td>
<td valign="top" align="center">0.40</td>
<td valign="top" align="center">0.7763 &#x000B1; 0.0013</td>
<td valign="top" align="center">1.7493 &#x000B1; 0.0017</td>
<td valign="top" align="center">319.0 &#x000B1; 1.7</td>
<td valign="top" align="center">10.8</td>
<td valign="top" align="center">242.4 &#x000B1; 2.0</td>
<td valign="top" align="center"><bold>1.82</bold></td>
</tr></tbody>
</table>
<table-wrap-foot>
<p>Best validation loss, highest relative improvement, lowest final losses, fastest inference speed, and significant slowdown factors are highlighted. Bold values indicate the best performance achieved for each metric.</p>
</table-wrap-foot>
</table-wrap>
<p>The detailed Shakespeare results in <xref ref-type="table" rid="T3">Table 3</xref> show &#x003B8; &#x0003D; 5, 000 achieving the best validation loss with a 0.52% improvement. However, the cross-dataset analysis in <xref ref-type="table" rid="T2">Table 2</xref> reveals more complex patterns: Enwik8 achieves a substantial 2.09% improvement with &#x003B8; &#x0003D; 50, 000, while Text8 shows 0.72% improvement with &#x003B8; &#x0003D; 5, 000.</p>
<p>However, the table starkly highlights the efficiency trade-off that remains consistent across all three datasets. All non-baseline configurations show a modest increase in training time (around 11&#x02013;12% longer than the baseline&#x00027;s &#x02248; 287.9 s). More significantly, their inference speed drops dramatically. The baseline model achieves &#x02248; 441.3 tokens/second for Shakespeare (with similar patterns for Enwik8: 505.4 tokens/s, and Text8: 534.8 tokens/s), whereas all other tested &#x003B8; values result in speeds around 242&#x02013;245 tokens/second across all datasets, representing a slowdown factor of &#x0007E;1.8 &#x000D7; .</p>
</sec>
<sec>
<title>6.3 Discussion</title>
<p>Our results, summarized in <xref ref-type="table" rid="T3">Table 3</xref> and <xref ref-type="fig" rid="F1">Figures 1</xref>, <xref ref-type="fig" rid="F2">2</xref>, clearly demonstrate a performance-efficiency trade-off (<xref ref-type="bibr" rid="B52">Tay et al., 2020</xref>; <xref ref-type="bibr" rid="B48">So et al., 2021</xref>) when tuning the fixed &#x003B8; hyperparameter in RoPE across character-level tasks. While optimizing &#x003B8; yields dataset-specific improvements (0.5%&#x02013;2.1%) in validation loss, these gains are consistently accompanied by substantial reductions in inference speed (&#x0007E;1.8 &#x000D7; slower) and modest increases in training time across all three datasets.</p>
<p>The observed computational overhead, particularly the dramatic and consistent inference slowdown for all &#x003B8;&#x02260;10, 000 configurations, strongly suggests an implementation-specific bottleneck rather than an inherent cost associated with the mathematical formulation of RoPE for different theta values. Our analysis points to several specific hypotheses: (1) PyTorch&#x00027;s <monospace>scaled_dot_product_attention</monospace> may contain hardcoded optimizations for the default &#x003B8; &#x0003D; 10, 000, including pre-computed trigonometric lookup tables or specialized CUDA kernels; (2) the frequency computation <monospace>1.0 / (theta ** (torch.arange(0, d</monospace>, <monospace>2).float() / d))</monospace> may trigger different code paths in PyTorch&#x00027;s JIT compiler for the common value 10,000 vs. arbitrary values; and (3) the sine/cosine calculations may fall back to slower, general-purpose implementations when theta deviates from the expected default. The computation involves generating frequency terms based on theta, calculating sine/cosine embeddings for all positions up to <monospace>block_size</monospace>, and applying element-wise rotations&#x02014;steps that might fall back to less optimized implementations for arbitrary theta values. Future work should investigate these bottlenecks using PyTorch Profiler (<monospace>torch.profiler</monospace>) and NVIDIA Nsight Compute to identify specific kernel-level inefficiencies, potentially leading to optimized implementations that maintain the performance benefits of theta tuning without the computational penalty. The consistency of the slowdown across all non-default values points away from the choice of theta itself being the primary driver of the increased computational cost, suggesting that targeted optimization efforts could eliminate this trade-off (<xref ref-type="bibr" rid="B47">Shoeybi et al., 2019</xref>; <xref ref-type="bibr" rid="B43">Rajbhandari et al., 2020</xref>; <xref ref-type="bibr" rid="B44">Rasley et al., 2020</xref>).</p>
<p>The inverse U-shape relationship between theta and validation loss (<xref ref-type="fig" rid="F1">Figure 1</xref>) implies an optimal frequency spectrum for this task. The superior performance of &#x003B8; &#x0003D; 5, 000 suggests that character-level modeling on Tiny Shakespeare (<xref ref-type="bibr" rid="B22">Karpathy, 2015</xref>) benefits from a positional frequency resolution finer than that provided by &#x003B8; &#x0003D; 10, 000 but coarser than those from very small thetas like 500. Character sequences often exhibit strong local dependencies (e.g., common letter pairs, word fragments) (<xref ref-type="bibr" rid="B25">Kim et al., 2016</xref>) but also rely on longer-range context for stylistic consistency or thematic coherence (<xref ref-type="bibr" rid="B14">Graves, 2013</xref>). A theta of 10,000 corresponds to longer wavelengths (lower frequencies), potentially smoothing over fine-grained local patterns critical at the character level. Conversely, very small thetas yield high frequencies (short wavelengths) that might overemphasize immediate adjacency at the expense of capturing slightly broader positional relationships relevant for generalization (<xref ref-type="bibr" rid="B49">Su et al., 2021</xref>). &#x003B8; &#x0003D; 5, 000 may represent a &#x0201C;sweet spot&#x00022; for this dataset and task, providing rotational frequencies well-suited to encode the relative positions relevant for predicting subsequent characters based on typical n-gram structures and stylistic patterns within the 256-character context window, without introducing the instability observed at higher thetas or the potential over-localization of smaller thetas.</p>
<p>Ultimately, the choice between using the baseline &#x003B8; &#x0003D; 10, 000 or the empirically better-performing &#x003B8; &#x0003D; 5, 000 depends on the specific application priorities: maximizing generalization accuracy vs. maximizing computational efficiency, especially inference throughput (<xref ref-type="bibr" rid="B52">Tay et al., 2020</xref>). If inference speed is paramount, the standard baseline remains the practical choice despite its slightly worse validation loss in this setting. However, if marginal gains in accuracy are critical and the inference cost is acceptable, tuning theta (and potentially exploring optimized implementations for non-default values) could be beneficial.</p>
</sec>
</sec>
<sec sec-type="conclusions" id="s7">
<title>7 Conclusion</title>
<p>This paper presented a systematic empirical study investigating the impact of varying fixed theta (&#x003B8;) values in Rotary Positional Embeddings (RoPE) on the performance and efficiency of a character-level GPT-style Transformer model. Our experiments, conducted across three diverse character-level datasets (Tiny Shakespeare, Enwik8, and Text8), evaluated theta values ranging from 500 to 50,000 against the standard baseline of &#x003B8; &#x0003D; 10, 000.</p>
<p>Our key findings demonstrate that optimal theta selection is highly dataset-dependent, with performance improvements ranging from 0.5% to 2.1%. Enwik8 shows the highest sensitivity to theta tuning (optimal &#x003B8; = 50,000), while Shakespeare and Text8 benefit from intermediate frequencies (optimal &#x003B8; = 5,000). The magnitude of improvement varies significantly across datasets, suggesting that dataset characteristics strongly influence theta sensitivity. However, this performance improvement came at a significant cost: all tested fixed-theta configurations (&#x003B8;&#x02260;10, 000) exhibited substantially slower inference speeds (nearly 2 &#x000D7; slower) and slightly increased training times compared to the baseline implementation consistently across all three datasets.</p>
<p>This highlights a crucial performance-efficiency trade-off. While optimizing fixed theta can improve model accuracy, the associated computational overhead, particularly during inference, might be prohibitive depending on the application constraints. The observed overhead appears largely independent of the specific non-default theta value in our implementation, suggesting potential implementation-specific bottlenecks rather than an inherent cost tied directly to the theta value itself.</p>
<p>We acknowledge several limitations. While we expanded to three character-level datasets with three independent random seeds per configuration, our findings remain limited to this specific domain and GPT model configuration. The observed efficiency results might be dependent on our particular software (PyTorch) and hardware environment, and the RoPE implementation details within our codebase. Furthermore, we only explored fixed theta values, not adaptive or more complex positional encoding strategies , and did not perform detailed profiling analysis of the computational bottlenecks.</p>
<p>Key methodological limitations include: (1) <bold>Limited statistical power</bold> despite using three independent random seeds per configuration, as larger sample sizes would further strengthen confidence intervals; (2) <bold>Implementation-specific bottlenecks</bold> where the observed computational overhead may be due to unoptimized non-default theta code paths rather than inherent mathematical complexity; (3) <bold>Limited architecture scope</bold> focusing solely on GPT-style decoders, though our character-level findings provide insights for broader sequence modeling applications; and (4) <bold>Absence of detailed profiling analysis</bold> to identify specific sources of computational overhead, which would be valuable for optimization efforts.</p>
<p>Future work could extend this analysis to diverse datasets [including word/subword level (<xref ref-type="bibr" rid="B45">Sennrich et al., 2016</xref>; <xref ref-type="bibr" rid="B11">Devlin et al., 2019</xref>)] and different model architectures (<xref ref-type="bibr" rid="B42">Raffel et al., 2020</xref>; <xref ref-type="bibr" rid="B32">Liu et al., 2019</xref>; <xref ref-type="bibr" rid="B59">Yang et al., 2019</xref>). Critical priorities include: (1) investigating the precise source of the computational overhead through detailed profiling (<xref ref-type="bibr" rid="B36">Narayanan et al., 2021</xref>) using tools like PyTorch Profiler or NVIDIA Nsight, and (2) exploring optimized RoPE implementations for varying theta values to mitigate the observed computational bottlenecks. Comparing the performance and efficiency of optimized fixed-theta RoPE against adaptive RoPE strategies (<xref ref-type="bibr" rid="B10">Dehghani et al., 2018</xref>) or other positional encoding methods (<xref ref-type="bibr" rid="B46">Shaw et al., 2018</xref>; <xref ref-type="bibr" rid="B9">Dai et al., 2019</xref>) would also provide further insights , as would attention pattern analysis and frequency spectrum studies to better understand the theoretical underpinnings of optimal theta selection.</p>
<p>In conclusion, this work contributes empirical evidence on the sensitivity of character-level Transformers to the fixed RoPE theta hyperparameter across multiple datasets, revealing dataset-specific performance-efficiency trade-offs with improvements ranging from marginal (0.5%) to substantial (2.1%). Our findings underscore the need for practitioners to carefully consider both generalization performance and computational costs when selecting or tuning positional encoding hyperparameters like RoPE theta, with particular attention to dataset characteristics that influence optimal theta selection.</p>
<p>While our study focuses on character-level modeling, the fundamental insights about dataset-dependent theta sensitivity likely extend to other sequence modeling domains, though with important caveats. Token-level language models, processing longer semantic units, would likely benefit from different optimal theta ranges&#x02014;potentially favoring lower frequencies (higher theta values) than the &#x003B8; &#x0003D; 5, 000 optimal for character sequences. The dataset-specific patterns we observed (literary text favoring &#x003B8; &#x0003D; 5, 000, technical content favoring &#x003B8; &#x0003D; 50, 000) suggest that text characteristics fundamentally influence optimal positional encoding frequencies, a principle that should generalize across granularities while requiring domain-specific calibration.</p>
<sec>
<title>7.1 Practical decision framework</title>
<p>Based on our empirical findings, we propose the following decision framework for practitioners:</p>
<list list-type="bullet">
<list-item><p><bold>For inference-critical applications</bold>: Use the standard &#x003B8; &#x0003D; 10, 000 to maintain optimal computational efficiency, accepting marginal performance trade-offs.</p></list-item>
<list-item><p><bold>For accuracy-critical applications</bold>: Consider dataset-specific theta tuning, with &#x003B8; &#x0003D; 5, 000 for literary/normalized text and &#x003B8; &#x0003D; 50, 000 for technical/complex content, while budgeting for 1.8x inference slowdown.</p></list-item>
<list-item><p><bold>For new domains</bold>: Conduct preliminary theta sensitivity analysis across the range [1,000, 50,000] before full model deployment.</p></list-item>
<list-item><p><bold>For resource-constrained scenarios</bold>: Prioritize implementation optimization for non-default theta values before considering theta tuning benefits.</p></list-item>
</list>
<sec>
<title>7.1.1 Cost-benefit analysis</title>
<p>The Enwik8 case exemplifies the trade-off calculus: a 2.1% performance improvement requires 1.8 &#x000D7; computational budget for equivalent throughput. This trade-off is justified when: (1) accuracy improvements translate to measurable business value exceeding the additional compute cost, (2) batch processing scenarios where latency is less critical than per-sample quality, or (3) research contexts where model performance takes precedence over operational efficiency. Conversely, real-time applications with strict latency requirements should prioritize the default &#x003B8; &#x0003D; 10, 000 unless implementation optimizations can mitigate the computational overhead. These guidelines should be validated for specific use cases, as optimal theta selection demonstrates strong dataset dependence in our study.</p>
</sec>
</sec>
</sec>
</body>
<back>
<sec sec-type="data-availability" id="s8">
<title>Data availability statement</title>
<p>Publicly available datasets were analyzed in this study. This data can be found at: The Tiny Shakespeare dataset analyzed in this study is publicly available. It can be obtained from Andrej Karpathy&#x00027;s char-rnn project on GitHub: <ext-link ext-link-type="uri" xlink:href="https://github.com/karpathy/char-rnn/blob/master/data/tinyshakespeare/input.txt">https://github.com/karpathy/char-rnn/blob/master/data/tinyshakespeare/input.txt</ext-link>. No new datasets requiring repository deposition or accession numbers were generated in this study.</p>
</sec>
<sec sec-type="author-contributions" id="s9">
<title>Author contributions</title>
<p>ZH: Formal analysis, Software, Visualization, Writing &#x02013; original draft. MC: Software, Validation, Writing &#x02013; review &#x00026; editing. SZ: Formal analysis, Investigation, Methodology, Visualization, Writing &#x02013; review &#x00026; editing.</p>
</sec>
<sec sec-type="funding-information" id="s10">
<title>Funding</title>
<p>The author(s) declare that no financial support was received for the research and/or publication of this article.</p>
</sec>
<sec sec-type="COI-statement" id="conf1">
<title>Conflict of interest</title>
<p>The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.</p>
</sec>
<sec id="s11">
<title>Generative AI statement</title>
<p>The author(s) declare that no Gen AI was used in the creation of this manuscript.</p>
<p>Any alternative text (alt text) provided alongside figures in this article has been generated by Frontiers with the support of artificial intelligence and reasonable efforts have been made to ensure accuracy, including review by the authors wherever possible. If you identify any issues, please contact us.</p></sec>
<sec sec-type="disclaimer" id="s12">
<title>Publisher&#x00027;s note</title>
<p>All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.</p>
</sec>
<ref-list>
<title>References</title>
<ref id="B1">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Almazrouei</surname> <given-names>E.</given-names></name> <name><surname>Alobeidli</surname> <given-names>H.</given-names></name> <name><surname>Alshamsi</surname> <given-names>A.</given-names></name> <name><surname>Cappelli</surname> <given-names>A.</given-names></name> <name><surname>Cojocaru</surname> <given-names>R.</given-names></name> <name><surname>Debbah</surname> <given-names>M.</given-names></name> <etal/></person-group>. (<year>2023</year>). <article-title>The falcon series of open language models</article-title>. <source>arXiv preprint arXiv:2311.16867</source>. <pub-id pub-id-type="doi">10.48550/arXiv.2311.16867</pub-id></citation>
</ref>
<ref id="B2">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Anil</surname> <given-names>R.</given-names></name> <name><surname>Dai</surname> <given-names>A. M.</given-names></name> <name><surname>Firat</surname> <given-names>O.</given-names></name> <name><surname>Johnson</surname> <given-names>M.</given-names></name> <name><surname>Lepikhin</surname> <given-names>D.</given-names></name> <name><surname>Liu</surname> <given-names>Y.</given-names></name> <etal/></person-group>. (<year>2023</year>). <article-title>Palm 2 technical report</article-title>. <source>arXiv preprint arXiv:2305.10403</source>. <pub-id pub-id-type="doi">10.48550/arXiv.2305.10403</pub-id></citation>
</ref>
<ref id="B3">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Ba</surname> <given-names>J. L.</given-names></name> <name><surname>Kiros</surname> <given-names>J. R.</given-names></name> <name><surname>Hinton</surname> <given-names>G. E.</given-names></name></person-group> (<year>2016</year>). <article-title>Layer normalization</article-title>. <source>arXiv preprint arXiv:1607.06450</source>. <pub-id pub-id-type="doi">10.48550/arXiv.1607.06450</pub-id></citation>
</ref>
<ref id="B4">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Bahdanau</surname> <given-names>D.</given-names></name> <name><surname>Cho</surname> <given-names>K.</given-names></name> <name><surname>Bengio</surname> <given-names>Y.</given-names></name></person-group> (<year>2014</year>). <article-title>Neural machine translation by jointly learning to align and translate</article-title>. <source>arXiv preprint arXiv:1409.0473</source>. <pub-id pub-id-type="doi">10.48550/arXiv.1409.0473</pub-id></citation>
</ref>
<ref id="B5">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Beltagy</surname> <given-names>I.</given-names></name> <name><surname>Peters</surname> <given-names>M. E.</given-names></name> <name><surname>Cohan</surname> <given-names>A.</given-names></name></person-group> (<year>2020</year>). <article-title>Longformer: the long-document transformer</article-title>. <source>arXiv preprint arXiv:2004.05150</source>. <pub-id pub-id-type="doi">10.48550/arXiv.2004.05150</pub-id></citation>
</ref>
<ref id="B6">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Brown</surname> <given-names>T. B.</given-names></name> <name><surname>Mann</surname> <given-names>B.</given-names></name> <name><surname>Ryder</surname> <given-names>N.</given-names></name> <name><surname>Subbiah</surname> <given-names>M.</given-names></name> <name><surname>Kaplan</surname> <given-names>J.</given-names></name> <name><surname>Dhariwal</surname> <given-names>P.</given-names></name> <etal/></person-group>. (<year>2020</year>). <article-title>Language models are few-shot learners</article-title>. <source>Adv. Neural Inf. Process. Syst</source>. <volume>33</volume>, <fpage>1877</fpage>&#x02013;<lpage>1901</lpage>.</citation>
</ref>
<ref id="B7">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Cho</surname> <given-names>K.</given-names></name> <name><surname>Van Merri&#x000EB;nboer</surname> <given-names>B.</given-names></name> <name><surname>Gulcehre</surname> <given-names>C.</given-names></name> <name><surname>Bahdanau</surname> <given-names>D.</given-names></name> <name><surname>Bougares</surname> <given-names>F.</given-names></name> <name><surname>Schwenk</surname> <given-names>H.</given-names></name> <etal/></person-group>. (<year>2014</year>). <article-title>Learning phrase representations using rnn encoder-decoder for statistical machine translation</article-title>. <source>arXiv preprint arXiv:1406.1078</source>. <pub-id pub-id-type="doi">10.3115/v1/D14-1179</pub-id></citation>
</ref>
<ref id="B8">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Chowdhery</surname> <given-names>A.</given-names></name> <name><surname>Narang</surname> <given-names>S.</given-names></name> <name><surname>Devlin</surname> <given-names>J.</given-names></name> <name><surname>Bosma</surname> <given-names>M.</given-names></name> <name><surname>Mishra</surname> <given-names>G.</given-names></name> <name><surname>Roberts</surname> <given-names>A.</given-names></name> <etal/></person-group>. (<year>2023</year>). <article-title>Palm: scaling language modeling with pathways</article-title>. <source>J. Mach. Learn. Res</source>. <volume>24</volume>, <fpage>1</fpage>&#x02013;<lpage>113</lpage>.<pub-id pub-id-type="pmid">37438534</pub-id></citation></ref>
<ref id="B9">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Dai</surname> <given-names>Z.</given-names></name> <name><surname>Yang</surname> <given-names>Z.</given-names></name> <name><surname>Yang</surname> <given-names>Y.</given-names></name> <name><surname>Carbonell</surname> <given-names>J.</given-names></name> <name><surname>Le</surname> <given-names>Q. V.</given-names></name> <name><surname>Salakhutdinov</surname> <given-names>R.</given-names></name></person-group> (<year>2019</year>). <article-title>&#x0201C;Transformer-XL: attentive language models beyond a fixed-length context,&#x0201D;</article-title> in <italic>Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics</italic> (<publisher-loc>Florence</publisher-loc>: <publisher-name>Association for Computational Linguistics</publisher-name>), <fpage>2978</fpage>&#x02013;<lpage>2988</lpage>. <pub-id pub-id-type="doi">10.18653/v1/P19-1285</pub-id><pub-id pub-id-type="pmid">36568019</pub-id></citation></ref>
<ref id="B10">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Dehghani</surname> <given-names>M.</given-names></name> <name><surname>Gouws</surname> <given-names>S.</given-names></name> <name><surname>Vinyals</surname> <given-names>O.</given-names></name> <name><surname>Uszkoreit</surname> <given-names>J.</given-names></name> <name><surname>Kaiser</surname> <given-names>L.</given-names></name></person-group> (<year>2018</year>). <article-title>Universal transformers</article-title>. <source>arXiv preprint arXiv:1807.03819</source>. <pub-id pub-id-type="doi">10.48550/arXiv.1807.03819</pub-id></citation>
</ref>
<ref id="B11">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Devlin</surname> <given-names>J.</given-names></name> <name><surname>Chang</surname> <given-names>M.-W.</given-names></name> <name><surname>Lee</surname> <given-names>K.</given-names></name> <name><surname>Toutanova</surname> <given-names>K.</given-names></name></person-group> (<year>2019</year>). <article-title>&#x0201C;Bert: pre-training of deep bidirectional transformers for language understanding,&#x0201D;</article-title> in <source>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)</source> (<publisher-loc>Association for Computational Linguistics</publisher-loc>), <fpage>4171</fpage>&#x02013;<lpage>4186</lpage>.</citation>
</ref>
<ref id="B12">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Dosovitskiy</surname> <given-names>A.</given-names></name> <name><surname>Beyer</surname> <given-names>L.</given-names></name> <name><surname>Kolesnikov</surname> <given-names>A.</given-names></name> <name><surname>Weissenborn</surname> <given-names>D.</given-names></name> <name><surname>Zhai</surname> <given-names>X.</given-names></name> <name><surname>Unterthiner</surname> <given-names>T.</given-names></name> <etal/></person-group>. (<year>2021</year>). &#x0201C;An image is worth 16 &#x000D7; 16 words: transformers for image recognition at scale,&#x00022; in <italic>International Conference on Learning Representations</italic> OpenReview.</citation>
</ref>
<ref id="B13">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Gehring</surname> <given-names>J.</given-names></name> <name><surname>Auli</surname> <given-names>M.</given-names></name> <name><surname>Grangier</surname> <given-names>D.</given-names></name> <name><surname>Yarats</surname> <given-names>D.</given-names></name> <name><surname>Dauphin</surname> <given-names>Y. N.</given-names></name></person-group> (<year>2017</year>). &#x0201C;Convolutional sequence to sequence learning,&#x00022; in <italic>International Conference on Machine Learning</italic> (PMLR), <fpage>1243</fpage>&#x02013;<lpage>1252</lpage>.</citation>
</ref>
<ref id="B14">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Graves</surname> <given-names>A.</given-names></name></person-group> (<year>2013</year>). <article-title>Generating sequences with recurrent neural networks</article-title>. <source>arXiv preprint arXiv:1308.0850</source>. <pub-id pub-id-type="doi">10.48550/arXiv.1308.0850</pub-id></citation>
</ref>
<ref id="B15">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>He</surname> <given-names>K.</given-names></name> <name><surname>Zhang</surname> <given-names>X.</given-names></name> <name><surname>Ren</surname> <given-names>S.</given-names></name> <name><surname>Sun</surname> <given-names>J.</given-names></name></person-group> (<year>2016</year>). &#x0201C;Deep residual learning for image recognition,&#x00022; in <italic>Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition</italic> (Las Vegas, NV: IEEE Computer Society), <fpage>770</fpage>&#x02013;<lpage>778</lpage>. <pub-id pub-id-type="doi">10.1109/CVPR.2016.90</pub-id></citation>
</ref>
<ref id="B16">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Hochreiter</surname> <given-names>S.</given-names></name> <name><surname>Schmidhuber</surname> <given-names>J.</given-names></name></person-group> (<year>1997</year>). <article-title>Long short-term memory</article-title>. <source>Neural Comput</source>. <volume>9</volume>, <fpage>1735</fpage>&#x02013;<lpage>1780</lpage>. <pub-id pub-id-type="doi">10.1162/neco.1997.9.8.1735</pub-id><pub-id pub-id-type="pmid">9377276</pub-id></citation></ref>
<ref id="B17">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Huang</surname> <given-names>C.-Z. A.</given-names></name> <name><surname>Vaswani</surname> <given-names>A.</given-names></name> <name><surname>Uszkoreit</surname> <given-names>J.</given-names></name> <name><surname>Shazeer</surname> <given-names>N.</given-names></name> <name><surname>Simon</surname> <given-names>I.</given-names></name> <name><surname>Hawthorne</surname> <given-names>C.</given-names></name> <etal/></person-group>. (<year>2018</year>). <article-title>Music transformer: generating music with long-term structure</article-title>. <source>arXiv preprint arXiv:1809.04281</source>. <pub-id pub-id-type="doi">10.48550/arXiv.1809.04281</pub-id><pub-id pub-id-type="pmid">40745012</pub-id></citation></ref>
<ref id="B18">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Huang</surname> <given-names>Z.</given-names></name> <name><surname>Chen</surname> <given-names>M.</given-names></name></person-group> (<year>2025</year>). <article-title>Optimizing the learnable rope theta parameter in transformers</article-title>. <source>IEEE Access</source> <volume>13</volume>:<fpage>131271</fpage>. <pub-id pub-id-type="doi">10.1109/ACCESS.2025.3590604</pub-id></citation>
</ref>
<ref id="B19">
<citation citation-type="web"><person-group person-group-type="author"><name><surname>Inan</surname> <given-names>H.</given-names></name> <name><surname>Khosravi</surname> <given-names>K.</given-names></name> <name><surname>Socher</surname> <given-names>R.</given-names></name></person-group> (<year>2017</year>). &#x0201C;Tying word vectors and word classifiers: a loss framework for language modeling,&#x00022; in <italic>5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings</italic>. Available online at: <ext-link ext-link-type="uri" xlink:href="https://OpenReview.net">https://OpenReview.net</ext-link></citation>
</ref>
<ref id="B20">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Jiang</surname> <given-names>A. Q.</given-names></name> <name><surname>Sablayrolles</surname> <given-names>A.</given-names></name> <name><surname>Mensch</surname> <given-names>A.</given-names></name> <name><surname>Bamford</surname> <given-names>C.</given-names></name> <name><surname>Chaplot</surname> <given-names>D. S.</given-names></name> <name><surname>de las Casas</surname> <given-names>D.</given-names></name> <etal/></person-group>. (<year>2023</year>). <article-title>Mistral 7b</article-title>. <source>arXiv preprint arXiv</source>:2310.06825. <pub-id pub-id-type="doi">10.48550/arXiv.2310.06825</pub-id></citation>
</ref>
<ref id="B21">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Kaplan</surname> <given-names>J.</given-names></name> <name><surname>McCandlish</surname> <given-names>S.</given-names></name> <name><surname>Henighan</surname> <given-names>T.</given-names></name> <name><surname>Brown</surname> <given-names>T. B.</given-names></name> <name><surname>Chess</surname> <given-names>B.</given-names></name> <name><surname>Child</surname> <given-names>R.</given-names></name> <etal/></person-group>. (<year>2020</year>). <article-title>Scaling laws for neural language models</article-title>. <source>arXiv preprint arXiv:2001.08361</source>. <pub-id pub-id-type="doi">10.48550/arXiv.2001.08361</pub-id></citation>
</ref>
<ref id="B22">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Karpathy</surname> <given-names>A.</given-names></name></person-group> (<year>2015</year>). <source>The Unreasonable Effectiveness of Recurrent Neural Networks</source>. Andrej Karpathy Blog.</citation>
</ref>
<ref id="B23">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Karpathy</surname> <given-names>A.</given-names></name> <name><surname>Johnson</surname> <given-names>J.</given-names></name> <name><surname>Fei-Fei</surname> <given-names>L.</given-names></name></person-group> (<year>2015</year>). <article-title>Visualizing and understanding recurrent networks</article-title>. <source>arXiv preprint arXiv:1506.02078</source>. <pub-id pub-id-type="doi">10.48550/arXiv.1506.02078</pub-id></citation>
</ref>
<ref id="B24">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Kenton</surname> <given-names>J. D. M.-W. C.</given-names></name> <name><surname>Toutanova</surname> <given-names>K.</given-names></name></person-group> (<year>2019</year>). <article-title>Bert: Pre-training of deep bidirectional transformers for language understanding</article-title>. <source>arXiv preprint arXiv:1810.04805</source>. <pub-id pub-id-type="doi">10.48550/arXiv.1810.04805</pub-id></citation>
</ref>
<ref id="B25">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Kim</surname> <given-names>Y.</given-names></name> <name><surname>Jernite</surname> <given-names>Y.</given-names></name> <name><surname>Sontag</surname> <given-names>D.</given-names></name> <name><surname>Rush</surname> <given-names>A. M.</given-names></name></person-group> (<year>2016</year>). &#x0201C;Character-aware neural language models,&#x00022; in <italic>Proceedings of the AAAI Conference on Artificial Intelligence</italic> Berlin: Association for Computational Linguistics. <pub-id pub-id-type="doi">10.1609/aaai.v30i1.10362</pub-id></citation>
</ref>
<ref id="B26">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Kingma</surname> <given-names>D. P.</given-names></name> <name><surname>Ba</surname> <given-names>J.</given-names></name></person-group> (<year>2015</year>). &#x0201C;Adam: a method for stochastic optimization,&#x00022; in <italic>International Conference on Learning Representations</italic> <publisher-loc>San Diego, CA</publisher-loc>: <publisher-name>ICLR (International Conference on Learning Representations)</publisher-name>.</citation>
</ref>
<ref id="B27">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Krizhevsky</surname> <given-names>A.</given-names></name> <name><surname>Sutskever</surname> <given-names>I.</given-names></name> <name><surname>Hinton</surname> <given-names>G. E.</given-names></name></person-group> (<year>2012</year>). <article-title>Imagenet classification with deep convolutional neural networks</article-title>. <source>Adv. Neural Inf. Process. Syst</source>. 25.</citation>
</ref>
<ref id="B28">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Lan</surname> <given-names>Z.</given-names></name> <name><surname>Chen</surname> <given-names>M.</given-names></name> <name><surname>Goodman</surname> <given-names>S.</given-names></name> <name><surname>Gimpel</surname> <given-names>K.</given-names></name> <name><surname>Sharma</surname> <given-names>P.</given-names></name> <name><surname>Soricut</surname> <given-names>R.</given-names></name></person-group> (<year>2019</year>). <article-title>Albert: a lite bert for self-supervised learning of language representations</article-title>. <source>arXiv preprint arXiv:1909.11942</source>. <pub-id pub-id-type="doi">10.48550/arXiv.1909.11942</pub-id></citation>
</ref>
<ref id="B29">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>LeCun</surname> <given-names>Y.</given-names></name> <name><surname>Bottou</surname> <given-names>L.</given-names></name> <name><surname>Bengio</surname> <given-names>Y.</given-names></name> <name><surname>Haffner</surname> <given-names>P.</given-names></name></person-group> (<year>1998</year>). <article-title>Gradient-based learning applied to document recognition</article-title>. <source>Proc. IEEE</source> <volume>86</volume>, <fpage>2278</fpage>&#x02013;<lpage>2324</lpage>. <pub-id pub-id-type="doi">10.1109/5.726791</pub-id></citation>
</ref>
<ref id="B30">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Lewis</surname> <given-names>M.</given-names></name> <name><surname>Liu</surname> <given-names>Y.</given-names></name> <name><surname>Goyal</surname> <given-names>N.</given-names></name> <name><surname>Ghazvininejad</surname> <given-names>M.</given-names></name> <name><surname>Mohamed</surname> <given-names>A.</given-names></name> <name><surname>Levy</surname> <given-names>O.</given-names></name> <etal/></person-group>. (<year>2020</year>). <article-title>&#x0201C;Bart: denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension,&#x00022;</article-title> in <source>Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics</source>, <fpage>7871</fpage>&#x02013;<lpage>7880</lpage>. <pub-id pub-id-type="doi">10.18653/v1/2020.acl-main.703</pub-id><pub-id pub-id-type="pmid">36568019</pub-id></citation></ref>
<ref id="B31">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Ling</surname> <given-names>W.</given-names></name> <name><surname>Trancoso</surname> <given-names>I.</given-names></name> <name><surname>Dyer</surname> <given-names>C.</given-names></name> <name><surname>Black</surname> <given-names>A. W.</given-names></name></person-group> (<year>2015</year>). <article-title>&#x0201C;Finding function in form: compositional character models for open vocabulary word representation,&#x00022;</article-title> in <source>Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing</source>, <fpage>1520</fpage>&#x02013;<lpage>1530</lpage>. <pub-id pub-id-type="doi">10.18653/v1/D15-1176</pub-id><pub-id pub-id-type="pmid">36568019</pub-id></citation></ref>
<ref id="B32">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Liu</surname> <given-names>Y.</given-names></name> <name><surname>Ott</surname> <given-names>M.</given-names></name> <name><surname>Goyal</surname> <given-names>N.</given-names></name> <name><surname>Du</surname> <given-names>J.</given-names></name> <name><surname>Joshi</surname> <given-names>M.</given-names></name> <name><surname>Chen</surname> <given-names>D.</given-names></name> <etal/></person-group>. (<year>2019</year>). <article-title>Roberta: a robustly optimized bert pretraining approach</article-title>. <source>arXiv preprint arXiv:1907.11692</source>. <pub-id pub-id-type="doi">10.48550/arXiv.1907.11692</pub-id></citation>
</ref>
<ref id="B33">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Loshchilov</surname> <given-names>I.</given-names></name> <name><surname>Hutter</surname> <given-names>F.</given-names></name></person-group> (<year>2017</year>). <article-title>Decoupled weight decay regularization</article-title>. <source>arXiv preprint arXiv:1711.05101</source>. <pub-id pub-id-type="doi">10.48550/arXiv.1711.05101</pub-id><pub-id pub-id-type="pmid">38536692</pub-id></citation></ref>
<ref id="B34">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Luong</surname> <given-names>M.-T.</given-names></name> <name><surname>Pham</surname> <given-names>H.</given-names></name> <name><surname>Manning</surname> <given-names>C. D.</given-names></name></person-group> (<year>2015</year>). <article-title>Effective approaches to attention-based neural machine translation</article-title>. <source>arXiv preprint arXiv:1508.04025</source>. <pub-id pub-id-type="doi">10.18653/v1/D15-1166</pub-id><pub-id pub-id-type="pmid">36568019</pub-id></citation></ref>
<ref id="B35">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Micikevicius</surname> <given-names>P.</given-names></name> <name><surname>Narang</surname> <given-names>S.</given-names></name> <name><surname>Alben</surname> <given-names>J.</given-names></name> <name><surname>Diamos</surname> <given-names>G.</given-names></name> <name><surname>Elsen</surname> <given-names>E.</given-names></name> <name><surname>Garcia</surname> <given-names>D.</given-names></name> <etal/></person-group>. (<year>2017</year>). <article-title>Mixed precision training</article-title>. <source>arXiv preprint arXiv:1710.03740</source>. <pub-id pub-id-type="doi">10.48550/arXiv.1710.03740</pub-id></citation>
</ref>
<ref id="B36">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Narayanan</surname> <given-names>D.</given-names></name> <name><surname>Shoeybi</surname> <given-names>M.</given-names></name> <name><surname>Casper</surname> <given-names>J.</given-names></name> <name><surname>LeGresley</surname> <given-names>P.</given-names></name> <name><surname>Patwary</surname> <given-names>M.</given-names></name> <name><surname>Korthikanti</surname> <given-names>V. A.</given-names></name> <etal/></person-group>. (<year>2021</year>). &#x0201C;Efficient large-scale language model training on gpu clusters using megatron-lm, in <italic>Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis</italic> (<publisher-loc>St. Louis, MO</publisher-loc>: <publisher-name>ACM</publisher-name>), <fpage>1</fpage>&#x02013;<lpage>15</lpage>. <pub-id pub-id-type="doi">10.1145/3458817.3476209</pub-id></citation>
</ref>
<ref id="B37">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>OpenA</surname> <given-names>I.</given-names></name></person-group> (<year>2023</year>). <article-title>Gpt-4 technical report</article-title>. <source>arXiv preprint arXiv:2303.08774</source>. <pub-id pub-id-type="doi">10.48550/arXiv.2303.08774</pub-id></citation>
</ref>
<ref id="B38">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Paszke</surname> <given-names>A.</given-names></name> <name><surname>Gross</surname> <given-names>S.</given-names></name> <name><surname>Massa</surname> <given-names>F.</given-names></name> <name><surname>Lerer</surname> <given-names>A.</given-names></name> <name><surname>Bradbury</surname> <given-names>J.</given-names></name> <name><surname>Chanan</surname> <given-names>G.</given-names></name> <etal/></person-group>. (<year>2019</year>). <article-title>Pytorch: an imperative style, high-performance deep learning library</article-title>. <source>Adv. Neural Inf. Process. Syst</source>. 32.</citation>
</ref>
<ref id="B39">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Press</surname> <given-names>O.</given-names></name> <name><surname>Wolf</surname> <given-names>L.</given-names></name></person-group> (<year>2017</year>). <article-title>&#x0201C;Using the output embedding to improve language models,&#x00022;</article-title> in <source>Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 2, Short Papers</source>, <fpage>157</fpage>&#x02013;<lpage>163</lpage>. <pub-id pub-id-type="doi">10.18653/v1/E17-2025</pub-id><pub-id pub-id-type="pmid">36568019</pub-id></citation></ref>
<ref id="B40">
<citation citation-type="web"><person-group person-group-type="author"><name><surname>Radford</surname> <given-names>A.</given-names></name> <name><surname>Narasimhan</surname> <given-names>K.</given-names></name> <name><surname>Salimans</surname> <given-names>T.</given-names></name> <name><surname>Sutskever</surname> <given-names>I.</given-names></name></person-group> (<year>2018</year>). <source>Improving Language Understanding by Generative Pre-training</source>. Available online at: <ext-link ext-link-type="uri" xlink:href="https://s3-us-west-2.amazonaws.com/openai-assets/research-covers/language-unsupervised/languageunderstandingpaper.pdf">https://s3-us-west-2.amazonaws.com/openai-assets/research-covers/language-unsupervised/languageunderstandingpaper.pdf</ext-link> (Accessed August 12, 2025).</citation>
</ref>
<ref id="B41">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Radford</surname> <given-names>A.</given-names></name> <name><surname>Wu</surname> <given-names>J.</given-names></name> <name><surname>Child</surname> <given-names>R.</given-names></name> <name><surname>Luan</surname> <given-names>D.</given-names></name> <name><surname>Amodei</surname> <given-names>D.</given-names></name> <name><surname>Sutskever</surname> <given-names>I.</given-names></name></person-group> (<year>2019</year>). <article-title>Language models are unsupervised multitask learners</article-title>. <source>OpenAI blog</source> <volume>1</volume>:<fpage>9</fpage>.<pub-id pub-id-type="pmid">35637722</pub-id></citation></ref>
<ref id="B42">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Raffel</surname> <given-names>C.</given-names></name> <name><surname>Shazeer</surname> <given-names>N.</given-names></name> <name><surname>Roberts</surname> <given-names>A.</given-names></name> <name><surname>Lee</surname> <given-names>K.</given-names></name> <name><surname>Narang</surname> <given-names>S.</given-names></name> <name><surname>Matena</surname> <given-names>M.</given-names></name> <etal/></person-group>. (<year>2020</year>). <article-title>Exploring the limits of transfer learning with a unified text-to-text transformer</article-title>. <source>J. Mach. Learn. Res</source>. <volume>21</volume>, <fpage>1</fpage>&#x02013;<lpage>67</lpage>.</citation>
</ref>
<ref id="B43">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Rajbhandari</surname> <given-names>S.</given-names></name> <name><surname>Rasley</surname> <given-names>J.</given-names></name> <name><surname>Ruwase</surname> <given-names>O.</given-names></name> <name><surname>He</surname> <given-names>Y.</given-names></name></person-group> (<year>2020</year>). &#x0201C;Zero: memory optimizations toward training trillion parameter models,&#x00022; in <italic>Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis</italic> (<publisher-loc>Atlanta</publisher-loc>: <publisher-name>IEEE/ACM</publisher-name>), <fpage>1</fpage>&#x02013;<lpage>16</lpage>. <pub-id pub-id-type="doi">10.1109/SC41405.2020.00024</pub-id></citation>
</ref>
<ref id="B44">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Rasley</surname> <given-names>J.</given-names></name> <name><surname>Rajbhandari</surname> <given-names>S.</given-names></name> <name><surname>Ruwase</surname> <given-names>O.</given-names></name> <name><surname>He</surname> <given-names>Y.</given-names></name></person-group> (<year>2020</year>). &#x0201C;Deepspeed: system optimizations enable training deep learning models with over 100 billion parameters,&#x00022; in <italic>Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining</italic> (CA: ACM), <fpage>3505</fpage>&#x02013;<lpage>3506</lpage>. <pub-id pub-id-type="doi">10.1145/3394486.3406703</pub-id></citation>
</ref>
<ref id="B45">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Sennrich</surname> <given-names>R.</given-names></name> <name><surname>Haddow</surname> <given-names>B.</given-names></name> <name><surname>Birch</surname> <given-names>A.</given-names></name></person-group> (<year>2016</year>). &#x0201C;Neural machine translation of rare words with subword units,&#x00022; in <italic>Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics</italic> (Berlin: Association for Computational Linguistics), <fpage>1715</fpage>&#x02013;<lpage>1725</lpage>. <pub-id pub-id-type="doi">10.18653/v1/P16-1162</pub-id><pub-id pub-id-type="pmid">36568019</pub-id></citation></ref>
<ref id="B46">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Shaw</surname> <given-names>P.</given-names></name> <name><surname>Uszkoreit</surname> <given-names>J.</given-names></name> <name><surname>Vaswani</surname> <given-names>A.</given-names></name></person-group> (<year>2018</year>). &#x0201C;Self-attention with relative position representations,&#x00022; in <italic>Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers)</italic> (New Orleans, LA: Association for Computational Linguistics), <fpage>464</fpage>&#x02013;<lpage>468</lpage>. <pub-id pub-id-type="doi">10.18653/v1/N18-2074</pub-id><pub-id pub-id-type="pmid">36568019</pub-id></citation></ref>
<ref id="B47">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Shoeybi</surname> <given-names>M.</given-names></name> <name><surname>Patwary</surname> <given-names>M.</given-names></name> <name><surname>Puri</surname> <given-names>R.</given-names></name> <name><surname>LeGresley</surname> <given-names>P.</given-names></name> <name><surname>Casper</surname> <given-names>J.</given-names></name> <name><surname>Catanzaro</surname> <given-names>B.</given-names></name></person-group> (<year>2019</year>). <article-title>Megatron-LM: training multi-billion parameter language models using model parallelism</article-title>. <source>arXiv preprint arXiv:1909.08053</source>. <pub-id pub-id-type="doi">10.48550/arXiv.1909.08053</pub-id></citation>
</ref>
<ref id="B48">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>So</surname> <given-names>D. R.</given-names></name> <name><surname>Le</surname> <given-names>Q. V.</given-names></name> <name><surname>Liang</surname> <given-names>C.</given-names></name></person-group> (<year>2021</year>). <article-title>Primer: searching for efficient transformers for language modeling</article-title>. <source>Adv. Neural Inf. Process. Syst</source>. <volume>34</volume>, <fpage>22989</fpage>&#x02013;<lpage>23002</lpage>.</citation>
</ref>
<ref id="B49">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Su</surname> <given-names>J.</given-names></name> <name><surname>Lu</surname> <given-names>Y.</given-names></name> <name><surname>Pan</surname> <given-names>S.</given-names></name> <name><surname>Murtadha</surname> <given-names>A.</given-names></name> <name><surname>Wen</surname> <given-names>B.</given-names></name> <name><surname>Liu</surname> <given-names>Y.</given-names></name></person-group> (<year>2021</year>). <article-title>Roformer: enhanced transformer with rotary position embedding</article-title>. <source>arXiv preprint arXiv:2104.09864</source>. <pub-id pub-id-type="doi">10.48550/arXiv.2104.09864</pub-id></citation>
</ref>
<ref id="B50">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Sun</surname> <given-names>K.</given-names></name> <name><surname>Lin</surname> <given-names>Y.-K.</given-names></name> <name><surname>Zhang</surname> <given-names>Z.-D.</given-names></name> <name><surname>Liu</surname> <given-names>Q.</given-names></name></person-group> (<year>2023</year>). <article-title>Xpos: Extending positional embeddings to longer contexts via progressive accumulation</article-title>. <source>arXiv preprint arXiv:2308.15706</source>. <pub-id pub-id-type="doi">10.18653/v1/2023.acl-long.816</pub-id><pub-id pub-id-type="pmid">36568019</pub-id></citation></ref>
<ref id="B51">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Sutskever</surname> <given-names>I.</given-names></name> <name><surname>Vinyals</surname> <given-names>O.</given-names></name> <name><surname>Le</surname> <given-names>Q. V.</given-names></name></person-group> (<year>2014</year>). <article-title>Sequence to sequence learning with neural networks</article-title>. <source>Adv. Neural Inf. Process. Syst</source>. 27.</citation>
</ref>
<ref id="B52">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Tay</surname> <given-names>Y.</given-names></name> <name><surname>Dehghani</surname> <given-names>M.</given-names></name> <name><surname>Bahri</surname> <given-names>D.</given-names></name> <name><surname>Metzler</surname> <given-names>D.</given-names></name></person-group> (<year>2020</year>). &#x0201C;Efficient transformers: a survey,&#x00022; in <italic>Proceedings of the ACM SIGKDD International Conference on Knowledge Discovery and Data Mining</italic> (<publisher-loc>New York, NY</publisher-loc>: <publisher-name>ACM</publisher-name>), <fpage>3520</fpage>&#x02013;<lpage>3521</lpage>.</citation>
</ref>
<ref id="B53">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Touvron</surname> <given-names>H.</given-names></name> <name><surname>Martin</surname> <given-names>L.</given-names></name> <name><surname>Stone</surname> <given-names>K.</given-names></name> <name><surname>Albert</surname> <given-names>P.</given-names></name> <name><surname>Almahairi</surname> <given-names>A.</given-names></name> <name><surname>Babaei</surname> <given-names>Y.</given-names></name> <etal/></person-group>. (<year>2023</year>). <article-title>Llama 2: open foundation and fine-tuned chat models</article-title>. <source>Adv. Neural Inf. Process. Syst</source>. 36. <pub-id pub-id-type="doi">10.48550/arXiv.2302.13971</pub-id></citation>
</ref>
<ref id="B54">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Vaswani</surname> <given-names>A.</given-names></name> <name><surname>Shazeer</surname> <given-names>N.</given-names></name> <name><surname>Parmar</surname> <given-names>N.</given-names></name> <name><surname>Uszkoreit</surname> <given-names>J.</given-names></name> <name><surname>Jones</surname> <given-names>L.</given-names></name> <name><surname>Gomez</surname> <given-names>A. N.</given-names></name> <etal/></person-group>. (<year>2017</year>). <article-title>Attention is all you need</article-title>. <source>Adv. Neural Inf. Process. Syst</source>. 30.</citation>
</ref>
<ref id="B55">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Wang</surname> <given-names>A.</given-names></name> <name><surname>Pruksachatkun</surname> <given-names>Y.</given-names></name> <name><surname>Nangia</surname> <given-names>N.</given-names></name> <name><surname>Singh</surname> <given-names>A.</given-names></name> <name><surname>Michael</surname> <given-names>J.</given-names></name> <name><surname>Hill</surname> <given-names>F.</given-names></name> <etal/></person-group>. (<year>2019</year>). <article-title>Superglue: a stickier benchmark for general-purpose language understanding systems</article-title>. <source>Adv. Neural Inf. Process. Syst</source>. 32.</citation>
</ref>
<ref id="B56">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Wang</surname> <given-names>A.</given-names></name> <name><surname>Singh</surname> <given-names>A.</given-names></name> <name><surname>Michael</surname> <given-names>J.</given-names></name> <name><surname>Hill</surname> <given-names>F.</given-names></name> <name><surname>Levy</surname> <given-names>O.</given-names></name> <name><surname>Bowman</surname> <given-names>S. R.</given-names></name></person-group> (<year>2018</year>). &#x0201C;Glue: a multi-task benchmark and analysis platform for natural language understanding,&#x00022; in <italic>Proceedings of the 2018 EMNLP Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP</italic> (Brussels: Association for Computational Linguistics), <fpage>353</fpage>&#x02013;<lpage>355</lpage>. <pub-id pub-id-type="doi">10.18653/v1/W18-5446</pub-id><pub-id pub-id-type="pmid">36568019</pub-id></citation></ref>
<ref id="B57">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Workshop</surname> <given-names>B.</given-names></name> <name><surname>Scao</surname> <given-names>T. L.</given-names></name> <name><surname>Fan</surname> <given-names>A.</given-names></name> <name><surname>Akiki</surname> <given-names>C.</given-names></name> <name><surname>Pavlick</surname> <given-names>E.</given-names></name> <name><surname>Ili&#x00107;</surname> <given-names>S.</given-names></name> <etal/></person-group>. (<year>2022</year>). <article-title>Bloom: A 176b-parameter open-access multilingual language model</article-title>. <source>arXiv preprint arXiv:2211.05100</source>. <pub-id pub-id-type="doi">10.48550/arXiv.2211.05100</pub-id></citation>
</ref>
<ref id="B58">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Wu</surname> <given-names>Y.</given-names></name> <name><surname>Schuster</surname> <given-names>M.</given-names></name> <name><surname>Chen</surname> <given-names>Z.</given-names></name> <name><surname>Le</surname> <given-names>Q. V.</given-names></name> <name><surname>Norouzi</surname> <given-names>M.</given-names></name> <name><surname>Macherey</surname> <given-names>W.</given-names></name> <etal/></person-group>. (<year>2016</year>). <article-title>Google&#x00027;s neural machine translation system: bridging the gap between human and machine translation</article-title>. <source>arXiv preprint arXiv:1609.08144</source>. <pub-id pub-id-type="doi">10.48550/arXiv.1609.08144</pub-id></citation>
</ref>
<ref id="B59">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Yang</surname> <given-names>Z.</given-names></name> <name><surname>Dai</surname> <given-names>Z.</given-names></name> <name><surname>Yang</surname> <given-names>Y.</given-names></name> <name><surname>Carbonell</surname> <given-names>J.</given-names></name> <name><surname>Salakhutdinov</surname> <given-names>R. R.</given-names></name> <name><surname>Le</surname> <given-names>Q. V.</given-names></name></person-group> (<year>2019</year>). <article-title>Xlnet: Generalized autoregressive pretraining for language understanding</article-title>. <source>Adv. Neural Inf. Process. Syst</source>. 32.</citation>
</ref>
<ref id="B60">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Zaheer</surname> <given-names>M.</given-names></name> <name><surname>Guruganesh</surname> <given-names>G.</given-names></name> <name><surname>Dubey</surname> <given-names>K. A.</given-names></name> <name><surname>Ainslie</surname> <given-names>J.</given-names></name> <name><surname>Alberti</surname> <given-names>C.</given-names></name> <name><surname>Ontanon</surname> <given-names>S.</given-names></name> <etal/></person-group>. (<year>2020</year>). <article-title>Big bird: transformers for longer sequences</article-title>. <source>Adv. Neural Inf. Process. Syst</source>. <volume>33</volume>, <fpage>17283</fpage>&#x02013;<lpage>17297</lpage>.</citation>
</ref>
<ref id="B61">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Zhang</surname> <given-names>J.</given-names></name> <name><surname>Zhao</surname> <given-names>Y.</given-names></name> <name><surname>Saleh</surname> <given-names>M.</given-names></name> <name><surname>Liu</surname> <given-names>P. J.</given-names></name></person-group> (<year>2020</year>). <article-title>Pegasus: pre-training with extracted gap-sentences for abstractive summarization</article-title>. <source>arXiv preprint arXiv:1912.08777</source>. <pub-id pub-id-type="doi">10.48550/arXiv.1912.08777</pub-id></citation>
</ref>
</ref-list>
</back>
</article>