Using AI at work

Check AI Claims About a Table or Chart by Recomputing the Numbers

An AI can describe a table fluently while still getting totals, percentages, averages, or changes wrong. This guide uses a tiny synthetic sales table and a Python script to recompute each numerical claim before you reuse it.

Show contents

Who this is forPeople who use an AI chat assistant to summarize tables, charts, reports, or spreadsheet results and need to verify the numerical claims.

What you need
  • Python 3.12
  • Basic understanding of totals, averages, and percentage change

01Why recompute every numerical claim

A chart description can sound reasonable even when one of its numbers is wrong. The risk is higher when the answer mixes several calculations: totals, averages, shares of a total, absolute differences, percentage changes, and statements such as "largest increase." A useful review method is to treat every number in the AI answer as a separate claim and calculate it again from the source data.

Do not verify only the final conclusion. A sentence such as "Q4 was strongest, contributing 32.6% of annual sales after growing 50% from Q1" contains several independent claims. The ranking, share, and growth rate should each be checked separately.

02Start with a small synthetic table

This example is synthetic. Suppose a quarterly sales table contains four values. Keeping the example small makes it possible to verify every result by hand before relying on code.

QuarterSales
Q1100
Q2120
Q3120
Q4150

From these four values, the annual total is 100 + 120 + 120 + 150 = 490. The mean is 490 / 4 = 122.5. Q4 contributes 150 / 490 × 100 = about 30.61% of the total. The change from Q1 to Q4 is 150 - 100 = 50, which is a 50 / 100 × 100 = 50% increase.

03Ask the AI for claims you can audit

Give the AI the table and ask it to state the calculations explicitly rather than requesting only a vague interpretation. For example: "Summarize this quarterly sales table. Report the total, average, Q4 share of the annual total, Q1-to-Q4 percentage change, and the largest quarter-to-quarter increase. Show the numbers used for each claim."

A typical AI answer might say: "Annual sales were 490, with an average of 120 per quarter. Q4 represented 32.6% of annual sales. Sales increased 50% from Q1 to Q4. The largest quarter-to-quarter increase was Q3 to Q4, rising by 30 or 25%."

That answer is intentionally mixed: some claims are correct and some are not. The total of 490 is correct. The stated average of 120 is wrong because the correct average is 122.5. The Q4 share of 32.6% is also wrong; it is about 30.61%. The 50% Q1-to-Q4 increase is correct, as are the Q3-to-Q4 increase of 30 and its 25% relative increase.

04Recompute each claim with Python

The following script stores the same synthetic values, recomputes the relevant metrics, and compares them with the numerical claims from the sample AI answer. It uses only the Python standard library. The script writes a report inside an outputs folder and refuses to replace an existing report.

python
from pathlib import Path

sales = {
    "Q1": 100,
    "Q2": 120,
    "Q3": 120,
    "Q4": 150,
}

ai_claims = {
    "annual_total": 490,
    "quarterly_average": 120,
    "q4_share_percent": 32.6,
    "q1_to_q4_change_percent": 50.0,
    "largest_qoq_absolute_change": 30,
    "largest_qoq_percent_change": 25.0,
}

values = list(sales.values())
quarters = list(sales.keys())

total = sum(values)
average = total / len(values)
q4_share = sales["Q4"] / total * 100
q1_to_q4_change = (sales["Q4"] - sales["Q1"]) / sales["Q1"] * 100

qoq_changes = []
for previous, current in zip(quarters, quarters[1:]):
    old_value = sales[previous]
    new_value = sales[current]
    absolute_change = new_value - old_value
    percent_change = absolute_change / old_value * 100
    qoq_changes.append(
        (previous, current, absolute_change, percent_change)
    )

largest_qoq = max(qoq_changes, key=lambda item: item[2])

recomputed = {
    "annual_total": total,
    "quarterly_average": average,
    "q4_share_percent": q4_share,
    "q1_to_q4_change_percent": q1_to_q4_change,
    "largest_qoq_absolute_change": largest_qoq[2],
    "largest_qoq_percent_change": largest_qoq[3],
}

def close_enough(claim, actual, tolerance=0.05):
    return abs(claim - actual) <= tolerance

lines = []
for name, claim in ai_claims.items():
    actual = recomputed[name]
    status = "PASS" if close_enough(claim, actual) else "FAIL"
    lines.append(
        f"{status}: {name}: AI={claim}, recomputed={actual:.2f}"
    )

lines.append(
    "Largest QoQ interval: "
    f"{largest_qoq[0]} to {largest_qoq[1]}"
)

output_dir = Path("outputs")
output_dir.mkdir(exist_ok=True)
output_file = output_dir / "claims_check.txt"

if output_file.exists():
    raise SystemExit(f"Stop: {output_file} already exists.")

output_file.write_text("\n".join(lines) + "\n", encoding="utf-8")
print(f"Wrote {output_file}")

05Interpret PASS and FAIL carefully

For this example, the total, Q1-to-Q4 percentage change, largest absolute quarter-to-quarter change, and largest relative quarter-to-quarter change should pass. The average and Q4 share should fail. A tolerance is used because a displayed percentage may be rounded, but tolerance should not be used to excuse a materially different result.

ClaimAI valueRecomputed valueResult
Annual total490490PASS
Quarterly average120122.5FAIL
Q4 share32.6%30.61%FAIL
Q1 to Q4 change50%50%PASS
Largest QoQ absolute increase3030PASS
Largest QoQ percent increase25%25%PASS

Also verify the wording around the number. "Increase by 25%" is different from "increase to 25%," and percentage change is different from percentage-point change. A correct arithmetic result can still support an incorrect sentence if the denominator, comparison period, or unit is wrong.

06Checks before reusing an AI summary

  • Match every claimed number to the exact source rows or chart values used to calculate it.
  • Recompute totals and averages instead of assuming they are internally consistent.
  • For a share, confirm both the numerator and the total used as the denominator.
  • For percentage change, confirm the earlier value is the denominator: (new - old) / old × 100.
  • Check whether "largest" means largest absolute change, largest percentage change, or largest final value.
  • Keep units consistent; do not mix counts, currency, percentages, thousands, or millions.
  • Check rounding only after calculating with the original values.
  • Treat qualitative claims such as "rapid growth" or "stable performance" separately from arithmetic claims.

07Common mistakes and limits

A common mistake is checking whether the AI answer looks plausible instead of reconstructing its arithmetic. Another is verifying only one headline number while leaving supporting percentages unchecked. Derived claims can also depend on hidden choices, such as whether an average is weighted, whether missing periods are excluded, or whether a change is measured against the previous period or the first period.

The Python script verifies the calculations that have been explicitly defined, not the meaning of the original business data. It cannot determine whether the table itself is accurate, whether a chart omitted records, or whether the selected metric is appropriate. Those questions require checking the underlying source and context.

For larger tables, the same principle applies: convert each AI statement into a testable calculation, recompute it from the source data, compare the result within an appropriate rounding tolerance, and investigate every mismatch before publishing or forwarding the summary.

Execution and verification record

2026-09-21 · hand-checked example · Python 3.12

  • Hand-checked the synthetic values 100, 120, 120, and 150.
  • Verified annual total: 100 + 120 + 120 + 150 = 490.
  • Verified quarterly average: 490 / 4 = 122.5.
  • Verified Q4 share: 150 / 490 × 100 = 30.612244...%, approximately 30.61%.
  • Verified Q1-to-Q4 change: (150 - 100) / 100 × 100 = 50%.
  • Verified quarter-to-quarter changes: Q1→Q2 = +20 or 20%; Q2→Q3 = 0 or 0%; Q3→Q4 = +30 or 25%.
  • Verified that Q3→Q4 is the largest positive quarter-to-quarter change in both absolute and percentage terms for this example.
  • Checked that the sample AI claims of average 120 and Q4 share 32.6% intentionally disagree with the recomputed values.
Verification limits
  • The Python code was not executed by me; the small synthetic example and expected results were checked by hand.
  • The script checks only the claims encoded in ai_claims and does not automatically extract claims from arbitrary AI prose.
  • The 0.05 comparison tolerance is illustrative and should be adjusted to the precision and rounding rules of the real data.
  • A correct recomputation does not prove that the underlying source table or chart is itself correct.

Site-wide writing and verification principles

References

The explanations and examples were written for this site. See the official sources below for the related behavior and concepts.