Dataset Viewer
Auto-converted to Parquet Duplicate
arm
string
seed
int64
time_s
int64
loss_brl
string
n_calls
int64
n_findings
int64
tp
int64
fp
int64
fn
int64
qwen3-8b-base
201
617
14322.70
60
3
1
2
1
qwen3-8b-base
202
647
15084.48
60
53
1
52
1
qwen3-8b-base
203
1,689
25008.96
60
0
0
0
2
qwen3-8b-base
204
579
1766.89
60
0
0
0
2
qwen3-8b-base
205
579
865.79
60
0
0
0
2

malha-benchmark — accounting agents priced in statutory fines

What does an accounting agent cost when it's wrong? Not pass/fail — money. malha generates a synthetic Brazilian company's complete fiscal year, injects defects from a frozen 15-class taxonomy, and prices an agent's audit in the fines the law actually charges (Lei 8.218/1991, art. 12). The oracle verifies audits by recomputation from artifacts — it never reads the answer key — and the pilot gate held 100% agreement with injected truth across all 15 defect classes.

This dataset is the measured 30-world pool of the C2 capability study: worlds, taxonomy, oracle, and both complete result tables.

Paper: Priced, not passed: what accounting agents actually lose in a SPED-native audit environment (November 2026). PDF and everything behind every number: github.com/caiotheodoro/malha — pre-registered at tag prereg-v1, decision log D012–D024.

What's inside

worlds/seed2NN/            one directory per world (seeds 201–230):
  ecd.txt                  ECD filing — Escrituração Contábil Digital
  efd_contrib.txt          EFD-Contribuições filing
  postings.jsonl           double-entry journal
  docs/nfe/*.xml           NF-e XML documents
  truth/, defects.json     injected defects with citations anchors
taxonomy.json              the frozen 15-class defect taxonomy
rollout_c2_h2_k3_30.json   gemini-hydrogen, 30 worlds × 3 episodes
rollout_c2_ds_k3_30_merged.json  deepseek-v4-pro, 30 × 3
qwen_eval_base_rows.json, qwen_sft_probe.json   8B-model evidence

Each world draws one substantive and one engine-detectable defect in mixed rotation. Substantive classes (personal expenses in the business, cutoff violations, chart-of-accounts gaps, unrecorded NF-e) require judging plausibility and intent — they are invisible to deterministic rules by construction. Engine-detectable classes (duplicated postings, control-total forgery, unbalanced entries, XML/filing inconsistency) are what rules engines catch for free.

The measured results

Headline table — neutral enforcement, P(autuação) = 0.15

arm mean loss (BRL/ep) margin vs malha_rules [95% CI]
flag_everything (floor) 28,110.42 —
file_as_is (no audit) 24,360.42 —
deepseek-v4-pro 13,954.81 +4,815.08 [+1,333.23, +8,815.25] — worse, separated
gemini-hydrogen 12,331.06 +3,191.33 [−1,532.25, +8,326.65] — not separated
malha_rules (deterministic engine) 9,139.73 —

Both agents beat both floors decisively — the capability is real. Neither beats the deterministic incumbent, and deepseek is the first cleanly separated priced result of an agent losing to a rules engine on its own task. Intervals are paired bootstrap over worlds — the world, not the episode, is the unit of randomness.

The verdict is a regime map, not a boolean

Re-scored under three enforcement regimes (P(autuação) = probability the Receita audits — a declared judgment parameter, not a fact):

P(autuação) hydrogen vs rules deepseek vs rules
0.05 conservative +5,086.80 [+1,107.09, +9,729.39] worse, separated +5,417.32 [+2,442.37, +8,927.65] worse, separated
0.15 neutral +2,682.31 [−2,043.76, +7,901.51] +4,439.02 [+1,218.89, +8,132.84] worse, separated
0.40 aggressive −3,328.92 [−10,909.89, +4,230.98] ahead, not separated +1,993.27 [−2,981.44, +6,965.46]

Under weak enforcement agents are decisively worse; under aggressive enforcement hydrogen's real substantive capability increasingly compensates its misses and the sign flips. Which arm to deploy depends on how much you believe the Receita audits.

The class-conditional slice — the paper's central finding

arm recall, substantive recall, engine-detectable fp cost over 90 eps
gemini-hydrogen 0.578 0.578 R$0.00
deepseek-v4-pro 0.289 0.533 R$66.67
malha_rules 0.0 (by construction) ~1.0 ~0

Hydrogen recalls 57.8% of judgment defects the engine definitionally cannot catch — measured, real capability. But its recall on engine-detectable defects is the same 0.578: it drops, at exactly the rate it drops judgment defects, balls the engine catches for free. The failure is non-selective reliability, not absence of judgment — which is why the data points at engine-as-tool inside the agent loop rather than agent-instead-of-engine.

Failure modes have geometry

Four model families, four geometrically distinct failure shapes, invisible to binary scoring:

family geometry example
flash stochastic whiff-or-solve seed 103: [74.3k, 0, 41.1k] — a coin flip per episode
pro precision collapse precision 0.3–0.5; the expensive direction of error
hydrogen deterministic per-class blindness misses identical [X,X,X] across all 3 episodes of a world
deepseek bimodal engagement seed 201: [0, 0, 55.8k] — precision intact when engaged

The training negative (why the traces and adapter exist)

The companion repos document a measured dead end, published with mechanism: SFT on 80 verified traces trains cleanly (loss 0.390) then flags zero findings on every eval seed — the probe shows perfectly parseable tool syntax collapsed into 58/60 identical modal actions. GRPO cannot start: within-group outcome variance is exactly zero across seeds, initializations, and temperatures. Imitation destroyed the variance the base model had.

Usage

from huggingface_hub import snapshot_download
snapshot_download("caiotheodoro/malha-benchmark", repo_type="dataset")
# worlds regenerate byte-identically from the repo: same seed, same world

The verifier, loss model, agent harness, and all analysis scripts are in the repository: uv sync --extra dev && uv run pytest is green end-to-end.

Provenance, ethics, license

  • Hypotheses frozen before measurement (tag prereg-v1); post-freeze interpretations are dated entries in DECISIONS.md — both negative branches were written before the race.
  • All companies, counterparties, and CNPJs are synthetic; CNPJs pass check-digit validation and are verifiably unassigned.
  • Vendor model names are codenames for dated versions; measurement dates are in the decision log.
  • License: MIT (data); code Apache-2.0; paper CC BY 4.0.

Citation

@misc{theodoro2026malha,
  author = {Theodoro, Caio},
  title = {Priced, not passed: what accounting agents actually lose in a
           SPED-native audit environment},
  year = {2026},
  howpublished = {\url{https://github.com/caiotheodoro/malha}}
}
Downloads last month
-

Collection including caiotheodoro/malha-benchmark