AI in Finance and Accounting: Close, Reconciliation and Controls

Bank lines matched to ledger entries with tolerance and an unmatched report

The month-end close is a deadline-driven chain of small, repetitive judgments: does this bank line match that ledger entry, was this invoice accrued, why did travel run over budget. Each link is a plausible target for AI, and each also sits inside a system whose whole purpose is to be correct and auditable. A finance lead adopting AI has to hold both facts. This article covers where a model helps with reconciliation, accruals, variance commentary and anomaly detection, why every number must come from the ledger and never from the model, and the controls that keep an auditor comfortable.

1. Why the close is a good target and a risky one

The close can be slow for mundane reasons. Data arrives from several systems in different formats, matching is manual, explanations are written from scratch each month, and reviewers have no cheap way to tell a routine item from an odd one. A model can help interpret messy descriptions and compare candidate matches, which may support this work.

Financial reports need accurate, auditable figures. A language model produces plausible text, and plausible is not the same as true. A model asked "what were September's travel costs?" without access to the ledger may still produce a fluent number. A model that does have the ledger can still add, round or transpose digits when it does arithmetic in prose. Design from the principle that the model proposes and the ledger decides.

Reconciliation Architecture and Human-in-the-Loop Control Gates Reconciliation Pipeline: Segregation of Retrieval, Proposal & Approval Bank Statements Feed & CSV Lines ERP Ledger Subledger Entries 1. Deterministic Code Date Window ±3d Amount Tol ≤ $1.00 2. AI Scoring Text Similarity Vendor Normalization High confidence Auto-match 5% sample Review needed Review queue Preparer review § Auditor Sign-Off & Period Lock: Separate duties: AI proposes; a preparer reviews exceptions. A controller locks the period; AI does not write to the ledger.
Figure 1. Architecture of the reconciliation process. Retrieval and arithmetic remain deterministic, while AI acts strictly in proposal queues.

2. The architecture rule: numbers come from the ledger

Keep a clear separation between retrieval and language. Deterministic code queries the ledger and computes every figure: totals, variances, percentages, ageing buckets. The model receives those finished figures as inputs and drafts the commentary. Validate numeric values, signs, units and references against the supplied data; a check for newly introduced number strings can catch some errors, but does not prove that the figures are used correctly.

That pattern fits each close task differently:

  • Reconciliation matching: code generates candidate pairs from amount and date windows, and a model or a text-similarity function scores the descriptions. The output is a proposed match with a score, never a posted entry.
  • Accrual suggestions: the model reads purchase orders and receipts for goods or services received but not yet invoiced, and proposes an accrual with its evidence. A preparer calculates the amount from the source documents, and a second person approves the journal.
  • Variance commentary: code computes actual versus budget; the model drafts a sentence per large variance using a driver the preparer supplies or confirms. A model has no knowledge of why the marketing team prepaid a conference, so an unconfirmed driver is labelled "driver not yet explained" and never guessed.
  • Anomaly detection: statistical rules (duplicate amounts, round-number entries, unusual posting times, new vendors with large first payments) flag items, and a model may summarize why an item looks unusual. The flag is a question for a person, not an accusation.

3. Reconciliation worked example and a control table

Illustrative numbers — replace with your own. A company has 1,000 bank lines to reconcile this month, and a person takes 1.5 minutes per line, so 1,000 × 1.5 = 1,500 minutes, or 25 hours. Suppose a matcher clears 700 lines as high-confidence and leaves 300 for a person. The 300 take 300 × 1.5 = 450 minutes. A reviewer also spot-checks 5% of the auto-cleared lines: 700 × 0.05 = 35 lines, or 52.5 minutes. Total effort is 450 + 52.5 = 502.5 minutes, about 8.4 hours, which saves roughly 16.6 hours. The spot-check is part of the cost. If it finds errors above your tolerance, the threshold for auto-clearing is too loose and should be raised.

The code below shows the mechanism on four bank lines and four ledger entries: an amount tolerance, a date window, description similarity, greedy one-to-one assignment, and an unmatched report. It is illustrative, so tune the tolerances to your own data.

from datetime import date
from difflib import SequenceMatcher

