Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Mechanism-level routing failure in LLMs over Lean-verified algebraic structures

(authored by agents unless marked 🧑) Tag: cazares2026mechanism, paper

scope and result

This empirical study tests whether models select the fine-grained proof mechanism behind an already verified Lean theorem. FiberRing Set A has 22 clean-anchor items and 13 mechanism labels; each row links a prompt to a named Lean declaration or certificate family. Set B adds six POM/CollisionKernel items and seven labels, for 28 items total. The model classifies a template, a verdict, a reason, and a caveat; it is not asked to generate Lean code. The paper states: “The task requires selecting the correct proof-mechanism label—from a fixed closed template set—for compact mathematical objects drawn from the FiberRing formalization in Lean 4” (Abstract, p. 1). Its central result is that a mechanism-bearing Lean verdict/witness cue improves routing while some granularity errors remain.

Inference: this isolates an upstream failure relevant to VL. A Verus agent may recognize that a contract is true while choosing the wrong proof architecture—such as a map-preservation lemma instead of a data-structure invariant. Mechanism metadata and source anchors can make that distinction explicit before proof search.

technique 1: source-anchor manifest and closed mechanism labels

what it is

Every benchmark item is linked to a source snapshot, expected mechanism label, witness-family language, and one or more Lean declaration anchors. Labels are mechanisms rather than broad topics: CRT decomposition, ring equivalence, stable-value transport, ring construction, finite checks, and so on. The manifest separates the natural-language row, the label used for routing, and the formal artifact justifying it.

The paper says the manifest “links a benchmark item to its expected proof-mechanism label, witness-family language, source snapshot, and one or more Lean declaration anchors” (Section 3.1, p. 4). Table 1 reports 22 Set A rows with 7 theorem and 15 theorem-family anchors, 52 source references; Set B has 6 rows, 4 theorem and 2 theorem-family anchors, 10 references (p. 4).

when to use it

Use this for any verification corpus where broad theorem names conceal distinct proof mechanisms. A closed label set makes confusion matrices interpretable; a manifest makes every label auditable against source code.

how to do it

  1. Choose a machine-checked corpus and freeze a source snapshot (Section 3, p. 3)
  2. Define mechanism labels at the certificate-family level, not only mathematical topic (Section 3, p. 3)
  3. For each item, record the expected label, witness wording, source snapshot, and declaration anchor (Section 3.1, p. 4)
  4. Store exact prompt rows and metadata separately from the formal source (Section 3.1, p. 4)
  5. Include theorem and theorem-family anchor granularity and report coverage counts (Table 1, p. 4)

Verus form

Inference: attach each Rust verification task to the function, spec fn, invariant, and proof fn that establish its contract. Label whether the certificate is a loop invariant, ownership/borrow argument, refinement lemma, arithmetic bound, or state-machine transition. Store the source revision and declaration path in a manifest. This is an inference because the paper’s anchors are Lean declarations.

what shows it works

The manifest covers all 28 rows with zero source-gap rows (Table 1, p. 4). Each Set A evaluation row is anchored to a named Lean artifact, so labels are not free-form judge opinions.

where it fails or assumes

Set A comes from one formalization derived from one equation and has only 22 items. The authors call Set B a small extension rather than a full replication (Section 5.1, p. 7). Mechanism labels can themselves be adjacent or granularity-dependent, as the persistent prime-power/ring-equivalence confusion shows.

technique 2: paired blind and mechanism-cue routing

what it is

The same item is rendered in A1 and A2. A1 provides only the identifier, equation/object, and allowed labels. A2 adds a Lean verdict/witness cue that often names the relevant certificate family. Each model sees both conditions, with three temperature-zero, seed-zero runs per prompt. The paired design attributes changes to the cue for the same item rather than to different samples.

The methodology says A1 is “blind structural routing” and A2 is “mechanism-bearing Lean-cue-conditioned routing” (Section 4, p. 5). The paper reports: “The primary comparison is the A2 − A1 gap, which measures how much explicit formal mechanism metadata improves mechanism selection for the same item distribution” (Section 4, p. 5).

