Classify invoice exceptions before running the full AP agent

A supplier invoice arrives for 240 bearings. The purchase order authorizes 240, but the warehouse has recorded only 200 received. Before an AI writes an explanation, accounts payable already needs a specific next step: reconcile the receiving discrepancy.

What this means for your business

For an outsourced accounting team or an internal AP department, classification can focus AI capacity on the exception that actually exists. The potential benefit is a shorter path to a reviewer-ready exception packet, with fewer duplicate ERP lookups and generic explanations. It is especially useful when many clients or entities share the same small set of exception types.

CLM-v0.1-8B scores supplied choices instead of writing an answer. Its two projection heads use a frozen Qwen3-8B encoder. That makes it a candidate for deciding which workflow should run next. It does not extract a complete record, execute a tool or prove that a document is correct. The model card and implementation are linked below.

A specific workflow: one PO, two delivery receipts

In a fictional three-way match, invoice INV-4821 contains 240 units of bearing BRG-6205 at $18 each. PO-7712 has the same quantity and price. Goods-received record GRN-918 shows 200 units. The supplier email says, “The remaining 40 were delivered on the second truck.”

An extractor reads the document fields; deterministic matching calculates the 40-unit difference. CLM receives the mismatch facts and email excerpt, then ranks: receiving-evidence reconciliation, unit-price review, suspected duplicate review, supplier-master review, or manual review. Straight-through cases with exact matches should bypass the model entirely under the team's existing rules.

The receiving route looks for a second goods-received record against PO-7712, checks whether the delivery reference has already been attached to another invoice, and prepares a linked evidence packet for the AP reviewer. It does not run the price-investigation or supplier-onboarding agent. If a second valid receipt accounts for the 40 units, the rules engine can propose that the quantity exception is resolved; payment authorization stays with the existing approval process.

The speed mechanism is fewer unnecessary specialist calls and tool round trips. CLM is ranking a next step from a short state. It is not doing reliable accounting arithmetic, reading all invoice fields or approving a payment. Keep tax checks and supplier-bank-change controls independent of this route.

A compact on-site deployment

The lightweight part is the scoring layer. The full service still needs the Qwen3-8B encoder. As a sizing calculation, eight billion weights at two bytes each occupy roughly 16 GB before runtime memory, activations and serving overhead. A single Linux workstation with a supported 24–32 GB GPU is a reasonable starting configuration to evaluate for short inputs and modest concurrency, not a tested minimum or a throughput promise.

The reference implementation pairs a vLLM pooling service with the CLM API. Keep decision inputs short, precompute reusable candidate embeddings, and batch arrivals within an acceptable waiting window. The repository's example caps inputs at 2,048 tokens; split longer documents into meaningful sections and retain page references instead of silently truncating evidence. One encoder can serve several department-specific sets of choices.

Four-bit weights would be roughly 4 GB in raw weight storage by arithmetic, but that is not the total memory requirement. Quantization changes embeddings and may change rankings. Validate the exact encoder, pooling method, precision and heads together before buying smaller hardware. The supplied heads cannot simply be attached to any small embedding model. A tiny CPU appliance or a Mac mini is not a verified drop-in deployment for this reference stack.

Why the ledger boundary is a useful hosting boundary

An on-site service can work beside ERP exports, scanned invoices and client workpapers without sending their contents to an external inference provider. For accounting firms, isolate client data and any cached document embeddings. Reusable generic routing labels may be shared, but one client's invoice state must never appear in another client's retrieval results.

Give the first deployment read-only ERP access and permission to create exception tasks. Record the matched document IDs, calculated discrepancy, model version and reviewer outcome. Local hosting is a good fit when steady invoice volume and existing IT support justify the workstation; include support and idle capacity when comparing its cost with an API.

Prove a quicker exception resolution

Use historical quantity exceptions with known final outcomes, including partial deliveries, credits, duplicate delivery references and scanned handwriting. Compare tool calls and p95 time to a reviewer-ready packet, plus rerouting and false-resolution rates. Keep the same matching rules in both comparisons so an improvement is attributable to routing. Measure cost per accepted exception resolution, not just cost per model request.

The release is an early candidate-ranking model. Published agent benchmarks do not establish accuracy or speed on this workflow. Scores are relative to the alternatives supplied, not calibrated probabilities that a business decision is correct. Include an explicit manual-review choice, then set abstention rules using held-out examples; adding that choice alone does not make the system safe.

Frequently asked questions

Can CLM perform the three-way match?

Use extraction and deterministic calculations for matching. CLM can rank which specialist should investigate a mismatch once those facts are available.

How lightweight is the full on-site service?

The scoring heads are small, but the encoder has roughly eight billion parameters. Raw 16-bit weights alone are about 16 GB. A 24–32 GB GPU workstation is a sizing hypothesis for evaluation, not a verified minimum; runtime memory and workload matter.

Are these workflow speed improvements measured?

No. These are proposed workflows using fictional examples. Measure the full pipeline against your baseline, including routing accuracy, review time, retrieval and downstream model calls.

Sources & further reading

Talk with us about your workflow →