arXiv:2611.04023cs.ITNov 2026

Manuscript Offprint

arXiv:2611.04023

Making Every Edit Count: Efficient Binary Edit Correction at the Gilbert-Varshamov Bound

Ryan Gabrys, Shubhransh Singhvi, Eitan Yaakobi

Abstract

We construct binary codes that attain the classical Gilbert–Varshamov redundancy guarantee for a fixed number of edit errors, with deterministic polynomial-time construction, encoding, and decoding. For every fixed integer t≥1t \geq 1 and all sufficiently large block lengths nn, our codes correct any combination of at most tt insertions, deletions, and substitutions in total, with redundancy at most 2tlog⁡2n+Ot(1)2t \log_2 n + O_t(1). All algorithms run in polynomial time in nn for fixed tt, and decoding recovers the original information message. This realizes the classical counting guarantee algorithmically without enumerating the exponentially large space of binary words.

*Qualcomm Institute, University of California San Diego, San Diego, CA, USA. Email rgabrys@ucsd.edu. †Department of Computer Science, Technion—Israel Institute of Technology, Haifa, Israel and Fuzzy Dynamics, Bengaluru, India. Email shubhranshsinghvi2001@gmail.com. ‡Henry and Marilyn Taub Faculty of Computer Science, Technion—Israel Institute of Technology, Haifa, Israel. Email yaakobi@cs.technion.ac.il. – Author names are listed alphabetically.

1 Introduction

A handful of missing bits can create uncertainty far beyond the values of the bits that were lost. Deletions disturb the alignment between a transmitted message and the sequence that reaches the receiver, so that even the surviving symbols may no longer have identifiable positions. This loss of synchronization turns a seemingly modest error model into a fundamental challenge for reliable communication. Since the early 1960s, researchers have sought codes that overcome it with minimal redundancy and efficient algorithms. The history of deletion correction is marked by a striking tension. A nearly optimal solution for a single deletion emerged early, while extending that success to multiple deletions has demanded decades of new ideas.

The contrast with classical error correction explains the difficulty. A substitution changes a symbol's value but preserves its position. An erasure leaves a marked gap. In either case, the receiver retains the correspondence between transmitted and received coordinates, even though some values are wrong or unknown. Familiar algebraic codes exploit this correspondence through checks involving specified positions. An insertion or deletion disrupts this correspondence, forcing the decoder to account for uncertainty about alignment when interpreting such checks. Different alignments can make different original messages consistent with the same received sequence. The code must therefore control uncertainty about both symbol values and symbol positions, and classical techniques do not transfer automatically [HS21].

File synchronization brings this problem into everyday computing. Machines and cloud services must reconcile different versions of a file without retransmitting content they already share. Insertions and deletions shift that content, so matching portions may occur at different offsets. The widely used rsync utility addresses this challenge through hashing, combining rolling checksums with stronger hashes to identify matching blocks and reuse data already present at the receiver [TM96]. Improving such methods remains an active systems problem. SkySync, presented at FAST 2026, builds on rsync and related protocols to reduce the computational cost of cloud synchronization [ZLT+26]. Reducing communication creates a direct role for deletion-correcting codes. Ni, Tauz, Gabrys, and Dolecek incorporate codes that correct multiple deletions into an interactive synchronization protocol, reducing the communication needed to reconcile files when one is a subsequence of the other. Their results show how advances in deletion correction can translate into more efficient synchronization [NTGD25].

The same challenge underlies both DNA data storage and robust watermarking of AI-generated text. In DNA data storage, digital information is encoded in nucleotide sequences, and synthesis and sequencing can introduce insertions, deletions, and substitutions [HMG19]. A watermark intended to identify a text's source, in turn, must remain detectable when words are deleted, inserted, or changed. The 2024 SynthID-Text study evaluated watermarking in a live experiment involving nearly twenty million Gemini responses [DSG+24]. Golowich and Moitra make the coding connection explicit by constructing pseudorandom codes that tolerate insertions, deletions, and substitutions and using them to obtain text watermarks with provable robustness to editing under their stated assumptions [GM24]. These applications require information to remain recoverable or recognizable even when the sequence carrying it has changed.

The origins of the subject lie in the study of communication with synchronization errors. Sellers's work on bit loss and gain appeared in 1962, followed by Levenshtein's foundational combinatorial treatment in the mid-1960s. An early discovery connected this new problem to a construction designed for a different purpose. Varshamov and Tenengolts had introduced codes for correcting a single asymmetric error, and Levenshtein recognized that their weighted-checksum construction also corrects a single deletion. These codes achieve essentially the minimum possible redundancy for that task. The single-deletion acase thus offered an unusually encouraging starting point, with a compact construction, an efficient recovery procedure, and a guarantee close to the information-theoretic limit [Sel62, VT65, Lev66].

Yet extending this early success to multiple deletions proved far more difficult. Helberg codes offered an important generalization of the weighted-checksum approach, proposed by Helberg and Ferreira and later given a complete proof by Abdel-Ghaffar and colleagues. These codes correct multiple deletions, but at a substantial cost. Even for two deletions, their redundancy grows linearly in the length of the transmitted sequence. The construction thus extended the reach of the checksum method while losing the remarkable economy of its single-deletion counterpart. Obtaining explicit codes that combined efficient encoding and decoding with similarly small redundancy remained a central challenge for decades [HF02, APFC12, BGZ18].

The problem also prompted a broader information-theoretic question about how much information a channel can carry when synchronization itself is unreliable. Dobrushin's 1967 coding theorem provided an early foundation for studying channels in which an input symbol can generate a random output sequence, including no output at all. This stochastic viewpoint asks about reliable transmission under a specified random error process. The combinatorial viewpoint instead demands recovery from every error pattern within a prescribed budget. Both study the loss of alignment, but their guarantees are different, with high-probability recovery over a random channel in one case and protection against the worst allowed pattern in the other [Dob67].

The algorithmic side of synchronization has since become an important meeting point of coding theory and theoretical computer science. In 1999, Schulman and Zuckerman constructed codes with efficient encoding and decoding that protect a constant proportion of information against a constant proportion of insertions and deletions. Later, Haeupler and Shahrasbi introduced synchronization strings, a method of attaching robust positional information to a sequence. By helping the receiver recover alignment, this method allows techniques for ordinary symbol errors and erasures to be adapted to insertion/deletion channels. These developments show how identifying positions can itself be treated as a coding problem, rather than assumed to have been solved by the communication system [SZ99, HS21].

The connection with document exchange gives a complementary route to code construction. A short summary that lets a receiver recover an original file from a nearby version can serve as the redundancy of a code, provided the summary itself is protected appropriately. Haeupler's work develops this connection through efficient document-exchange protocols and derives systematic insertion/deletion-correcting codes from them. The relationship makes progress on communication-efficient reconciliation relevant to the design of codes for synchronization errors [Hae19].

Within this broader history, correcting a fixed number of deletions poses a particularly sharp challenge. The message grows longer while the number of errors stays small, so almost all of the transmitted symbols survive. The aim is to protect those messages with a vanishing fraction of redundant bits, while preserving efficient encoding and decoding. The classical single-deletion construction achieves precisely this kind of economy. Multiple deletions are harder to separate because several losses of alignment can interact, and a check that resolves one missing symbol need not distinguish all the possibilities created by several.

Brakensiek, Guruswami, and Zbarsky made a major advance by constructing efficient binary codes for any fixed number of deletions with the same qualitative dependence of redundancy on message length as in the single-deletion case. Multiple deletions could therefore be handled efficiently without a fundamentally larger growth in overhead, although substantial room remained to reduce the amount of redundancy. For two deletions, Guruswami and Håstad subsequently obtained explicit codes matching the leading redundancy of the classical greedy existence guarantee. Their construction builds on the single-deletion checksum by adding checks that distinguish the more complicated ambiguities created by a second deletion. These results illustrate the central algorithmic challenge.

Counting arguments can show that enough well-separated messages exist without revealing how to encode messages into such a set or recover them efficiently [BGZ18, GH21].

For a fixed number tt of errors, the classical Gilbert–Varshamov-type counting argument guarantees binary codes with redundancy at most 2tlog⁡2n+Ot(1)2t \log_2 n + O_t(1), even when the errors may be any combination of insertions, deletions, and substitutions. The direct greedy construction, however, searches an exponentially large space.

Recent results highlight the remaining algorithmic challenge. Bui, Wang, and Vu give deterministic polynomial-time encoding and decoding for binary codes correcting tt such edits with redundancy (2t+1)log⁡2n+Ot(log⁡log⁡n)(2t+1)\log_2 n + O_t(\log \log n). On the existential side, En Gad obtains the smaller redundancy (2t−1)log⁡2n+Ot(log⁡log⁡n)(2t-1)\log_2 n + O_t(\log \log n) for fixed t≥2t \geq 2. The classical Gilbert–Varshamov guarantee is therefore an algorithmic benchmark rather than the strongest known existence bound [BWV26, EG26].

Our focus is to turn the classical Gilbert–Varshamov guarantee into an efficient code construction. We ask the following question.

Problem 1. For every fixed t≥2t \geq 2, can one construct binary codes that correct any combination of at most tt insertions, deletions, and substitutions in total, with redundancy at most 2tlog⁡2n+Ot(1)2t \log_2 n + O_t(1), using deterministic algorithms for construction, encoding, and decoding that run in polynomial time in nn?

We answer this question affirmatively. To the best of our knowledge, this is the first binary code construction to attain the classical Gilbert–Varshamov guarantee up to an additive constant for every fixed t≥2t \geq 2, while supporting deterministic polynomial-time construction, encoding, and decoding. In particular, our result removes the additional log⁡2n\log_2 n term in the redundancy bound of Bui, Wang, and Vu [BWV26] and achieves constant additive overhead above 2tlog⁡2n2t \log_2 n.

Moreover, it provides a surprisingly simple solution to this longstanding construction problem. As we explain in the next section, the proof uses elementary counting and linear algebra. It combines counting solutions to affine binary systems, applying the method of conditional expectations, and encoding messages one bit at a time using additive lower bounds on the number of valid completions. These ideas also apply beyond the edit channel. Section 2.3 compares them with previous approaches and discusses extensions to more general error types.

This paper is organized as follows. Section 2 states the main result, reviews the Gilbert–Varshamov-type bound, and outlines the construction. Section 3 develops the affine representation of edit patterns and the counting procedure used throughout the proof. Section 4 gives the deterministic construction, encoding, and decoding algorithms and proves the main theorem. Section 5 illustrates the method with a worked example. Section 6 concludes with directions for further work.

References (25)