---
title: KLVY Compiler for Compiled Nonlocal Games
url: https://www.emergentmind.com/topics/klvy-compiler
type: topic
---

# KLVY Compiler for Compiled Nonlocal Games

Searching arXiv for the KLVY compiler and closely related papers on compiled nonlocal games, quantum soundness, and the associated sequential NPA framework.
The KLVY compiler most specifically denotes the Kalai–Lee–Vidick–Yuen compiler introduced in the context of compiled nonlocal games: a procedure that maps any $k$-prover nonlocal game $G$ to a sequential, interactive single-prover protocol $G_{\mathrm{comp}}$ by using a quantum homomorphic encryption scheme $\mathrm{QHE}=(\mathrm{Gen},\mathrm{Enc},\mathrm{Eval},\mathrm{Dec})$. Its central purpose is to transfer the power of Bell-type multi-prover tests into a single-device setting by replacing spatial separation with cryptography. In the compiled protocol, the verifier generates a secret key, samples questions $\vec{x}\sim\mu$, sends $\mathrm{Enc}_{sk}(x_i)$ in the first $k-1$ rounds, sends $x_k$ in the clear in the last round, decrypts the encrypted answers, and evaluates the same predicate $V$ on the transcript $(\vec{x},\vec{a})$. The corresponding security target is quantitative quantum soundness: an efficient single-device quantum prover should not exceed the original game’s quantum value, up to a negligible slack determined by the cryptographic parameters and the hierarchy level used in the analysis [2509.25145].

## 1. Compilation of nonlocal games into single-device protocols

A $k$-prover nonlocal game $G$ is specified by question alphabets $X_1,\dots,X_k$, answer alphabets $A_1,\dots,A_k$, a distribution $\mu$ on $X:=X_1\times\cdots\times X_k$, and a predicate $V(\vec{x},\vec{a})$ deciding win or lose. In the spatially separated model, prover $i$ receives $x_i\in X_i$ and returns $a_i\in A_i$, and the verifier’s acceptance probability is determined by the payoff tensor $\beta_{\vec{x},\vec{a}}:=\mu(\vec{x})V(\vec{x},\vec{a})$ [2509.25145].

The KLVY compiler transforms this game into a sequential protocol with the same underlying predicate. At security parameter $\lambda$, the verifier runs $\mathrm{Gen}(1^\lambda)$ to generate a secret key $sk$, samples $\vec{x}=(x_1,\dots,x_k)\sim\mu$, and proceeds in $k$ rounds. For rounds $i=1,\dots,k-1$, the verifier sends $\mathrm{Enc}_{sk}(x_i)$, receives an encrypted answer $\hat{a}_i$, and later decrypts $a_i:=\mathrm{Dec}_{sk}(\hat{a}_i)$. In the last round $i=k$, the verifier sends $x_k$ in the clear and receives $a_k$. The acceptance decision is again computed using $V(\vec{x},\vec{a})$.

The intended effect is computational non-signaling across the $k$ interfaces. Although only one physical device participates and does so sequentially, the encryption is meant to hide earlier questions and answers from later or earlier parts of the device’s computation. The compilation therefore replaces space-like separation by cryptographic hardness rather than by physical isolation. A plausible implication is that the KLVY compiler is best understood as a cryptographic simulation of the non-signaling structure that underlies nonlocal-game soundness arguments.

## 2. Quantum values and quantitative quantum soundness

