Sampling Production Traces
The per-trace loop is the daily cycle the FDE works inside: production traces are sampled, a pattern is identified, a fix is coded, and the change is tested.
Why Production Traces Pile Up
Once an AI product is running with real users, the most useful information about its behavior is the record of what actually happened in each interaction. Those records are called production traces. A forward-deployed engineer, or FDE, does not treat these records as a one-time report. Instead, the FDE works through them on a repeating daily cycle. This article calls that cycle the per-trace loop. Each pass through the loop takes a small slice of real behavior, turns it into a candidate improvement, and checks whether the improvement really helps before it reaches users.
What do you think happens?
Why does the FDE sample production traces instead of reading every one of them?
Reveal answer
Because production traces pile up faster than anyone can read them.
The source states that production traces can pile up faster than anyone can read them, so the FDE samples. Sampling is how the loop gets a manageable slice of real behavior to work with each day.
Walking the Daily Per-Trace Loop
It helps to think of the loop as a sequence that starts with new material arriving and ends with a decision. The source describes the loop as the place where the FDE spends the day, so the stages below are the ones that repeat from one day to the next. The four stages are sampling production traces, identifying a pattern, coding a fix, and testing the change.
- 1Sample: pull a set of production traces from the much larger pile of recorded interactions
- 2Identify a pattern: find a repeated shape across several sampled traces, such as the same kind of mistake appearing in many conversations
- 3Code a fix: turn the chosen response to the pattern into a concrete change to the system rather than a note in a document
- 4Test the change: run the eval set against the changed system and use the score to decide what happens next
Notice that the loop only moves forward through the fix when there is evidence from real traces. A pattern is the bridge between what the FDE read and what the FDE changes. Without that bridge, a change would be a guess. The final check, running the eval set, is what separates a plausible idea from a change that is actually known to help.
Choosing Which Traces to Read
The source describes two ways sampling can happen. Sometimes it is random, which gives a broad, unbiased view of what the product is doing. Often, though, the sample is weighted toward two kinds of cases. The first is traces the inline judge flagged. The inline judge is a signal already attached to the product's behavior that points at traces that may have gone wrong. The second is traces the customer manually marked, which point at interactions a person using the product found worth noticing.
Random sampling is the choice to let the review set reflect the pile as a whole. Its strength is breadth: it shows the common behavior of the product without favoring any particular kind of case. Weighted sampling is the choice to tilt the review set toward cases that already carry a signal, namely traces the inline judge flagged or the customer marked. Its strength is focus: it puts more of the FDE's limited reading time on interactions most likely to reveal a problem. The source does not say the two methods are used in a fixed proportion, so the FDE decides the balance for the situation.
From Pattern to Candidate Fix
A pattern is a repeated shape across several sampled traces. Once the FDE sees that shape, the next question is what change might address it. The source lists four families of changes a pattern might point toward. A prompt change alters the instructions the model receives. A tool-description change alters how the model understands the tools it can call. A context-window strategy change alters how information is packed into what the model sees at once. A model swap replaces the model itself. Each family changes a different part of the system.
The choice among these families is driven by the pattern itself. The source does not give a rule for matching patterns to families, so this matching is a judgment the FDE makes from the traces in front of them. What the source makes clear is that the chosen fix is then coded, which turns it into a concrete change that can be tested.
Following one pattern through the loop
Illustrative scenario: an FDE samples traces from a customer-support assistant. In several sampled traces, the assistant gives an outdated refund window. The mistake repeats across many conversations, so it is a pattern.
- 1Sample
The FDE includes flagged traces and a few customer-marked traces, since those are the cases most likely to show the problem, and also some random traces to see whether the issue is widespread.
- 2Identify the pattern
The same outdated refund window appears in several conversations. That repeated shape is the pattern that connects what the FDE read to what the FDE will change.
- 3Choose a family
The instructions the model receives are the part of the system most directly responsible for the stated refund window, so the FDE considers a prompt change. The source leaves this matching to the FDE's judgment.
- 4Code the fix
The prompt change is written into the system as a concrete edit, not left as a note.
- 5Test
The eval set is run against the changed system, and the resulting score determines whether the change ships.
The fix moves forward only if the eval score improves. If it does not, the change goes back to the bench for more work, even if the edited prompt looked convincing when it was written.
The Eval Set as a Ship-or-Return Gate
A fix that looks right on a handful of traces may still make the product worse elsewhere. To check the change more broadly, the FDE runs the eval set from Chapter 9 against the changed system. The eval set is the instrument for this test. Its role is to produce a score, and the score is what the loop uses to judge the change. The test happens before the change is shipped, which means the eval set stands between a coded fix and real users.
The loop ends with a binary decision that depends on the score. If the change improves the score, it ships. If it does not, it goes back to the bench for further work. Because the decision is tied to the eval set's score rather than to how convincing the change looked when it was written, each shipped change rests on a measured improvement.
Mistakes People Make with the Loop
Common mistake Treating the production trace archive as a one-time report
Why it failsThe source says the FDE works through traces on a repeating daily cycle, not as a single review.
Do this insteadTreat sampling, pattern finding, fixing, and testing as a loop that repeats each day.
Common mistake Shipping a fix because it looks right on a few traces
What it looks likeA rewritten prompt fixes the example conversation the FDE was reading, but the eval set has never been run against it.
Why it failsThe source warns that a fix that looks right on a handful of traces may still make the product worse elsewhere.
Do this insteadRun the eval set against the changed system and ship only if the score improves.
Common mistake Sampling only flagged or customer-marked traces
Why it failsWeighted sampling gives a focused view, but the source describes random sampling as the way to get a broad, unbiased view of what the product is doing.
Do this insteadUse weighting to focus attention, and keep random sampling in the mix to see the product's general behavior.
Common mistake Assuming a pattern dictates exactly one fix
Why it failsThe source lists four families of changes a pattern might point toward and leaves the matching to the FDE's judgment.
Do this insteadConsider which family of change fits the pattern, then code and test the chosen fix.
Common mistake Confusing the eval set's score with an opinion about how good the change feels
Practice: Tracing One Pass Through the Loop
An FDE samples a set of production traces, and most of the sample is randomly chosen, but a few are customer-marked interactions. Several traces show the assistant ignoring a tool it should call. Describe, in order, what the FDE does next, which families of change the FDE might consider, and what decides whether the change ships.
Hints
- Start from the four stages of the loop: sample, identify a pattern, code a fix, and test.
- The source lists four families: prompt change, tool-description change, context-window strategy change, and model swap. Think about which one concerns how the model understands the tools it can call.
- The final decision depends on the score from the eval set.
Key Takeaways
- The FDE's per-trace loop is a daily cycle: sample production traces, identify a pattern, code a fix, and test the change.
- Production traces pile up faster than anyone can read them, so the FDE samples, either randomly for a broad view or weighted toward inline-judge-flagged and customer-marked traces for focus.
- A pattern is a repeated shape across sampled traces and can suggest a prompt change, a tool-description change, a context-window strategy change, or a model swap.
- The eval set from Chapter 9 runs against the changed system, and the change ships only if the score improves; otherwise it goes back to the bench for more work.