NiceDay

GLM-5.4 on its own for three hours: how many mistakes did it make?

Zhipu released GLM-5.4 on November 23. At 9:12 p.m. on the 25th, I gave it one line inside an agent: "Keep writing — see which post is next." For the next three hours, no human touched it. It picked its own topic, tracked down why a game stuttered (the whole board being redrawn at once, plus the finished-piece thumbnail drawing a gradient bead by bead), wrote measurement scripts, benchmarked the code before and after the fix, turned it into an article of about 4,000 Chinese characters, ran it through a review checklist I'd written in advance, and then merged, deployed and checked the live site.

This isn't a post about how smart the model is. I wanted to answer a different question: if you let it do something that has to be accurate, alone, how often does it get things wrong, where, and what catches it? The numbers here aren't impressions. They were counted from the agent's session database, which logs every model request, every command and every error. The counting was delegated to the model too. That session log lives locally in the agent, so you can't recompute it yourself; the best I can do is spell out exactly what was counted and how it was grouped.

If you also hand AI the kind of work where one wrong number is embarrassing, here's what you can take away:

  • An error log. In three hours, its code had 36 problems, and the article needed 37 more fixes after the first draft.
  • A ledger. What caught each kind of mistake: an error message, a checking script, a second model, or its own second look.
  • A verdict. The hard part isn't writing, it's verifying. It getting things wrong is no surprise. What's notable is that the scripts doing the verifying were written by it too.

Credit where it's due first.

What it got right

Nobody suggested the topic. It read the end of the previous post, found the line "more on that next time", and settled on the subject: the hitch the bead game hits the moment a large piece finishes ironing.

The method was solid. Instead of guessing, it drove a headless browser with real pointer events to iron a whole piece, wrapped the key functions in timers, and measured how long the main thread stayed busy without a break. Where frame intervals couldn't explain things, it went to the browser's own trace. An old code comment claimed "drawing sprites is faster than gradients"; it ran a separate controlled experiment and found the opposite.

What impressed me more was how it overturned itself. Along the way it reached eight conclusions it later threw out: "it doesn't stutter at all on fast machines", "the new version actually does less work overall", "the headless browser is rendering in software". Each one fell apart when it measured a different way. In the final article, all 88 numbers and code facts were recomputed one by one from raw data, and every one checked out.

It didn't get there by being right the first time. It got there by measuring over and over and knocking down its own claims until they held.

The hard numbers from three hours

From the instruction to a reviewed draft took 3 hours 6 minutes; publishing and checking the live site took another 8. In those first three hours:

  • 205 model requests. The model accounted for 140.5 minutes, or 76% of the time; most of the rest was tools running. The median request took 25 seconds, the 90th percentile 75.
  • 504K output tokens, 115M input tokens. 98.8% of the input was cache hits.
  • 270 tool calls. 181 shell commands, 27 whole-file writes, 26 file reads, 20 targeted edits, and 16 others such as updating its to-do list or fetching background results.
205 requests: duration over time (log scale)1 s10 s100 s1000 smedian 25 sp90 75 sLongest: 21.7 minutes114K tokens of output21:1222:1223:1200:18
Every model request in the main session. Each gridline up is ten times longer. The thick orange line is the longest request, which ran for 21.7 minutes from start to finish.

Those numbers look steady, but that steadiness comes from the median. Spread out every request and look at the thick orange line: that's a single request.

The runaway request

At 11:04 p.m. it set out to rewrite a 200-line checking script. That one request ran for 21.7 minutes and produced 114K tokens, 92 times the median output per request. The resulting file was 3,247 lines long: the same line of code repeated hundreds of times, interleaved with increasingly garbled variants. That single request accounted for 23% of all output over the three hours.

Nobody stopped it. Only after it finished did it look back, notice the file was wrong, confirm with a syntax check that it was broken, and rewrite it. On an unattended overnight run, the cost would have been twenty-odd minutes and a broken file.