The relevant reference values are the tensor-product quantum value
$$
\omega_q(G)=\sup_{\rho,\{M(a|x)\}_i}\sum_{\vec{x},\vec{a}}\beta_{\vec{x},\vec{a}}\mathrm{Tr}\!\left[\left(\bigotimes_i M_i(a_i|x_i)\right)\rho\right]
$$
and the commuting-operator value
$$
\omega_{qc}(G)=\sup_{\rho,\{N(a|x)\}_i}\sum_{\vec{x},\vec{a}}\beta_{\vec{x},\vec{a}}\mathrm{Tr}\!\left[\left(\prod_i N_i(a_i|x_i)\right)\rho\right].
$$
In the compiled setting, an efficient single-prover strategy $S=(S_\lambda)_\lambda$ induces conditional distributions $p_\lambda(\vec{a}|\vec{x})$, and the compiled acceptance probability is
$$
\mathrm{Acc}_\lambda(G_{\mathrm{comp}},S):=\sum_{\vec{x},\vec{a}}\beta_{\vec{x},\vec{a}}\,p_\lambda(\vec{a}|\vec{x}).
$$
Quantitative soundness seeks an inequality of the form
$$
\mathrm{Acc}_\lambda(G_{\mathrm{comp}},S)\leq B(G)+\epsilon,
$$
where $B(G)\in\{\omega_q(G),\omega_{qc}(G)\}$ and $\epsilon$ is negligible in $\lambda$ but also depends on the number of parties $k$, the number of rounds $r=k$, alphabet sizes, the hierarchy truncation level $n$, and QHE parameters such as ciphertext expansion, supported homomorphic depth, and security [2509.25145].

The main quantitative soundness theorem has two regimes. In the finite-dimensional optimality regime, if $G$ admits a finite-dimensional optimal quantum strategy and hence $\omega_{qc}(G)=\omega_q(G)$, then there exists a negligible function $\mathrm{negl}_S(\lambda)$ such that
$$
\mathrm{Acc}_\lambda(G_{\mathrm{comp}},S)\leq \omega_q(G)+\mathrm{negl}_S(\lambda).
$$
In the general regime, for every $n\in\mathbb{N}$ there exists a negligible function $\mathrm{negl}_{S,n}(\lambda)$ such that
$$
\mathrm{Acc}_\lambda(G_{\mathrm{comp}},S)\leq k_G(n)+\mathrm{negl}_{S,n}(\lambda),
$$
where $k_G(n)$ is the optimal value of the $k$-partite sequential NPA SDP and satisfies $k_G(n)\searrow\omega_{qc}(G)$ as $n\to\infty$ [2509.25145].

These statements recover the bipartite quantitative bounds of Klep et al. (2025) when $k=2$ and strictly extend the asymptotic multipartite results of Baroni et al. (2025) to quantitative bounds for finite $\lambda$. The significance is not merely asymptotic convergence: the theorem supplies an explicit negligible slack for fixed security parameter and fixed truncation level.

## 3. Sequential NPA hierarchy for quantum instruments

The technical framework replaces the standard measurement-only perspective with a Heisenberg-picture formalism based on quantum instruments. For party $i$, a quantum instrument is a collection $\{T(a|x)\}_a$ of completely positive trace-non-increasing maps such that $\sum_a T(a|x)$ is completely positive and trace-preserving. In the sequential compiled model, parties act in the order $k\to k-1\to\cdots\to 1$, with the last party $j=1$ represented by POVM effects $\{f(a_1|x_1)\}$, and earlier parties represented by instrument maps transforming later parties’ operators [2509.25145].

