mlsanityData to 7 Oct 2026

Dynamic Stability of LLM-Generated Code

arXiv 2511.07463 ↗First posted 7 Nov 2025cs.PL cs.AI cs.SEcited by 4

Not on the map. Why?

Abstract (arXiv)

Current evaluations of LLMs for code generation emphasize functional correctness, overlooking the fact that functionally correct solutions can differ significantly in algorithmic complexity. For instance, an (O(n2)) versus (O(n log n)) sorting algorithm may yield similar output but incur vastly different performance costs in production. This discrepancy reveals a critical limitation in current evaluation methods: they fail to capture the behavioral and performance diversity among correct solutions. To address this, we introduce a principled framework for evaluating the dynamic stability of generated code. We propose two metrics derived from opcode distributions: Static Canonical Trace Divergence (SCTD), which captures algorithmic structure diversity across generated solutions, and Dynamic Canonical Trace Divergence (DCTD), which quantifies runtime behavioral variance. Their ratio, the Behavioral Expression Factor (BEF), serves as a diagnostic signal: it indicates critical runtime instability when BEF ll 1 and functional redundancy when BEF gg 1. Empirical results on BigOBench and CodeContests show that state-of-the-art LLMs exhibit significant algorithmic variance even among functionally correct outputs. Notably, increasing sampling temperature improves pass@1 rates but degrades stability, revealing an unrecognized trade-off: searching for correct solutions in diverse output spaces introduces a "penalty of instability" between correctness and behavioral consistency. Our findings call for stability-aware objectives in code generation and new benchmarks with asymptotic test cases for robust, real-world LLM evaluation.

Key facts. Cited by 4 papers in the map (data through 7 Oct 2026). Builds on 13 of its 34 references that are in the map. First posted on arXiv 7 Nov 2025.

Builds on

13 of 34 references.

References · 13

  1. 2020A Simple Framework for Contrastive Learning of Visual Representationscited by 11,979
  2. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  3. 2022Competition-Level Code Generation with AlphaCodecited by 1,427
  4. 2020Sharpness-Aware Minimization for Efficiently Improving Generalizationcited by 1,404
  5. 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 468
  6. 2022A Systematic Evaluation of Large Language Models of Codecited by 360
  7. 2020Neurosymbolic AI: The 3rd Wavecited by 253
  8. 2020The Next Decade in AI: Four Steps Towards Robust Artificial Intelligencecited by 194
  9. 2023Is ChatGPT the Ultimate Programming Assistant -- How far is it?cited by 72
  10. 2023A Survey on Large Language Models for Software Engineeringcited by 58
  11. 2024Revisiting Code Similarity Evaluation with Abstract Syntax Tree Edit Distancecited by 26
  12. 2025GREEN-CODE: Learning to Optimize Energy Efficiency in LLM-based Code Generationcited by 3
1 more
  1. 2025Does Acceleration Cause Hidden Instability in Vision Language Models? Uncovering Instance-Level Divergence Through a Large-Scale Empirical Studycited by 2

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 4.

4 papers.