GLM-5.4's official blog acknowledges that it can fall into overly long "marathon thinking". What I hit may not be the same thing: what went haywire was the content it wrote, and I can't tell what it was thinking at the time.

Code: 181 commands, 27 with errors

Of 181 commands, 27 (15%) showed signs of errors in their output, 40 in total: 9 syntax errors, 23 runtime exceptions and 8 failed assertions. Grouped into distinct problems, that's 29. Add 7 logic errors that never raised anything and you get 36: 9 syntax errors, 20 runtime exceptions or assertion failures, and 7 logic errors. The grouping was done by the model, item by item against the logs.

The syntax errors looked like this: padEnd(8) written as padEnd(8s) in an experiment script; a Python-style hash comment inside a JavaScript file; a stray line of garbage in the script that generated a measurement script. That generator never ran, but the tests after it did, against the old file, and passed for nothing.

What caught them: 25 were flagged on the spot by the interpreter or an assertion, 3 were found before running by rereading or a syntax check, 4 surfaced only after a checking script reported a failure, 3 were spotted while looking at output or screenshots, and 1 was a tool error. None of them were committed to the repo.

Errors that raise errors aren't scary; they show up immediately. The scary ones are the ones that don't.

The errors that don't raise errors

Three of the 7 logic errors are typical. A throwaway script printed end times as if they were durations, making every frame look over budget. A checking script, computing when the thumbnail finished, also counted each frame's routine redraw, turning 458 ms into 599. And when tallying main-thread busy time, it inferred which function called which from the order of timestamps, and got it wrong.

None of these produced an error message. Each was found because a result looked off and it went back into the raw data.

Add the eight overturned conclusions mentioned earlier. Its way of correcting itself was always the same: measure again, a different way.

Those eight aren't part of the 36: the 36 are code problems, the eight are wrong conclusions. And the 3,247-line broken file counts as just one of the 36.

The article: 37 fixes after the first draft

The article didn't come out right in one go. After the first draft it took 37 more fixes, in three kinds: 13 wrong numbers or facts, 16 overclaims or missing qualifiers, and 8 ambiguities or inconsistencies.

Wrong numbers looked like this: "done within 400 ms", when the slowest run actually took 458; "the new version is 18% lighter", when recomputing over the article's own window gave 14%; "all five runs had a 33 ms gap", when one had 50. Overclaims looked like this: "no longer visible to the naked eye", with no subjective comparison ever done; "so the difference is in time, not in the picture", when only the average pixel difference had been compared.

37 fixes after draft 1: what caught them × typeScriptOwn readReviewWrong fact131021Overclaim160511Ambiguous8026Total1091837"Own read": proofreading, code checks, data digs
Each cell counts how many issues of that type were caught that way; darker means more. "Outside review" is step two of the checklist: have another model review the draft.

The column I most want you to look at is the left one. First, a note: "outside review" is step two of that checklist, having another model review the draft, and it was the model itself that called it. The line-by-line checking script caught 10 issues, all numbers and facts. Of the 16 overclaims, it caught none: 11 were found by the second model and 5 by the model rereading its own draft. Of the remaining 11: among the 3 number-or-fact issues, 2 were caught by its own rereading and 1 by outside review; among the 8 ambiguities, 6 were caught by outside review and 2 by its own rereading.

The checking script works on a simple idea: recompute every sentence in the article that contains a number from the raw data, and stop if it doesn't match. Stripped down, the core is just a few lines; the example uses a mistake that really appeared in the article:

// How the checking script works: recompute every sentence with a number from raw data; stop on a mismatch.
// runs holds each run's raw measurements; each claim pairs a sentence from the article with the condition it must satisfy.
const runs = [
  { longest: 111, gap: 33 }, { longest: 95, gap: 50 }, { longest: 103, gap: 33 },
];
const claims = [
  ["The longest stretch is 95 to 111 ms",
    runs.map((r) => r.longest).every((x) => 95 <= x && x <= 111)],
  ["Every run had a gap of only 33 ms", runs.every((r) => r.gap === 33)],
  ["The average gap is 38.7 ms", avg(runs.map((r) => r.gap)) === 38.7],
];
function avg(xs) {
  return Math.round(xs.reduce((a, b) => a + b, 0) / xs.length * 10) / 10;
}
let failed = 0;
for (const [text, ok] of claims) {
  console.log(ok ? "PASS" : "FAIL", text);
  if (!ok) failed++;
}
process.exit(failed ? 1 : 0);