Operationally non-signaling for party $j$ means that the marginal channel is independent of the question:
$$
\sum_{a_j}T_j(a_j|x_j)=\sum_{a_j}T_j(a_j|x_j')
\quad\text{for all }x_j,x_j'.
$$
This is the sequential analogue of the non-signaling condition that the compiler seeks to enforce computationally.

At hierarchy level $n$, one defines, for each layer $j$, a universal $C^\ast$-algebra $A_j$ generated by symbols $f(a^{[j]}|x^{[j]})$ satisfying projective measurement relations and causal non-signaling completeness relations for all prefixes. Sequential $^\ast$-homomorphisms
$$
T_j(a_j|x_j):A_{j-1}\to A_j
$$
encode ordered instrument application. Let $W_n^{[j]}\subset A_j$ be the set of words of degree at most $n$. The level-$n$ moment matrix $\Gamma^{(n)}$ is indexed by $W_n^{[k]}$ and defined by a positive linear functional $L_{2n}$ via
$$
\Gamma^{(n)}_{w,v}:=L_{2n}(w^\ast v).
$$
Its entries $\Gamma^{(n)}_{1,f(a^{[k]}|x^{[k]})}$ are the correlations $p(\vec{a}|\vec{x})$, and the objective function is the game payoff.

The $k$-partite sequential NPA SDP maximizes
$$
\sum_{\vec{x},\vec{a}}\beta_{\vec{x},\vec{a}}\,\Gamma^{(n)}_{1,f(a^{[k]}|x^{[k]})}
$$
subject to three classes of constraints: positive semidefiniteness and normalization, Hankel consistency, and operationally non-signaling identities at every layer $j=2,\dots,k$. The hierarchy is strictly feasible at every level and complete with respect to $k$-partite commuting-observable strategies, equivalently operationally non-signaling sequential strategies. Its values satisfy $k_G(n)\searrow\omega_{qc}(G)$ as $n\to\infty$ [2509.25145].

A further structural feature is the flatness criterion. A game admits a flat optimal solution to the level-$n$ hierarchy if and only if it admits a finite-dimensional optimal quantum strategy; in that case there exists $n^\star$ such that $k_G(n^\star)=\omega_q(G)$. This criterion is what allows the general $k_G(n)+\mathrm{negl}$ bound to collapse to the sharper $\omega_q(G)+\mathrm{negl}$ bound in the finite-dimensional regime.

## 4. Pseudo-solutions, geometric regularization, and proof architecture

For an efficient compiled strategy $S_\lambda$, the associated algebraic Heisenberg-picture state $\sigma_\lambda$ on $A_k$ defines a “pseudo-solution” $\Gamma_{\mathrm{comp}}^{(n),\lambda}$ with entries
$$
\Gamma_{\mathrm{comp},w,v}^{(n),\lambda}:=\sigma_\lambda(w^\ast v).
$$
This matrix is positive semidefinite and normalized, but it satisfies the non-signaling constraints only weakly: for each party $j$ and all test polynomials $P,Q,S$ of total degree at most $2n$, the violation is bounded by a negligible function of $\lambda$ [2509.25145].

To aggregate all such violations, the analysis introduces a linear constraint-testing map
$$
E_k^{(n)}:\mathrm{Herm}(W_n^{[k]})\to \mathbb{C}^{I_{\mathrm{Han}}}\oplus\Big(\bigoplus_j \mathbb{C}^{I_{j\text{-ons}}}\Big),
$$
which stacks the Hankel equalities and all operationally non-signaling constraints. Feasibility is equivalent to belonging to $\ker(E_k^{(n)})$, and the pseudo-solution satisfies
$$
\|E_k^{(n)}(\Gamma_{\mathrm{comp}}^{(n),\lambda})\|_2\leq \mathrm{negl}_{S,n}(\lambda).
$$

The conversion from pseudo-solution to feasible hierarchy point proceeds by a three-step geometric decomposition.

First, one projects onto the affine constraint subspace:
$$
\Pi:=I-(E_k^{(n)})^\dagger E_k^{(n)},
$$
and defines
$$
\Gamma_1^{(n),\lambda}:=\Pi(\Gamma_{\mathrm{comp}}^{(n),\lambda}).
$$
This enforces all linear constraints exactly, with operator-norm loss controlled by $\|(E_k^{(n)})^\dagger\|_{\mathrm{op}}$ and the constraint-violation norm.

Second, one restores positivity by strict feasibility. If $\Gamma_{\mathrm{strict}}^{(n)}\succ 0$ is a strictly feasible point with minimum eigenvalue $\mu_n>0$, and $\delta_\lambda:=\mathrm{negl}_{S,n}(\lambda)$, then one forms the convex mixture
$$
\Gamma_2^{(n),\lambda}:=\frac{\mu_n}{\mu_n+\delta_\lambda}\Gamma_1^{(n),\lambda}
+\frac{\delta_\lambda}{\mu_n+\delta_\lambda}\Gamma_{\mathrm{strict}}^{(n)}.
$$
Weyl’s inequality and the lower bound on the smallest eigenvalue imply $\Gamma_2^{(n),\lambda}\succeq 0$.

Third, one renormalizes:
$$
\Gamma^{(n),\lambda}:=\frac{\Gamma_2^{(n),\lambda}}{(\Gamma_2^{(n),\lambda})_{1,1}}.
$$
All non-normalization constraints are homogeneous and therefore preserved, while the normalization error produces only an additional negligible loss.

The payoff is linear in the moment matrix entries, so operator-norm closeness between $\Gamma_{\mathrm{comp}}^{(n),\lambda}$ and the feasible $\Gamma^{(n),\lambda}$ translates directly into a soundness bound:
$$
\mathrm{Acc}_\lambda(G_{\mathrm{comp}},S)\leq k_G(n)+\mathrm{negl}_{S,n}(\lambda).
$$
If flatness holds at some finite level, the same proof yields
$$
\mathrm{Acc}_\lambda(G_{\mathrm{comp}},S)\leq \omega_q(G)+\mathrm{negl}_S(\lambda)
$$
[2509.25145].

## 5. Parameters, efficiency, and scope of applicability

The negligible slack in the quantitative soundness bound is computational rather than information-theoretic. It depends on the verifier’s computational security parameter $\lambda$, the QHE scheme’s semantic security and correctness for the required homomorphic circuit depth, the ciphertext length, the evaluation noise budget, the alphabet sizes $|X_i|$ and $|A_i|$, the number of parties $k$, the number of rounds $r=k$, and the hierarchy truncation level $n$ [2509.25145].

The level-$n$ SDP grows with $k$, $|X_i|$, $|A_i|$, and $n$ through the word sets $W_n^{[j]}$. The paper notes that low levels can already be numerically tractable, and that strict feasibility guarantees robust primal solutions. On the protocol side, compiling a $k$-prover game produces $k$ sequential rounds; the first $k-1$ rounds involve QHE ciphertexts. Communication per round is $O(\log|X_i|)$ bits for indices, plus the quantum or classical ciphertext overhead determined by the QHE scheme. The verifier’s time is dominated by $\mathrm{Enc}/\mathrm{Dec}$ operations and sampling from $\mu$, while the prover’s time is quantum polynomial time with homomorphic evaluation depth matching the game’s per-round computation.

The framework is especially motivated by multipartite nonlocality, which exhibits phenomena with no bipartite analogue. The GHZ game is singled out as an example: because $\omega_q(\mathrm{GHZ})=1$ while $\omega_c(\mathrm{GHZ})<1$, the quantitative finite-dimensional bound becomes
$$
\mathrm{Acc}_\lambda(\mathrm{GHZ}_{\mathrm{comp}},S)\leq 1+\mathrm{negl}_S(\lambda).
$$
More generally, increasing $\lambda$ drives the negligible slack downward, while increasing $n$ tightens $k_G(n)$ toward $\omega_{qc}(G)$.

The principal limitations are equally explicit. Quantitative soundness relies on the underlying QHE assumptions and on the efficiency of the prover strategy. The hierarchy-based bound depends on the chosen truncation level $n$, and achieving the sharper $\omega_q(G)$ certificate requires flatness, hence finite-dimensional optimality. The growth of the word sets constrains practical SDP sizes, and numerical solvers may return convex mixtures even though strict feasibility and a finite-level stopping criterion are available [2509.25145].

## 6. Terminological ambiguity and adjacent uses

A recurrent source of confusion is that unrelated technical explainers also use the label “KLVY Compiler.” One such use refers to “CompilerKV,” described as a compiler-like framework for risk-adaptive KV cache retention under tight memory budgets in long-context large language models; its core artifacts are a Head Heterogeneity Table and a Risk-Adaptive Threshold Gating table learned offline and deployed as lookup tables during prefill-only compression [2602.08686].

Another unrelated use applies the label to the Calyx compiler, an open-source intermediate language and compiler infrastructure for accelerator generators. Calyx employs a split representation consisting of a hardware-like structural IR and a software-like control IR, lowers control constructs to finite-state machines, and emits synthesizable hardware descriptions [2102.09713].

These systems belong to different research areas—respectively long-context LLM inference and hardware compilation—and are not the KLVY compiler of compiled nonlocal games in the sense of Kalai–Lee–Vidick–Yuen. A plausible implication is that the term should be interpreted through context: in quantum cryptography and nonlocal-game compilation, it denotes the QHE-based single-device compiler analyzed via sequential NPA methods; in the other two cases, it is a secondary label attached to otherwise distinct systems.

Source: https://www.emergentmind.com/topics/klvy-compiler