WhoBuilt

How We Built Zeta2: Training an Edit Prediction Model in Production

May 30, 2026· 11 min· 2.4K views·Watch on YouTube

Speaker

Ben Kunkle, edit predictions lead at Zed, explains how his team trained and evaluated Zeta2 at an AI Engineer event.

Build a focused edit prediction model

Edit prediction uses code around the cursor, recent edits, definitions, types, and diagnostics to predict the next code change. Because it runs on every keystroke, Zed uses a small model specialized for this task. The training pipeline starts with opt-in production snapshots.

Distill and repair teacher predictions

Zed asks a frontier model to predict edits from the collected snapshots, then checks its outputs with offline heuristics. The checks catch cases such as undoing the user's latest typing or crossing the editable region boundary. A second frontier model repairs failed predictions, and the resulting outputs become student training targets.

Use settled edits to find useful examples

Zed is experimenting with saving a code region after the user has stopped editing it for 10 seconds. Because the final state can be noisy, the team compares it with multiple predictions and looks for examples that are close but not trivially obvious. Running a student checkpoint 50 times costs far less than making 10 teacher predictions for each of 100,000 examples.

Evaluate offline and in production

The team evaluates on held-out data using Delta CER, a Levenshtein-based metric, and reversal ratio, which tracks when a model undoes recent typing. It compares predictions against three teacher outputs because a code edit can have multiple good answers. Zed also samples models in production, including experiments assigned 15% or 20% of traffic, and tracks acceptance, latency, and diagnostic error counts.

Treat experiment results as a production question

Offline metrics do not necessarily match what users want in their editor, so Zed uses production experiments to assess models. The team can control how much traffic a model receives or make it the live model. For settled-state collection, it currently uses a 10-second pause in editing as a rough signal and does not check Git commits.

Takeaways

  • A narrow, latency-sensitive feature can benefit from a small model trained specifically for that task.
  • Cache reusable teacher predictions so experiments can vary prompt formatting without repeating distillation.
  • Use automated checks and a repair step to improve training labels from frontier models.
  • Filter noisy final outcomes by comparing them with multiple candidate predictions.
  • Use held-out metrics to screen models, then validate them with controlled production traffic and user behavior.

Mentioned in this talk

Search inside this talk

What was claimed 9

  • works at
    Ben Kunkle works at Zed
    Edit predictions lead (engineer)
    “I'm the edit predictions lead at Zed.”
    YouTube
    Verified2 sources· Talk, Web· archived
  • built
    “We recently announced our model, Zeta2”
    YouTube
    Unverified1 source· Talk
  • built
    “We recently announced our model, Zeta2”
    YouTube
    Verified1 source· Talk
  • feature
    Zeta2: Small, specialized model fine-tuned for edit prediction and designed to run on every keystroke
    “it's ideal for a small, specialized model, fine-tuned to do this task”
    YouTube
    Unverified1 source· Talk
  • feature
    Zeta2: Predicts the next code edit using context around the cursor
    “asking it to predict the next edit you're going to make”
    YouTube
    Unverified1 source· Talk
  • metric
    Zeta2: 100,000 training examples at peak; 10,000–50,000 for smaller experiments
    “We're generally doing 100,000 examples to train a model; that's our peak.”
    YouTube
    Unverified1 source· Talk
  • uses
    stores training pipeline data as line-oriented JSON
    “we've designed it so it's all JSONL”
    YouTube
    Unverified1 source· Talk
  • uses
    filters settled examples by comparing them with repeated model predictions
    “generating 10 teacher predictions and seeing if any are close, using something like Levenshtein distance”
    YouTube
    Unverified1 source· Talk
Show all 9 facts

Related talks