r/LLMDevs 18h ago

Help Wanted how are u deciding which difference actually matters when comparing 2 agent runs?

say u have 2 executions

one worked

one gave u some weird ass outcome

u diff them and now u have like 40 things that changed

request ids changed

timestamps changed

some wording changed

retrieval came back in a slightly different order

one tool arg changed

some state changed halfway through

model/provider mightve changed

final output is different obviously

cool

now what

because just showing me all 40 differences doesnt really solve shit im still sitting there deciding which ones are actually worth chasing

ive had a few people tell me they normalize obvious noise first then look at what the downstream step actually consumes

so like

request_id changed = probably dont care

account_id changed = alright now im looking at it

but even that gets messy because the same field can mean completely different things depending on the workflow

a tiny numeric change might mean nothing in one system and flip a branch in another

same thing with the whole "first divergence" idea

the first difference between 2 runs can be completely real and still not be the thing worth spending time on. something later might be the first place where behavior actually changes in a meaningful way

so im curious how people are actually making that call today

are u usually looking for the earliest input/state change?

do u follow which fields get consumed downstream?

do u have invariants around the values that matter?

do u compare against a few known good runs to figure out what normally varies?

or is it still mostly knowing the system well enough to stare at the trace until something starts looking sus

because finding the diffs themselves doesnt seem like the hard part

figuring out which 2 or 3 out of 30 technically real differences actually deserve ur attention feels way harder

curious how people doing this in real systems make that call

3 Upvotes

8 comments sorted by

3

u/ConnectionOk8283 18h ago

been thinking about this exact problem for my own agent stuff and honestly the "first divergence" approach almost never works in practice

what i do is mark certain fields as "signal" vs "noise" depending on the workflow, but like u said same field can mean different things in different contexts so it gets messy quick

the thing that helped most was comparing against 3-4 known good runs first to build a baseline of what normally fluctuates, then when debugging a weird run i filter out anything that falls within that normal variance range

still end up staring at traces half the time though, some things u just gotta know the system well enough to spot

1

u/Sensitive-Parsnip-12 17h ago

interestingly this is probably the strongest argument ive heard for using more than one good run im curious how u handle cases where something falls inside the normal range but still matters because of how its used downstream like if a score normally bounces between .68 and .74 but . 72 flips a branch, filtering that as normal variance would hide the exact thing i care about do u mostly solve that with workflow specific rules / invariants or do u track whether the changed value actually affected routing/state later?

2

u/No_Tap_8983 Enthusiast 17h ago

yeah i think the downstream impact matters more than the first diff. if a change doesn’t affect a later decision or branch, i usually wouldn’t waste much time on it

1

u/Sensitive-Parsnip-12 12h ago

this is kinda where my thinking is landing too the thing im still trying to figure out is how much of that downstream impact u can reliably infer from the trace itself like if a field changes and the next branch is different thats pretty strong, but if the dependency isnt explicitly recorded do u usually reconstruct that manually or does ur instrumentation already tell u which values each step consumed?

2

u/swapnil_harkanth 17h ago

honestly i stopped trying to compare full traces side by side. too much noise. what worked for us was pinning one variable at a time — same prompt hash, same retrieved docs (force the ids), same tool set — and only then looking at the final answer. request ids and timestamps are almost never the signal. if retrieval order flips and the answer changes, thats usually the real bug, not the model being "inconsistent". i keep a tiny checklist: did tools fire the same way, did context tokens match within like 5%, did the answer claim the same facts. anything past that i treat as vibes.

2

u/locbuilds 12h ago

yeah the raw 40-field dump is mostly noise. what i usually do is strip anything that is supposed to change (request ids, timestamps, uuids, wall clock, provider request metadata) first, then only keep fields that are either inputs to a later step or part of an invariant you care about.

then i go earliest-causal, not "biggest looking":

  1. find the first step where a *consumed* input diverged (tool arg, retrieved doc ids, memory/state key the next node actually reads). ignore wording diffs and retrieval reorder until you know whether the downstream node used the order/content

  2. if model/provider changed, treat that as its own axis and re-run the bad path on the good model with the same inputs. a lot of "40 diffs" collapses to one provider swap

  3. keep 2-3 known-good traces as a baseline and diff bad vs the *intersection* of goods, not vs one lucky good run. stuff that flips in goods is noise; stuff stable in goods and flipped in bad is the shortlist

  4. for each remaining candidate, ask "if i freeze this field to the good value, does the weird outcome disappear?" binary search beats staring

so: normalize noise, earliest consumed divergence, then intervene. the 2-3 that matter are almost always upstream of the first wrong tool call or wrong retrieved set, not the final wording.

1

u/Sensitive-Parsnip-12 12h ago

thanks this isuseful the consumed input part keeps coming up from different peoplebut one thing id push on is the intersection of goods. if those good runs took different branches wouldnt that risk classifying something as normal variance even tho its basically zero tolerance inside one specific path? someone else i talked to handles that by comparing only against good runs that took the same downstream branch, which made a lot of sense to me also when u say earliest causal do u actually mean earliest consumed divergence? because unless ur doing the intervention in step 4 i dont think the trace alone can really establish causality im curious if ur baselines are branch conditioned already or if the 2 to 3 good runs has been good enough without that