mlsanityData to 14 Oct 2026

Hydra: Efficient, Correct Code Generation via Checkpoint-and-Rollback Support

arXiv 2605.15238 ↗First posted 14 May 2026cs.SE cs.AI cs.PLcited by 0

Not on the map. Why?

Abstract (arXiv)

Large language models are increasingly used for code generation, but many generated programs fail to compile, a prerequisite for further correctness checks such as unit tests. Existing solutions for repairing static errors are costly in both latency and token consumption. Post-hoc repair delays error detection until generation completes and commonly regenerates large regions of previously valid code. Constrained semantic decoding checks after each token, incurring per-token overhead while limiting repair to the current token even when the root cause lies earlier. We present Hydra, a system for efficient recovery from static errors during code generation. Hydra allows checking to proceed asynchronously with generation, avoiding checker overhead when the generated code is semantically correct. In addition, it provides checkpoint-and-rollback support for targeted repair, avoiding regeneration and rechecking of valid prefixes. We retrofit the Clang C/C++ compiler to support Hydra with modest modifications. Paired with a token-efficient repair strategy, Hydra reduces latency by up to 71% and token consumption by up to 70% relative to post-hoc repair on C/C++ code generation tasks that encounter static errors.

Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 15 of its 34 references that are in the map. First posted on arXiv 14 May 2026.

Builds on

15 of 34 references.

References · 15

  1. 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,944
  2. 2023Code Llama: Open Foundation Models for Codecited by 2,139
  3. 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Codecited by 2,004
  4. 2024SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineeringcited by 1,737
  5. 2022Fast Inference from Transformers via Speculative Decodingcited by 1,653
  6. 2023Teaching Large Language Models to Self-Debugcited by 988
  7. 2022MultiPL-E: A Scalable and Extensible Approach to Benchmarking Neural Code Generationcited by 136
  8. 2024SWT-Bench: Testing and Validating Real-World Bug-Fixes with Code Agentscited by 133
  9. 2024Automata-based constraints for language model decodingcited by 51
  10. 2024Iterative Refinement of Project-Level Code Context for Precise Code Generation with Compiler Feedbackcited by 46
  11. 2025Type-Constrained Code Generation with Language Modelscited by 35
  12. 2024ContrastRepair: Enhancing Conversation-Based Automated Program Repair via Contrastive Test Case Pairscited by 19
3 more
  1. 2025ChopChop: a Programmable Framework for Semantically Constraining the Output of Language Modelscited by 15
  2. 2024Statically Contextualizing Large Language Models with Typed Holescited by 9
  3. 2025SemGuard: Real-Time Semantic Evaluator for Correcting LLM-Generated Codecited by 2

Built on by

Not cited yet.