Skip to main content
QUICK REVIEW

[Paper Review] Assured LLM-Based Software Engineering

Nadia Alshahwan, Mark Harman|arXiv (Cornell University)|Feb 6, 2024
Business Process Modeling and AnalysisBusiness, Management and Accounting3 citations
TL;DR

This paper proposes Assured LLM-Based Software Engineering (Assured LLMSE), a generate-and-test framework inspired by Genetic Improvement that uses semantic filters to ensure LLM-generated code maintains original functionality while improving measurable properties like performance and correctness. The approach enables fully automated, human-review-only code enhancement without hallucination risks by enforcing verifiable, testable guarantees in an offline setting.

ABSTRACT

In this paper we address the following question: How can we use Large Language Models (LLMs) to improve code independently of a human, while ensuring that the improved code - does not regress the properties of the original code? - improves the original in a verifiable and measurable way? To address this question, we advocate Assured LLM-Based Software Engineering; a generate-and-test approach, inspired by Genetic Improvement. Assured LLMSE applies a series of semantic filters that discard code that fails to meet these twin guarantees. This overcomes the potential problem of LLM's propensity to hallucinate. It allows us to generate code using LLMs, independently of any human. The human plays the role only of final code reviewer, as they would do with code generated by other human engineers. This paper is an outline of the content of the keynote by Mark Harman at the International Workshop on Interpretability, Robustness, and Benchmarking in Neural Software Engineering, Monday 15th April 2024, Lisbon, Portugal.

Motivation & Objective

  • To address the challenge of ensuring LLM-generated code does not regress original functionality while improving measurable software properties.
  • To enable fully automated code improvement using LLMs without human intervention beyond final review.
  • To develop a verifiable, testable, and measurable framework for LLM-based code generation that supports offline assurance.
  • To bridge the gap between LLM-based code generation and formal software engineering practices through semantic filtering and search-based optimization.
  • To explore scalable, hybrid computational search strategies that integrate LLMs with software measurement and genetic improvement techniques.

Proposed method

  • Employs a generate-and-test pipeline where LLMs produce code variants, followed by automated semantic filtering to validate functional and performance guarantees.
  • Applies a suite of semantic filters that act as fitness functions, ensuring generated code preserves original behavior and improves on metrics like execution time, memory usage, and test coverage.
  • Uses offline processing to enable time-intensive verification steps such as full regression testing, static analysis, and linter enforcement.
  • Leverages re-prompting and chained prompting strategies to iteratively refine LLM outputs, guided by SBSE principles.
  • Introduces a domain- and code-aware prompting language designed for computational search, enabling genetic operators to evolve effective prompting strategies.
  • Hybridizes LLM inference with parallelized computational search to scale the optimization process, exploiting embarrassingly parallel LLM response evaluation.
Figure 1. Top level comparison between Assured and Non-Assured Large Language Model Software Engineering. In the assured mode, there is a whole infrastructure phase for implementing ‘Assurance by Analysis and Manipulation’. This assurance phase pre-processes and post-processes the initial code produ
Figure 1. Top level comparison between Assured and Non-Assured Large Language Model Software Engineering. In the assured mode, there is a whole infrastructure phase for implementing ‘Assurance by Analysis and Manipulation’. This assurance phase pre-processes and post-processes the initial code produ

Experimental results

Research questions

  • RQ1How can LLM-generated code be improved without regressing original functionality?
  • RQ2What mechanisms ensure that LLM-generated code improvements are verifiable, measurable, and formally assured?
  • RQ3How can offline LLMSE be systematically migrated to online deployment while preserving assurance guarantees?
  • RQ4What efficient, approximate metrics can serve as fast proxies for expensive fitness functions in LLM-based code optimization?
  • RQ5How can domain-aware and code-aware search strategies navigate the LLM’s conditional probability distribution to find optimal code improvements?

Key findings

  • The Assured LLMSE framework successfully decouples code generation from human review by enforcing verifiable, testable, and measurable guarantees through semantic filters.
  • Offline deployment enables rigorous assurance checks—such as full regression testing and static analysis—that are infeasible in real-time online settings.
  • Semantic filters act as effective fitness functions, preventing hallucination and ensuring that only semantically correct and improved code variants are retained.
  • The approach enables full automation of code improvement, with the human engineer only serving as a final reviewer, similar to code from human developers.
  • The framework demonstrates the feasibility of integrating SBSE and GI principles into LLM-based code engineering to achieve systematic, measurable, and reliable improvements.
  • Scalable hybridization strategies, including parallel evaluation of multiple prompt programs, show promise for reducing computational costs in large-scale LLMSE pipelines.

Better researchstarts right now

From reading papers to final review, dramatically reduce your research time.

No credit card · Free plan available

This review was created by AI and reviewed by human editors.