Technical White Paper · 2026-11-26 · Reproducible Benchmarks

The Trust Layer for AI Data Analysis.

LLMs are great at writing SQL and Python — until a silent many-to-many join doubles revenue, an unweighted average hides Simpson’s paradox, or a broken 54/46 A/B test gets shipped as a win. We built a local, deterministic DuckDB + statistical verification layer inside TinyPivot MCP and tested it across four models from a Mac-local small model to frontier Claude Sonnet.

75% → 96%Combined accuracy across 4 models & 6 hard DS traps
33% → 83%Small Mac-local model (Inkling 2 Mini) lifted +50 pts
−40.4% costClaude Sonnet Pro ($0.54) beat vanilla Python ($0.57) & Free ($0.91)
−47% tokensRecursive Data Memory on repeat schema inquiries

01 · The Problem

Why agents get numbers silently wrong.

Most AI analytics tools focus on generating prettier charts faster. That misses the real reason data leaders still rebuild AI output in Excel before a board meeting: silent analytical failure. A query that throws a syntax error is harmless — the model fixes it in one retry. A query that runs cleanly in 12 ms while silently multiplying revenue by 2.1×, dropping 40% of NULL rows on !=, or celebrating a p-hacked A/B segment is dangerous because the LLM presents it with complete confidence.

Existing tools split into three incomplete worlds: cloud notebooks (upload sensitive files, no runtime statistical oracle), heavy enterprise semantic layers (weeks of YAML modeling + cloud warehouse), and raw database MCP servers (read-only security checks only, zero analytical or statistical guardrails).

02 · Empirical Proof (4 Models × 3 Arms)

Higher accuracy and fewer tokens.

We first tested simple single-table SQL traps — and threw them out because modern 2026 models already ace textbook SQL. Instead, we built six enterprise-scale (2,000 to 20,000 row) Data Science and multi-table BI traps with exact mathematical ground-truth oracles, then ran every model head-to-head across Baseline (bare-sql or Python/Bash), TinyPivot Free, and TinyPivot Pro.

Hard 6-Task Data Science & BI Trap Benchmark · 2026-11-26 · Local & Frontier Models
Model Baseline TinyPivot Free TinyPivot Pro Measured Pro Lift
Inkling 2 Mini (fast)Small local (Mac) · vs Bare DuckDB SQL2/6 (33%)7.7 turns2/6 (33%)7.7 turns · 301.5k tok5/6 (83%)6.7 turns · 297.9k tok+50 pts accuracy (matches Sonnet on Python)
DeepSeek V4.1 Flash 1017Local cluster (DGX Spark) · vs Bare DuckDB SQL5/6 (83%)6.5 turns5/6 (83%)6.7 turns · 272.6k tok6/6 (100%)6.5 turns · 234.1k tok+17 pts · −14.1% tokens vs Free
Claude Haiku 4.5Fast cloud · vs Python / Bash6/6 (100%)681k tok · $0.03796/6 (100%)1,192k tok · $0.06736/6 (100%)1,064k tok · $0.0476−29.3% cost vs Free (beats Python on 3/6 tasks)
Claude SonnetFrontier cloud · vs Python / Bash5/6 (83%)505k tok · $0.56776/6 (100%)968k tok · $0.90726/6 (100%)748k tok · $0.5407100% vs 83% · cheaper than Python (−40.4% vs Free)
Combined (24 tasks/arm) 18/24 (75%)19/24 (79%)23/24 (96%) +21 pts vs baseline · fewer tokens than Free on all 4 models
Six enterprise-scale traps (SRM + 12-segment p-hacking, confounded OLS reversal, right-censored cohorts, seasonal structural break, 3-table chasm trap, Kitagawa mix-vs-rate). Local models tested in fast non-thinking mode against bare DuckDB SQL; cloud models tested in headless Claude Code against Python/Bash.

1. Small local models jump +50 points

On a local Mac model (Inkling 2 Mini, fast non-thinking mode), accuracy jumped from 2/6 (33%) on bare SQL and Free to 5/6 (83%) on Pro — matching frontier Claude Sonnet running vanilla Python/Bash. On the confounded-discount task, both bare SQL and Free failed after 9 turns while Pro solved it in 5 turns (29s, −46% tokens vs. Free).

2. Frontier Sonnet beats Python on accuracy & cost

Normally, verification layers add turns and cost. On Claude Sonnet, TinyPivot Pro achieved 6/6 (100%) vs. 5/6 (83%) for vanilla Python/Bash while costing $0.5407 vs. $0.5677 (−4.8% cheaper than Python, −40.4% cheaper than Free). Adding zero-param column auto-inference to analyze alone cut Sonnet Pro tokens by 26%.

3. DeepSeek V4.1 hits 100% with −41% tokens on A/B

On a local DGX Spark cluster (DeepSeek V4.1 Flash 1017), Pro lifted accuracy from 83% → 100% and cut total tokens −14.1% vs. Free. On the broken A/B test, Pro solved it in 3 turns / 14.5k tokens / 18.2s — −41% fewer tokens and 60% faster than bare DuckDB SQL.

4. Recursive Data Memory compounds over time

Every time an [AUDIT] warning catches a trap or a human edits SQL in TinyPivot Studio, a compact schema-fingerprinted lesson is stored locally. On repeat inquiries against the same schema, Inkling 2 Mini dropped from 6 turns / 32.5k tokens (Free) to 4 turns / 22.7k (Pro cold) to 3 turns / 17.1k tokens (−47%) with Recursive Memory warm.

03 · The Six Hard Traps

What we tested under the hood.

01 · Broken A/B Test (SRM + P-Hacking)

Trap: 12-segment experiment with a broken 54/46 traffic split (χ² = 76.8, p < 10⁻¹⁷) and one noisy segment at raw p = 0.021.

Typical LLM failure: Models celebrate a fake segment winner and recommend shipping on broken randomization.

TinyPivot guardrail: analyze(ab_test) runs automatic SRM χ² + Holm-Bonferroni correction across all 12 segments on Turn 1.

02 · Confounded Discount Causal Reversal

Trap: 2,000 accounts where discounts target at-risk accounts: naive SQL shows discounts hurt renewal by −19.1 pp, while true controlled lift is +8.0 pp.

Typical LLM failure: Small/fast models take the naive −19 pp difference at face value and tell leadership to kill discounts.

TinyPivot guardrail: analyze(regression) fits controlled OLS, compares naive vs. controlled slope, and flags CONFOUNDING / SIGN REVERSAL.

03 · Right-Censored Cohort Retention

Trap: 6 monthly cohorts where the 3 newest cohorts have not existed 3 months yet; true matured M3 retention is flat at 40.4%.

Typical LLM failure: Naive SQL averages 0% / partial trailing cells into M3 and alarms on a fake retention collapse.

TinyPivot guardrail: analyze(cohort_retention) masks immature cells as null and averages matured cohorts only.

04 · Hidden Structural Break in Seasonality

Trap: 90 days of daily orders with a 62% weekend drop hiding a permanent −16.5% regime shift starting 2026-02-18.

Typical LLM failure: Weekday/weekend variance swamps simple min/max or rolling checks, missing the exact start date.

TinyPivot guardrail: analyze(anomalies) strips day-of-week seasonality, runs MAD z-scores, and scans every split date for a Welch t-stat break.

05 · 3-Table Multi-Fact Chasm Trap

Trap: Joining accounts + orders + support_tickets directly multiplies both revenue and ticket counts 6×–8×.

Typical LLM failure: Standard 3-way SQL silently explodes totals without throwing an error.

TinyPivot guardrail: Pro [AUDIT] probes joined key uniqueness in DuckDB and flags join fan-out before the model answers.

06 · Simpson’s Paradox (Kitagawa Mix vs. Rate)

Trap: 18,000 funnel rows where blended conversion fell −1.99 pp even though both segments improved (+0.52 pp rate effect vs. −2.51 pp mix shift).

Typical LLM failure: Models either miss the exact pp attribution or misattribute the drop to segment performance.

TinyPivot guardrail: analyze(explain_change) computes exact Kitagawa mix-vs-rate decomposition and flags Simpson’s paradox.

04 · Architecture

Neuro-symbolic analytics in under 2,500 schema tokens.

TinyPivot stays fast and local by pairing an LLM’s reasoning with deterministic DuckDB & TypeScript verification — keeping raw rows off the wire and out of context.

  1. 01

    Silent-When-Clean SQL Audit Oracle

    Runs lightweight DuckDB probes (~5–15 ms) after each query. Completely silent when SQL is clean; emits actionable [AUDIT] blocks with exact corrected metrics (daily run-rates, excluded NULL totals, top outlier IDs, fan-out multipliers) only when a real BI trap triggers.

  2. 02

    Zero-Param 1-Call Data Science Shelf

    Exposes five deterministic statistical engines through a single compact MCP tool (analyze) so tool schemas stay under 2,500 tokens. Auto-infers columns and aliases — cutting Claude Sonnet Pro tokens by 26% in a single Auto-Research iteration.

  3. 03

    Recursive Data Memory (100% Local)

    Every [AUDIT] catch and every human SQL edit in TinyPivot Studio is saved locally by schema fingerprint (~/.local/share/tinypivot/memory.json). On repeat inquiries, TinyPivot recalls a ~40-token brief on Turn 1 — cutting Inkling 2 Mini join-trap tokens by 47% (6 → 3 turns).

  4. 04

    Proof-of-Work Studio & Lineage

    Every chart and pivot links back to editable SQL (with lossless revision history), clickable Underlying Source Rows, order-independent SHA-256 Data Hashes, claim-checked prose, and zero-CDN Offline HTML Notebooks.

05 · Why Free Now Has Unlimited Local Rows

Never truncate a trust tool.

Previously, TinyPivot Free capped datasets at 2,500 rows. That cap worked against our core promise: an analyst evaluating a trust layer on a 15,000-row CSV should never see partial totals. Starting today, TinyPivot Free includes unlimited local rows (up to DuckDB’s safe memory cap), charts, pivots, DuckDB SQL, Studio IDE + Proof-of-Work Lineage, basic SQL guardrails, offline HTML export, and analyze(explain_change, ab_test).

TinyPivot Pro gates the enterprise trust & data science engine: deep relational and statistical audits (join fan-out, chasm traps, partial trailing periods, silent NULL drops, extreme outliers), the full analyze shelf (SRM + Holm-Bonferroni, controlled multivariate regression, right-censored cohorts, seasonal change-points), Recursive Data Memory, closed-loop claim verification, editorial themes, white-label HTML & Excel exports, and direct PostgreSQL.

Try TinyPivot MCP free · unlimited local rows10s setup
npx @smallwebco/tinypivot-mcp@latest init

Detects Claude Code, Claude Desktop, Cursor, Antigravity, OpenCode, Codex and pi.