Specification-Guided Synthesis of Deadlock-Free Communication Protocol Refinements with Large Language Models

📅 2026-07-30
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work addresses behavioral inconsistencies and deadlocks arising from protocol refinement in distributed systems by proposing a novel approach that integrates multiparty session types (MPST) formal specifications with large language models. By deeply embedding behavioral correctness constraints—such as deadlock freedom—into the generation process, the method achieves, for the first time, formal-specification-guided automatic protocol refinement. Evaluated across multiple large language models, the approach demonstrates high effectiveness, yielding valid protocols in 95.6%–99.5% of cases while maintaining strong syntactic correctness. It successfully generates diverse and non-trivial deadlock-free protocol variants, substantially enhancing the safety, compatibility, and scalability of protocol replacement in distributed environments.
📝 Abstract
Ensuring behavioural correctness in communication protocols is a central challenge in distributed software systems, as subtle inconsistencies can lead to deadlocks. In such settings, protocol refinement - the safe substitution of a protocol that preserves correctness and compatibility with other components - is essential. Large language models (LLMs) have demonstrated strong capabilities in code generation and program synthesis, yet lack mechanisms to reliably produce outputs with correct behaviour. Formal specification approaches, such as multiparty session types (MPST), offer rigorous guarantees, including deadlock freedom, but provide limited support for automatically constructing protocol refinements. In this paper, we present Syntropy, a framework for synthesising protocol refinements guided by MPST specifications and LLMs. It incorporates refinement constraints directly into the generation process, ensuring the generated variants satisfy these guarantees. Our comprehensive evaluation indicates that Syntropy achieves 95.6%-99.5% validity while maintaining high syntactic correctness, and produces diverse, non-trivial refinements across multiple LLMs.
Problem

Research questions and friction points this paper is trying to address.

deadlock-free
protocol refinement
large language models
multiparty session types
behavioural correctness
Innovation

Methods, ideas, or system contributions that make the work stand out.

protocol refinement
deadlock freedom
multiparty session types
large language models
specification-guided synthesis