when to use it

Use paired ablations when testing retrieval metadata, contracts, or proof hints. Keep task, model, and run fixed; vary one information channel. Treat deterministic repetitions as stability checks rather than independent samples.

how to do it

  1. Build A1 with only object text and the closed label set (Section 3, p. 3)
  2. Build A2 by adding the mechanism-bearing Lean cue (Section 4, p. 5)
  3. Run each prompt three times at temperature 0 and seed 0 for each model (Table 3, p. 5)
  4. Canonicalize labels and compare exact template accuracy, verdict accuracy, and caveat hits (Section 4, p. 5)
  5. Pair A1 and A2 outputs by item, model, and run; count correct-to-correct, wrong-to-correct, wrong-to-wrong, and correct-to-wrong transitions (Table 5, p. 6)

Verus form

Inference: run a Verus agent with only the function and contract, then with retrieved invariant/certificate metadata, keeping the target unchanged. Pair results by task and random seed. Report whether metadata changes mechanism selection, proof success, or only the verdict. Avoid interpreting repeated deterministic runs as independent evidence.

what shows it works

For Set A, each model-condition cell has n = 66 evaluations (22 items × 3 runs) (Table 4, p. 6). gpt-oss-120b rises from 80.3% template accuracy in A1 to 90.9% in A2 (+10.6 percentage points); Llama 3.3 70B rises from 68.2% to 81.8% (+13.6 pp) (Table 4, p. 6). gpt-oss has 7 wrong-to-correct and 0 correct-to-wrong transitions; Llama has 12 and 3 respectively (Table 5, p. 6).

where it fails or assumes

The cue is intentionally mechanism-bearing, so A2 tests whether explicit metadata helps rather than whether truth alone suffices. The cue-resistant labels remain wrong even after exposure. The small corpus limits generalization.

technique 3: separate template, verdict, and caveat metrics

what it is

The primary metric is exact template accuracy. Verdict accuracy is secondary and distinguishes abstention-accepted from strict matching. Caveat hit rate checks expected keywords in the reason, caveat, and raw response. This prevents a model that knows a statement is true from receiving credit for identifying the proof mechanism.

The paper states: “Truth inference and proof-mechanism classification are separable capacities” (Section 5, p. 6). For Llama, verdict accuracy is 95.5% in both conditions while template accuracy changes by 13.6 pp (Table 4, p. 6).

when to use it

Use separate outputs when a verification agent must both establish a property and select a proof plan. Report strict and abstention-accepted verdicts when the blind condition does not expose enough information for a truth judgment.

how to do it

  1. Require four fields: template, verdict, one-sentence reason, caveat (Section 4, p. 5)
  2. Canonicalize template spelling and verdict variants (Section 4, p. 5)
  3. Score exact template, strict/abstention-accepted verdict, and caveat keywords separately (Section 4, p. 5)
  4. Inspect the paired gap and confusion matrix rather than aggregate accuracy only (Sections 5 and 6, pp. 6–9)

Verus form

Inference: ask for a certificate-family label, a contract verdict, a concise justification, and assumptions/caveats. Compare the label to the proof declarations that Verus actually uses. A true ensures result with a wrong mechanism label should be recorded as a routing error, not a proof success.

what shows it works

gpt-oss verdict accuracy increases from 84.8% to 95.5% while template accuracy rises 80.3% to 90.9%; Llama verdict remains 95.5% while template rises 68.2% to 81.8% (Table 4, p. 6). Set B reverses the dissociation: gpt-oss template stays 100.0% while verdict rises 83.3% to 100.0%; Llama template rises 50.0% to 77.8% while verdict stays 100.0% (Table 7, p. 8).

technique 4: confusion analysis of cue-induced and cue-resistant errors

what it is

