{
    "@context": "https://schema.org",
    "@type": "NewsArticle",
    "@id": "https://badiyaa.com/zai-glm-5-4-loop-transformer/#article",
    "mainEntityOfPage": "https://badiyaa.com/zai-glm-5-4-loop-transformer/",
    "headline": "Z.ai's GLM-5.4 runs 28 layers twice, and the lab says it rivals 2 trillion-parameter AI models",
    "description": "Z.ai's GLM-5.4 reuses 28 layers of its GLM-5 base model in two passes, and the lab says it reasons like a 2 trillion to 3 trillion parameter model.",
    "datePublished": "2026-11-23T20:30:00+00:00",
    "dateModified": "2026-11-23T15:42:11+00:00",
    "author": {
        "@type": "Organization",
        "name": "Badiyaa Editorial Desk",
        "url": "https://badiyaa.com/author/editorial-desk/"
    },
    "publisher": {
        "@type": "NewsMediaOrganization",
        "@id": "https://badiyaa.com/#organization",
        "name": "Badiyaa",
        "url": "https://badiyaa.com/",
        "logo": {
            "@type": "ImageObject",
            "url": "https://badiyaa.com/wp-content/uploads/2026/10/badiyaa-logo-color-600x60-1.png",
            "width": 600,
            "height": 60
        },
        "email": "badiyaavideo@gmail.com",
        "publishingPrinciples": "https://badiyaa.com/editorial-policy/",
        "correctionsPolicy": "https://badiyaa.com/corrections/",
        "actionableFeedbackPolicy": "https://badiyaa.com/contact/",
        "ownershipFundingInfo": "https://badiyaa.com/about/#ownership",
        "sameAs": [
            "https://www.facebook.com/profile.php?id=61595518283625",
            "https://www.instagram.com/badiyaa.com.ai/",
            "https://www.threads.net/@badiyaa.com.ai"
        ],
        "parentOrganization": {
            "@type": "Organization",
            "name": "Rezilient Digital",
            "url": "https://www.rezilientdigital.com/",
            "address": {
                "@type": "PostalAddress",
                "streetAddress": "Fl No 3, Nav Shyam Sadan, Plot No 38, Pestom Sagar, Chembur",
                "addressLocality": "Mumbai",
                "addressRegion": "Maharashtra",
                "postalCode": "400089",
                "addressCountry": "IN"
            },
            "sameAs": [
                "https://www.linkedin.com/company/rezilientdigital"
            ]
        }
    },
    "isAccessibleForFree": true,
    "inLanguage": "en-US",
    "wordCount": 710,
    "image": [
        "https://badiyaa.com/wp-content/uploads/2026/11/virginia-tech-data-center.jpg"
    ],
    "articleSection": "Tech",
    "keywords": "Z.ai, GLM-5.4, Large language models, Transformer",
    "articleBody": "Z.ai has built its newest flagship AI model by making part of it run twice. GLM-5.4, released to subscribers of the lab's GLM Coding Plan, takes 28 layers from its existing GLM-5 base model and passes every token through them two times, a design the company calls a Loop Transformer. The payoff, according to Z.ai's GLM-5.4 developer documentation, is reasoning on par with models of 2 trillion to 3 trillion parameters, from a base of roughly 750 billion. That is the headline claim, and it comes from Z.ai alone. No outside lab has published results on the model yet, and the company says its public API will open only after a security assessment is finished. What a loop transformer actually does In an ordinary transformer, the stack of layers fires once for each step of the model's work. A looped model reuses a block of those layers, feeding its own output back in for another pass. The network gets deeper without getting any bigger on disk, because the second pass shares the same weights as the first. Z.ai is open about the fact that the idea is old. The company points back to the 2018 Universal Transformer, and the Universal Transformer paper on arXiv, written by Mostafa Dehghani and colleagues, describes a model that applies the same block repeatedly and adds a per-position halting mechanism. What Z.ai says is new is the scale, and the shortcut: rather than training a looped model from scratch, which it says tends to fall behind, it converted an already trained base model through continued training. Three tweaks made that work, the documentation says: Gates on each pass. Per-token gates control how much each loop writes back. The first pass writes cautiously; the second opens up, and harder tokens get bigger first-pass updates. A cheaper memory cache. The second loop reuses the first loop's selected context and keeps only a small sliding window of its own, so an extra loop does not double memory use. Recycled attention indexes. The sparse attention indexes computed on pass one are reused on pass two at zero extra cost. The numbers Z.ai is quoting Before betting its flagship on the design, the lab says it tested loops on 1B, 4B, 30B and 750B base models. In a matched test on the 30B model, the looped version used about 10% more training compute and the same parameter count, and it produced 10% to 14% shorter answers on benchmarks such as GPQA-Diamond and MMLU-Pro, because some of the reasoning moved inside the loop instead of being written out. The GLM-5.4 specification page lists a 1 million token context window, up to 128,000 output tokens, and speeds of up to 200 tokens per second off-peak, falling to 70 to 80 at peak load. Coding Plan users on weekly quotas get 1.5 times the GLM-5.3 allowance. For scale, that 2T-to-3T comparison means Z.ai is claiming the reasoning of a model about three to four times larger than its own 750B base. Badiyaa has covered that end of the market before, including Alibaba's 2.4-trillion-parameter Qwen3.8, whose weights alone need 4.8 TB, as well as smaller models such as Thinking Machines Lab's laptop-sized Inkling 2 Mini. Coding that leaves the code editor Z.ai's pitch is what it calls Generalized Coding: using code to do jobs that are not software. Its demos include a self-narrated music video called \"Hello World,\" a six-axis robotic arm designed in the open-source FreeCAD program, and an interactive 3D bird-watching scene written with custom GLSL shaders. The lab also flags a flaw. GLM-5.4 can get stuck in what the company calls overly long \"marathon thinking\" loops, though it says the extra self-correction tends to raise accuracy. For readers trying local alternatives, Badiyaa's look at Localcode's open-source coding agent for Macs covers the other end of the spectrum. Z.ai is already teasing what comes next. \"We are not choosing between scaling depth and scaling model size; we are pursuing both,\" the company writes in its GLM-5.4 overview, adding that a significantly larger model built on these lessons \"will be ready soon.\" SourcesGLM-5.4 overview, Z.ai developer documentation, 2026Universal Transformers (Dehghani et al.), arXiv, 2018 Image: Christopher Bowns, CC BY-SA 2.0 via Wikimedia Commons This article was produced with AI assistance and reviewed by our Editorial Desk. How we work.",
    "markdown": "https://badiyaa.com/zai-glm-5-4-loop-transformer.md"
}