mlsanityData to 24 Nov 2026

From Observation to Explanation: Mechanistic Interpretability of LLM-Generated Code for Principled Repair

arXiv 2611.28153 ↗Submitted 19 Nov 2026Announced 24 Nov 2026cs.SE cs.AIcited by 0

On the map: Mechanistic interpretability → Knowledge and representations inside LLMs

Abstract (arXiv)

Large language models (LLMs) have transformed software development, yet our understanding of how they generate code remains critically underdeveloped. We address this gap by triangulating evidence across three layers. Longitudinally, autonomous agent-attributed code is statistically indistinguishable from human code under a semantic modification definition (HR = 1.019, p = 0.490), yet attracts disproportionately corrective modifications in production (49.1% vs 37.9% human baseline). This finding demands a causal explanation. Empirically, existing benchmarks overestimate LLM capabilities: models that achieve 84 to 89% correctness on synthetic tasks attain only 24 to 35% on real-world class-level code. Behaviourally, detection systems reveal puzzling asymmetries: GPT-3.5 is far more detectable than modern models (AUC-ROC = 0.96, a 27-point gap), even though modern models produce mutually similar code structures; yet no single feature reliably distinguishes AI-generated from human code at the class level, and the leading commercial detector achieves only 15 to 64% recall. Together, these findings raise a question that empirical studies cannot answer: why do LLMs generate code with these properties? This thesis proposes mechanistic interpretability, a causal token-level circuit tracing, as the bridge between empirical observation and principled correction. By identifying the transformer circuits responsible for detectable stylistic signatures, hallucination patterns, and systematic defects, we aim to drive an agentic repair framework that intervenes at the causal source of defects rather than patching surface symptoms.

Key facts. No citing papers in the map yet (data through 24 Nov 2026). Placed in Knowledge and representations inside LLMs, one of 13 directions in Mechanistic interpretability. Builds on 11 of its 27 references that are in the map. Submitted 19 Nov 2026, announced 24 Nov 2026.

Builds on

11 of 27 references.

References · 11

  1. 2021Evaluating Large Language Models Trained on Codecited by 8,938
  2. 2022Locating and Editing Factual Associations in GPTcited by 2,951
  3. 2024RepairAgent: An Autonomous, LLM-Based Agent for Program Repaircited by 251
  4. 2024Bugs in Large Language Models Generated Code: An Empirical Studycited by 64
  5. 2022What Do They Capture? -- A Structural Analysis of Pre-Trained Language Models for Source Codecited by 53
  6. 2022SelfAPR: Self-supervised Program Repair with Test Execution Diagnosticscited by 34
  7. 2024HumanEvo: An Evolution-aware Benchmark for More Realistic Evaluation of Repository-level Code Generationcited by 31
  8. 2024Distinguishing LLM-generated from Human-written Code by Contrastive Learningcited by 18
  9. 2026Where Do AI Coding Agents Fail? An Empirical Study of Failed Agentic Pull Requests in GitHubcited by 16
  10. 2025OpenClassGen: A Large-Scale Corpus of Real-World Python Classes for LLM Researchcited by 4
  11. 2024Automatic Detection of LLM-Generated Code: A Comparative Case Study of Contemporary Models Across Function and Class Granularitiescited by 3

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2025Mechanistic Interpretability of Code Correctness in LLMs via Sparse Autoencoders
  2. 2025Enabling Global, Human-Centered Explanations for LLMs:From Tokens to Interpretable Code and Test Generation
  3. 2025Artificial or Just Artful? Do LLMs Bend the Rules in Programming? ↗
  4. 2026AI-Generated Smells: An Analysis of Code and Architecture in LLM and Agent-Driven Development
  5. 2025Lost in Code Generation: Reimagining the Role of Software Models in AI-driven Software Engineering
  6. 2025AI-Generated Code Is Not Reproducible (Yet): An Empirical Study of Dependency Gaps in LLM-Based Coding Agents
  7. 2025Breakpoint: Scalable evaluation of system-level reasoning in LLM code agents
  8. 2025A Survey of LLM-based Automated Program Repair: Taxonomies, Design Paradigms, and Applications