Hydra: Efficient, Correct Code Generation via Checkpoint-and-Rollback Support
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
- 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,944
- 2023Code Llama: Open Foundation Models for Codecited by 2,139
- 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Codecited by 2,004
- 2024SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineeringcited by 1,737
- 2022Fast Inference from Transformers via Speculative Decodingcited by 1,653
- 2023Teaching Large Language Models to Self-Debugcited by 988
- 2022MultiPL-E: A Scalable and Extensible Approach to Benchmarking Neural Code Generationcited by 136
- 2024SWT-Bench: Testing and Validating Real-World Bug-Fixes with Code Agentscited by 133
- 2024Automata-based constraints for language model decodingcited by 51
- 2024Iterative Refinement of Project-Level Code Context for Precise Code Generation with Compiler Feedbackcited by 46
- 2025Type-Constrained Code Generation with Language Modelscited by 35
- 2024ContrastRepair: Enhancing Conversation-Based Automated Program Repair via Contrastive Test Case Pairscited by 19
Built on by
Not cited yet.