In letter-of-credit (LC) document examination, a correct final decision does not show that every requirement was examined. We therefore evaluate examination requirement by requirement and make each requirement executable. A language model converts the bill of lading (BL) and commercial invoice (IV) requirements of a credit into atomic conditions and logical structures, and a deterministic verifier retrieves the named evidence and computes each outcome, so every check can be compared with a gold encoding and traced to logged evidence. Because LC records are confidential, our on-premises 9B parser is fine-tuned only on synthetic pairs built from templates and human-reviewed public document values. On 345 real LC cases, final-decision accuracy proves misleading: a constant PASS rule has the highest raw accuracy while examining nothing. Although it never sees a real record during training, the fine-tuned parser detects 93% of the atomic requirements its ontology covers and reconstructs 86% of the covered requirements exactly. It verifies 82% of the evaluable requirements correctly, against 54% for a tool-using agent, and leads the agent on both satisfied requirements and discrepancies. It also completely examines 1.8 times as many cases as few-shot prompting of the same model, while direct prediction and the agent complete none. Executing the gold encodings with the same verifier shows that some of the remaining errors, missed discrepancies included, come from the operators and normalization, which a better parser alone cannot fix. Every rejection comes with a trace of the units and evidence behind it, which suits examiner-in-the-loop review.
Figures & tables
Figure 1. Illustrative example with five atomic, evaluable units. All five gold unit decisions are PASS, but the system correctly verifies only two and returns PASS for the case. Its final decision is correct, while Atomic Recall and Unit Success are both 2/5 and the examination is incomplete. Six clause spans are paired with their gold atomic schemas, gold decisions and system judgments. All gold decisions are PASS. The first three system judgments are PASS; the remaining three units are not examined. Two summary boxes contrast a correct final PASS decision with incomplete examination: only three of six requirements are correctly verified.
Figure 2. Study design. Synthetic pairs train the parser (left); every method is evaluated on the same real cases, facts and ontology against human-annotated gold outcomes (right). A two-part diagram. On the left, clause templates and document values extracted from public bills of lading and commercial invoices are combined by rule-based binding into paired clauses and executable specifications, which train a specification parser by supervised fine-tuning. On the right, a box describing the real benchmark of 345 cases with a shared field ontology and a human-validated fact store feeds three method boxes: a direct model given the whole fact table in one prompt, a generic agent with a field-level lookup tool, and the schema-based methods — zero-shot, few-shot and the proposed fine-tuned parser — which go from clause to specification to fact lookup to deterministic execution, the model writing the specification and the verifier computing the compliance decisions. A dashed arrow runs from the fine-tuned parser into the schema-based methods. All methods feed one evaluation box that states the gold outcomes are human-annotated and lists the detection, reconstruction, verification and case-level metrics.
Operator
Test
Typical use
EQUALS
normalized equality
parties, currency, enumerations
CONTAINS
normalized substring
free text, marks, addresses
EXISTS
field present
data required to appear
LTE
numeric or date ≤
deadlines, ceilings
GTE
numeric or date ≥
counts, floors
NEGATION
value absent
absence of adverse notations
Table 1. The six supported operators. Requirements that need other operations cannot be expressed. NEGATION denotes field-value absence.
Figure 3. Gold atomic key frequencies in 345 cases. The 20 most frequent BL keys and 12 most frequent IV keys account for 4,460 of the 4,493 key-covered occurrences; the 378 key-level out-of-ontology requirements are not shown. Two side-by-side panels of horizontal bars: 20 of 24 BL keys and 12 of 14 IV keys. The BL panel ranges from notify party at 386 occurrences to hs code and shipper at 10 each. The IV panel ranges from signed/stamped at 305 to invoice number at 9.
Method
Mode
Evidence access
Judgment
Direct
no-think
full fact table
model
Generic Agent
think
field-level tool
model
Schema Zero-shot
no-think
specification
verifier
Schema Few-shot
no-think
specification
verifier
Ours SFT
no-think
specification
verifier
Table 2. Compared methods. Schema-based methods share a deterministic verifier. Mode: thinking or non-thinking generation.
Figure 4. The observable layers each metric compares. For schema-based methods the trace is the verifier’s retrieval; Direct has none, so its grounding is not applicable. Arrows indicate the primary comparison; retrieval traces determine grounding eligibility for Judgment Accuracy and Unit Success. Three boxes across the top: the gold annotation, which gives the atomic schemas, their grouping into units, the evidence each unit needs and each unit's outcome; the retrieval trace, which gives the fields actually accessed; and the system output, which gives the checks or specification a method emits and its decisions. Below them, five rows name a metric, the pair of layers it compares and how it is computed: Atomic Recall and Unit Detection Recall, and Exact Unit Recall, compare the gold annotation with the system output; Grounding Rate compares the gold annotation with the retrieval trace; Judgment Accuracy and Unit Success compare the gold annotation with the system output.
Method
Addr.
Ground.
Judg.
Unit Succ.
FAIL
Generic Agent
73.62
91.37
80.53
54.17
28
Schema Zero-shot
87.40
100.00
74.49
65.10
38
Schema Few-shot
90.27
100.00
84.86
76.61
37
Ours SFT
91.55
100.00
89.96
82.36
39
Gold spec.
100.00
100.00
93.54
93.54
49
Table 3. Unit verification on the 2,817 evaluable gold units (%). Grounding is conditional on addressed units, and Judgment on grounded units. FAIL: gold FAIL units correctly identified, of 86. Direct, which has no retrieval step, reaches 47.60% Unit Success. Gold spec.: executed gold encodings, a diagnostic reference (Section 7.1 ).
Method
FR
FA
Acc.
Bal.
CER
Incompl.
Always PASS
0
64
81.45
50.00
0.00
100.00
Always FAIL
281
0
18.55
50.00
0.00
100.00
Direct
43
58
70.72
47.04
0.00
100.00
Generic Agent
243
11
26.38
48.17
0.00
100.00
Schema Zero-shot
261
4
23.19
50.43
7.54
67.50
Schema Few-shot
201
5
40.29
60.33
25.51
36.69
Table 4. Case-level results within the evaluated scope (281 gold PASS, 64 gold FAIL). FR/FA: false rejections/acceptances; Acc.: Case Decision Accuracy; Bal.: balanced accuracy; Incompl.: share of final-correct cases with an unsuccessful evaluable unit.
Method
Atom. R
Atom. P
Unit Det.
Exact
Perfect
Direct
44.25
87.42
51.04
n/a
n/a
Generic Agent
65.35
62.88
70.84
n/a
n/a
Schema Zero-shot
78.19
81.89
87.71
57.64
0.00
Schema Few-shot
88.80
86.97
91.71
76.53
10.14
Ours SFT
93.19
86.94
93.32
85.76
27.83
Table 5. Detection and reconstruction (%) over 4,493 atomic schemas and 3,848 gold units. Exact: Exact Unit Recall; Perfect: Perfect Cases. Few-shot and SFT share the same three-example prompt.
Outcome
Agent
Zero-shot
Few-shot
SFT
MISS
743
355
274
238
UNGROUNDED
179
0
0
0
WRONG_DECISION
369
628
385
259
CORRECT
1,526
1,834
2,158
2,320
Table 6. Terminal statuses on 2,817 evaluable gold units.
Method
PASS
FAIL
Balanced
Generic Agent
54.85
32.56
43.70
Schema Zero-shot
65.76
44.19
54.97
Schema Few-shot
77.66
43.02
60.34
Ours SFT
83.52
45.35
64.44
Gold spec.
94.69
56.98
75.83
Table 7. Unit Success (%) on the 2,731 PASS and 86 FAIL evaluable units; Balanced is their unweighted mean. Derived from Tables 3 and 6 .