Run it and the first line passes, the second fails, the third passes, and the script exits with a non-zero status. It only understands numbers, and it can be wrong too: the misjudged sentences mentioned above were its verdicts. A sentence with no number in it, like "it's fixed", is outside its reach.

The checking scripts get things wrong too

Of the 36 code problems, 11 were in scripts written specifically to check things, 3 in scripts that computed totals, and 3 in scripts that generated the article. A missing comma glued two sentences into one; a comparison of a rounded integer against a decimal boundary flagged a correct sentence as wrong; the acceptance range set for "23 ms at most" was wrong from the start.

Take the sentence "done within 400 ms". The first draft said 400 ms, which was wrong to begin with. The checking script flagged it, but the number it reported, 599, was also wrong: going back to the raw logs showed the script had counted the routine redraw that happens every frame. With the script fixed, the real number was 458, and only then did the article change from 400 to 500. In the same round, another sentence failed: "the new version is 18% lighter". That time the article really was wrong; the recomputed figure was 14%.

So the rule learned here: when a script reports a failure, don't touch the article yet. Go back to the raw data and work out whether the script is wrong or the article is. This time it was both.

Having AI write the checking scripts is like having it write its own exam. Someone has to check the exam, too.

The full error log: 36 code problems, 37 article fixes, 8 overturned conclusions

