Skip to content
Preprint

LLVM Translation Validation Automated with Large Language Models and Lean

Sep 2026 · 0 citations · 61 references
Computer Science

TL;DR

Trivet is presented, a framework combining large language models (LLMs) and Lean for automated translation validation of LLVM transformations, which generates structured proof scaffolds based on source and target functions, automatically discharges obligations amenable to deterministic reasoning, and delegates transformationspecific obligations to LLMs.

Abstract

LLVM is the cornerstone of modern compilers, but its subtle intermediate representation (IR) semantics make transformations error-prone and necessitate formal verification. Alive2, a state-of-the-art translation validator based on satisfiability modulo theories, has achieved substantial success in automating the validation of LLVM transformations. However, it still faces scalability limitations, does not support symbolic bitwidths, and offers only bounded guarantees for loops. In contrast, interactive theorem provers such as Lean can address these cases but require substantial proof engineering. In this paper, we present Trivet, a framework combining large language models (LLMs) and Lean for automated translation validation of LLVM transformations. Trivet generates structured proof scaffolds based on source and target functions, automatically discharges obligations amenable to deterministic reasoning, and delegates transformationspecific obligations to LLMs. It produces refinement proofs or counterexample-based refutations, with every successful verdict checked by the Lean kernel. On 148 LLVM transformations, Trivet verifies or refutes 147, leaving one invalid case unresolved. Successful cases include 60 loop-free transformations with symbolic bitwidths, 27 cases from a restricted class of loop-containing transformations, and 10 complex valid fixed-bitwidth cases on which Alive2 times out. Compared with an unscaffolded baseline, scaffolding enables 26 additional proofs. On cases solved by both configurations, it reduces mean proof time by 75.9% and mean monetary cost by 88%.

View source

Similar papers

Review Oct 2026

ForTress: Bringing Assurance and Determinism for LLM-Driven Fortran-to-Python Translation

Modernizing mature scientific software from Fortran to Python can improve accessibility and integration with modern computing tools, but manual rewriting is expensive. Large language models (LLMs) make translation more practical, yet generated code can pass regression tests while violating source-language semantics, an...

Qin-Run Dai, Rui-Tong Liu, Chien-Wei Huang et al. · 0 citations
#software testing Preprint Sep 2026

Verified Learning for Compiler Optimization: An LLM-Guided Architecture with Formal Control

This work fine-tune a code-centric LLM on transformations produced by Wyvern and embed Alive2 into a feedback loop that enforces semantic preservation for every generated rewrite, demonstrating that generative AI components can be safely integrated into compiler pipelines through deterministic validation and structured...

Devyani Singh, Rong Feng, Suman Saha · 0 citations
#artificial intelligence Preprint Oct 2026

Scaling Lean Theorem Proving for Real-World Code Verification

EasyProver is presented, a Lean proving system built from recursive agents with isolated contexts, asynchronous search, parallel tactic probing, and an elastic elaboration service, and Aegis is introduced, which converts competitive programming problems into much harder verification tasks over real implementations.

Debargha Ganguly, Divya Raghunathan, Dejan Jovanovic et al. · 0 citations
Book Open access Oct 2026

A Transformation-Based Benchmark for Evaluating the Robustness of LLMs in Generating OCL

Large Language Models (LLMs) have shown promising performance in generating Object Constraint Language (OCL) constraints from natural language specifications. However, existing evaluations rely on publicly available UML models, which may overestimate generalization due to potential data leakage and reliance on recurrin...

Hamza Attarwala, Moataz Chouchen, Omar Alam et al. · 0 citations
Preprint Oct 2026

Proving LLM-Generated GPU Kernels Correct and Safe: Floating-Point Verification in Lean and VerCors

Modern statistical model development begins with a high-level specification in an automatic differentiation framework such as PyTorch, JAX, or TensorFlow, which is then lowered to a target backend by a compiler or implemented manually by a research engineer. In this paper, we study whether frontier language models can...

A. Browne, Eugene Lee, Cristopher Salvi · 1 citation

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.