From Letter-of-Credit Requirements to Executable Specifications: Evaluating Verification Accuracy and Completeness

Ji Sub Choi, Whan Choi, Seo Yeon Gu, Suhyun Kim, Inyong YunarXiv 2026 · arXiv

TL;DR

In the high-stakes world of trade finance, getting the "right" answer for the wrong reasons can be a multi-million dollar mistake. This paper argues that evaluating AI on a simple PASS/FAIL for document examination is dangerously insufficient; instead, we must turn legal requirements into executable specifications. By forcing an AI to "show its work" through a deterministic verifier, the authors achieved a 47% complete examination rate on real-world cases—a feat where standard LLM agents and direct predictions failed entirely.

What Problem Does This Paper Address?

When a bank handles a Letter of Credit (LC), they are essentially acting as a high-precision referee. They must compare documents like a Bill of Lading (BL) or a Commercial Invoice (IV) against a set of complex, free-text requirements. If the documents don't match the rules, the bank must list every single discrepancy found.

The current trend is to throw a Large Language Model (LLM) at the problem and ask, "Does this comply?" But there’s a catch: a model can return a correct "PASS" simply because it missed a discrepancy, or it might "FAIL" a document for a reason that isn't actually in the contract. This "black box" approach is a nightmare for auditability and legal compliance.

As shown in Figure 1, a system can get the final decision right while failing to examine the majority of the actual requirements.

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.

The authors tackle this by moving away from "vibes-based" checking toward a system that decomposes text into a logical, executable structure.

Methods

The researchers developed a pipeline called Specification-Guided Verification. It consists of two main parts:

  1. The Parser: A 9B-parameter LLM (Qwen3.5-9B) fine-tuned to act as a translator. It takes the messy, free-text requirements and converts them into "atomic schemas"—structured tuples like (document, key, operator, expected_value). For example, it turns "To the order of Hana Bank" into a logical check: BL.consignee EQUALS "TO ORDER OF HANA BANK".
  2. The Verifier: Unlike the LLM, this part is deterministic. It doesn't "think"; it simply executes the schemas. It fetches the relevant facts from a pre-validated "fact store" and applies logical operators (EQUALS, CONTAINS, EXISTS, etc.) to reach a verdict.

This separation of powers is key: the model decides what to check, but a transparent, auditable piece of code decides if the check passes.

The study design uses synthetic data for training and real cases for evaluation.

Datasets

One of the biggest hurdles in this field is data privacy—banks don't exactly post their confidential LC records on GitHub. To solve this, the authors used:

  • Synthetic Training Data: 2,000 files containing ~41,000 atomic schemas. These were generated using templates based on international standards (UCP 600, ISBP 821) and populated with public document values extracted from the "AI Hub" OCR dataset.
  • Real-Case Evaluation Set: 345 real-world LC cases from a financial institution, featuring 4,871 human-annotated atomic requirements. This served as the "gold standard" to test how well the synthetic training translated to the real world.

Key Insights and Ideas

  • The "Lazy Student" Problem: The paper reveals that a "constant PASS" rule (simply saying everything is fine) actually has the highest raw accuracy (81%) because most real-world presentations are compliant. This proves that "accuracy" is a terrible metric for this task.
  • Synthetic Supervision Works: Even though the parser never saw a real LC record during training, it detected 93% of the requirements in real cases. This suggests that the structure of legal requirements is consistent enough that templates can effectively teach the logic.
  • Agents vs. Parsers: A "tool-using agent" (which decides on the fly what to look up) struggled significantly, failing to complete a single case perfectly. The structured "parse-then-execute" approach was far more reliable because it forced the model to commit to a full plan of examination upfront.

Key Results

The authors evaluated their fine-tuned model (SFT) against several baselines:

  • Atomic Recall: The SFT parser correctly identified 93.19% of the requirements, significantly outperforming direct prediction (44.25%).
  • Complete Examination Rate (CER): This is the "gold medal" metric—did the system get every requirement right for a given case? The SFT model achieved 46.96%. For comparison, the generic agent and direct prediction models scored 0%.
  • Unit Success: On individual requirements, the SFT model was correct 82.36% of the time, compared to 54.17% for the agent.

Limitations and Future Work

While a major step forward, the system isn't ready to replace humans just yet:

  • Scope: It currently only handles Bill of Lading and Commercial Invoice requirements. Expanding to other documents (like Insurance Certificates) is a necessary next step.
  • Nuance: The deterministic verifier uses strict operators. Real-world "not conflict" standards in banking are sometimes more flexible than a simple EQUALS or CONTAINS check.
  • The "Missed" Discrepancies: Even with "gold" (perfect) specifications, the verifier only found 49 out of 86 annotated discrepancies. This suggests that the logic of the operators needs to be more sophisticated to match human expert judgment.

The authors suggest that the best path forward is a "hybrid AI-human" approach, where the AI provides a clear, traceable map of its logic for a human expert to verify.

Summary updated

Abstract

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.
BibTeX
@misc{choi2026from,
  author = {Ji Sub Choi and Whan Choi and Seo Yeon Gu and Suhyun Kim and Inyong Yun},
  title = {{From Letter-of-Credit Requirements to Executable Specifications: Evaluating Verification Accuracy and Completeness}},
  year = {2026},
  eprint = {2611.26988},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.26988},
}
Figure