<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>RoPE on Lee</title>
        <link>/en/tags/rope/</link>
        <description>Recent content in RoPE on Lee</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>en</language>
        <copyright>Lee</copyright>
        <lastBuildDate>Tue, 22 Sep 2026 09:14:54 +0800</lastBuildDate><atom:link href="/en/tags/rope/index.xml" rel="self" type="application/rss+xml" /><item>
            <title>LLaMA: No Architecture Revolution, Yet It Became the Open-Model Foundation</title>
            <link>/en/p/llama-open-ecosystem/</link>
            <pubDate>Tue, 22 Sep 2026 00:00:00 +0000</pubDate>
            <guid>/en/p/llama-open-ecosystem/</guid>
            <description>&lt;img src=&#34;/en/p/llama-open-ecosystem/cover.jpg&#34; alt=&#34;Featured image of post LLaMA: No Architecture Revolution, Yet It Became the Open-Model Foundation&#34; /&gt;&lt;p&gt;The LLaMA paper, released in February 2023, was unusual for a supposed breakthrough: it barely claimed a new core component. The network remained a decoder-only Transformer. RMSNorm, SwiGLU, and RoPE all came from earlier work. What changed was the result of combining those choices well. Models from 7B to 65B parameters were trained on 1.0T or 1.4T tokens from publicly available sources, then matched or exceeded much larger models at sizes that were comparatively practical to run.&lt;/p&gt;&#xA;&lt;p&gt;That outcome mattered more than a temporary leaderboard win. A model family that was strong enough, structurally conventional, and available in several useful sizes gave fine-tuning tools, quantizers, inference engines, and applications a common foundation. LLaMA&amp;rsquo;s historical importance is not that it replaced the Transformer. It showed that &lt;strong&gt;a careful combination of proven components, training allocation, and release strategy can change how quickly a technology spreads.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;figure&gt;&lt;img src=&#34;/en/p/llama-open-ecosystem/cover.jpg&#34;&gt;&lt;figcaption&gt;&#xA;&#x9;&#x9;&#x9;&lt;h4&gt;Cover: a relatively compact model foundation supports an ecosystem much larger than itself&lt;/h4&gt;&#xA;&#x9;&#x9;&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;h2 id=&#34;make-the-model-worth-deploying&#34;&gt;Make the Model Worth Deploying&#xD;&#xA;&lt;/h2&gt;&lt;p&gt;LLaMA inherited Chinchilla&amp;rsquo;s concern with training allocation but moved the objective one step toward deployment. The paper noted that a compute-optimal training prescription ignores inference cost. If a model will be called many times, a smaller model trained on more tokens may have a lower lifetime cost even if reaching the target quality requires more pretraining.&lt;/p&gt;&#xA;&lt;p&gt;LLaMA-7B was therefore trained on 1T tokens, while the 33B and 65B models saw 1.4T. The paper reported that 13B beat 175B GPT-3 on most of its benchmarks and that 65B was competitive with Chinchilla-70B and PaLM-540B. Two qualifications matter. These were the academic evaluations used in 2023, not a complete measure of present-day product quality; “most benchmarks” does not mean every capability. The evidence still supported an important conclusion: parameter count was no longer the only route to useful capability.&lt;/p&gt;&#xA;&lt;p&gt;Smaller models also reduced the cost of research. Meta emphasized that the 13B model could run inference on a single V100 GPU. Training remained expensive, but experimenting with adapters, quantization, inference kernels, or safety methods no longer required owning a training cluster. LLaMA separated “being able to study a frontier-class model” from “being able to pretrain one from scratch.”&lt;/p&gt;&#xA;&lt;h2 id=&#34;an-architecture-recipe-without-an-invention-myth&#34;&gt;An Architecture Recipe Without an Invention Myth&#xD;&#xA;&lt;/h2&gt;&lt;figure&gt;&lt;img src=&#34;/en/p/llama-open-ecosystem/architecture-recipe.png&#34;&gt;&lt;figcaption&gt;&#xA;&#x9;&#x9;&#x9;&lt;h4&gt;Figure 1: the original LLaMA combined three existing mechanisms—RMSNorm, SwiGLU, and RoPE—inside a standard decoder-only Transformer&lt;/h4&gt;&#xA;&#x9;&#x9;&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;The original architecture can be summarized by three substitutions. None originated in the LLaMA paper. Their value was to form a simple, stable default recipe that had now been validated at substantial scale.&lt;/p&gt;&#xA;&lt;p&gt;The first was &lt;strong&gt;pre-normalization with RMSNorm&lt;/strong&gt;. The original Transformer applies LayerNorm after adding a residual. LLaMA normalizes the input before each attention or feed-forward sublayer. RMSNorm controls scale without subtracting the mean:&lt;/p&gt;&#xA;$$\operatorname{RMSNorm}(x)=\frac{x}{\sqrt{\frac{1}{d}\sum_i x_i^2+\epsilon}}\odot g$$&lt;p&gt;Its immediate purpose is not a new capability. It makes deep-network training more stable while using a simpler statistic for scale control.&lt;/p&gt;&#xA;&lt;p&gt;The second substitution was a &lt;strong&gt;SwiGLU feed-forward block&lt;/strong&gt;. A conventional ReLU feed-forward network has one activated path. SwiGLU lets one projection produce a gate and another carry content, then multiplies them element by element:&lt;/p&gt;&#xA;$$\operatorname{SwiGLU}(x)=\operatorname{SiLU}(xW_g)\odot(xW_v)$$&lt;p&gt;The gate lets the network vary which features pass for each input. LLaMA also set the hidden width to roughly $\frac{2}{3}\times4d$, balancing the extra gated projection against the total parameter budget.&lt;/p&gt;&#xA;&lt;p&gt;The third substitution was &lt;strong&gt;RoPE&lt;/strong&gt;. Instead of adding an absolute position vector to each token embedding, rotary position embedding rotates pairs of query and key channels by a position-dependent angle at every layer. If positions $m$ and $n$ use rotation matrices $R_m$ and $R_n$, then:&lt;/p&gt;&#xA;$$ (R_m q)^\top(R_n k)=q^\top R_{n-m}k $$&lt;p&gt;The right-hand side depends on the relative offset $n-m$. That is RoPE&amp;rsquo;s elegant property: absolute positions enter through rotations, while query-key matching naturally exposes relative distance. RoPE became a default in many open models, but popularity should not be confused with unlimited extrapolation. Beyond the training length, frequency scaling, further training, or other long-context techniques are still required.&lt;/p&gt;&#xA;&lt;h2 id=&#34;gqa-was-not-an-original-llama-feature&#34;&gt;GQA Was Not an Original LLaMA Feature&#xD;&#xA;&lt;/h2&gt;&lt;p&gt;Timelines often put LLaMA, RoPE, and GQA in one box, which can blur the chronology. &lt;strong&gt;LLaMA 1 used ordinary multi-head attention (MHA), not GQA.&lt;/strong&gt; Grouped-query attention entered the family with Llama 2, and only for the 34B and 70B configurations described in the paper; the 7B and 13B models still used MHA. Llama 3 later adopted GQA for both its 8B and 70B models.&lt;/p&gt;&#xA;&lt;p&gt;GQA addresses memory bandwidth during autoregressive decoding. To generate the next token, a model caches the key and value vectors for every previous token. Its memory use can be approximated as:&lt;/p&gt;&#xA;$$M_{KV}\approx 2LSn_{kv}d_hb$$&lt;p&gt;Here, $L$ is the number of layers, $S$ is the cached sequence length, $n_{kv}$ is the number of key-value heads, $d_h$ is each head&amp;rsquo;s dimension, and $b$ is bytes per element. Longer sequences and larger batches make reading the KV cache a growing bottleneck.&lt;/p&gt;&#xA;&lt;table&gt;&#xA;&#x9;&lt;thead&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;th&gt;Attention&lt;/th&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;th style=&#34;text-align: right&#34;&gt;Query heads&lt;/th&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;th style=&#34;text-align: right&#34;&gt;KV heads&lt;/th&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;th&gt;Trade-off&lt;/th&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&lt;/thead&gt;&#xA;&#x9;&lt;tbody&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;MHA&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td style=&#34;text-align: right&#34;&gt;Many&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td style=&#34;text-align: right&#34;&gt;As many as query heads&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;Richest representation, largest KV cache&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;MQA&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td style=&#34;text-align: right&#34;&gt;Many&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td style=&#34;text-align: right&#34;&gt;1&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;Smallest cache, possible quality loss&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;GQA&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td style=&#34;text-align: right&#34;&gt;Many&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td style=&#34;text-align: right&#34;&gt;Several groups&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;Middle ground between quality and bandwidth&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&lt;/tbody&gt;&#xA;&lt;/table&gt;&#xA;&lt;p&gt;GQA lets a group of query heads share one key-value head. The original GQA paper found quality close to MHA and speed comparable to MQA. Llama 2&amp;rsquo;s larger models used eight KV projections because cache pressure becomes especially costly for large models and high-throughput serving. The progression captures a recurring Llama design preference: do not chase naming rights for modules; select validated components that improve total system cost.&lt;/p&gt;&#xA;&lt;h2 id=&#34;from-a-research-release-to-an-ecosystem-standard&#34;&gt;From a Research Release to an Ecosystem Standard&#xD;&#xA;&lt;/h2&gt;&lt;p&gt;The original release&amp;rsquo;s “openness” needs precise language. In February 2023, Meta distributed the weights case by case under a noncommercial research license and published inference code. It was not a permissive open-source release that anyone could immediately use commercially. In July 2023, Llama 2 made pretrained and chat models available for research and commercial use under a custom community license, together with weights and starter code.&lt;/p&gt;&#xA;&lt;p&gt;The more accurate term is therefore an &lt;strong&gt;open-weight ecosystem&lt;/strong&gt;, not a perfect synonym for traditional open-source software. Weight access lets the community inspect behavior, fine-tune the model, and replace its inference implementation. But the cleaned training dataset was not released in full, and the licenses included use restrictions. The complete training process could not be reconstructed from the weights alone.&lt;/p&gt;&#xA;&lt;p&gt;Even with those limits, the ecosystem grew quickly. In September 2023, Meta reported more than 30 million downloads of Llama-based models through Hugging Face, over 7,000 derivative models, and more than 7,000 GitHub projects that built on or mentioned Llama. Cloud providers, chip vendors, quantization tools, and local inference engines began treating Llama compatibility as a basic feature.&lt;/p&gt;&#xA;&lt;p&gt;Those numbers mean more than popularity. Once layer shapes, tensor names, tokenizers, and weight formats become a de facto interface, a new quantization method can begin by supporting one dominant family. Inference engines can optimize kernels around the same set of model sizes. The ecosystem lowers deployment cost, which attracts more fine-tunes and tools, creating a feedback loop. &lt;strong&gt;LLaMA&amp;rsquo;s strongest moat was not a benchmark score; it was the growing expectation that every useful tool should answer, “Yes, it works with Llama.”&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;where-the-success-story-stops&#34;&gt;Where the Success Story Stops&#xD;&#xA;&lt;/h2&gt;&lt;p&gt;“Publicly available data” does not mean controversy-free data or complete reproducibility. The LLaMA paper disclosed sources and mixture weights: CommonCrawl provided 67%, followed by C4, GitHub, Wikipedia, books, arXiv, and Stack Exchange. The community did not receive the exact cleaned dataset, however. Deduplication, filters, and source versions can materially change the resulting model.&lt;/p&gt;&#xA;&lt;p&gt;Language coverage was also uneven. The first paper selected the twenty languages with the most speakers but focused on Latin and Cyrillic scripts. The Llama 2 paper later acknowledged that its pretraining data was predominantly English and that non-English performance remained fragile. Open weights reduce the cost of adaptation, but they do not automatically remove gaps in corpora and evaluation.&lt;/p&gt;&#xA;&lt;p&gt;Finally, weight access moves part of the responsibility from the model provider to the deployer. Llama 2 shipped with chat tuning, safety evaluations, and a responsible-use guide, while its paper also stated that testing could not cover every scenario. A base model can become a medical assistant, coding tool, or offline agent; each system has a different risk surface and cannot inherit one generic safety scorecard. Openness makes auditing and improvement easier. It can also make capability replication and misuse easier. Both claims can be true at the same time.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-design-principles-that-lasted&#34;&gt;The Design Principles That Lasted&#xD;&#xA;&lt;/h2&gt;&lt;p&gt;The lesson is not to copy RMSNorm, SwiGLU, RoPE, and GQA one more time. It is to understand the three layers of trade-offs behind them.&lt;/p&gt;&#xA;&lt;p&gt;First, model design should optimize both training and long-run inference, not only one compute-optimal training run. Second, architectural innovation does not require novelty in every layer; combining mature components into a stable, implementable, deployable system is a real contribution. Third, release strategy changes technical value. Weights without usable code, licensing, and tool support remain a research result. A model that becomes a shared interface can become a platform.&lt;/p&gt;&#xA;&lt;p&gt;LLaMA&amp;rsquo;s central story is therefore not another reversal in which a small model beats a large one. It demonstrates a different kind of scaling effect: the model can remain comparatively compact while the collaboration network around it becomes enormous. What scaled was not only the parameter count. It was reuse.&lt;/p&gt;&#xA;&lt;h2 id=&#34;references&#34;&gt;References&#xD;&#xA;&lt;/h2&gt;&lt;ol&gt;&#xA;&lt;li&gt;Touvron et al., &lt;a class=&#34;link&#34; href=&#34;https://arxiv.org/abs/2302.13971&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xD;&#xA;    &gt;LLaMA: Open and Efficient Foundation Language Models&lt;/a&gt;, 2023.&lt;/li&gt;&#xA;&lt;li&gt;Meta AI, &lt;a class=&#34;link&#34; href=&#34;https://ai.meta.com/blog/large-language-model-llama-meta-ai/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xD;&#xA;    &gt;Introducing LLaMA: A foundational, 65-billion-parameter large language model&lt;/a&gt;, 2023.&lt;/li&gt;&#xA;&lt;li&gt;Touvron et al., &lt;a class=&#34;link&#34; href=&#34;https://arxiv.org/abs/2307.09288&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xD;&#xA;    &gt;Llama 2: Open Foundation and Fine-Tuned Chat Models&lt;/a&gt;, 2023.&lt;/li&gt;&#xA;&lt;li&gt;Ainslie et al., &lt;a class=&#34;link&#34; href=&#34;https://arxiv.org/abs/2305.13245&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xD;&#xA;    &gt;GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpoints&lt;/a&gt;, 2023.&lt;/li&gt;&#xA;&lt;li&gt;Su et al., &lt;a class=&#34;link&#34; href=&#34;https://arxiv.org/abs/2104.09864&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xD;&#xA;    &gt;RoFormer: Enhanced Transformer with Rotary Position Embedding&lt;/a&gt;, 2021.&lt;/li&gt;&#xA;&lt;li&gt;Meta AI, &lt;a class=&#34;link&#34; href=&#34;https://ai.meta.com/blog/llama-2-updates-connect-2023/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xD;&#xA;    &gt;The Llama Ecosystem: Past, Present, and Future&lt;/a&gt;, 2023.&lt;/li&gt;&#xA;&lt;li&gt;Meta AI, &lt;a class=&#34;link&#34; href=&#34;https://ai.meta.com/blog/meta-llama-3/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xD;&#xA;    &gt;Introducing Meta Llama 3&lt;/a&gt;, 2024.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;</description>
        </item></channel>
</rss>
