Manuscript Offprint
arXiv:2611.08114Sum-of-Squares Refutation Implies Planted Recovery for Semirandom CSPs
Abstract
We give a -time algorithm for solving semirandom planted instances of a -ary Boolean constraint satisfaction problem (CSP) with constraints, for any choice of the runtime parameter . Up to polylog() factors, this matches the known runtime vs. number of constraints trade-off for refuting semirandom CSPs, as well as the trade-off for solving fully random planted CSPs.
Prior work on designing algorithms for semirandom CSPs follows a high-level blueprint of decomposing the constraint hypergraph of the instance into pieces, each with an explicit pseudorandom property that allows the standard algorithm for random CSPs to succeed on every piece. We depart considerably from this framework and instead implicitly learn such a decomposition, without appealing directly to explicit properties such as expansion.
More generally, we construct such a learning algorithm from the assumption that semirandom -XOR has Sum-of-Squares certificates of refutation. This yields the broader implication that any Sum-of-Squares refutation algorithm for semirandom -XOR gives a corresponding algorithm for solving semirandom planted CSPs, and instantiated this reduction with known Sum-of-Squares algorithms for refuting semirandom -XOR gives our main algorithm. To the best of our knowledge, this is the first reduction from search to refutation for (semi)random CSPs.
*Supported by NSF Grant DMS-2424441.
Contents
1 Introduction 1
1.1 Our results 3
1.2 Technical Overview 6
2 Preliminaries 9
2.1 Sum-of-Squares background 9
3 Proof of Theorem 1 10
3.1 The noise prediction algorithm: proof of Lemma 3.5 12
3.2 The sample splitting algorithm: proof of Lemma 3.6 14
4 Solving Semirandom Planted CSPs 15
Acknowledgments 17
Statement of AI Use 18
References 18
Due to the above difficulty of designing algorithms for CSPs in the worst case, and also in part due to reasons in cryptography [Gol00], there has been considerable effort to design algorithms for CSPs in the average case, that is, random CSPs. The study of algorithms for random CSPs can be divided into two lines of work, refutation [GL03, CGL07, AOW15, BM16, RRS17, AGK21, GKM22, HKM23] and search [BHL⁺02, JMS07, BQ09, CCF10, FPV15, GHKM23, BHLM26, COX26], depending on whether the distribution over instances for the -CSP is supported primarily on unsatisfiable instances or satisfiable ones. In the refutation problem, the algorithmic task is to output a certificate of unsatisfiability, whereas in the search problem, the algorithmic task is to find a satisfying assignment. While the search task may appear to be the more natural algorithmic one, it is easier to define the refutation problem because it has the more natural distribution over inputs: a uniformly random -CSP with constraints is unsatisfiable with high probability. To define the search problem, one must specify a distribution over -CSPs that simultaneously has a planted satisfying assignment but still feels similar to a uniformly random CSP. Doing this requires some care to ensure that recovering the planted assignment is not a trivial algorithmic task.¹
However, in sharp contrast to the NP-hardness of worst-case -CSPs (even up to clauses), a line of work [GL03, CGL07, AOW15, BM16] shows that one can refute uniformly random -CSPs with clauses in polynomial time. Furthermore, [RRS17] shows that one can refute random -CSPs with clauses in time for any choice of the “runtime parameter” , thus giving a smooth trade-off between runtime and number of clauses, as the runtime varies from polynomial to fully exponential when the number of clauses decreases from to . This trade-off is known to be optimal for Sum-of-Squares algorithms [KMOW17], and is also the basis of some cryptographic hardness assumptions [ABW10]. More recently, [AGK21, GKM22, HKM23] show that one can also refute semirandom -CSPs at the same runtime vs. number of constraints trade-off as [RRS17]: a semirandom -CSP is a CSP that is chosen with a worst-case constraint hypergraph (or scopes), while the literal negations are chosen independently and uniformly at random. That is,
¹For example, for some CSPs such as -SAT, if every clause is sampled uniformly randomly conditioned on being satisfied by , then a simple “literal counting” argument suffices to recover when the instance only has constraints. In such cases, clauses have to be sampled non-uniformly from the set of clauses satisfying to pose an interesting algorithmic question. See Definition 1.7 for details.
a semirandom -CSP is a random -CSP with an arbitrary constraint hypergraph.
A parallel line of results also holds for solving random planted CSPs. A long line of works [BHL⁺02, JMS07, BQ09, CCF10, FPV15], culminating in [FPV15], gives a polynomial-time algorithm to solve random planted -CSPs with clauses, and this was extended very recently by [BHLM26] to obtain the “[RRS17]”-style trade-off between runtime and number of clauses. That is, [BHLM26] gives an algorithm to solve random planted CSPs in time with constraints. Thus, for random CSPs, the algorithms for refutation and search have essentially² identical runtime vs. number of clauses trade-offs, even though they have been obtained in parallel lines of work and we have no formal reductions between the two.
Surprisingly, progress on designing algorithms for semirandom planted CSPs has been much more limited. Analogous to the definition of semirandom CSPs in the refutation case, a semirandom planted CSP is sampled similarly to a random planted CSP, only the constraint hypergraph is now worst-case. The only known algorithmic result is due to [GHKM23], which gives a poly-time algorithm for solving³ semirandom planted CSPs with constraints. Despite several recent attempts [BHLM26, Kot26], we still do not have an algorithm that achieves a “[RRS17]”-style runtime vs. constraints trade-off for semirandom planted CSPs.
The lack of a “[RRS17]”-style trade-off for semi-random planted CSPs is aesthetically displeasing in its own right; we want to obtain the same complete picture of search algorithms for planted CSPs in the semirandom case like we do for random CSPs. However, more importantly, it exposes a more fundamental gap in our understanding of the average-case complexity of CSPs: we do not know how to relate the computational tractability/difficulty between refutation and search! This gap in our understanding is made even more perplexing by the fact that the runtime vs. constraints trade-offs are nearly identical for both problems in the random case, even though known algorithms for search generally require significantly more technical ideas than their refutation counterparts. While there has been a recent attempt at unifying these two lines of work [AMX26], there is still no reduction known between refutation and search.
Our contributions. As the main contribution of this paper, we close this gap in our understanding by showing a generic reduction that gives an algorithm for solving semirandom planted CSPs from Sum-of-Squares refutation certificates for semirandom -XOR. Instantiating this reduction with known “[RRS17]”-style Sum-of-Squares algorithms for refuting semirandom -XOR yields an “[RRS17]”-style algorithm for solving semirandom planted CSPs.
We note that strictly speaking, this is not a reduction from, say, the semirandom planted -SAT problem to Sum-of-Squares refutation for semirandom -SAT, but rather -XOR. However, we note that all Sum-of-Squares refutation algorithms for general Boolean CSPs go via a reduction from a general -CSP to semirandom -XOR, and similarly algorithms for planted CSPs [FPV15, GHKM23, BHLM26], including the algorithm in this paper, also go via a reduction from the general case to -XOR. Thus, the asymmetry between the predicate of the -CSP of the planted problem versus the -XOR predicate for refutation should be viewed only a mild technicality.
²Technically, this holds up to polylog factors, which we have suppressed.
³Technically, the algorithm outputs an assignment satisfying a -fraction of the equations, and this almost certainly cannot be avoided.
1.1 Our results
We now turn to giving more formal statements of our results. We will first explain our results for k-XOR before we give our results for general Boolean k-CSPs. Before we continue, we recall the definition of semirandom noisy planted k-XOR, as defined in [GHKM23].
Definition 1.1 (k-XOR instance). An instance of -XOR with variables and constraints is defined by the data , where (1) is an arbitrary multiset, and (2) for each . This data represents the system of constraints , where .
We let denote the polynomial where for every , is the fraction of constraints satisfied by . We call this polynomial the instance polynomial of .
Definition 1.2 (Semirandom planted noisy k-XOR). Let be an arbitrary multiset, and let . Let denote the distribution on -XOR instances obtained by, for each , sampling bits independently for each , and then adding the constraints , where . Here, is the distribution over that is 1 with probability , and otherwise is -1, and . A semirandom planted noisy k-XOR instance is an instance drawn from , for some choice of , and . We note that is represented by the data , where the 's are the right-hand sides of the constraints.
Our main result shows that if degree- Sum-of-Squares is capable of certifying that when , i.e., the right-hand sides of the instance are chosen uniformly at random from , then there is an -time algorithm that, when given an instance , is essentially capable of de-noising the constraints, provided that we approximately know .
Theorem 1 (Informal Theorem 3.1). Let . There is an algorithm that takes as input a “runtime parameter” , a “bias guess” , and a -XOR instance with constraint hypergraph of size , and in time outputs a partition of with the following guarantee. Suppose that, with probability over , degree- Sum-of-Squares can certify that . Then, with probability , it holds that (1) for every , we have , (2) for every , we have , and (3) is a set of size .
Applying known results on semirandom k-XOR refutation using Sum-of-Squares [AGK21, GKM22, HKM23], we obtain the following corollary.
Corollary 1.3. Let . There is an algorithm that takes as input a “runtime parameter” , a “bias guess” , and a -XOR instance with constraint hypergraph of size , and in time outputs a partition of with the following guarantee. Suppose that the input is drawn from and . Then, with probability , it holds that (1) for every , we have , (2) for every , we have , and (3) is a set of size .
The output sets , of Theorem 1 and Corollary 1.3 should be interpreted as the algorithm's guesses for constraints where and , respectively, with denoting a set of constraints where the algorithm is allowed to "give up" with no penalty, albeit subject to the requirement that it cannot "give up" on too many constraints. The strong guarantee achieved by Theorem 1 and Corollary 1.3 is that with high probability, the algorithm's implicit guess is correct for every simultaneously, and is the bulk of the constraints. This means that by changing the sides of the right-hand sides appropriately and running Gaussian elimination on the constraints in , we can easily obtain an assignment where for all , and since this is the bulk of the constraints, we then have .
Notice that if we are given the hidden "noise bits" (as defined in Definition 1.2) for the instance , then we can trivially recover for every , which is all the information that the hypergraph can yield about . Because is "small", the algorithm recovers for almost all , which is intuitively almost all of the information encoded about in the instance . As pointed out in [GHKM23], there are simple examples that show that we cannot hope to recover for all , allowing the algorithm to discard some small subset of is necessary.
However, there is one caveat about the algorithm in Theorem 1: it requires a very good estimate of in order for the algorithm to succeed with high probability. This is not an issue if we are only interested in recovering a good assignment to the instance , as we can try all values of for , and one of them is guaranteed to be -close to . The following corollary captures this algorithm, which successfully recovers a near-optimal assignment to a semirandom planted noisy -XOR instance.
Corollary 1.4 (Informal). Let . There is an algorithm that takes as input a "runtime parameter" and a -XOR instance with constraint hypergraph of size , and in time outputs an assignment with the following guarantee. Suppose that the input is drawn from and . Then, with probability , it holds that .
Note that with probability , we have and , so with probability .
We prove Theorem 1 and Corollaries 1.3 and 1.4 in Section 3.
Extension to general Boolean CSPs. As shown by the reduction in [GHKM23, Section 4], any algorithm for semirandom planted noisy -XOR with the strong output guarantees as in Theorem 1 can be extended to give an algorithm for solving any semirandom planted Boolean -CSP. We thus obtain analogous algorithms for general semirandom planted CSPs. Before we can state the guarantees of our algorithm, we recall the definitions of semirandom planted CSPs, as defined in [GHKM23].
Definition 1.5 (k-ary Boolean CSP). A CSP instance with a k-ary predicate is a set of constraints on variables of the form , where
Technically, the reduction requires a small modification due to the presence of the "bias guess" in Theorem 1. We explain the slight modification in Section 4.
ranges over a collection of scopes (or clause structure) of -tuples of variables and are “literal negations”, one for each in . We additionally allow to be a multiset, i.e., that multiple clauses can contain the same ordered tuple of variables.
We let denote the fraction of constraints satisfied by an assignment , and we define the value of , , to be .
Definition 1.6 (Instance polynomial). Given a -CSP instance with predicate , we define the instance polynomial as follows
Note that is a degree polynomial, and that is the fraction of constraints satisfied by an assignment .
A semirandom planted CSP is defined as follows.
Definition 1.7 (Semirandom planted -ary Boolean CSPs). Let be a predicate. We say that a distribution over is a planting distribution for if .
We say that an instance with predicate is a semirandom planted instance with planting distribution if it is sampled from a distribution where
(1) The planted assignment is arbitrary;
(2) the set is an arbitrary multiset. We let ;
(3) for each , the literal negations are sampled by , where “” denotes the element-wise product of two vectors. That is, for each . Then, add the constraint
to the instance .
Because is supported only on satisfying assignments to , it follows that if , then with probability 1, i.e., satisfies .
Theorem 2 (Informal). Let . There is an algorithm that takes as input a “runtime parameter” and a -CSP with predicate and constraint hypergraph of size , and in time outputs an assignment with the following guarantee. Suppose that, with probability over , degree- Sum-of-Squares can certify that . Then, if for any , with probability , it holds that .
Applying known results on semirandom -XOR refutation using Sum-of-Squares, gives the corollary:
Corollary 1.8. Let . There is an algorithm that takes as input a “runtime parameter” and a -CSP with predicate and constraint hypergraph of size , and in time outputs an assignment with the following guarantee. Suppose that the input is drawn from and . Then, with probability , it holds that .
We prove Theorem 2 and Corollary 1.8 in Section 4.
1.2 Technical Overview
In this subsection, we give an overview of the proof of Theorem 1. Let be the input to the algorithm.
The barriers of current approaches. The strategy employed by [GHKM23] is to partition into sets , where is the set of bad hyperedges that will be outputted in Theorem 1, and for every constraint set in the partition, there is an algorithm that recovers for all correctly and simultaneously with high probability when given . As the subinstance of with hyperedges is clearly distributed as , the result follows.
The way this strategy is executed in [GHKM23] is by using expander decomposition. For simplicity, let us assume that is even, as the proof of [GHKM23] is substantially simpler when is even. They first convert the hypergraph to a graph using the basic, or level , Kikuchi graph, which is a graph with vertices and an edge if . By using expander decomposition, they decompose into expanders with spectral gap , and they argue that the basic SDP for 2-XOR successfully “de-noises” all edges if the graph is an expander.
The issue with this strategy is that it seems difficult to generalize it to the general case of -time algorithms. The natural approach here is to try to use the level Kikuchi graph, which is a graph with vertices and edges if , where is the symmetric difference of and . However, the expander decomposition strategy no longer works, as the spectral gap that one can ensure is only . This ends up losing an extra poly() factor in the number of constraints, and which does not yield the vs. constraints trade-off that we are targeting.
More recently, there have been two attempts, first by [BHLM26] and then by [Kot26] to extend the strategy of [GHKM23] to give an algorithm with an “[RRS17]”-style trade-off. However, both attempts have only succeeded in the case of random -CSPs, and the latter work of [Kot26] even has the additional restriction that must be even, which is typically the case that is substantially easier to prove.
The algorithm in [BHLM26] is a 2-step algorithm that first finds an assignment that is close to while holding out of the random constraints, and then in the second step it rounds to exactly recover using these extra constraints. The key idea in the first step is to not use the Kikuchi graph , but instead study a direct notion of expansion on . This notion, called
"(ℓ, λ)-certifiable expansion" in [AMX26], says that
for every degree- pseudo-expectation . Certifiable expansion is a natural generalization of spectral expansion, which is for homogeneous degree 2 polynomials, to homogeneous degree polynomials. It is therefore natural to wonder if one can replace the spectral expansion criteria in [GHKM23] with certifiable expansion. It turns out, however, that this is too much to hope for. The work of [COX26, AMX26] shows that if a -CSP has a constraint hypergraph that is -certifiably expanding, then there is an -time algorithm that finds a near-optimal assignment , i.e., with , and this algorithm succeeds even if the literal negations of are worst case, and may be chosen depending on the hypergraph . In other words, if we could decompose any hypergraph into certifiably expanding pieces while only discarding a small fraction of hyperedges, then we would be able to find a near-optimal assignment to any worst-case CSP, which would imply that . Thus, certifiable expansion is too strong to be used for semirandom planted CSPs.
The work of [Kot26] reproves the main result of [BHLM26] in the restricted case of even with a different approach: it shows that if is random, then is a spectral sparsifier of the Johnson scheme. The hope expressed in [Kot26] is that one could decompose an arbitrary hypergraph into components that are each approximately Johnson, and then the analysis of [GHKM23] would then immediately give an algorithm for semirandom planted CSPs. However, this hope is too good to be true, for the same reason as certifiable expansion. Indeed, it is not too difficult to observe that if is a spectral sparsifier of the Johnson scheme with relative error, then is -certifiably expanding. Thus, the arguments of [COX26, AMX26] again imply that this is too strong of a condition to be used in the semirandom case.
In essence, both certifiable expansion and Johnson spectral sparsification are properties that rely very heavily on having a random , and are too strong to extend to the semirandom setting of a worst-case .
Our approach: learning the set of bad hyperedges. The key idea behind our approach is very simple: rather than attempting to find the "bad hyperedges" and a decomposition of the remaining hyperedges into "good pseudorandom pieces" , we will instead learn the bad hyperedges directly. For simplicity, in the below exposition we will assume that the algorithm knows exactly. We note that in Theorem 1, this is not required, and the algorithm is only guaranteed to work well if it is given an estimate that is close to .
To design the learning algorithm, we consider the following experiment. Suppose we sample , which we note is identically distributed as (since we know ) except the planted assignment is instead of . Now, we can compute the degree- pseudo-expectation that maximizes . By appealing to known results for semirandom -XOR refutation, we can show (see proof of Lemma 3.5 in Section 3.1) that has . As by the Booleanity constraints, it follows that at least hyperedges have .
The above analysis shows that if we use as a “guess” for whether or not , i.e., whether or not the hyperedge is noisy in , then every time we run this experiment, there are at least hyperedges where this estimator is correct. Note that this not sufficient to imply Theorem 1 because the output of Theorem 1 is not permitted to make any mistakes. If we run the estimator directly on the input instance , it will have correct predictions for most hyperedges, but we do not know which hyperedges are wrong. (We cannot union bound over all hyperedges because the term can only be as small as .) That is, we need to determine the set of hyperedges where the estimator is untrustworthy.
Let denote the set of “good” hyperedges where the estimator is correct with probability at least over the draw of . Imagine that we are given independent samples from the same distribution as . (Note that we cannot actually draw these samples, as we do not know .) The “noise predictor” immediately gives a prediction for each in each subsample, and we know that if is “good”, then the predictions are i.i.d. and each correct with probability . If , then taking the majority vote is correct with probability , and this is high enough to take a union bound over all hyperedges in .
There are still two components missing from the full proof. First, we need to argue that we can find the set algorithmically. This is fairly straightforward, as by generating the fake samples (which we can do, because they have planted assignment ) we can obtain an empirical estimate for the probability that estimator is correct on each hyperedge. By taking all hyperedges with empirical probability larger than some appropriate cut-off, we obtain a subset of size at least and we also have with high probability. This allows us to find a large subset of the good hyperedges, which is sufficient. We set .
The far more pressing issue, however, is that we cannot actually generate the samples ourselves because we do not know . The key technical lemma, Lemma 3.6, shows that we actually can generate these samples from the single sample , at the cost of decreasing the bias parameter . In more detail, Lemma 3.6 shows the following simple statement. Suppose we are given a bit generated as where is secret and . Then, there is an algorithm running in time that outputs that is jointly distributed as i.i.d. samples from . This allows us to split the single sample from into samples from . Running the predictor algorithm with samples generated from then finishes the algorithm. We note that Lemma 3.6 is closely related to more general “cloning theorems” in literature, see, for e.g. [BBH19, Lemma 14] and [BB20, Lemma 22]. We nevertheless prove Lemma 3.6 to keep our presentation self-contained.
Finally, we note that while the algorithm does not know itself, one can show that if we run the algorithm using to generate our samples, rather than the true , then all of the above distributions using are -close in TV distance to the “true target” distributions that use . This allows us to make do with a “good enough” estimate of , which we can guess by trying all possibilities.
The full proof of Theorem 1 and its related corollaries Corollaries 1.3 and 1.4 is presented in Section 3. We prove the guarantees of the “noise predictor” (Lemma 3.5) in Section 3.1, and we prove the sample splitting lemma (Lemma 3.6) in Section 3.2. We prove Theorem 2, the generalization to semirandom planted k-CSPs, and its related corollary Corollary 1.8 in Section 4.
2 Preliminaries
We state some notation and background that we will use in the proofs of our results.
We define the distribution Bias( ), as follows.
Definition 2.1 (Biased random bit). Let . Let Bias( ) to be the distribution that is equal to 1 with probability and -1 otherwise.
2.1 Sum-of-Squares background
We recall some basic facts about SoS (see [BS16, FKP19] for further details). Define to be the set of polynomials in of degree .
Definition 2.2 (Pseudo-expectations over the hypercube). For any , a degree pseudo-expectation over is a linear functional satisfying the following properties:
-
(Normalization) ,
-
(Booleanity) for all , ,
-
(Positivity) for all .
Finally, denote by ( ) the set of all degree ( ) pseudo-expectations over .
We will make a slight abuse of terminology and use the phrase “pseudo-expectation” to mean a pseudo-expectation over . Note that for any degree-t multilinear polynomial , it holds that for all .
Given a degree-t polynomial , the SoS algorithm can compute all moments up to degree of some pseudo-expectation in in time.
Fact 2.3 (SoS Algorithm (Corollary 3.40 in [FKP19])). Let be a polynomial of degree with rational coefficients such that each coefficient has bit complexity. Then for any , there exists an algorithm that, on input and , runs in time and outputs , where for all , and . In particular in time one can compute such that satisfies , where .
We will use the fact that Sum-of-Squares is capable of certifying that a semirandom k-XOR instance has value , which is shown in [AGK21, GKM22, HKM23].
Fact 2.4 (Theorem 4.1 of [HKM23]). Fix , and let . Let be a -uniform hypergraph with vertices and hyperedges, and let be a semirandom -XOR instance, where the right-hand sides of each constraint are independently chosen from . If for and , then with probability over , it holds that for every degree- pseudo-expectation (Definition 2.2).
3 Proof of Theorem 1
In this section, we prove the formal versions of Theorem 1 and Corollaries 1.3 and 1.4. We will first prove Theorem 3.1 stated below, which is the formal version of Theorem 1.
Theorem 3.1. Let . There is an algorithm that takes as input a “runtime” parameter , a “bias guess” , and a -XOR instance with constraint hypergraph with hyperedges, and in time outputs a partition with the following guarantee. Suppose further that degree- sum-of-squares can refute instances drawn from , i.e., that with probability over , it holds that
Let and . Then, with probability over the draw of , it holds that (1) for every , we have , (2) for every , we have , and (3) .
We note that Theorem 3.1, together with known SoS refutation algorithms (Fact 2.4), implies the following corollary, which is the formal version of Corollary 1.3.
Corollary 3.2. Let . There is an algorithm that takes as input a “runtime parameter” , a “bias guess” , and a -XOR instance with constraint hypergraph of size , and in time outputs a partition of with the following guarantee. Suppose that the input is drawn from and for some universal depending only on . Then, with probability , it holds that (1) for every , we have , (2) for every , we have , and (3) is a set of size .
Proof. By Fact 2.4, for sufficiently large , with probability over , we have for all degree-2 pseudoexpectations . The result then holds with probability by Theorem 3.1.
Remark 3.3. When is even, the result of Fact 2.4 holds when , with a dependence of instead of (see Remark 4.2 of [HKM23]). Thus the result of Corollary 3.2 holds when .
Corollary 3.4. Let . There is an algorithm that takes as input a “runtime parameter” and a -XOR instance with constraint hypergraph of size , and in time outputs an assignment with the following guarantee. Suppose that the input is drawn from and for some universal depending only on . Then, with probability , it holds that .
Note that with probability , we have and , so with probability .
Proof. Let be the constant from Corollary 3.2 and for all , run the algorithm of Theorem 3.1 with , let be its output, and solve the linear system with equations for . Output the value of maximizing .
There exists an such that , so by Corollary 3.2, with probability , we have and for all and for all , so the system has at least one solution satisfying for all and thus .
As explained in Section 1.2, the proof of Theorem 3.1 follows a simple two step process. First, we use Sum-of-Squares semirandom -XOR refutation certificates to construct a “noisy prediction” algorithm, and then we the sample splitting trick to split the input into independent copies from a semirandom -XOR distribution with smaller bias.
The noise predictor is captured by the first lemma below, and the splitting trick is captured by the second lemma.
Lemma 3.5 (Noise prediction algorithm). Let . There is a deterministic algorithm Predict that takes as input a “runtime parameter” , a “bias guess” , and a -XOR instance with constraint hypergraph on variables with hyperedges, and in time outputs a function with the following guarantee. Suppose further that degree- sum-of-squares can refute instances drawn from , i.e., that with probability over , it holds that
Then there is an -time randomized algorithm Prune that takes in and outputs some of size at least such that with probability , for every and every ,
Lemma 3.6 (Sample splitting). There is a randomized algorithm that takes as input a bit , a parameter and , and in time outputs with the following guarantee. Suppose that where is a secret bit and . Then, the joint distribution of , over the randomness of the algorithm and , is -close in TV distance to independent samples from .
We postpone the proofs of Lemmas 3.5 and 3.6 to Sections 3.1 and 3.2, respectively. Below, we finish the proof of Theorem 3.1.
Proof of Theorem 3.1. Our algorithm works as follows:
-
Set and for all , run the algorithm of Lemma 3.6 on to generate bits .
-
For all , let run the algorithm Predict (Algorithm 3.7) from Lemma 3.5 on and let denote its output.
-
Run the algorithm Prune (Algorithm 3.8) from Lemma 3.5 on and let denote its output.
-
For all , let .
-
Set , , and . Output .
By Lemma 3.6, note that is -close in total variation distance to independent samples from Bias, so the total variation distance of and independent XOR is at most . Therefore, by Lemma 3.5, Chernoff, and a union bound, with probability , we have for all , and for all with probability . ■
3.1 The noise prediction algorithm: proof of Lemma 3.5
In this subsection, we prove Lemma 3.5, restated below.
Lemma 3.5 (Noise prediction algorithm). Let . There is a deterministic algorithm Predict that takes as input a “runtime parameter” , a “bias guess” , and a -XOR instance with constraint hypergraph on variables with hyperedges, and in time outputs a function with the following guarantee. Suppose further that degree- sum-of-squares can refute instances drawn from XOR, i.e., that with probability over , it holds that
Then there is an -time randomized algorithm Prune that takes in and outputs some of size at least such that with probability , for every and every ,
Proof. First, we state the algorithm Predict for generating the predictor .
Algorithm 3.7 (Predict).
Input: A system of -XOR equations , where , and a parameter .
Output: A function of predictions.
Operation:
(1) Sample uniform independent bits .
(2) Set for all and solve the SDP .
(3) Let where . Output pred.
Next, we state the algorithm Prune for finding .
Algorithm 3.8 (Prune).
Input: A -uniform hypergraph
Output: A subset .
Operation:
(1) For iterations, sample independent bits , run Predict on , and let be the result.
(2) For all , let . Output .
Run Prune on . For any , let and be the random bits and pseudoexpectation from the call to Predict. Note that . For any , we have if , so . Thus the total number of incorrect predictions for the th iteration is upper bounded by . By optimality, we have , so
For all , let be an independent Bias() and be an independent Rademacher. Then
where the last step follows from the refutation guarantee, so the expected number of mistakes is at most . By Chernoff, the total number of incorrect predictions over all rounds is at most
with probability . Therefore, since counts the total number of , such that over all iterations, we have
Now we bound the prediction accuracy given a planted XOR instance with sufficiently close bias . By Chernoff and a union bound, with probability , we have . Then for all , we have . Now consider and suppose we run Predict on . Note that , and that does not depend on as pred randomizes the plant to some before solving the SDP. Thus with probability , for all ,
3.2 The sample splitting algorithm: proof of Lemma 3.6
In this subsection, we prove Lemma 3.6, restated below
Lemma 3.6 (Sample splitting). There is a randomized algorithm that takes as input a bit , a parameter and , and in time outputs with the following guarantee. Suppose that where is a secret bit and . Then, the joint distribution of , over the randomness of the algorithm and , is -close in TV distance to independent samples from .
Proof. For all and any , let be the density functions of independent and random variables, respectively. Given input , we sample with probability
First we show this is nonnegative for all . Note that , . Without loss of generality, assume (the same calculation holds with in place of when ). Then
To show that each has the ideal bias distribution, let and first note that
For intuition, observe that since , we have
so each has distribution .
Now we will show the desired bound on the total variation. Let be the pdf of independent Bias random variables. Observe that . By symmetry, we may assume that s = 1.
Then the total variation distance between the distribution and the distribution is . The latter term is at most , which is . It remains to bound . We have
Hence, , as required.
Remark 3.9. We note that Lemma 3.6 is implied by the more general “cloning theorems”, see [BBH19, Lemma 14] and [BB20, Lemma 20]. In fact, [BB20, Lemma 20] can sample the independent bits in poly(t) time (as opposed to the naive time that it takes our algorithm, which writes down the entire PDF of to sample ).
4 Solving Semirandom Planted CSPs
In this section, we prove Theorem 2 and Corollary 1.8. We state the formal versions below.
Theorem 4.1. Let . There is an algorithm that takes as input a “runtime parameter” and a -CSP with predicate and constraint hypergraph of size , and in time outputs an assignment with the following guarantee. For all , let be the -uniform hypergraph where for all . Suppose that for all with probability over , degree- Sum-of-Squares can certify that , and either the same holds for or we have . Then, if for any , with probability , it holds that .
Corollary 4.2. Let . There is an algorithm that takes as input a “runtime parameter” and a -CSP with predicate and constraint hypergraph of size , and in time outputs an assignment with the following guarantee. Suppose that the input is drawn from and for some universal constant depending only on . Then, if for any , with probability , it holds that .
Proof of Corollary 4.2. By Fact 2.4, for sufficiently large , for any such that , with probability over we have for all degree- pseudoexpectations . Since we have , the result then holds with probability by Theorem 4.1.
Recall the definition of a semirandom planted -CSP with predicate and planting distribution from Definition 1.7. Let be the Fourier coefficients of the distribution function of , i.e. .
Using , we define -XOR instances for all as follows.
Definition 4.3. Let be a planted -ary CSP with clause set and negations . For all , define to be the -XOR instances where, for all , contains the constraint , where and , and contains the constraint .
We note that are noisy planted -XOR instances with the same planted assignment .
Fact 4.4 (Claim 4.2 of [GHKM23]). and
We modify the reduction in Section 4 of [GHKM23], which first guesses which satisfy , then guesses for each of those , and uses their noisy planted semirandom -XOR algorithm to solve either or , depending on the sign guess. Since our more general noisy planted -XOR algorithm requires us to guess such that to achieve our soundness guarantee, we additionally guess a noise level for each or .
We first state two simple results shown as part of the proof of Theorem 2 of [GHKM23]. The first shows that for any clause such that has sufficiently large probability mass on , then if we have some consistent with on all subsets except those where is small, satisfies clause . The second states that with high probability, all but fraction of clauses will have a planted value with large enough probability mass.
Fact 4.5 (Step 2, Proof of Theorem 2 of [GHKM23]). Suppose such that and for all such that , we have . Then .
Fact 4.6 (Step 3, Proof of Theorem 2 of [GHKM23]). With probability , for all but at most fraction of , we have .
Finally, we state the following result for solving planted 1-XOR instances, which we use to solve or when .
Fact 4.7 (Lemma C.1 of [GHKM23]). Let . There is an algorithm that takes as input a 1-XOR instance with constraint set of size and in time outputs a partition such that for any , with probability over the draw of , it holds that (1) for every , we have , (2) for every , we have , and (3) .
Proof of Theorem 4.1. We iterate over all functions and do the following given some , for all , construct , and for all , construct . Then for all and , iterate over all for and apply the algorithm of Theorem 3.1 to obtain a partition . Then for each , , solve the linear system
to obtain some . Finally, output the value of that maximizes .
Then there exists some such that if and only if , if and only if , and otherwise, and for each , some such that . Then for all such where by Fact 4.4, we apply the algorithm Theorem 3.1 with and (so ), and when , we either do the same or apply the algorithm of Fact 4.7. A union bound shows that with probability , simultaneously for all we have for all , for all , and . Letting , we get , and for all , , we have . Then by Fact 4.5 and Fact 4.6, with probability , for all but at most of . Thus with probability , as desired.
Acknowledgments
We thank Pravesh K. Kothari, Jun-Ting "Tim" Hsieh, and Venkatesan Guruswami for numerous helpful discussions over the years on the semirandom planted CSP problem. We also thank Madhur Tulsiani and Tushant Mittal for pointing out the connection between Lemma 3.6 and the general theory of Bernoulli factories.
Statement of AI Use
This statement is intended solely to describe the role of AI in the research process and should not be read as an endorsement of such systems or of the companies that produce them. In the production of this paper, we have used AI models for the following tasks.
| Activity | AI used |
|---|---|
| Asking the research question | [No] |
| Coming up with the approach | [No] |
| Proof development | [Yes] |
| Writing and exposition | [No] |
| Checking for bugs | [Yes] |
| Other supporting tasks | [Yes] |
Details. The problem of designing an “[RRS17]”-style algorithm for semirandom planted CSPs dates back to [GHKM23]. Over the course of our previous work [BHLM26], we came up with the “learning algorithm” approach explained in Section 1.2 in one of our attempts to design an algorithm for random planted CSPs. However, we were unable finish the proof ourselves, as we did not see how to prove a statement like Lemma 3.6.
A few weeks after the release of GPT-6 Astra, A.L. attempted to tackle the “[RRS17]”-style semirandom planted CSP problem with the help of Astra, and succeeded after a few prompts with vacuous human input. Notably, Astra was not provided with the “learning algorithm” approach, which it came up with independently from us. However, from our perspective the key contribution of Astra was Lemma 3.6, as we already had formulated and proven all the other key lemmas in this paper, such as Lemma 3.5, ourselves. A subsequent literature search using GPT-6 Astra revealed that Lemma 3.6 was already present in the literature [BBH19, BB20], and it seems plausible that GPT-6 Astra got the idea of Lemma 3.6 from the aforementioned papers, which it then used without attribution.
We have verified the correctness and originality of all content, including references, by completely rewriting the AI’s output and manually incorporating it into the paper. We have not made use of AI in the writing process, except to check for bugs after a near-final draft was produced and to do a literature search for Lemma 3.6.
References
[ABW10] Benny Applebaum, Boaz Barak, and Avi Wigderson. Public-key cryptography from different assumptions. In Proceedings of the 42nd ACM Symposium on Theory of Computing, STOC 2010, Cambridge, Massachusetts, USA, 5-8 June 2010, pages 171–180. ACM, 2010. 1
[AGK21] Jackson Abascal, Venkatesan Guruswami, and Pravesh K. Kothari. Strongly refuting all semi-random Boolean CSPs. In Proceedings of the 2021 ACM-SIAM Symposium on Discrete Algorithms, SODA 2021, Virtual Conference, January 10 - 13, 2021, pages 454–472. SIAM, 2021. 1, 3, 9
[AKK95] Sanjeev Arora, David R. Karger, and Marek Karpinski. Polynomial time approximation schemes for dense instances of NP-hard problems. In Proceedings of the Twenty-Seventh Annual ACM
Symposium on Theory of Computing, 29 May-1 June 1995, Las Vegas, Nevada, USA, pages 284–293. ACM, 1995. 1
[ALM 98] Sanjeev Arora, Carsten Lund, Rajeev Motwani, Madhu Sudan, and Mario Szegedy. Proof verification and the hardness of approximation problems. Journal of the ACM (JACM), 45(3):501–555, 1998. 1
[AMX26] Prashanti Anderson, Peter Manohar, and Jeff Xu. Certifiable near-optimality: A simple framework for unifying search and refutation for (semi)random csps. CoRR, abs/2609.38367, 2026. 2, 7
[AOW15] Sarah R. Allen, Ryan O'Donnell, and David Witmer. How to Refute a Random CSP. In IEEE 56th Annual Symposium on Foundations of Computer Science, FOCS 2015, Berkeley, CA, USA, 17-20 October, 2015, pages 689–708. IEEE Computer Society, 2015. 1
[AS98] Sanjeev Arora and Shmuel Safra. Probabilistic checking of proofs: A new characterization of np. Journal of the ACM (JACM), 45(1):70–122, 1998. 1
[BB20] Matthew Brennan and Guy Bresler. Reducibility and statistical-computational gaps from secret leakage. In Proceedings of Thirty Third Conference on Learning Theory, volume 125 of Proceedings of Machine Learning Research, pages 648–847. PMLR, 09–12 Jul 2020. 8, 15, 18
[BBH19] Matthew Brennan, Guy Bresler, and Wasim Huleihel. Universality of computational lower bounds for submatrix detection. In Proceedings of the Thirty-Second Conference on Learning Theory, volume 99 of Proceedings of Machine Learning Research, pages 417–468. PMLR, 25–28 Jun 2019. 8, 15, 18
[BHL 02] Wolfgang Barthel, Alexander K Hartmann, Michele Leone, Federico Ricci-Tersenghi, Martin Weigt, and Riccardo Zecchina. Hiding solutions in random satisfiability problems: A statistical mechanics approach. Physical review letters, 88(18):188701, 2002. 1, 2
[BHLM26] Arpon Basu, Jun-Ting Hsieh, Andrew D. Lin, and Peter Manohar. Solving random planted csps below the threshold. In 53rd International Colloquium on Automata, Languages, and Programming, ICALP 2026, Royal Holloway, University of London, Egham, United Kingdom, July 7-10, 2026, volume 374 of LIPIcs, pages 23:1–23:22. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2026. Full version: arXiv:2507.10833. 1, 2, 6, 7, 18
[BM16] Boaz Barak and Ankur Moitra. Noisy Tensor Completion via the Sum-of-Squares Hierarchy. In Proceedings of the 29th Conference on Learning Theory, COLT 2016, New York, USA, June 23-26, 2016, volume 49 of JMLR Workshop and Conference Proceedings, pages 417–445. JMLR.org, 2016. 1
[BQ09] Andrej Bogdanov and Youming Qiao. On the security of Goldreich's one-way function. In Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques: 12th International Workshop, APPROX 2009, pages 392–405. Springer, 2009. 1, 2
[BS16] Boaz Barak and David Steurer. Proofs, beliefs, and algorithms through the lens of sum-of-squares, 2016. Lecture notes, available at http://sumofsquares.org. 9
[Bul17] Andrei A. Bulatov. A dichotomy theorem for nonuniform csps. In 2017 IEEE 58th Annual Symposium on Foundations of Computer Science (FOCS), pages 319–330, 2017. 1
[CCF10] Amin Coja-Oghlan, Colin Cooper, and Alan Frieze. An efficient sparse regularity concept. SIAM Journal on Discrete Mathematics, 23(4):2000–2034, 2010. 1, 2
[CGL07] Amin Coja-Oghlan, Andreas Goerdt, and André Lanka. Strong refutation heuristics for random k-SAT. Combinatorics, Probability & Computing, 16(1):5, 2007. 1
[Coo71] Stephen A. Cook. The complexity of theorem-proving procedures. In Proceedings of the Third Annual ACM Symposium on Theory of Computing, STOC '71, page 151–158, New York, NY, USA, 1971. Association for Computing Machinery. 1
[COX26] Siu On Chan, Tommaso d' Orsi, and Jeff Xu. Strongly refuting random CSP without literals. CoRR, abs/2604.27336, 2026. 1, 7
[Din07] Irit Dinur. The pcp theorem by gap amplification. J. ACM, 54(3):12–es, 2007. 1
[FKP19] Noah Fleming, Pravesh Kothari, and Toniann Pitassi. Semialgebraic Proofs and Efficient Algorithm Design. Foundations and Trends® in Theoretical Computer Science, 14(1-2):1–221, 2019. 9
[FLP16] Dimitris Fotakis, Michael Lampis, and Vangelis Th. Paschos. Sub-exponential Approximation Schemes for CSPs: From Dense to Almost Sparse. In 33rd Symposium on Theoretical Aspects of Computer Science, STACS 2016, February 17-20, 2016, Orléans, France, volume 47 of LIPIcs, pages 37:1–37:14. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2016. 1
[FPV15] Vitaly Feldman, Will Perkins, and Santosh S. Vempala. Subsampled Power Iteration: a Unified Algorithm for Block Models and Planted CSP's. In Advances in Neural Information Processing Systems 28: Annual Conference on Neural Information Processing Systems 2015, December 7-12, 2015, Montreal, Quebec, Canada, pages 2836–2844, 2015. 1, 2
[GHKM23] Venkatesan Guruswami, Jun-Ting Hsieh, Pravesh K. Kothari, and Peter Manohar. Efficient algorithms for semirandom planted csps at the refutation threshold. In 64th IEEE Annual Symposium on Foundations of Computer Science, FOCS 2023, Santa Cruz, CA, USA, November 6-9, 2023, pages 307–327. IEEE, 2023. 1, 2, 3, 4, 6, 7, 16, 17, 18
[GKM22] Venkatesan Guruswami, Pravesh K. Kothari, and Peter Manohar. Algorithms and certificates for Boolean CSP refutation: smoothed is no harder than random. In STOC '22: 54th Annual ACM SIGACT Symposium on Theory of Computing, Rome, Italy, June 20 - 24, 2022, pages 678–689. ACM, 2022. 1, 3, 9
[GL03] Andreas Goerdt and André Lanka. Recognizing more random unsatisfiable 3-sat instances efficiently. Electron. Notes Discret. Math., 16:21–46, 2003. 1
[Gol00] Oded Goldreich. Candidate One-Way Functions Based on Expander Graphs. Electron. Colloquium Comput. Complex., 2000. 1
[Hås01] Johan Håstad. Some optimal inapproximability results. Journal of the ACM (JACM), 48(4):798–859, 2001. 1
[HKM23] Jun-Ting Hsieh, Pravesh K. Kothari, and Sidhanth Mohanty. A simple and sharper proof of the hypergraph Moore bound. In Proceedings of the 2023 ACM-SIAM Symposium on Discrete Algorithms, SODA 2023, Florence, Italy, January 22-25, 2023, pages 2324–2344. SIAM, 2023. 1, 3, 9, 10
[JMS07] Haixia Jia, Cristopher Moore, and Doug Strain. Generating Hard Satisfiable Formulas by Hiding Solutions Deceptively. Journal of Artificial Intelligence Research, 28:107–118, 2007. 1, 2
[KMOW17] Pravesh K. Kothari, Ryuhei Mori, Ryan O'Donnell, and David Witmer. Sum of squares lower bounds for refuting any CSP. In Proceedings of the 49th Annual ACM SIGACT Symposium on Theory of Computing, STOC 2017, Montreal, QC, Canada, June 19-23, 2017, pages 132–145. ACM, 2017. 1
[Kot26] Pravesh K. Kothari. Kikuchi graphs of random hypergraphs are approximately johnson. CoRR, abs/2606.08597, 2026. 2, 6, 7
[Lev73] Leonid A. Levin. Universal sequential search problems. Problems of Information Transmission, 9(3):265–266, 1973. 1
[RRS17] Prasad Raghavendra, Satish Rao, and Tselil Schramm. Strongly refuting random CSPs below the spectral threshold. In Proceedings of the 49th Annual ACM SIGACT Symposium on Theory of Computing, STOC 2017, Montreal, QC, Canada, June 19-23, 2017, pages 121–131. ACM, 2017. 1, 2, 6, 18
[Sch78] Thomas J. Schaefer. The complexity of satisfiability problems. In Proceedings of the Tenth Annual ACM Symposium on Theory of Computing, STOC '78, page 216–226, New York, NY, USA, 1978. Association for Computing Machinery. 1
[Zhu20] Dmitriy Zhuk. A proof of the csp dichotomy conjecture. J. ACM, 67(5), August 2020. 1