- The paper introduces an agent-first canonicalization method that transforms chaotic raw code into a structured, cost-efficient substrate.
- It employs governed canonical profiles, behavior cells, and proof-carrying change objects to compress representation and action spaces markedly.
- Empirical results demonstrate improved learnability and a reduction in verified change costs by 30×–500× in routine software domains.
Canonical Code and the No-Accident Horizon: An Agent-First Compression Theory for Code LLMs
Motivation and Thesis
The paper introduces a high-precision research agenda for reducing the "accidental representation" endemic to human software repositories by transforming raw code corpora into an agent-first canonical substrate. The central thesis is that current code LLMs are not merely learning product behaviors—they are also forced to model and generalize over a chaotic collection of local conventions, duplicated contracts, naming drift, CI folklore, and insufficiently structured repository artifacts. This accidental entropy imposes a fourfold cost: during model training, context gathering, inference/tool use, and human review. The authors propose substrate-level canonicalization, claiming that for routine product domains the all-in cost per verified correct change can be reduced by factors ranging from 30× to 500× compared to current state-of-the-art code models, anchored to measurable outcome denominators.
Human-Code Entropy and Canonical Substrate Design
Human repositories contain valuable operational memory—behavior, incidents, migrations, tests—but are structurally noisy. The canonical code proposal is not a style filter; it is a transformation of the training target:
- Governed canonical profiles: Each software class receives a versioned configuration specifying language role, naming, file grammar, generated boundaries, repository and dependency policy, and proof lanes.
- Behavior cells: Product primitives (CRUD, auth, billing, workflow, migration, audit, jobs, observability) map to reusable, parameterized behavior cells; domain-specific novelty is isolated explicitly.
- Proof-carrying change objects: Every accepted change is expressed not as a raw patch but as a structured object: intent, affected cells, typed diff, schema/migration/security/test delta, proof receipts, rollback plan, and provenance.
By transforming the code archive into this substrate, the action and reasoning spaces experienced by agentic models are directly compressed: fewer legal encodings, more constrained edit grammars, and explicit proof obligations.
The paper formulates the canonicalization process as quotienting software by declared oracles of observable behavior. Rather than learning the full orbit of possible surface implementations (P), the model learns the representative of the behavior-equivalence class under the oracle (P/∼O), accompanied by evidence and a disposition ledger for residual novelty/risk.
This aligns with information-theoretic compression: canonicalization reduces human-code conditional entropy given fixed behavior, contracts, and environment:
Hhuman=H(representation∣behavior,contracts,environment)
The accidental representation tax is quantified as:
ART(y,τ)=log∣Ey,τ∣−log∣Cy,τ∣
where Ey,τ is the set of behavior-equivalent raw encodings and Cy,τ is the canonical subset.
Canonicalization Compression Cascade
The paper describes a compression ladder, starting from raw human code and progressing through canonical profiles, contract-first generation, behavior cells, semantic patch cells, proof lanes, reasoning digests, and constrained edit grammars. The aggregate effect is a theoretical reduction in:
- Effective representation-space: 40×–150×
- Agent action-space: 500×0–500×1
- Reasoning/token space: 500×2–500×3
- Training-token efficiency: 500×4–500×5
- Cost per verified correct change: 500×6–500×7
Each layer is measured separately and cannot be multiplied naively; causal overlap and denominators are explicitly acknowledged.
Empirical Evidence: Learnability and Loss Convergence
The authors present a QLoRA parameter-efficient fine-tuning experiment using Qwen2.5-Coder-14B-Instruct on 64,088 canonically translated agentic coding trajectories. The raw loss curve demonstrates robust learnability and strict adherence to the target profile, with zero forbidden-language markers over all evaluation checkpoints.
Figure 1: Training and validation loss convergence for Qwen2.5-Coder-14B on 64,088 canonical trajectories; loss drops from 2.707/2.261 to 0.419/0.646 respectively, with no forbidden-language markers.
This demonstrates that canonical data is learnable and profile constraints can be reliably enforced under parameter-efficient adaptation, but does not yet prove cost-per-correct-change reduction, behavior preservation, or token-space efficiency against raw human repositories.
No-Accident Horizon: Compression Limit and Planning Regime
The strongest theoretical claim is the existence of the "No-Accident Horizon"—the asymptotic limit, as accidental representation and repeated architecture are quotiented away, of verified change cost reduction achievable by canonicalization.
Figure 2: Reduction curves for all-in verified-change cost, with conservative, central, and aggressive bands converging to 500×8, 500×9, and P0 limits for routine software domains.
This limit is formalized as:
P1
where P2 is the fraction of removable work under supported domain and declared oracle.
- For arbitrary programs: P3 (no compression; distribution-free limit).
- For routine product/software domains: P4; this covers SaaS/web/backend/data, where canonicalization and certified cells absorb the bulk of repetitive behavior.
Verification, Falsification, and Evaluation Protocol
The paper defines explicit falsification criteria for each hypothesis:
- Substrate value: Same-model ablation on paired raw/canonical repositories must yield lower files opened, reasoning tokens, tool calls, invalid edits, and cost per verified correct change.
- Training-token efficiency: Paired scaling curves must demonstrate lower tokens to target accuracy.
- Behavior preservation: Canonical ports must pass graded evidence tiers—tests, traces, migration replay, security negatives, human review.
- Economics: Foundry amortization must be repaid by downstream cost savings.
- Theoretical limit: If the residual floor (P5) for routine product changes exceeds P6, or behavior-cell coverage stalls below P7, aggressive bands must be rejected.
Practical and Theoretical Implications
Practically, canonical code offers a path to lower training budgets for code LLMs, increased serving throughput for dense-active inference, reduced agent sprawl during context and reasoning, and amortizable improvements in software maintenance, security, and review. Theoretically, it reframes code LLM pretraining as learning behavior quotients rather than surface orbits, and establishes information-theoretic and economic limits for agentic software systems.
Future directions include mining software "genomes" (global atlas of behavior cells), establishing behavior IR and typed change algebras, exploiting proof receipts and negative memory, and institutionalizing runtime evidence as first-class evaluation artifacts. Mature foundries should publish corpus and change ledgers for transparent accounting.
Conclusion
This paper develops a falsifiable compression theory for code LLMs, anchored in agent-first canonicalization and quotient learning by declared behavior oracles. Routine product software is shown to admit theoretical reduction in all-in verified-change cost by P8–P9, provided substrate transformation, behavior-cell census, graded evidence, and amortization conditions are met. The proposal is not universal for arbitrary software but is precise for supported domains, and every major claim is tied to measurable outcome denominators and kill-chain validation experiments. The end state is a constrained substrate for software agents, in which novel engineering effort is spent exclusively on irreducible product novelty, evidence, governance, and safety.
(2606.14357)