GLM‑5.4: From Writing Code to Building a Playable Game

Four projects from Z.ai show what GLM‑5.4 can build. See how its loop architecture works, then test the same idea on a small web project.

You can explore the map, move a character, and get into a fight. The game that Z.ai built with GLM‑5.4 asks more of a coding model than a standalone function: the map, physics, and combat all have to work together.

The code is a means to an end; the real test is whether the result runs. Z.ai applies the same approach to a music video, a CAD model, and an interactive 3D scene.

What does GLM‑5.4’s code produce?

These four videos show projects Z.ai built with GLM‑5.4.

“Hello World”: a music video assembled with code

Blue trails sweep across the night sky above a building with warm yellow windows. Code brings the visuals, captions, and music together on one timeline.

A six-axis robot arm in FreeCAD

The orange arm is a 3D model built in FreeCAD, not just a rendered picture. The base, arm segments, and joints show how the pieces fit together.

Brickwild: an explorable game with collectibles and combat

The player crosses a block-built map and collects gold bricks, with a minimap in the upper-right corner. Movement, physics, and combat all have to work in the same scene.

3D birdwatching: a scene built with geometry and shaders

A close-up of a bird on a branch reveals its feather contours and the light around it. Geometry defines the forms and GLSL shaders render materials and lighting in an interactive 3D scene.

Why run the same layers twice?

In a game, a change to movement speed can affect collision detection and combat pacing. Keeping related decisions consistent is part of what makes a project harder than a single coding exercise. One change Z.ai made was to let the model revisit its intermediate work rather than simply adding more parameters.

A standard Transformer runs its layers in sequence during a forward pass. GLM‑5.4 runs a block of 28 layers twice, using the same weights. The second pass works on the internal state left by the first. That is the loop in Loop Transformer: more computation without a second set of weights.

The two passes don’t repeat all the same work. Z.ai describes smaller updates on the first pass and stronger revisions on the second. The second also reuses the first pass’s attention indices and selected cache entries, keeping new cache entries in a local window instead of duplicating the entire long-context cache.

Loop Transformer architecture
Loop Transformer architecture · Z.ai

Did the second pass help?

Z.ai’s launch post compares two 30-billion-parameter models with the same parameter count. The looped version used about 10% more training compute. Its AIME25 math score rose from 19.17 to 30.42. On GPQA‑Diamond, a science question benchmark, it went from 47.58 to 56.26 while its average output was 11.7% shorter.

Controlled 30B loop experiment

This tests the architecture, not how GLM‑5.4 ranks against other flagships. Shorter output doesn’t guarantee a quicker result, either: Z.ai notes that GLM‑5.4 can spend too long reasoning. On a real coding job, check how much of the first result passes review and how long it takes to get something you can use.

Where can you use GLM‑5.4?

Check availability in Z.ai Chat, ZCode, or the GLM Coding Plan. The model docs list a 1M-token context window and up to 128K output tokens. The general API was listed as pending when checked. GLM‑5.4 can read images and video but returns text. Code and external tools turn that text into the projects shown here.

Build a browser version of the robot arm

The FreeCAD project above starts with a base, arm segments, and joints. Try a smaller version of the same idea: a 2D arm you control with two sliders. Click Send to start the task with GLM‑5.3 in Wuwei AI Work.

Open robot-arm.html in your browser. Moving the shoulder should rotate the whole arm; moving the elbow should turn only the forearm and gripper. Then press Reset and check that the arm returns to its starting pose.

Build a controllable robot arm in Wuwei

GLM-5.3

Want to animate the gripper next? Download Wuwei and keep working on the file locally.

Windows · macOS · Linux · free, no login