Code problems are grouped by distinct issue; the 3,247-line broken file counts as one. Each entry ends with what caught it.

  1. The code injected into the page by a measurement script was missing a closing parenthesis (syntax error). Caught on the spot by the interpreter or an assertion.
  2. An extra semicolon in the same code, exposed only after fixing the previous one (syntax error). Caught on the spot by the interpreter or an assertion.
  3. padEnd(8) written as padEnd(8s) in an experiment script (syntax error). Caught on the spot by the interpreter or an assertion.
  4. A GPU check script used import in a .cjs file (syntax error). Caught on the spot by the interpreter or an assertion.
  5. A page check script used a Python-style hash comment in a .mjs file (syntax error). Caught on the spot by the interpreter or an assertion.
  6. The checking script came out completely broken: 3,247 lines, the same code repeated hundreds of times (syntax error). Caught by its own look before running, followed by a syntax check.
  7. A stray line of garbage in the script that generated a measurement script; it failed to run, and the tests after it ran against the old file and passed for nothing (syntax error). Caught on the spot by the interpreter or an assertion.
  8. Missing parentheses in an assertion in the script that built the X post package (syntax error). Caught by a syntax check before running.
  9. Invalid code like toFixed(1f) in an image script, plus a constant declared without a value (syntax error). Caught by its own look before running, followed by a syntax check.
  10. A count assertion in the tracing script failed (runtime exception or assertion). Caught on the spot by the interpreter or an assertion.
  11. Two exceptions in the script that summarized measurements (runtime exception or assertion). Caught on the spot by the interpreter or an assertion.
  12. An exception in the script comparing the two versions' timelines frame by frame (runtime exception or assertion). Caught on the spot by the interpreter or an assertion.
  13. An exception in the script that inspected trace files (runtime exception or assertion). Caught on the spot by the interpreter or an assertion.
  14. Main-thread busy time: command-line arguments parsed wrong (runtime exception or assertion). Caught on the spot by the interpreter or an assertion.
  15. Same tally: the method for de-duplicating nested events was wrong (runtime exception or assertion). Caught on the spot by the interpreter or an assertion.
  16. Same tally: inferring the call hierarchy from timestamps got it wrong (runtime exception or assertion). Caught on the spot by the interpreter or an assertion.
  17. An exception in the script that turned traced samples into medians (runtime exception or assertion). Caught on the spot by the interpreter or an assertion.
  18. A failed assertion in the script that generated the figures (runtime exception or assertion). Caught on the spot by the interpreter or an assertion.
  19. A failed assertion in the script that wrote the article into the site files (runtime exception or assertion). Caught on the spot by the interpreter or an assertion.
  20. The first version of the checking script: exceptions plus failed assertions (runtime exception or assertion). Caught on the spot by the interpreter or an assertion.
  21. A throwaway inspection script couldn't find the substring it was looking for (harmless) (runtime exception or assertion). Caught on the spot by the interpreter or an assertion.
  22. Another throwaway script couldn't find its substring (harmless) (runtime exception or assertion). Caught on the spot by the interpreter or an assertion.
  23. An extra quote in a replacement regex (runtime exception or assertion). Caught on the spot by the interpreter or an assertion.
  24. Two lines of conclusions ended up at the end of a test script's output file, so it wasn't pure JSON (runtime exception or assertion). Caught on the spot by the interpreter or an assertion.
  25. A self-check script read a key that didn't exist (runtime exception or assertion). Caught on the spot by the interpreter or an assertion.
  26. The script that built the X post package was missing an import (runtime exception or assertion). Caught on the spot by the interpreter or an assertion.
  27. A missing comma while editing the checking script glued two sentences into one (runtime exception or assertion). Caught on the spot by the interpreter or an assertion.
  28. A patch to the checking script failed to match because the target sentence spanned two lines (runtime exception or assertion). Caught on the spot by the interpreter or an assertion.
  29. The edit tool was used on a file a script had just changed, without rereading it first (runtime exception or assertion). Caught by a tool error.
  30. Figure screenshots captured the whole viewport, with a big blank area underneath (logic error). Caught by looking at the output.
  31. The cover layout: bars too wide and touching the edge, labels on top cut in half, dashed lines running through text (logic error). Caught by looking at the screenshot.
  32. The checking script, computing when the thumbnail finished, also counted each frame's routine redraw (logic error). Caught by the checking script reporting a failure.
  33. The checking script compared rounded integers against decimal boundaries, flagging correct sentences as wrong (logic error). Caught by the checking script reporting a failure.
  34. The acceptance range the checking script set for "23 ms at most" was wrong (logic error). Caught by the checking script reporting a failure.
  35. When checking "every profile ran at least 5 times", the checking script included the phone profile, which only ran twice (logic error). Caught by the checking script reporting a failure.
  36. A throwaway script printed end times as durations, making every frame look over budget (logic error). Caught by looking at the output.

The article fixes are changes made after the first draft was finished.

  1. The desktop frame's work was written as "around 19 ms"; 16 measured runs gave 19 to 23 ms (wrong number or fact). Caught by the line-by-line checking script.
  2. "The next frame was only 3 ms late"; measured 2 to 6 ms (wrong number or fact). Caught by the line-by-line checking script.
  3. The thumbnail "split into 13 chunks"; individual runs were actually 12 to 15 (wrong number or fact). Caught by the line-by-line checking script.
  4. "Done within 400 ms"; the slowest run was 458 ms (wrong number or fact). Caught by the line-by-line checking script.
  5. finish() itself "takes 8 to 12 ms"; measured 7 to 10 ms (wrong number or fact). Caught by the line-by-line checking script.
  6. The board redraw "split into 6 chunks"; actually 5 to 6 (wrong number or fact). Caught by the line-by-line checking script.
  7. The phone profile was described as "one run"; each version actually ran twice (wrong number or fact). Caught by the line-by-line checking script.
  8. "Counting script time only, the new version is 18% lighter"; recomputed over the stated window it's 14% (wrong number or fact). Caught by the line-by-line checking script.
  9. "All five runs had a 33 ms gap"; one of them was 50 ms (wrong number or fact). Caught by the line-by-line checking script.
  10. The closing questions still mentioned "a 33 ms gap" (wrong number or fact). Caught by the line-by-line checking script.
  11. The cause of the fix was misstated as deleting a line in finish(); it was actually a switch to redrawing across frames (wrong number or fact). Caught by checking against the code.
  12. "On phones you can only build up to 32×32"; the game's own wording is that bigger ones count as offline patterns (wrong number or fact). Caught by checking against the code.
  13. A subheading said "30% busier"; the body said 26%, and the other profile was 35% (wrong number or fact). Caught by outside review.
  14. "7 runs" didn't mention that 5 of them took a shortcut (overclaim or missing qualifier). Caught by its own proofreading.
  15. The assumption about whether the shortcut was reliable was only disclosed at the end as tested on the tablet profile alone (overclaim or missing qualifier). Caught by outside review.
  16. The shortcut itself creates a 50 ms long frame, which wasn't mentioned (overclaim or missing qualifier). Caught while digging through data.
  17. "So the slowness isn't in the sprites themselves" was an inference (overclaim or missing qualifier). Caught by its own proofreading.
  18. "About 33 ms in total" was actually a median and wasn't labeled as one (overclaim or missing qualifier). Caught by outside review.
  19. "Keeps the CPU busy an extra 100 ms": the tablet was 93, the throttled desktop 121 (overclaim or missing qualifier). Caught by outside review.
  20. "A 33 to 50 ms gap with the thread completely idle": the 50 ms one was never checked in the trace (overclaim or missing qualifier). Caught by its own proofreading.
  21. The opening said "splitting the work beats switching drawing methods", which read as universal; sprites versus gradients was only measured at one size (overclaim or missing qualifier). Caught by outside review.
  22. "Consistent with the phone results", when at 32×32 the old and new versions take the same path and can't be told apart (overclaim or missing qualifier). Caught by outside review.
  23. The desktop profile only said "0 chunks over budget", without mentioning dropped frames in 5 of 16 runs (overclaim or missing qualifier). Caught by outside review.
  24. Concluding "it's fixed" without saying by which metric (overclaim or missing qualifier). Caught by outside review.
  25. A caption said "so the difference is in time, not in the picture", based only on average pixel difference (overclaim or missing qualifier). Caught by outside review.
  26. "Fixed, and the cost fully measured" claimed too much (overclaim or missing qualifier). Caught by outside review.
  27. "No longer visible to the naked eye", with no subjective comparison ever done (overclaim or missing qualifier). Caught by outside review.
  28. "This is a one-time browser cost" was stated as fact (overclaim or missing qualifier). Caught by outside review.
  29. The checklist then restated it as "there's a one-time cost" (overclaim or missing qualifier). Caught by its own proofreading.
  30. Calling what finish() does "bookkeeping" was too narrow (ambiguous or inconsistent). Caught by checking against the code.
  31. "Not once in the old version's 16 runs" could be read as the old version not stuttering on desktop (ambiguous or inconsistent). Caught by its own proofreading.
  32. The opening promised a list of "three numbers that lie"; the list actually had seven items (ambiguous or inconsistent). Caught by outside review.
  33. "Why look at all three? Because I got fooled three times": only one of those three times involved these numbers (ambiguous or inconsistent). Caught by outside review.
  34. "The thumbnail still takes the old path", when "thumbnail" had meant the finished-piece preview throughout (ambiguous or inconsistent). Caught by outside review.
  35. "Which answers the first question", when nothing earlier had been ranked (ambiguous or inconsistent). Caught by outside review.
  36. "A 144-pixel canvas" gave only one dimension (ambiguous or inconsistent). Caught by outside review.
  37. The caption and the body gave two different origins for the same control version (ambiguous or inconsistent). Caught by outside review.

