← All articles
Spring Merchant / Blog

Why AI Keeps Generating Your Documents Wrong (And How to Fix It)

An accounting firm with more than 50 employees recently shared a frustrating experience on X. They wanted AI to generate financial statements, engagement letters, workpapers and presentations that followed their existing formatting standards:

  • Display whole dollars without cents.
  • Bold specific sections.
  • Apply consistent table borders.
  • Maintain a standard document structure.
  • Keep single-page reports on a single page.

Despite extensive instructions, reference documents, custom AI skills and multiple agents, something was always slightly wrong. One report included cents. Another had unexpected bold text. A spreadsheet was missing a border. A single-page document spilled onto a second page.

Their question was simple:

How are you getting AI to give you the exact same format every single time?

It exposes a fundamental flaw in how many businesses implement AI.

The problem with asking AI to follow a template

Imagine asking an employee to recreate a monthly financial report from scratch every month using only a style guide instead of giving them an Excel workbook with predefined formulas, headers and formatting.

Most businesses take the first approach with AI. Every time you ask a language model to interpret formatting rules and reconstruct a document from scratch, you introduce variation. Longer prompts help, but they don't fix the underlying process.

Use deterministic software where consistency matters

One word came up repeatedly in the X thread: deterministic.

Deterministic software produces the exact same output for the same inputs every time. Instead of reminding an AI in every prompt to format currency in whole US dollars with thousands separators, a few lines of code enforce $1,234,568 automatically. No reminders, no examples and no second agent required.

A better architecture for AI-generated documents

At Spring Merchant, we solve this by separating responsibilities. AI handles interpretation and language; traditional software handles calculations, formatting and enforceable business rules.

How a report moves from source data to approval

  1. AI reads the source documents and returns the findings as structured JSON.
  2. Code applies your business rules and calculates the figures.
  3. Code fills the approved document template.
  4. Code validates the finished report. If it passes, it goes for approval. If it fails, the issue is corrected or routed to a reviewer.

Here is how the four steps work in practice:

1. Ask AI for structured data

Instead of generating a finished report, AI analyzes supporting material and returns structured JSON validated against a strict schema.

01 / AI output

Structured data

{
  "client": "Acme Industries",
  "period": "November 2026",
  "revenue": 1250000,
  "expenses": 875000
}

02 / Template output

Monthly financial report

Acme Industries · November 2026

Revenue $1,250,000
Expenses $875,000
Net income $375,000

The AI doesn't need to know your fonts, logo placement or column widths: only what content is required and how long it can be.

2. Move calculations into code

Financial math, rounding policies and reconciliations belong in tested code, not prompts. AI can explain the numbers and flag anomalies, while every figure remains accurate and auditable back to its source data.

3. Build reusable templates once

Populate approved templates programmatically:

  • Excel: openpyxl or predefined workbooks
  • Word: docxtpl
  • PowerPoint: python-pptx with slide masters
  • PDFs & Reports: HTML and CSS rendered to PDF

When branding or reporting standards change, update the template once and every future document inherits it automatically.

4. Validate the finished document

Even strong templates can break when an executive summary runs long or a client name overflows. Automated checks verify reconciled totals, currency formatting, unresolved placeholders and page counts before anyone sees the file.

If a one-page report spills onto page two, the system can automatically ask the AI for a tighter summary and re-render or flag it for human review without ever silently dropping required figures.

Would a second AI agent fix it?

A review agent is useful for subjective checks like unclear language, inconsistent terminology or unsupported conclusions. It is the wrong tool for checking cell borders, font sizes or decimal places.

A useful rule of thumb: If a conventional program can test the requirement, let code handle it.

This extends beyond accounting

Consider a Shopify or BigCommerce merchant receiving wholesale orders through emails, PDFs and spreadsheets.

  • Use AI to: read customer emails, extract requested items and draft personalized responses.
  • Use traditional software to: match SKUs against your catalog, apply customer pricing and discounts, check inventory, calculate tax and generate the quote PDF.

The same split works for purchase orders, supplier onboarding, product catalogs and monthly reporting.

Start with one document

Small formatting errors add up quickly. If 50 employees spend just five minutes a day fixing AI-generated documents, that adds up to over 1,000 hours a year roughly $52,000 annually at $50/hour.

Start with one frequently produced document. Collect approved examples, separate what changes from what stays constant, build the template and tests, and expand once it proves reliable.

Don't expect generative AI to behave like deterministic software. Let AI interpret and draft, and let software enforce the rules your business depends on.

If your employees are repeatedly correcting the same AI mistake, you've probably identified a business rule worth automating.


Are your employees spending too much time correcting AI-generated work?

Spring Merchant builds custom AI integrations, document generation systems and business automation software that connect with your existing applications.

If you've experimented with AI and are struggling to make it reliable enough for everyday operations, let's talk.

AI Workflows AI Automation
← Back to the blog