AMOUNT_TOL = 1.00   # currency units; illustrative
DAYS_TOL = 3
MIN_SCORE = 0.6

bank = [
    (1, date(2026, 10, 1), -1200.00, "ACME SUPPLIES INV 4471"),
    (2, date(2026, 10, 2), 5000.00, "CUSTOMER PAYMENT BETA LTD"),
    (3, date(2026, 10, 5), -89.50, "CLOUD HOSTING OCT"),
    (4, date(2026, 10, 6), -45.00, "BANK FEE"),
]
ledger = [
    ("L1", date(2026, 10, 1), -1200.00, "Acme Supplies invoice 4471"),
    ("L2", date(2026, 10, 3), 4999.50, "Beta Ltd receipt"),
    ("L3", date(2026, 10, 5), -89.50, "Cloud hosting October"),
    ("L4", date(2026, 10, 7), -300.00, "Office furniture deposit"),
]

def score(b, l):
    if abs(b[2] - l[2]) > AMOUNT_TOL or abs((b[1] - l[1]).days) > DAYS_TOL:
        return 0.0
    return SequenceMatcher(None, b[3].lower(), l[3].lower()).ratio()

pairs = sorted(((score(b, l), b[0], l[0]) for b in bank for l in ledger), reverse=True)
used_b, used_l, matched = set(), set(), []
for s, bid, lid in pairs:
    if s >= MIN_SCORE and bid not in used_b and lid not in used_l:
        matched.append((bid, lid, round(s, 2)))
        used_b.add(bid); used_l.add(lid)

print("matched:", matched)
print("bank unmatched:", [b[0] for b in bank if b[0] not in used_b])
print("ledger unmatched:", [l[0] for l in ledger if l[0] not in used_l])
# matched: [(1, 'L1', 0.92), (3, 'L3', 0.89)]
# bank unmatched: [2, 4]
# ledger unmatched: ['L2', 'L4']

Bank line 2 and ledger entry L2 are within the amount tolerance and the date window, but their descriptions score below the threshold, so both land in the unmatched report for a person. That is the correct behavior: a weak text match on a large receipt goes to review, not to automatic clearing.

Close taskAI roleControl
Bank reconciliationPropose matches with scoresPerson approves below threshold; sample auto-cleared lines; unmatched report reviewed
Accrual estimateFind unbilled receipts, draft entryPreparer computes amount from source; separate approver posts
Variance commentaryDraft text around supplied figuresEvery number traced to the ledger query; driver confirmed by budget owner
Anomaly reviewFlag and summarize unusual itemsRules documented; analyst clears or escalates each flag with a note
Journal entry postingNonePreparer and approver are different people; system enforces it
Period lock and sign-offNoneController sign-off; changes after lock need a logged reason
Month-End Reconciliation Effort Comparison: Manual vs AI-Assisted Close Time Breakdown (1,000 Bank Lines @ 1.5 min/line) 0h 6.25h 12.5h 18.75h 25.0h Manual Baseline 1,000 lines (25.0 hrs) AI-Assisted Close 502.5 min (8.4 hrs total) Illustrative: 997.5 min saved (16.6 h; 66.5%) Model: 700 lines cleared automatically, 300 exceptions reviewed manually, 35 auto-matches audited (5% sample).
Figure 2. Reconciliation effort shift. Even with mandatory spot-checks, automated matching recovers 16.6 hours of accounting capacity.

A second worked example: unbilled goods receipt and tiered pricing accrual

Illustrative scenario with hypothetical inputs. Accruals need careful checking. Consider an unbilled goods receipt at month end. A company issues purchase order PO-8810 for 100 industrial filtration cartridges. The purchase agreement includes a volume tier: units 1 to 40 cost $80.00 each, and units 41 to 100 cost $65.00 each. Goods receipt note GRN-304 confirms all 100 units were delivered to the warehouse on Oct 25, but the vendor invoice has not arrived by the Oct 31 close deadline.

If a model used the baseline unit rate ($80.00) for all 100 units, it would propose an accrual of $8,000.00. That would overstate liabilities and operating expense by $900.00 (12.7%). The correct calculation must execute through deterministic pricing logic:

# Illustrative numbers — replace with your own.
# Deterministic tier calculation for unbilled goods receipt accrual
def calculate_tiered_accrual(qty, tiers):
    if qty < 0 or any(limit < 0 or rate < 0 for limit, rate in tiers):
        raise ValueError("Quantity, tier limits, and rates must be non-negative")
    remaining = qty
    total = 0.0
    for threshold, rate in tiers:
        take = min(remaining, threshold)
        total += take * rate
        remaining -= take
        if remaining <= 0:
            break
    if remaining > 0:
        raise ValueError("Quantity exceeds the configured tiers")
    return total

# Tier 1: first 40 units @ $80.00; Tier 2: next 60 units @ $65.00
tiers = [(40, 80.00), (60, 65.00)]
qty_received = 100
correct_accrual = calculate_tiered_accrual(qty_received, tiers)
print(f"Correct accrual: ${correct_accrual:,.2f}")
# Correct accrual: $7,100.00
# Baseline error if model naively calculates 100 * $80 = $8,000.00 (diff: +$900.00)

The system pattern is clear: deterministic code computes the exact $7,100.00 accrual against the contract tier table, while the AI model is restricted to extracting metadata (identifying that GRN-304 links to PO-8810 and that no matching invoice exists in accounts payable). The model outputs a draft proposal; the preparer verifies the receipt quantities; and the accounting manager reviews the journal entry before posting.

4. Controls and failure modes

Segregation of duties is the oldest control in accounting and it still applies. The person who prepares an entry should not approve it, and an AI system is not a second pair of eyes if the same person accepts its suggestions without reading them. Treat the AI as part of the preparer's workflow. A different human approves.

Approvals should be recorded in the system of record with the evidence that supported them. An audit trail for an AI-assisted entry captures the input documents, the proposed entry, the model or rule version, who accepted or changed it, and when. Without that record you cannot answer a reviewer's question about why a number is what it is.

Failure modes to expect: a matcher that clears a pair because the amounts agree while the vendor is wrong; commentary that explains a variance with a confident story the preparer never verified; a threshold tuned on last quarter's data that quietly fails on a new bank's description format; credentials that let an AI integration post directly to the ledger; and a model upgrade that changes behavior without anyone re-testing. Give an AI integration read access to source data and write access only to a proposals queue, and rerun a fixed test set whenever the model or prompt changes. Where financial reporting rules or audit expectations are in play, ask your auditors early what evidence they expect, since requirements differ by jurisdiction and change over time.

Trade-offs when choosing a matching method

No single approach fits every dataset. Deterministic rules are easy to trace but need updates when source formats change; fuzzy matching handles some description variations but can confuse similar names. An LLM can propose interpretations for inconsistent descriptions, but it needs source evidence and a human review path for uncertain cases. Keep the match rationale and source evidence with every approach.

ApproachStrengthLimit to control
Deterministic rulesConsistent, reproducible resultsSensitive to format changes and description variants
Fuzzy matching (Levenshtein, Jaro-Winkler)Reproducible scores; handles some character errorsCan confuse similar vendor names
LLM proposals in a review queueCan interpret descriptions and suggest pairs for reviewNeeds source evidence, logging, and human approval
Automated postingReduces manual stepsRemoves independent review before posting

5. A first close cycle with AI, step by step

Pick one account with high volume and low value per item, such as a main operating bank account. Run the matcher in shadow mode for a full close: it proposes, people reconcile as usual, and you compare. Record agreement rate, false matches and the lines it missed.

In the second close, let the matcher clear only the highest-confidence band, and keep the spot-check on. Log the threshold, the sample size and the errors found. Add the unmatched report as a standing artifact that the controller reads before sign-off.

In the third close, add variance commentary drafts for the five largest variances only, with the number-check from section 2 enforced in code. Measure how many drafts the budget owners edit and why. Add accrual suggestions last, because they carry the most judgment.

Keep a short control document that lists each AI-assisted task, who prepares, who approves, what evidence is stored, and how often the tolerance is re-tested. If you cannot fill in one of those cells, that task stays manual.