matchev

Match and reconcile records at volume.

A small, fast model that works out which records belong together, and explains every difference between them. Exact code finds the candidates, does the arithmetic and checks every rule; this adapter judges only what code can't, in one forward pass per record, with a calibrated p.

GitHub Use cases Results Apache-2.0

matchev-4b is the learned layer of Matchev, one model in five layers
Code and results · Use cases · Results · Quickstart

Payment-group accuracy 0.950 (Sonnet 5.5 0.948, Haiku 5.5 0.947, Jev 1.14 0.905, best code 0.917); 92% answered at p ≥ 0.95, 98% of them right (Sonnet 19%, Jev 23%, Haiku 12%); $0.09 per 1,000 questions self-hosted (Jev $0.12, Haiku $0.41, Sonnet $11.18). On record matching Jev 1.14 is ahead.

One cash-application request: PAY-9 settles INV-101 and INV-102 less withholding tax and a bank fee at p 0.9996; PAY-14 pays part of INV-103 with 9,000 left open at p 0.9998; PAY-15 is unmatched. Code alone finds the same groups at p 0.80 and 0.77.

What sets it apart

Sets in, groups out; every difference explained; guarantees checked by code; a p you can automate on; small and cheap to run; corrections without training.

  • Sets in, groups out. Whole record sets in one request (tested to 136,500 records); groups, typed explanations of every difference, and leftovers with a reason come back, not a similarity score per pair.
  • Guarantees, checked by code. Totals balance, no record is used twice, confirmed groups stay and rejected pairs never return. A response that breaks one is never sent.
  • Small and cheap to run. About $0.09 per 1,000 questions on rented GPUs before any batching; code settles about a quarter of generated payments with no model call at all.

What this is

A LoRA adapter (rank 16, alpha 32) for Qwen/Qwen3.5-4B at revision 851bf6e806efd8d0a36b00ddf55e13ccb7b8cd0a, plus calibration.json (one temperature, 1.3133, fitted at one forward pass on held-out training questions). It reads one question at a time: a record, and up to 23 options built by Matchev's exact layers (candidate records, or candidate payment groups with their explanations), and returns its choice or "none" from the logits of the option codes. On its own it is not a matcher: use it inside the Matchev package, which builds the questions, settles the exact cases in code, picks one consistent set of groups and checks every guarantee before a response leaves.

How to use

git clone https://github.com/mohit67890/matchev && cd matchev
uv venv -p 3.13 .venv && uv pip install -p .venv -e '.[fast]'           # Apple silicon (MLX)
hf download mohit67890/matchev-4b --local-dir adapters/matchev-4b
.venv/bin/python -m matchev.fast merge --adapter adapters/matchev-4b    # once; downloads the pinned base (about 8 GB)
.venv/bin/python -m matchev.api serve --adapter adapters/matchev-4b --port 8080
curl -s localhost:8080/v1/match -H 'Content-Type: application/json' -d @request.json

The request and response are in docs/api.md; copy-paste specs for each business case are in docs/recipes.md.

Use cases

Nine use cases: five checked in 0.1 (accounts receivable, accounting and treasury, procurement, marketplaces, onboarding) and four recipe-ready, not yet measured.

The five checked use cases: the records, what matchev-4b returned, every difference explained, and the same request with one field flipped. The expected answers were written before any model ran; misses are shown.

Cash application: PAY-9 settles INV-101 and INV-102 less withholding tax and a bank fee; PAY-14 pays part of INV-103; PAY-15 goes to a person. Flips: 2 of 4 right; it applies a payment from an unknown payer because the sums fit.

Bank reconciliation: a card payout matched to two days of sales less a 2.98% fee; a transfer matched to invoice 77, not the identical invoice 78. Flips: 3 of 4 right.

Vendor master clean-up: duplicates joined with each difference named (renamed, moved); a renamed supplier joined; the parent and two look-alikes kept apart. Flips: 3 of 3 right.

Product catalogue mapping: matches by part number, the 2TB drive not the 1TB, the 1 m cable not in the catalogue. Flips: 4 of 4 right.

Business onboarding: an applicant matched to its registered company, a renamed company found through its previous name, one not in the register. Flips: 1 of 3 right; it onboards on the address alone when the previous name is missing.

Results

Cost per 1,000 questions on the same payment-group questions: matchev-4b $0.09, Jev 1.14 $0.12, Haiku 5.5 $0.41, Sonnet 5.5 $11.18, with accuracy and how often each answers at p ≥ 0.95.

The same 7,200 questions from 24 test sets, each judge answering in the learned layer's place (26–27 Nov 2026):

matchev-4b Jev 1.14 Claude Haiku 5.5 Claude Sonnet 5.5 best code
Payment groups (600): accuracy 0.950 0.905 0.947 0.948 0.917
· answers at p ≥ 0.95: share / right 92% / 98% 23% / 100% 12% / 100% 19% / 100% 60% / 98%
Record matching (19 sets, 5,700): accuracy 0.682 0.786 0.764 – –
· answers at p ≥ 0.95: share / right 36% / 99% 65% / 87% 56% / 83% – –
Cost per 1,000 questions about $0.09 (self-hosted, 2×H100, unbatched) $0.12 $0.41 $11.20 about 0

At p ≥ 0.95, payment groups: 83% posted automatically and right, 1.7% posted wrongly, 15% to a person. Record matching: 25% posted and right, 0.3% wrongly, 74% to a person.

Strongest on payment groups (cash application with withholding, fees, part payments and parent companies). Weakest on product catalogues unlike anything it trained on, where it says "none" when a match exists. Full tables and method: docs/results.md.

Training

One run from the base model, 0.3 epoch (6,224 steps) over 125,551 training questions, LoRA on the attention, MLP and linear attention projections, learning rate 1.5e-4, on 2×H100 (27 Nov 2026). Loss: the log-probability of the true option, or "none", over the frozen language-model head's rows for the option codes.

Source Licence
Generated identity and cash-application cases (Matchev's generator; held-out families excluded) generated
GLEIF to Companies House links, train half GLEIF CC0 1.0; Companies House free data product (no formal licence; use stated as unrestricted)
GLEIF duplicate registrations, train half CC0 1.0
USAspending contract actions, train half US government work, public domain
WDC Products 2017 train and valid splits (cameras, computers, shoes, watches) none stated

The WDC Products 2017 corpus states no licence; it was used for training, downloaded from its source and is not redistributed here. No test split, held-out dataset or held-out generator family was trained on. No output of Claude, Jev or any other model was used for training; those models were only measured.

Limits

  • Says "none" too often on product catalogues it never saw: safe (the record goes to a person) but less automation.
  • Trusts balancing sums too much when the payer is unknown, and an address alone when a company has renamed.
  • English records; tested on public and generated data only, not yet on a hand-labelled set of real exceptions.
  • Calibrated at one forward pass per question; p from other settings is not calibrated.

Choose a threshold on a few hundred of your own reviewed records before automating anything.

Downloads last month
1
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for mohit67890/matchev-4b

Finetuned
Qwen/Qwen3.5-4B
Adapter
(1,266)
this model