The overturned conclusions are ones it reached along the way and later rejected itself.

  1. "There's no stutter at all on fast machines": every run actually had two frames over budget; frame-interval logs just didn't show it
  2. "The new version does 18% less work overall": that only counted script time; the browser's trace showed 26% more
  3. "The headless browser renders in software": it checked and confirmed a real GPU was in use
  4. "Sprites are 1.7 to 2.7 times slower than gradients": this didn't match the separate controlled experiment, because drawing is only flushed at the end of the frame
  5. An extra 250 ms long frame in the first run was first blamed on the game: the trace showed the GPU process initializing
  6. A long frame just before ironing finished was first blamed on the game: the shortcut had created it
  7. Bucketing work by frame timestamps: work from timer callbacks got charged to frames
  8. Inferring who called whom from timestamp order: wrong, replaced by the known call structure

Open-ended questions make it time out

The checklist has three steps: reread your own changes; have another model review them independently; then verify each review comment, fix only the ones that hold up, and test end to end. For step two it used another command-line tool backed by GLM; I can't confirm the exact version behind it. It ran 5 reviews, and 2 hit the seven-minute limit and were killed without producing a word.

Of the two timeouts, one had too much material: three large chunks of SVG markup plus a long fact sheet, with a request to cover every aspect at once. The other was an open-ended critique of "argument, reader value, search-friendliness and Chinese style".

The three that survived all asked specific questions that could be answered by quoting the text: "check every number against this fact sheet and list mismatches", "list at most 5 holes in the argument", "which sentence states an inference as a conclusion, which two statements contradict each other, which sentence is ambiguous". The three rounds produced 26 comments, and 16 held up when verified. The rest were false alarms, like citing 73.7 to claim the article's 74 was wrong. Review comments are leads, not orders.

The cost, and what I didn't do

Time: 3 hours 6 minutes, 76% of it waiting on the model. The time went into generation; a good share of the errors were in the checking scripts, 14 of the 36. Tokens: 115M input (98.8% cache hits), 504K output, 23% of which came from the runaway request. As for money, I can't see a figure converted into cost, so I won't make one up.

The human part: a checklist written in advance and a one-line task. Even these statistics were compiled by the model. One more caveat: this is one task in one session. A different model or a different job could produce completely different numbers.

What to take with you: a checklist

For having AI do work that has to be accurate, here are seven rules. The first six were all used this time; the seventh is the one that wasn't:

  1. Keep records you can count. Session logs, every command's output, exit codes. Without them, every number above would be guesswork.
  2. Syntax-check scripts before running them. Three syntax errors were caught before running this time.
  3. Glance at whether the output looks right. The 3,247-line file and the "every frame over budget" result were both found because they looked wrong. Neither raised an error.
  4. Recompute every sentence with a number. Write each one as an assertion in a checking script. It only understands numbers; sentences without them need something else.
  5. When the check fails, check the check. Go back to the raw data and decide whether the script or the article is wrong; compute the expected values a second, independent way.
  6. Ask the second model specific questions, with a timeout. The two timeouts this time came from too much material and too open a question. Verify every comment: 16 of 26 held up.
  7. Cap single requests, or at least set an alert. Nobody knew the 21.7-minute request had run away until it finished on its own.

The post you're reading was also written by it, using the first six rules. Whether anything slipped through is the first question below.

Four questions I haven't figured out

  1. 88 numbers checked out, which only means those 88 checked out. It also chose which sentences to check. Are there errors among the ones it didn't pick? I don't know, and neither does it.
  2. The reviewing model is from the same family as the writing model. Do models from the same family share the same blind spots? Reviewing with a model from a different vendor is worth trying; I didn't get to it this time.
  3. From instruction to merge, nobody read that article word for word. On your project, would you let it merge a draft nobody has read, or a change nobody has reviewed, by itself? If yes, what are you relying on?
  4. Does the model know to stop when a request runs away? If not, should the cap live in the tooling, or should tasks be designed so big outputs are split up from the start?

Have you had AI finish something on its own? Did you go back and count how often it was wrong? If your numbers look very different from mine, I'd especially like to hear from you.

— NiceDay