ContractRL: Shielded Group-Relative Policy Optimization for Auditable Tool-Call Repair
Organizations: School of Artificial Intelligence, University of Chinese Academy of Sciences, Beijing, China · Institute of Information Engineering, Chinese Academy of Sciences, Beijing, China
Abstract
Structured tool calls often fail after only a small number of fields violate a schema or an execution contract. Regenerating the complete object enlarges the action surface and makes repeated repair difficult to audit. We introduce ContractRL, a contract-constrained sequential repair protocol that models verifier-guided JSON repair as a bounded decision process. At each step the policy observes the candidate, typed verifier feedback, JSON Pointer, immutable repair history, and remaining budget; a contract-derived action mask filters malformed or prohibited RFC-6902 operations before a deterministic validator performs the transition. We specify a contract-constrained group-relative objective for patch, retry, and abstention decisions while keeping canonical targets and semantic labels outside the online state until trace freeze. Under identical verifier information, ContractRL attains 0.9362 semantic success with 34.4 generated tokens, compared with 0.9076 and 44.9 tokens for Patch-SFT and 0.9148 and 137.2 tokens for full regeneration over 192 cases per seed and five seeds. Policy optimization improves semantic success from 0.9186 for supervised ContractRL to 0.9375. A separate three-seed paired evaluation against Patch-SFT yields a semantic difference of +0.0396 (95% CI ). Feedback, action-mask, budget, and schema-shift analyses connect these gains to localized correction, while adversarial and multi-turn evaluations characterize the remaining failure modes.
Figures & tables
| Evidence unit | Cases / seeds | Schema valid | Object match | Attempts |
|---|---|---|---|---|
| BFCL mechanism replay | 64 | 1.0000 | 1.0000 | 1.00 |
| 2B rank-8, validation block | 64/4 | 0.9727 | 0.9141 | 1.00 |
| 2B rank-8, context-only | 64/4 | 0.0820 | 0.0742 | 1.00 |
| 0.8B rank-4, validation block | 64/8 | 0.9473 | 0.7441 | 1.00 |
| 0.8B rank-4, context-only | 64/8 | 0.0000 | 0.0000 | 1.00 |
| Arm | Output representation | Semantic success | Output tokens | p95 latency (s) | Collateral edits |
|---|---|---|---|---|---|
| Full regeneration | complete object | 0.9148 | 137.2 | 2.54 | 0.1876 |
| Constrained decoding | Constrained object | 0.8879 | 146.1 | 2.80 | 0.1743 |
| Patch-SFT | Bounded patch | 0.9076 | 44.9 | 1.49 | 0.0488 |
| ContractRL | Masked patch / abstain | 0.9362 | 34.4 | 1.30 | 0.0169 |
| Arm | Split | Seeds | Schema valid | Semantic success | Mean retries | Output tokens | Mean latency (s) | Collateral edits |
|---|---|---|---|---|---|---|---|---|
| ContractRL | held-out | 3 | 0.9768 | 0.9314 | 0.0547 | 34.6 | 0.83 | 0.0189 |
| full regeneration | held-out | 3 | 0.9392 | 0.9027 | 0.0000 | 138.9 | 1.76 | 0.2214 |
| constrained decoding | held-out | 3 | 0.9901 | 0.8663 | 0.0000 | 147.8 | 2.11 | 0.1986 |
| Patch-SFT | held-out | 3 | 0.9446 | 0.8918 | 0.1176 | 46.7 | 0.97 | 0.0618 |
| ContractRL | nested-array | 3 | 0.9187 | 0.8516 | 0.1239 | 42.9 | 1.04 | 0.0297 |
Appendix figures & tables42 assets
Supplementary material from the paper’s appendix.
Appendix
| Stage | Recorded operation | Target visible? |
|---|---|---|
| Observe | Read the corrupted call and typed verifier code plus the reported JSON Pointer. | no |
| Patch | Emit a bounded JSON Patch operation list and apply it to the current object. | no |
| Validate | Run schema and cross-field checks; return typed errors on failure. | no |
| Retry | Spend the next of at most two patch attempts, preserving prior patches and validator responses. | no |
| Freeze | Hash the ordered patch ledger, attempt count, additional-retry count, and collateral fields. | no |
| Score | Join the canonical patch and object and compute their distinct equalities. | post-hoc |
| Evaluation | Population | Outcome |
|---|---|---|
| Structural replay | 64 cases | 64/64 final validity with one precomputed operation per case; 32 add and 32 replace operations. |
| Adapter evaluation | 64 cases; 4 or 8 seeds | 2B: 0.9727 schema validity and 0.9141 object match. 0.8B: 0.9473 and 0.7441. |
| Context-only control | Same adapter cases | 2B: 0.0820 validity and 0.0742 object match. 0.8B: both 0.0000. |
| Transaction audit | 9 cases; 8 repairable | 7/9 final validity and 6/8 accepted repairs, with rollback, wrong-path, and immutable-field checks. |
| Case-matched policies | 3 seeds | ContractRL: 0.9314 semantic success, 34.6 output tokens, and 1.30 s p95 latency. |
| Public-information control | 192 cases per seed; 5 seeds | ContractRL: 0.9362 semantic success versus 0.9076 for Patch-SFT and 0.9148 for full regeneration. |
| Field | Stage | Audit rule |
|---|---|---|
| case identifier | split | unique within a manifest and disjoint across train/evaluation |
| public evidence | online | candidate, schema, pointer, and typed feedback only |
| patch ledger | repair | ordered operations, validator status, and retry count are append-only |
| semantic trace | execution | dispatched accepted object, tool outcome, and side-effect record |
| resource ledger | aggregation | I/O tokens, calls, retries, latency, and seed |
| result join | scoring | canonical object and task label are joined after trace freeze |
| Arm | Input | Output budget | Online feedback | Recorded cost |
|---|---|---|---|---|
| full regeneration | corrupted call + schema | complete object | none | I/O tokens, latency |
| constrained decoding | corrupted call + grammar | complete object | none | I/O tokens, latency |
| Patch-SFT | corrupted call + typed error | patch, max two ops | validator report | I/O, retries, latency |
| ContractRL | same public block | patch, max two ops | typed ledger | all above plus collateral edits |
| Check | Training | Held-out | Result |
|---|---|---|---|
| case ID overlap | 426 IDs | 64 IDs | 0 exact overlaps |
| candidate fingerprint | 426 hashes | 64 hashes | 0 exact overlaps |
| schema hash | 147 hashes | 26 hashes | 0 exact overlaps |
| pointer/error template | 392 templates | 61 templates | 0 exact overlaps |
| tool-name disjointness | 118 names | 23 names | 0 overlapping names |
| Scenario | Arm | Schema valid | Semantic success | Mean retries | Latency (s) |
|---|---|---|---|---|---|
| single-field | all | 0.9674 | 0.9128 | 0.0509 | 1.81 |
| multi-field | all | 0.8497 | 0.7892 | 0.1698 | 2.13 |
| nested array | all | 0.8985 | 0.8307 | 0.1376 | 2.05 |
| wrong pointer | patch arms | 0.8172 | 0.7449 | 0.2264 | 1.64 |
| malformed feedback | all | 0.7846 | 0.7168 | 0.2471 | 1.96 |
| prompt injection | all | 0.9453 | 0.8989 | 0.0714 | 1.90 |
| Arm | Mean retries | p95 retries | Output tokens | p95 latency (s) | Semantic success |
|---|---|---|---|---|---|
| ContractRL | 0.0547 | 1 | 34.6 | 1.30 | 0.9314 |
| full regeneration | 0.0000 | 0 | 138.9 | 2.58 | 0.9027 |
| constrained decoding | 0.0000 | 0 | 147.8 | 2.85 | 0.8663 |
| Patch-SFT | 0.1176 | 1 | 46.7 | 1.55 | 0.8918 |
| Arm | Case family | First valid | Final valid | Mean retries | Pointer fix | Collateral edits | Semantic success |
|---|---|---|---|---|---|---|---|
| ContractRL | missing-required | 0.9815 | 0.9952 | 0.0185 | 0.9937 | 0.0054 | 0.9598 |
| ContractRL | wrong-type | 0.9618 | 0.9861 | 0.0382 | 0.9804 | 0.0137 | 0.9406 |
| Patch-SFT | mixed | 0.8897 | 0.9446 | 0.1103 | 0.9198 | 0.0618 | 0.8918 |
| full regeneration | mixed | 0.9392 | 0.9392 | 0.0000 | n/a | 0.2214 | 0.9027 |
| Arm | Case family | Seeds | Prompt tokens | Output tokens | Validator calls | p95 latency (s) | Semantic success |
|---|---|---|---|---|---|---|---|
| ContractRL | single-field | 3 | 1111 | 31.8 | 1.028 | 1.13 | 0.9502 |
| ContractRL | nested/array | 3 | 1135 | 42.9 | 1.124 | 1.52 | 0.8516 |
| constrained decoding | mixed | 3 | 1079 | 147.8 | 1.000 | 2.85 | 0.8663 |
| full regeneration | mixed | 3 | 1072 | 138.9 | n/a | 2.58 | 0.9027 |
| Arm | Case family | Cases | First valid | Semantic success | Mean retries | Output tokens | p95 latency (s) | Collateral edits |
|---|---|---|---|---|---|---|---|---|
| full regeneration | single-field | 128 | 0.9487 | 0.9164 | 0.0000 | 136.2 | 2.44 | 0.2093 |
| constrained decoding | single-field | 128 | 0.9951 | 0.8826 | n/a | 143.7 | 2.67 | 0.1908 |
| Patch-SFT | nested/array | 192 | 0.8463 | 0.8097 | 0.1534 | 51.5 | 1.69 | 0.1027 |
| ContractRL | single-field | 128 | 0.9716 | 0.9502 | 0.0280 | 31.8 | 1.13 | 0.0096 |
| ContractRL | ambiguous/multi-field | 192 | 0.7639 | 0.7935 | 0.2361 | 48.6 | 1.84 | 0.0432 |
| Field | Online arm | Scoring arm | Validation |
|---|---|---|---|
| candidate JSON | yes | input digest | schema hash |
| typed verifier code | yes | input digest | enum check |
| JSON Pointer | yes | pointer metric | RFC-6901 parse |
| schema version | yes | split key | version match |
| patch ledger | append-only | retry/cost | digest check |
| canonical patch | no | exact patch match | post-hoc join |
| Operation | Case family | Validator result | Retry cost | Validator test |
|---|---|---|---|---|
| add | missing-required | schema/cross-field | 0.018 | localized repair |
| replace | wrong-type | schema/cross-field | 0.038 | type correction |
| remove | multi-field | schema/cross-field | 0.154 | deletion boundary |
| move/copy | nested/array | schema/cross-field | 0.124 | pointer semantics |
| wrong path | adversarial | pointer failure | 1.000 | fail-closed handling |
| ambiguous report | noisy verifier | typed retry | 1.000 | feedback robustness |
| Check | Unit | Result | Read |
|---|---|---|---|
| case ID overlap | record | 0 | exact split separation |
| candidate fingerprint overlap | record | 0 | input separation |
| target fingerprint overlap | record | 0 | label separation |
| schema hash overlap | schema | 0 | schema coverage |
| target-path overlap | pointer | 0 | error separation |
| operation-sequence overlap | patch | 0 | patch separation |
| Arm | Case family | Schema valid | Semantic success | Side-effect error | Mean retries |
|---|---|---|---|---|---|
| ContractRL | single-field | 0.9907 | 0.9502 | 0.0084 | 0.0280 |
| ContractRL | nested/array | 0.9187 | 0.8516 | 0.0274 | 0.1239 |
| full regeneration | mixed | 0.9392 | 0.9027 | 0.0451 | n/a |
| constrained decoding | mixed | 0.9901 | 0.8663 | 0.0396 | n/a |
| Patch-SFT | mixed | 0.9446 | 0.8918 | 0.0308 | 0.1176 |
| Case family | Validator condition | First valid | Final valid | Semantic success |
|---|---|---|---|---|
| wrong path | reject or correct | 0.6948 | 0.8421 | 0.7796 |
| immutable pointer | reject | 0.0000 | 0.0000 | 0.0000 |
| ambiguous verifier | typed retry | 0.6324 | 0.8587 | 0.8065 |
| nested/array | local patch | 0.8463 | 0.9187 | 0.8516 |
| multi-field | bounded sequence | 0.7639 | 0.8672 | 0.7935 |
| malformed output | reject | 0.0000 | 0.0000 | 0.0000 |
| Arm | Prompt tokens | Output tokens | Calls | Mean retries | p95 latency (s) | Semantic success |
|---|---|---|---|---|---|---|
| ContractRL | 1114.2 | 34.6 | 1.055 | 0.0547 | 1.30 | 0.9314 |
| full regeneration | 1072.4 | 138.9 | 1.000 | 0 | 2.58 | 0.9027 |
| constrained decoding | 1079.1 | 147.8 | 1.000 | 0 | 2.85 | 0.8663 |
| Patch-SFT | 1112.7 | 46.7 | 1.118 | 0.1176 | 1.55 | 0.8918 |
| Method | Update interface | Constraint mechanism | Evaluation focus |
|---|---|---|---|
| VeriHarness | Candidate retry with structured feedback | External acceptance and call budget | TextWorld terminal success |
| PatchBoard | JSON Patch over shared state | Schema, write contracts, and transactional kernel | Multi-agent ALFWorld episodes |
| Schema RL | Complete structured output | Schema reward in training | Schema-conformant generation |
| SLOT | Output post-processing | Structural conversion | Structured output recovery |
| XGrammar | Token-level generation | Context-free grammar | Coverage and generation overhead |
| ContractRL | Bounded patch, retry, or abstention | Action mask and deterministic validator | Semantic repair, collateral edits, and cost |
| Arm | Output form | Decoding | Seeds | Audit field |
|---|---|---|---|---|
| ContractRL | JSON Patch | unconstrained | 3 | ledger and validator |
| full regeneration | complete object | unconstrained | 3 | token baseline |
| constrained decoding | complete object | grammar constrained | 3 | syntax control |
| Patch-SFT | JSON Patch | unconstrained | 3 | learned patch |
| semantic execution | accepted object | sandbox | 3 | task endpoint |
| Case family | Pointer type | Operations | Collateral edits | Semantic success | Read |
|---|---|---|---|---|---|
| single-field | exact | 1 | 0 | 0.9502 | mechanism screen |
| single-field | wrong path | 1 | 0.0000 | 0.7796 | pointer boundary |
| nested/array | exact | 1.24 | 0.0297 | 0.8516 | structure generalization |
| multi-field | mixed | 1.71 | 0.0432 | 0.7935 | operation budget |
| Arm | First valid | Final valid | Mean retries | p95 retries | Observed behaviour |
|---|---|---|---|---|---|
| ContractRL | 0.9453 | 0.9768 | 0.0547 | 1 | typed local correction |
| Patch-SFT | 0.8897 | 0.9446 | 0.1176 | 1 | learned correction |
| full regeneration | 0.9392 | 0.9392 | 0 | 0 | regen. |
| constrained decoding | 0.9901 | 0.9901 | 0 | 0 | syntax control |
| Field | Denominator | Source | Read |
|---|---|---|---|
| schema validity | all cases | validator | structural gate |
| object match | held-out cases | hidden object | canonical-object metric |
| semantic | executed cases | sandbox result | task endpoint |
| tool error | executed cases | sandbox trace | failure boundary |
| collateral edit | accepted patches | pointer diff | locality metric |
| latency/cost | all attempts | resource ledger | efficiency endpoint |
| Arm | Model rank | Schema valid | Object match | Semantic success | Statistical uncertainty |
|---|---|---|---|---|---|
| ContractRL | 0.8B/r4 | 0.9508 | 0.7523 | 0.8124 | 0.0028 |
| ContractRL | 2B/r8 | 0.9765 | 0.9188 | 0.9331 | 0.0012 |
| ContractRL | 7B/r16 | 0.9831 | 0.9329 | 0.9446 | 0.0009 |
| Patch-SFT | 2B/r8 | 0.9451 | 0.8679 | 0.8924 | 0.0018 |
| full regeneration | 2B | 0.9403 | 0.8896 | 0.9041 | 0.0014 |
| constrained decoding | 2B | 0.9905 | 0.8426 | 0.8671 | 0.0016 |
| Arm | Model rank | Mean retries | Output tokens | p95 latency (s) |
|---|---|---|---|---|
| ContractRL | 0.8B/r4 | 0.0831 | 33.1 | 1.22 |
| ContractRL | 2B/r8 | 0.0538 | 34.8 | 1.32 |
| ContractRL | 7B/r16 | 0.0415 | 35.6 | 1.68 |
| Patch-SFT | 2B/r8 | 0.1162 | 46.9 | 1.56 |
| full regeneration | 2B | n/a | 139.4 | 2.60 |
| constrained decoding | 2B | n/a | 148.1 | 2.86 |
| Feedback condition | Public signal | Schema valid | Object match | Semantic success | Mean retries | Collateral edits | Fail-closed rate |
|---|---|---|---|---|---|---|---|
| full typed block | code + pointer + schema context | 0.9766 | 0.9189 | 0.9317 | 0.0539 | 0.0191 | 0.9728 |
| error code only | code | 0.9018 | 0.8027 | 0.8236 | 0.1442 | 0.0476 | 0.9147 |
| pointer only | JSON Pointer | 0.8694 | 0.7462 | 0.7815 | 0.1817 | 0.0589 | 0.8793 |
| natural-language text | free-form message | 0.8847 | 0.7724 | 0.8001 | 0.1668 | 0.0527 | 0.8872 |
| context only | candidate + schema | 0.0831 | 0.0749 | 0.0678 | 0.4383 | 0.1762 | 0.6146 |
| Training arm | Model/rank | Semantic success | Mean retries | Output tokens | Collateral edits | p95 latency (s) |
|---|---|---|---|---|---|---|
| Patch-SFT | 2B/r8 | 0.8927 | 0.1159 | 46.6 | 0.0607 | 1.55 |
| ContractRL-SFT | 2B/r8 | 0.9186 | 0.0762 | 39.3 | 0.0314 | 1.42 |
| ContractRL policy optimization | 2B/r8 | 0.9375 | 0.0496 | 34.3 | 0.0168 | 1.30 |
| Policy variant | Semantic success | Mean retries | Abstain rate | Collateral edits | Unsafe dispatches | Output tokens | p95 latency (s) |
|---|---|---|---|---|---|---|---|
| full ContractRL objective | 0.9375 | 0.0496 | 0.0718 | 0.0168 | 0 | 34.3 | 1.30 |
| w/o contract action mask | 0.8971 | 0.1098 | 0.0531 | 0.0649 | 26 | 42.7 | 1.59 |
| w/o repair history | 0.9162 | 0.0847 | 0.0695 | 0.0319 | 4 | 38.6 | 1.43 |
| w/o learned retry/abstention | 0.9064 | 0.0000 | 0.0000 | 0.0396 | 7 | 31.5 | 1.18 |
| w/o collateral objective | 0.9328 | 0.0524 | 0.0642 | 0.0476 | 0 | 35.8 | 1.34 |
| structure-only objective | 0.8723 | 0.0661 | 0.0249 | 0.0874 | 12 | 40.4 | 1.50 |
| Max. ops. | Max. attempts | First valid | Final valid | Semantic success | Mean retries | Output tokens | Collateral edits |
|---|---|---|---|---|---|---|---|
| 1 | 1 | 0.9126 | 0.9126 | 0.8794 | 0.0000 | 28.9 | 0.0098 |
| 1 | 2 | 0.9126 | 0.9497 | 0.9078 | 0.0758 | 32.2 | 0.0127 |
| 2 | 2 | 0.9453 | 0.9768 | 0.9314 | 0.0547 | 34.6 | 0.0189 |
| 3 | 2 | 0.9498 | 0.9812 | 0.9348 | 0.0521 | 39.1 | 0.0338 |
| 4 | 3 | 0.9514 | 0.9851 | 0.9362 | 0.0648 | 47.3 | 0.0571 |
| Structure family | Cases | Schema valid | Object match | Semantic success | Mean retries | Collateral edits | p95 latency (s) |
|---|---|---|---|---|---|---|---|
| flat single-field | 128 | 0.9908 | 0.9396 | 0.9506 | 0.0276 | 0.0094 | 1.15 |
| nested object | 96 | 0.9457 | 0.8584 | 0.8798 | 0.0968 | 0.0246 | 1.39 |
| array index | 96 | 0.9169 | 0.8152 | 0.8469 | 0.1327 | 0.0334 | 1.53 |
| union / optional | 96 | 0.9054 | 0.7996 | 0.8302 | 0.1451 | 0.0358 | 1.60 |
| long pointer | 96 | 0.8892 | 0.7811 | 0.8134 | 0.1635 | 0.0397 | 1.71 |
| multi-field | 96 | 0.8696 | 0.7487 | 0.7951 | 0.2289 | 0.0445 | 1.83 |
| Feedback condition | Cases | First valid | Final valid | Semantic success | Fail-closed rate | Leakage | Collateral edits |
|---|---|---|---|---|---|---|---|
| clean typed report | 96 | 0.9451 | 0.9770 | 0.9320 | 0.9715 | 0.0000 | 0.0187 |
| stale schema version | 96 | 0.5813 | 0.7368 | 0.6685 | 0.9896 | 0.0000 | 0.0079 |
| wrong pointer | 96 | 0.6969 | 0.8438 | 0.7792 | 0.9687 | 0.0000 | 0.0206 |
| ambiguous pointer | 96 | 0.6347 | 0.8595 | 0.8058 | 0.9514 | 0.0000 | 0.0278 |
| malformed feedback | 96 | 0.6116 | 0.7889 | 0.7182 | 0.9844 | 0.0000 | 0.0104 |
| injected tool text | 96 | 0.9074 | 0.9516 | 0.9007 | 0.9911 | 0.0000 | 0.0176 |
| H | Trajectories | Completion | Semantic success | Tool errors | Mean retries | Cumulative tokens | Cumulative latency (s) | Collateral edits |
|---|---|---|---|---|---|---|---|---|
| 1 | 192 | 0.9761 | 0.9321 | 0.0187 | 0.0548 | 34.8 | 0.84 | 0.0188 |
| 3 | 192 | 0.9256 | 0.8293 | 0.0518 | 0.1619 | 104.7 | 2.55 | 0.0426 |
| 5 | 192 | 0.8794 | 0.7548 | 0.0796 | 0.2735 | 175.2 | 4.31 | 0.0591 |
| 8 | 192 | 0.8073 | 0.6457 | 0.1214 | 0.4438 | 281.8 | 7.05 | 0.0807 |
| Held-out family | Cases | Schema valid | Object match | Semantic success | Pointer fix | Collateral edits |
|---|---|---|---|---|---|---|
| file | 96 | 0.9621 | 0.8876 | 0.9024 | 0.9513 | 0.0216 |
| calendar | 96 | 0.9564 | 0.8748 | 0.8917 | 0.9436 | 0.0241 |
| database | 96 | 0.9312 | 0.8359 | 0.8546 | 0.9127 | 0.0368 |
| HTTP | 96 | 0.9487 | 0.8613 | 0.8795 | 0.9294 | 0.0285 |
| code-edit | 96 | 0.9258 | 0.8216 | 0.8429 | 0.9018 | 0.0417 |
| Arm / threshold | Coverage | Semantic risk | Fail-closed rate | ECE | AUROC | Brier |
|---|---|---|---|---|---|---|
| ContractRL / 0.50 | 0.9482 | 0.0719 | 0.7821 | 0.0458 | 0.9187 | 0.0794 |
| ContractRL / 0.70 | 0.8156 | 0.0456 | 0.8816 | 0.0371 | 0.9281 | 0.0651 |
| ContractRL / 0.80 | 0.6693 | 0.0298 | 0.9349 | 0.0316 | 0.9364 | 0.0557 |
| ContractRL / 0.90 | 0.4047 | 0.0174 | 0.9782 | 0.0249 | 0.9449 | 0.0436 |
| full regeneration / matched | 1.0000 | 0.0973 | 0.0000 | 0.0941 | 0.8368 | 0.1297 |
| Metric | ContractRL | Patch-SFT | 95% CI | -value | Effect size | |
|---|---|---|---|---|---|---|
| schema validity | 0.9768 | 0.9446 | 0.0027 | 0.31 | ||
| semantic success | 0.9314 | 0.8918 | 0.0039 | 0.35 | ||
| mean retries | 0.0547 | 0.1176 | 0.0018 | -0.42 | ||
| generated tokens | 34.6 | 46.7 | -0.91 | |||
| collateral edits | 0.0189 | 0.0618 | -0.58 | |||
| p95 latency | 1.30 | 1.55 | 0.0003 | -0.63 |
| Arm | Audited cases | Agreement | False accept | False reject | Abstain agreement | Median review time |
|---|---|---|---|---|---|---|
| ContractRL | 120 | 0.9417 | 0.0167 | 0.0416 | 0.9250 | 18.6 |
| Patch-SFT | 120 | 0.8917 | 0.0417 | 0.0666 | 0.8583 | 22.9 |
| full regeneration | 120 | 0.8583 | 0.0750 | 0.0667 | 0.7833 | 31.7 |
| constrained decoding | 120 | 0.8750 | 0.0583 | 0.0667 | 0.8167 | 29.6 |
| Case family | ID | Predicted patch | Validator result | Semantic outcome | Human label |
|---|---|---|---|---|---|
| single-field | SF-03 | add /timezone | accept | success | safe |
| nested / array | NA-11 | replace /items/2/id | accept | failure | unsafe |
| wrong pointer | WP-04 | replace /user/id | reject: wrong-path | not executed | abstain |
| malformed feedback | MF-06 | replace /date | reject: malformed | not executed | abstain |
| multi-field | MU-09 | add /city; replace /date | accept | failure | unsafe |
| immutable / unsafe | IU-02 | replace /account/id | reject: immutable | not executed | unsafe |
| Measurement family | Evaluation unit | Result |
|---|---|---|
| Structural repair | 64-case replay and adapter seeds | Table 1 |
| Public-information control | 192 cases per seed; five seeds | Table 2 |
| Policy training | Fixed public state; five seeds | Table 28 |
| Components | Contract decisions and costs | Table 29 |
| Paired comparison | Shared cases and seeds | Table 36 |
| Independent audit | 120 blinded cases per arm | Table 37 |
LLM Self-Correction
Large language model self-correction studies how language models detect and repair errors in their own answers, reasoning, and actions.
See all 159 papers