{"resourceId":"arxiv-2605-21537-llm-code-modernization-self-review-failures","versions":[{"version":"external-d79359824254dda55bc7e2e438b535734635543b0f54d98b91fc2412e3cf6e2e","resource":{"id":"arxiv-2605-21537-llm-code-modernization-self-review-failures","title":"Preprint (May 2026): across 1,980 legacy-code modernization calls on 11 production LLMs, semantic-trap snippets drifted in 39.7% of attempts and producing models endorsed 31.7% of their own drift as behavior-preserving","organization":"Gokul Chandra Purnachandra Reddy, Aditya Lolla, Harsha Sanku (arXiv preprint authors)","sector":"Software engineering research; applicable to public-sector legacy modernization","geography":"Not specified; laboratory study","publishedAt":"Submitted to arXiv May 20, 2026","publicationDate":"2026-05-20","eventDate":null,"sourceName":"arXiv (cs.SE)","sourceLabel":"Academic preprint","sourceUrl":"https://arxiv.org/abs/2605.21537","evidenceClass":"academic-research","outcomeClass":"cautionary","topics":["developers-agents","governance-procurement"],"finding":"An independent preprint tested 11 production LLMs on 1,980 legacy-code modernization calls and found that code requiring real semantic changes drifted from original behavior in 39.7% of attempts, against 7.0% on control code. When asked to judge their own output, the models endorsed 31.7% of drifted outputs as behavior-preserving, sometimes after explaining the very distinction they broke. Drift rates did not track model capability or price.","sledRelevance":"Why now: Anthropic's Nov. 25 migration post argues that AI-written code must be checked by external verifiers and human review; this study supplies independent evidence for that point. Agencies running Claude Code modernization pilots (as in Seattle) should not accept model self-review or AI-ported tests as proof of correctness. Limited applicability: small Python 2 corpus, models not identified on the inspected page.","evidence":"Controlled study with a behavioral oracle, control baseline and released artifacts; preprint. Consistent with Anthropic's own report of 98% test pass versus about 25% production match and with Swimm's Feb. 2026 competitor test showing inconsistent Claude Code COBOL extraction.","architectureImplications":"Interpretation: modernization pipelines need an independent behavioral oracle (legacy runtime outputs, differential tests) rather than the generating model's judgment.","governanceImplications":"Interpretation: acceptance criteria for AI-assisted migrations should prohibit self-certification by the generating model and require independent tests or human review.","securityPrivacyImplications":"Silent semantic drift in numeric or eligibility logic can create incorrect payments or decisions without errors; the study does not address security controls directly.","caveats":"Preprint, not peer reviewed. Abstract page inspected; the abstract does not name the models, so whether Claude models were included was not verified. Small 60-snippet Python 2 corpus, not COBOL or production government systems; function-level snippets, not agentic whole-system migration with external verifiers.","streamIds":["anthropic"],"roles":{"sales":"Sales framing: this is a credibility tool for honest conversations about AI modernization. Agencies worried that AI rewrites will silently break eligibility or payment logic are right to be; the study shows models often fail to catch their own errors. Position Claude-assisted modernization only with independent verification built in, and avoid any claim that the model can check its own work.","engineering":"Engineering framing: design pipelines so the model never certifies its own output. Use the legacy system or a type-strict behavioral oracle for differential testing, target known trap areas such as numeric semantics first, and run cross-checks with deterministic tools. The released corpus and oracle could serve as a small benchmark before an agency pilot.","delivery":"Delivery framing: write acceptance criteria that require independent behavioral evidence for every migrated component and treat model explanations as non-evidence. Budget reviewers with legacy-language expertise and track drift found by verifiers over time to decide when automation can expand."},"roleDetails":{"sales":{"customerProblem":"Agencies need assurance that AI-modernized code preserves legally significant behavior.","stakeholders":["Application modernization lead","Program owners of eligibility or payment logic","Internal audit","Procurement"],"discoveryQuestions":["How will you detect behavior changes the AI does not report?","Which logic areas (numeric, eligibility, dates) carry the most risk?","Will vendors provide independent verification evidence?"],"valueHypothesis":"Independent verification can catch silent drift that model self-review misses; it adds cost but reduces risk.","potentialEngagement":"A short verification-design workshop and benchmark run on a sample of agency legacy code.","unsupportedClaims":["Does not show Claude specifically drifts at these rates","Not evidence about COBOL or whole-system migration","No cost or time data"]},"engineering":{"fit":"Relevant to any LLM-assisted code translation; strongest for function-level rewrites with subtle semantics.","architectureIntegration":"Behavioral oracle or differential tests between legacy and new code; model output never self-certified.","prerequisites":["Executable legacy code or recorded outputs","Typed comparison harness","Trap-case inventory"],"constraints":["Small Python 2 corpus limits generalization","Models unnamed on inspected page","Preprint status"],"security":"Not a security study; ensure differential testing uses synthetic or approved data.","proofOfValue":["Run agency sample code through generation plus independent oracle","Measure self-review miss rate on agency code","Compare drift across candidate models"]},"delivery":{"work":"Embed independent behavioral verification in AI-assisted modernization.","dependencies":["Legacy runtime access","Test harness","Expert reviewers"],"ownership":"Modernization engineering lead with internal audit oversight","skillsAdoption":"Train reviewers on legacy-language semantic traps and on not trusting model explanations.","governanceCheckpoints":["Verification plan approved before generation starts","Independent evidence required at each component acceptance","Audit of drift findings before expanding scope"],"acceptanceCriteria":["Proposed: zero components accepted on model self-review alone","Proposed: drift detected by oracle tracked per component","Proposed: high-risk logic areas covered by differential tests"],"risks":["Silent behavior changes in payments or eligibility","Overreliance on model explanations","Reviewer skill gaps"]}},"retrievedAt":"2026-11-27T04:24:23Z","enrichedAt":"2026-11-27T04:27:49Z","enrichmentBasis":"retrieved source","accessibilityWorkforceImplications":"Interpretation: reviewers need legacy-language semantic expertise, since the failures concentrate in subtle language differences.","procurementImplications":"Interpretation: contracts for AI-assisted modernization should require vendors to provide independent verification evidence, not model-generated assurances.","operatingModelImplications":"Interpretation: separates the roles of code generator and verifier; agencies should staff or contract the verifier role explicitly.","peerReview":"preprint","sourceVerification":{"openedUrl":"https://arxiv.org/abs/2605.21537","referenceExcerpt":"across all semantic drift cases, 31.7% are silently endorsed by the same model that produced them (83/262)","promptVersion":"sled-research-v4.0","model":null,"basis":"agent-reported inspection"}}}]}