DFilterForge Retrospective 02: Show the model the packet that disproves it
When a filter is wrong, DFilterForge gives the model one more round, with a counterexample: the frames that disprove it if it ran wrong, the error if it failed to compile. On the frozen test split, out of 75 wrong answers, counterexamples repaired 35, a bare 'wrong' repaired 21, and resending the same prompt repaired 4. This post covers four things: how the model's input is designed, what goes on a counterexample card, how to read the results of the three arms, and the conclusions that didn't hold or couldn't be read. What didn't hold: typed intent did not beat writing the filter directly. What couldn't be read: most single-model comparisons show no difference. Also, the fine-tuned 1.7B small model repaired none with counterexamples.
- Published
- Reading time
- 15 min read
- Category
- Retrospectives
- Tags
- Translated from
- the Chinese original
Contents12 sections
This is the second post in the DFilterForge retrospective (series overview). The previous post covered how we decide a filter is wrong. This one covers the other half: what the model sees, and whether, after a wrong answer, handing it the packet that disproves it lets it fix the answer.
The conclusion first. On the frozen test split, four hosted models produced 75 silent-wrong or invalid answers under condition C4. Every wrong answer got one more round, and there are three ways of giving it:
- With a counterexample card (the frames that disprove it if it ran wrong, the error if it failed to compile): 35 repaired;
- Told only “your filter was incorrect”: 21 repaired;
- The first-round prompt sent again unchanged: 4 repaired.
A few conclusions didn’t hold, or couldn’t be read:
- Typed intent did not beat writing the filter directly;
- Most single-model comparisons are inconclusive;
- The fine-tuned 1.7B small model repaired none with counterexamples.
Every number in this post comes from committed records in the repository1.
What the model hands back
The model answers under four conditions:
| Condition | Hands back | Retrieved fields attached |
|---|---|---|
| C1 | Display filter | No |
| C2 | Display filter | Yes |
| C3 | Typed intent IR | No |
| C4 | Typed intent IR | Yes |
- Typed intent is a predicate tree built from
all,any, andnot. Each predicate names a field and an operator, and most carry a value (existsonly asks whether the field is present, with no value). The compiler first checks every field name against the frozen field catalog (case must match too), then checks the type, operator, and value. Only when all pass does it compile into a filter and hand it to tshark. - Retrieved fields are 16 fields retrieved from the field catalog and attached to the prompt.
For mei-1038 from the previous post, the typed intent stored in the scoring record looks like this (indentation and key order adjusted for readability):
{
"expression": {
"kind": "all",
"children": [
{"kind": "predicate", "field": "tcp.srcport", "operator": "eq", "value": 443},
{"kind": "predicate", "field": "tcp.completeness.fin", "operator": "eq", "value": true}
]
},
"ir_schema_version": "1.0",
"scope": "packet"
}After repair, only the second predicate’s field name changed to tcp.flags.fin.
The project’s registered primary question is: with retrieved fields attached, does writing typed intent (C4) beat writing the filter directly (C2)? The answer is no; the results come later. First, the two pitfalls on the input side.
The prompt didn’t say how to write values
On the first dev split run, the typed IR prompt only said "value":V, without saying how V should be written. The compiler accepts only JSON numbers on integer fields, and only true or false on boolean fields.
As a result, C3 wrote all 24 integer and boolean values as strings: only 1 of 16 items was strong exact, 15 invalid. C4 did better, because its retrieved fields carry types: 7 of 16 strong exact. So the +0.375 for C4−C3 mostly measured “does the prompt give the value’s type”, not retrieval itself (typed-ir-prompt-v2.md).
Prompt v2 changed only this one explanation, and named no fields. It spelled out:
- How to write each type of value;
- Which operators go with which types;
- Protocols can only be judged by “exists”;
allandanymust have at least two children.
| Condition (v1 → v2) | strong exact | silent-wrong | invalid |
|---|---|---|---|
| C3 | 1 → 7 | 0 → 2 | 15 → 6 |
| C4 | 7 → 10 | 2 → 5 | 5 → 0 |
The table counts by the probes after the DNS gap was filled. The original table has 8 strong exact for C3, counted by the probes before the gap was filled; as the previous post explained, after the fill mei-0011 became silent-wrong.
Quoted integers and booleans dropped from 30 to 0. But C4’s silent-wrong rose from 2 to 5: three answers that previously failed the type check (two) or the “at least two children” check (one) now ran, and ran wrong. The original conclusion: compiles does not mean correct.
This change also surfaced an engineering pitfall. Scoring rebuilds every committed prompt from the current prompt text and checks it against the records, so once the prompt changed, the first run could no longer be matched in CI. The fix was to keep every version of the prompt: changing the prompt adds a new version, never edits in place (33ad868).
One more note. C1 and C2 had byte-identical prompts across the two runs, yet some answer texts still differed: C1 had 4, C2 had 2, and one of C1’s changed its result. So C1 going from 8 strong exact to 9 was just rerun fluctuation. Temperature 0 does not mean identical every time; the next post goes into that.
Retrieval: first it has to find the field
The 16 fields for C2 and C4 come from retrieval over the tshark field catalog. Two pitfalls here.
The first is field-name syntax. The original rule required field names to start with a lowercase letter, followed only by lowercase letters, digits, and _.-; but tshark 4.6.8 registers names like bacapp.IPV4, diameter.TCP-SYN, _ws.expert.message. Retrieval threw an exception on them, and 10 of 16 dev split items failed outright. The fix was to accept every spelling registered in the field catalog (b901d51). Per the progress record (progress.md), usable names went from 149,890 to 266,363.
The second is ranking. The request said “IPv4 TTL”, but retrieval returned mpls_echo.tlv.ilso_ipv4.ttl and aeron.setup.ttl, never ip.ttl. Only 1 of 16 dev split items had all its reference fields in the top 16. Left unfixed, C2 and C4 would have measured the retriever, not the model (field-retrieval-ranking.md).
The two main changes:
- Recognize protocols. When a word in the request equals a protocol’s abbreviation, or is the acronym of the protocol’s full name (e.g. IPv4 for “Internet Protocol Version 4”), that protocol’s fields get weighted.
- Count how much of the field name is mentioned. The fewer segments of a field name not mentioned in the request, the higher the score, so short fields in a named protocol rise to the top.
| Dev split, top 16 | Before | After |
|---|---|---|
| Items with all reference fields in the list | 1 / 16 | 10 / 16 |
| Mean recall | 0.115 | 0.74 |
| Time | 11.583 s | 2.241 s |
The test split then had only 32 items. After the rules were set, it was tested only once, going from 2/32 to 12/32; it was never used to tune any parameter.
Retrieval also brought new problems. On the first run, two C2 items didn’t retrieve their reference fields, so the model used similar fields near the top of the list (dns.a, dns.aaaa). Compared with C1, which has no retrieval:
- One went from invalid to silent-wrong;
- One went from strong exact to silent-wrong.
The original wording: retrieval traded loud errors for quiet ones.
The frozen test split later grew to 80 items, of which only 28 had all reference fields retrieved, a proportion of 0.350. mei-1038 from the previous post is one such case: the list had no tcp.flags.fin; the only field whose display name was FIN was tcp.completeness.fin.
Typed intent was not more accurate
With retrieved fields attached, the four models’ C4 minus C2 differences were −0.075, −0.100, −0.063, and +0.088; none of the intervals excludes 0.
Two further points don’t support the hypothesis either:
- Two models’ net differences exceeded the rerun noise bound, but in opposite directions.
- That noise bound was extrapolated from another model, and the reading of one of the two was also affected by rate limiting.
By the registered rule, no model showed an advantage for typed intent (locked-test-v1.md). This negative result was published as is. How the noise bound is computed and how rate limiting affects readings are in the next post.
What goes on a counterexample card
The repair round’s rules were registered before any test request (repair-round.md). Two parts were registered later as amendments: the frontier model changed providers, and the counting unit for pooling changed. Both came after the first test request and before any test repair request; the next post covers them. The rules:
- Only C4’s wrong answers are repaired. C4 items whose result is silent-wrong or invalid are called “triggered” items. There are 75 on the test split: 54 silent-wrong, 21 invalid.
- The standard for repaired. The new answer must be strong exact on all three scoring probes.
- The frames on the card all come from the fourth probe (also a synthetic capture). This feedback probe is not scored; there is one for the dev split and one for the test split.
The feedback probe is built separately and kept out of scoring because if the packets on the card came from a scoring probe, the model could fit its fix to those packets and pass scoring. Like the scoring probes, it contains all 20 packet recipes and 33 witness packets, only with different bytes. This means the repair round tests “given a packet of a known kind that distinguishes right from wrong, can the model fix the answer”, not that it can fix answers for new kinds of packets.
Witness packets are just as critical here (ablation 007):
- Without them, 112 mutants on the feedback probe are indistinguishable; 6 of the 24 silent-wrong answers in the two dev split runs would get no counterexample at all — the very answers that got witness packets added in the first place.
- With them, all 24 get counterexamples; none of the 60 strong exact answers gets a false counterexample.
- Items the feedback probe can’t distinguish stay in the denominator. The counterexample arm sends them the bare message without a card, and a correct fix still counts as repaired. This too was registered in advance; no such item appeared on the test split.
What if the card carried only three things: the frame number, whether the answer matched this frame, and whether this frame should match? The control group in ablation 008 used exactly such cards. Measured:
- For none of the 52 questions could the labels be inferred from the card;
- The frame number is itself a shortcut field;
- After deduplicating frames, 345 of the 392 cards generated for mutant answers had only one frame left.
The final card gives, per frame, those three things plus whichever of these 13 header fields the frame has:
- IP layer: source address, destination address, TTL, ECN;
- TCP layer: ports, flags, payload length;
- UDP layer: ports;
- DNS layer: response bit, response code, query type.
These values are read by a bounded decoder, then confirmed by tshark: a filter built from these values must select exactly this frame, or the whole round stops. Thus:
- All 961 values were confirmed;
- The labels of all 52 questions can be inferred from the cards;
- The largest card is 717 bytes, against a cap of 1,024 bytes;
- The cost was 10.7% slower, over the self-imposed 5% threshold, but accepted for this quality difference.
Three rejected alternatives:
- Mask the addresses: only 37 questions inferable;
- Only protocol, TCP flags, and DNS response bit: only 9;
- Give the truth value of each predicate in the answer: the original says this would execute the leaf conditions of the reference answer.
The card’s frame-selection rules:
- At most three frames, alternating between “missed” and “wrongly matched”;
- Skip frames that differ from an already selected frame only in frame number or ephemeral port (the packet scripts use 41000 to 51254);
- An invalid answer has no frames to give, so it gets an error card stating what error was reported and which field errored.
The card mei-1038 received had a single frame:
{"frames":[{"answer_matched":false,"frame":63,"ip.dsfield.ecn":0,"ip.dst":"192.0.2.135","ip.src":"198.51.100.63","ip.ttl":64,"should_match":true,"tcp.dstport":41197,"tcp.flags":["FIN","ACK"],"tcp.len":0,"tcp.srcport":443}]}The second-round messages, in order:
- The original system message;
- The original request;
- The model’s own first-round answer, placed unchanged in the assistant message;
- A user message: “Your filter was incorrect. Reply with a corrected answer in the same JSON format.”, followed by a line
COUNTEREXAMPLE_JSONand this card.
The bare arm sends the same message, just without the card (generation.py).
But mei-1038 can’t show how much the card matters: in the bare arm, it also fixed the answer.
Ablation 008 itself states a limit: that the labels can be inferred from the card is a necessary condition for the card to teach the model, not a sufficient one. Whether the model actually follows it is what the comparison below shows.
The three arms
Each arm runs once, and every triggered item is sent once in each arm:
![A screenshot of DFilterForge's Board page. The small heading reads BOARD, FROZEN TEST SPLIT. The large heading reads 'After one structured counterexample, 35 of 75 failed test answers were repaired.', with 35 in carmine red. Below, an explanation: telling the model only 'Your filter was incorrect' repaired 21, and asking again with the same prompt repaired 4; the failed answers are all silent-wrong or invalid answers the hosted models gave under C4 on directly answerable questions; a new answer counts as repaired only if it is strong exact on every scoring probe; counterexamples come only from the unscored feedback probe. Below that are three bars: resample is 0.053 [0.014, 0.113], 4 of 75 repaired; bare is 0.280 [0.161, 0.435], 21 repaired; counterexample is 0.467 [0.347, 0.590], 35 repaired. Under each bar a line marks the interval. The bottom line explains: four models pooled, intervals from a case-level bootstrap with 1000 resamples over 40 cases, seed 17.](/_astro/board.DUYtCFMv_jw0DN.webp)
Broken down by model (repair-round.md):
| Model | Triggered | Resample | Bare | Counterexample |
|---|---|---|---|---|
| qwen3-32b | 28 | 1 | 14 | 16 |
| qwen3.5-9b | 15 | 1 | 3 | 6 |
| qwen3.5-122b-a10b | 20 | 0 | 2 | 9 |
| deepseek-v4-pro-0813 | 12 | 2 | 2 | 4 |
| Total | 75 | 4 | 21 | 35 |
Of the 35 repaired with counterexamples, 30 were silent-wrong answers that received frames disproving them (out of 54), and 5 were invalid answers that received error cards (out of 21).
All four models repaired the most with counterexamples, but the size of the difference varies a lot:
- qwen3-32b, told only “wrong”, repaired 14, close to the 16 with counterexamples;
- qwen3.5-122b-a10b repaired 2 with bare and 9 with counterexamples; the card did the most work on it.
An example repaired only by the card
mei-1040 asks: all TCP segments with the ECE flag, whatever other flags they carry, whatever the ports and direction; segments with only CWR and no ECE should not match. The reference answer is simply tcp.flags.ece == 1.
qwen3-32b’s first-round typed intent meant “has ECE, and does not have CWR”. It read “don’t take segments with only CWR and no ECE” as “don’t take segments with CWR”.
- Bare: it handed back typed intent identical to the first round.
- With counterexample: the card showed two frames from a client to port 443, both carrying SYN, ECE, and CWR, both should match, and the answer matched neither. It changed the second condition to “not (‘has CWR and not ECE’)”, and was strong exact on all three probes.
The repaired expression takes a detour: the first condition already requires ECE, so the second condition is always true, and the whole expression is equivalent to checking ECE alone. It is almost a word-for-word translation of the request’s sentence.
After pooling
Four models pooled, counted by case (repair-pool/test.json). Within a case, if the two arms repaired different numbers of items, it counts as a discordant case; by the registered rule, a comparison is conclusive only with at least 10 discordant cases and an interval excluding 0:
| Comparison | Difference [95% interval] | Cases repaired more (first / second) | Discordant cases |
|---|---|---|---|
| Counterexample − bare | 0.187 [0.056, 0.301] | 12 / 4 | 16 |
| Counterexample − resample | 0.413 [0.277, 0.537] | 21 / 2 | 23 |
| Bare − resample | 0.227 [0.115, 0.369] | 13 / 0 | 13 |
All three comparisons are conclusive:
- Bare repairs considerably more than resending;
- Counterexamples repair a further chunk beyond bare.
The whole test-split repair round took 12 runs and cost at most 0.214 USD.
What couldn’t be read
The registered primary comparison is, within each model, counterexample versus bare. Of the four models, only qwen3.5-122b-a10b’s is conclusive: 9 versus 2, a difference of 0.350 [0.056, 0.636]. The other three models had only 4, 2, and 4 discordant cases.
This was expected at registration: the first limitation written down at registration was “Comparisons will mostly be inconclusive.” The reason is that a model’s discordant cases cannot exceed its triggered cases. Measured later, the four models triggered 20, 11, 16, and 9 cases; deepseek-v4-pro-0813 could never reach 10 no matter the outcome.
The resample arm doesn’t purely measure “try again” either:
- At temperature 0, with the same prompt sent again, qwen3-32b had 16, qwen3.5-9b had 5, and qwen3.5-122b-a10b had 15 answers identical to the first round (out of 28, 15, and 20 total).
- deepseek-v4-pro-0813’s three arms switched providers because of rate limiting, so its resample arm also measures “switched providers”.
Counting by case when pooling was also a fix made after the dev split revealed the wrong statistical unit. These all go in the next post.
Repaired, but using values from the card
Of the 35 answers repaired with counterexamples, 21 contain a (field, value) pair that appeared on the card, such as tcp.dstport 443 or ip.ttl 64.
- Why it still counts as repaired: these values are outside the shortcut rules.
- What copying would be judged as: copying a host address or ephemeral port would be judged a shortcut. In fact, none did.
This 21 is an upper bound on the number of answers that copied the card, because the count doesn’t look at the request text. For example, mei-1038’s repaired tcp.srcport == 443 — the card also showed tcp.srcport 443, so by the rule it counts as one reuse; but 443 was already written in the request.
The 1.7B small model can’t use counterexamples
The fine-tuned Qwen3-1.7B also ran the same repair round. This round was added post hoc: at registration, the base model’s and the three fine-tuned seeds’ test scores were already known.
The three seeds triggered 125 items in total (45, 44, 36), covering 58 distinct items across 36 questions. Repairs:
- Counterexample: 0;
- Bare: 2;
- Resample: 1.
No comparison reads a difference (SFT repair summary).
In the counterexample arm’s second-round answers, out of 125:
- 95 abstained;
- 12 were malformed;
- 18 were silent-wrong, and all 18 repeated the first-round answer verbatim.
In the resample arm, 109 of 125 were identical to the first round. On the same self-hosted vLLM service with greedy decoding, resample measures whether the service itself is stable, not a second chance (self-served-runs.md).
These adapters were trained only on the single-round C4 prompt; the second round’s four-message conversation was never seen in training. One possible reason is that the training data is single-round only. But this round didn’t run the un-fine-tuned base model through repair, so it can’t separate “model too small” from “training format”. Training is covered in the fourth post.
Summary
- Spell out the input first. If how to write values and what fields are called are unclear, you’re measuring the prompt and the retrieval, not the model;
- Compiles does not mean correct. Fix the loud errors and the quiet errors may grow;
- Prompts need versions, never in-place edits, or old runs can’t be rescored;
- The packets used for feedback must be separate from the packets used for scoring. Every value on a card must be confirmed by the same tshark;
- From a card that only marks each frame right or wrong, no question’s labels can be inferred. The card can only be useful if it gives fields from which the labels can be inferred;
- Have a control. Bare “wrong” already repairs quite a few; the extra chunk repaired with counterexamples is the card’s contribution;
- Decide how to read the results in advance. With small samples, most comparisons are inconclusive to begin with; write that down as it is.
The next post covers measurement itself: freezing, pre-registration, and the times the numbers nearly went wrong.
Footnotes
-
The repository is WeiGuang-2099/DFilterForge. The source and documents linked in this post are all pinned to commit 09bb537 of November 9, 2026. ↩︎