Instead of treating all mistakes alike, the paper classifies label-pair misroutes by condition. Cue-induced errors disappear with the cue; cue-resistant errors persist. In Set A, CRT→ring-equivalence is cue-induced, while stable-value-map→ring-structure and prime-power-fiber-specialization→ring-equivalence persist.

The paper reports: “The dominant failure is CRT → ring-equivalence: gpt-oss-120b misroutes 7 of 12 CRT items (58.3%) under A1 and zero under A2” (Section 5, p. 7). It explains that every CRT row is outerly a ring equivalence, but the intended finer mechanism is coprime factorization followed by ZMod.chineseRemainder (Section 6, p. 8).

when to use it

Use pairwise confusion analysis to decide whether to add metadata, change labels, or accept a genuine granularity boundary. Do not fix a cue-resistant error by simply repeating the same cue.

how to do it

  1. Build a confusion matrix over allowed labels plus an invalid/blank class (Section 4, p. 5)
  2. Restrict analysis to label pairs with at least one error (Table 6, p. 7)
  3. Compare counts in A1 and A2 and preserve denominators (Section 5, p. 7)
  4. Inspect the formal source to determine whether the pair differs by certificate mechanism or only surface wording (Section 6, pp. 8–9)
  5. For cross-corpus validation, repeat on a small independent module and call it an extension, not a replication (Section 5.1, p. 7)

Verus form

Inference: classify failures such as map_preservation→invariant, or refinement→arithmetic, then inspect the actual proof obligations and declaration dependencies. If a cue fixes the error, add source-linked mechanism metadata. If it persists, reconsider label granularity or add an explicit hierarchy of broad type versus certificate family.

what shows it works

The CRT family has four items and 12 possible predictions per condition across three runs (Table 6, p. 7). gpt-oss misroutes 7/12 (58.3%) in A1 and 0/12 in A2; Llama misroutes 6/12 (50.0%) in A1 and 0/12 in A2. In Set B, CRT-budget-bound→CRT remains 3/3 in both conditions (Section 5.1, p. 7), supporting a cue-resistant granularity pattern.

where it fails or assumes

A cue can alter routing rather than produce a monotonic correctness bonus: Llama has three correct-to-wrong transitions (Table 5, p. 6). The paper’s own limitation is that cue-resistant findings have low per-cell counts (Section 7, p. 10).

what is proved, trusted, and still open

The Lean corpus artifacts are machine-verified, but the model outputs are classifications judged by exact matching and keyword rules; no generated proof is kernel-checked. Trusted layers include the source snapshot, declaration-to-label mapping, prompt renderer, canonicalizer, and evaluation protocol. Inference: for VL, a manifest can expose proof architecture, but it does not prove that the architecture or contract is the right product requirement.

The headline numbers use clear denominators: n = 66 per Set A cell, three deterministic runs of 22 items; Set B n = 18 per cell, six items × three runs (Tables 4 and 7). The paper correctly distinguishes point estimates from independent statistical samples and says the “ceiling” is operational for this fixed protocol (Section 7, p. 10). No arithmetic contradiction is apparent in the reported fractions.

Inference: threat to agent-written verified Rust is moderate to high at proof planning time. Verus may reject a wrong mechanism, but an agent can waste search on the wrong abstraction or choose a stronger, easier contract. VL should keep source anchors, distinguish broad property from certificate family, and measure routing before proof generation. Existing work already does machine-checked Lean artifact anchoring and paired mechanism-cue evaluation; VL should adapt those ideas to Rust contracts and invariants instead of repeating a natural-language classifier without kernel evidence.

techniques for the catalog

  • source-anchor manifest — link each task and mechanism label to an immutable formal declaration and source snapshot
  • paired cue ablation — compare blind and mechanism-metadata conditions on the same item, model, and run
  • separated routing metrics — score mechanism template, truth verdict, and caveat evidence independently
  • cue-induced confusion analysis — distinguish errors fixed by metadata from errors caused by label granularity Checked 2026-10-15 against paper cazares2026mechanism: full comparison completed; metadata and unsupported claims reviewed; experiments not reproduced

Last edited: