Verifier-Guided Code Translation via Meta-Step Decoding
Tianyang Zhou, Somesh Jha, Mihai Christodorescu, Kirill Levchenko, Varun Chandrasekaran · 2026
Read Verifier-Guided Code Translation via Meta-Step Decoding by Tianyang Zhou, Somesh Jha, Mihai Christodorescu, Kirill Levchenko, Varun Chandrasekaran (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2605-17626.txt.
Introduction
Zhou and colleagues introduce Decoding Time Verification for verifier-guided coding at structural boundaries. Code translation suits test-time scaling since source programs constrain outputs, while compilers give pass-fail feedback. Outcome-only methods check only after drafting, letting early errors corrupt context with rare later fixes. It interleaves generation with verifier calls, locking in checked prefixes to stop error spread. With Qwen3-4B, pass rates rise from about 72 to 82 percent on C-to-Rust and from about 33 to 46 percent on JavaScript-to-TypeScript.
Catalog record
| CREATOR | Tianyang Zhou, Somesh Jha, Mihai Christodorescu, Kirill Levchenko, Varun Chandrasekaran |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 109630 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2605.17626
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Verifier-Guided Code Translation via Meta-Step Decoding Tianyang Zhou, Somesh Jha, Mihai Christodorescu, Kirill Levchenko, Varun Chandrasekaran Abstract Test-time scaling is an important mechanism for improving large language models, especially on tasks with deterministic verifiers. Code translation is a canonical example: the source program constrains valid outputs, while compilers, type checkers, and behavioral checks provide exact pass/fail feedback. Existing approaches typically apply these verifiers only after generation, which is inefficient because early errors corrupt the autoregressive context and are rarely corrected later. We introduce Decoding Time Verification (DTV) , a framework that treats structural boundaries as meta steps for verifier-guided decoding. DTV interleaves generation with verifier calls under a state-machine controller that enforces valid prefixes, using structural-boundary checks and structure-aware rollback to prevent error propagation while reducing wasted tokens. We evaluate DTV on C-to-Rust and JavaScript-to-TypeScript translation. Using Qwen3-4B as the primary generator under matched token budgets, DTV improves pass rates from 72.3% to 82.0% on C-to-Rust and from 33.3% to 46.0% on JavaScript-to-TypeScript relative to matched self-refinement baselines, while using fewer tokens per case; the same trend largely transfers to Gemma-4-E4B. In the evaluated cost-matched grid, DTV achieves a more favorable pass-rate-cost tradeoff than post-hoc verification or sampling-based scaling. These results show that verifier-guided decoding is an effective use of inference-time compute for code translation. 1 Introduction Figure 1 : GENERATION extends the target prefix to the next structural boundary (statement, block, function, or program). VERIFICATION renders the prefix and runs applicable oracles, committing on pass. RECOVERY parses diagnostics on fail, rolls back to the last checkpoint with augmented context, and escalates scope on repeated failure. The loop terminates on program-level success or budget bailout. Large language models (LLMs) have become capable general-purpose code generators, but improving performance on difficult inputs is increasingly pursued at inference time rather than solely through larger pretraining runs. A growing line of work studies test-time scaling : allocating additional inference compute through repeated sampling, search, self-refinement, or process-level guidance to improve the performance of a frozen pretrained model [ 32 , 23 , 16 , 21 , 26 , 20 ] . Most existing test-time scaling methods are designed for open-ended domains where correctness is difficult to verify exactly. Consequently, they guide generation using probabilistic signals derived from the model itself or learned scorers [ 8 , 39 ] , such as token likelihoods, preference models, or intermediate reasoning heuristics. While these signals can improve reasoning quality in open-ended settings, coding tasks impose discrete semantic and syntactic correctness constraints, making probabilistic guidance only weakly aligned with true success: models may assign high probability to plausible-looking yet incorrect programs, while learned reward models for code are expensive to train and brittle across languages and libraries [ 33 , 17 ] . At the same time, coding tasks expose deterministic external verifiers unavailable in most domains. Compilers, type checkers, and behavioral tests provide exact pass/fail feedback together with structured diagnostics, creating an opportunity for stronger inference-time guidance. Existing approaches, however, typically use these signals only post-hoc to filter, rerank, or repair completed samples [ 25 , 9 , 10 ] . This cannot influence the trajectory of generation itself: once a verifier-detectable error enters the autoregressive prefix, later decoding proceeds under a corrupted conditioning context, and models tend to continue the trajectory rather than recover [ 3 ] . One possible approach to overcome this limitation is to let verifier signals participate directly in the autoregressive loop, governing which prefixes are admitted as conditioning context rather than only which completed samples are retained. Doing so raises three coupled questions: when to invoke a verifier, since verifiers require structurally complete artifacts rather than arbitrary token prefixes; how to roll back when verification fails, balancing context preservation against error excision; and what to do with diagnostics beyond retry with the same context. We introduce Decoding Time Verification (DTV), a decoding framework that interleaves generation from a pretrained code model with deterministic verifier calls under an explicit state-machine controller 1 1 1 Source code is available at: https://github.com/qsdrqs/dtv-translation . As illustrated in Figure 1 , DTV generates target code up to the next structural boundary (e.g., statement, block, or function), renders the current prefix into a verifier-consumable artifact, and runs the applicable verifiers. If all checks pass, the prefix is committed; else, the controller rolls back to an earlier checkpoint, updates a feedback state using verifier diagnostics, and retries generation. Unlike prior in-loop verification systems that fix a particular combination of scope, verifier type, and search mechanism [ 18 , 7 , 1 ] , DTV separates the controller, verification scopes, and verifier suite as configurable components. It combines three key mechanisms. First, structural-boundary verification enforces a legal prefix invariant : only prefixes satisfying all applicable verifiers are admitted as conditioning context for subsequent decoding. Second, structure-aware rollback with escalation rolls back to the smallest scope implicated by the verifier diagnostic, escalating to larger scopes on repeated failures rather than retrying more. Third, feedback via prompt augmentation summarizes verifier diagnostics and injects them back into the model context so retries proceed under updated information rather than blind resampling. Together, these mechanisms prevent verifier-detectable errors from propagating through the autoregressive context by ensuring generation continues only from committed verified prefixes. While we instantiate DTV on code translation, the framework applies to any task with deterministic process-level verifiers and a structural renderer in principle, such as code generation tasks or even open-ended generation with external knowledge validators. We evaluate DTV on two translation settings with complementary verifier structures. C-to-Rust combines compiler checks with differential testing against the output in the end, while JavaScript-to-TypeScript relies on static type and lint verification for the type annotation task. Using Qwen3-4B [ 30 ] as the primary generator under matched generation budgets, DTV with self-refinement improves compile-pass rate from 72.3% to 82.0% on C-to-Rust and from 33.3% to 46.0% on JavaScript-to-TypeScript, while using fewer tokens overall (§ 4.1 ); the same gains transfer to Gemma-4-E4B [ 12 ] (Appendix K ). These gains are not solely due to outer-loop scaling: even without outer-loop retry, in-loop verification alone improves one-shot pass rate by +30.7 pp and +16.7 pp over direct decoding, showing that DTV introduces a distinct scaling mechanism. In the cost-matched grid, DTV also achieves a more favorable pass-rate-cost point than other test-time scaling methods, including best-of- N and the compile-feedback-based S * baseline [ 19 ] . Ablations show that all three key design components of DTV contribute, with in-loop recovery providing the largest benefit (§ 4.2 ). 2 Decoding Time Verification As discussed in § 1 , post-hoc verification applies verifier feedback only after generation is complete, surfacing errors too late to guide decoding. We instead verify during decoding using deterministic program verifiers (e.g., compilers, type checkers, and tests) as oracles. Verifier calls are aligned with structural boundaries such as completed statements, blocks, or functions, where verdicts become meaningful and rollback can target the scope at which an error was introduced. This forms an inner loop of generation that complements traditional outer-loop strategies (e.g., self-refinement with verifier feedback) operating only on completed programs. Outer-loop verification is recovered as a special case by invoking oracles only at full-program scope. 2.1 Overview Decoding Time Verification