Viverra: Text-to-Code with Guarantees
Haoze Wu, Rocky Klopfenstein, Keith Farkas, Nina Narodytska
NeurIPS page · Open on the map
Category: LLM Agents, Evals & Benchmarks › Verified Code Synthesis and Testing · Type: system or tooling · Keywords: text-to-code, formal verification, assertions, bounded model checking, code comprehension, AI coding tools
Areas: Code & Coding Agents › Code Verification › Verified code generation; Evaluation & Benchmarks › Language Model and Agent Benchmarks › Formal Verification Benchmarks
Summary
Viverra is a system that generates C code with formally verified annotations to improve code comprehension and correctness.
Explained to a 5-year-old
People use computers to make code that tells machines what to do. Sometimes the code can have mistakes, and checking it all by hand takes a lot of time. This new system makes code and also writes little notes that say if the code is safe and correct. It uses a special tool to check those notes quickly. This helps people understand the code better and trust that it works.
Explained to a 5-year-old, longer
Computers can be told what to do by writing code, which is like a set of instructions. When code is written by a smart program, it can be fast, but we need to make sure it does what we want. Checking every line of code by hand is boring and takes a long time. The new system works like a helper that not only writes code but also adds little notes. These notes are called assertions, and they say things like "this part will not crash" or "this part is safe". The system uses a tool that reads those notes and checks them carefully. If the notes are correct, the code is more trustworthy. This way, people can look at the code and the notes together and understand what the program does. It also helps avoid bugs that could cause problems later. The system was tested on many different kinds of programming tasks. In a big experiment, many people found it easier to read and understand the code with the notes. Overall, the system makes using AI to write code less scary and more useful.
For a technical reader
Viverra takes a natural-language description of a programming task and uses a large language model to generate a C program together with candidate correctness assertions. These assertions are then checked automatically by a collection of bounded model checkers, which verify safety and correctness properties in a compositional best-effort fashion. The generated code comes with formally verified annotations that help developers understand and trust the output without manual review. Evaluation on 18 diverse programming tasks and a user study with over 400 participants show that the annotations improve code-comprehension performance and reduce the effort needed to verify generated code.
Problem
Text-to-Code systems currently provide no guarantees about the correctness of generated code, requiring developers to manually review, test, and maintain the code, which can be time-consuming and offset productivity gains.
Method
The approach takes a natural-language task description, prompts an LLM to produce a C program together with candidate assertions, and then verifies those assertions using a portfolio of bounded model checkers in a compositional best-effort manner.
Results
The approach efficiently generates code with verified assertions and these assertions improve users' performance on code-comprehension tasks, as shown in a user study with over 400 participants.
Contributions
The paper introduces a system that automatically produces formally verified annotations alongside generated code, using an LLM and a portfolio of bounded model checkers, and demonstrates its effectiveness through a large-scale user study.
Practical relevance
By providing automatically verified annotations, Viverra reduces the manual effort needed to understand and trust generated code, helping developers adopt AI coding tools more effectively.
Research questions this paper is counted under
This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction