A locally testable code is a type of error-correcting code for which it can be determined if a string is a word in that code by looking at a small (frequently constant) number of bits of the string. In some situations, it is useful to know if the data is corrupted without decoding all of it so that appropriate action can be taken in response. For example, in communication, if the receiver encounters a corrupted code, it can request the data be re-sent, which could increase the accuracy of said data. Similarly, in data storage, these codes can allow for damaged data to be recovered and rewritten properly.
Contents
In contrast, locally decodable codes use a small number of bits of the codeword to probabilistically recover the original information. The fraction of errors determines how likely it is that the decoder correctly recovers the original bit; however, not all locally decodable codes are locally testable.
Clearly, any valid codeword should be accepted as a codeword, but strings that are not codewords could be only one bit off, which would require many (certainly more than a constant number) probes. To account for this, testing failure is only defined if the string is off by at least a set fraction of its bits. This implies words of the code must be longer than the input strings by adding some redundancy.
Definition
To measure the distance between two strings, the Hamming distance is used
The distance of a string
Relative distances are computed as a fraction of the number of bits
A code
Limits
It remains an open question whether there are any locally testable codes of linear size, but there are several constructions that are considered "nearly linear":
- Polynomial arbitrarily close to linear; for any
ϵ > 0 ,n = k 1 + ϵ - Functions of the form
n = k 1 + ϵ ( k ) ϵ ( k ) is a function tending toward 0. This makes n closer to linear as k increases. For example: -
1 / log log k -
1 / ( log k ) c c ∈ ( 0 , 1 ) -
exp ( ( log log log k ) c ) / log k forc ∈ ( 0 , 1 )
These have both been achieved, even with constant query complexity and a binary alphabet, such as with
Parallels
Locally testable codes have a lot in common with probabilistically checkable proofs (PCPs). This should be apparent from the similarities of their construction. In both, we are given
Despite this difference, locally testable codes and PCPs are similar enough that frequently to construct one, a prover will construct the other along the way.
Hadamard code
One of the most famous error-correcting codes, the Hadamard code is a locally testable code. A codeword x is encoded in the Hadamard code to be the linear function
It is easy to see that for any valid encoding
This works for
For any given
Long code
The Long code is another code with very large blowup which is close to locally testable. Given an input
Other locally testable codes include Reed-Muller codes (see locally decodable codes for a decoding algorithm), Reed-Solomon codes, and the short code.