[2/2] Stanford CME295: GLM-5 and the role of the agent harness (#AI)
In the practical section of Stanford CME295’s third lecture, Shervine Amidi brings the training methods together through one model: GLM-5 (we discussed the theory earlier). This raises a question that can get lost among algorithm names: how do you teach a model something new while preserving what it could already do?
First, the training path as presented in his walkthrough.
🔸 Pretraining: filter web data, select code and scientific material, and change their proportions during training. The model acquires a general foundation through next-token prediction.
🔸 Midtraining: extend the context window using long material—books, issue discussions, PRs, and code diffs. Document packing matters too: it needs to preserve connections within the material that teach the model to use a long context.
🔸 SFT: demonstrate desired responses, solutions, and tool use. Reasoning can alternate with tool calls in the examples: the model learns to continue working after receiving a result.
🔸 RL: develop several groups of capabilities. Reasoning RL concerns problem solving; agentic RL concerns actions in an environment, such as editing code and checking it with tests; general RL concerns response quality and interaction with users.
But improvements do not necessarily accumulate without losses. Every subsequent stage changes the same model. Successful training on new tasks can hurt performance on earlier ones. This does not necessarily mean knowledge has literally been “erased”: the way the model responds or selects actions may also have changed.
The final stage uses on-policy cross-stage distillation. Saved model versions from earlier stages—checkpoints—become teachers: the current model generates responses, and the teachers provide a training signal on its continuations. The aim is to restore useful capabilities from preceding stages while retaining new ones. It is an attempt to combine skills, whose success needs to be evaluated across different tasks.
I like the idea itself: an earlier version can be weaker overall and still be a useful teacher. A saved checkpoint becomes material for further training as well.
From here, Shervine moves to a hypothesis about the agent harness—the code that organizes the model’s work with tools and context. If the model has already learned to select actions, check results, and correct mistakes, some detailed external workflows may become unnecessary. He cites Pi in the lecture; its creator, Mario Zechner, also connects the effectiveness of a minimal agent to the training of the models themselves.
Take a bug fix. Selecting a file, responding to a failed test, and deciding to run another check are behaviors the model can acquire during training. Running the tests, providing repository access, storing state, and enforcing permissions still belong to the environment. These components have different responsibilities.
Incidentally, the GLM-5 report itself provides a useful boundary for the simplification hypothesis: removing older tool results while keeping recent ones raises BrowseComp performance from 55.3% to 62.0% in the authors’ experiment. Context management continues to help an already strong model.
#AI #LLM #Agents #Engineering #AI4SDLC