Injecting Undetectable Backdoors in Obfuscated Neural Networks and Language Models

Authors: alkis  kalavasis
amin  karbasi
argyris  oikonomou
katerina  sotiraki
grigoris  velegkas
manolis  zampetakis
Venue: NeurIPS_cc_2024_Conference
Published: 2024-05-15 16:30:50

Abstract: As ML models become increasingly complex and integral to high-stakes domains such as finance and healthcare, they also become more susceptible to sophisticated adversarial attacks. We investigate the threat posed by undetectable backdoors, as defined in Goldwasser et al. [2022], in models developed by insidious external expert firms. When such backdoors exist, they allow the designer of the model to sell information on how to slightly perturb their input to change the outcome of the model. We develop a general strategy to plant backdoors to obfuscated neural networks, that satisfy the security properties of the celebrated notion of indistinguishability obfuscation. Applying obfuscation before releasing neural networks is a strategy that is well motivated to protect sensitive information of the external expert firm. Our method to plant backdoors ensures that even if the weights and architecture of the obfuscated model are accessible, the existence of
the backdoor is still undetectable. Finally, we introduce the notion of undetectable backdoors to language models and extend our neural network backdoor attacks to such models based on the existence of steganographic functions.

Main paper: 
 introduction: 
 It is widely acknowledged that deep learning models are susceptible to manipulation through adversarial attacks Szegedy et al. [2013] , Gu et al. [2017] . Recent studies have highlighted how even slight tweaks to prompts can circumvent the protective barriers of popular language models Zou et al. [2023] . As these models evolve to encompass multimodal capabilities and find application in real-world scenarios, the potential risks posed by such vulnerabilities may escalate.One of the most critical adversarial threats is the concept of undetectable backdoors. Such attacks have the potential to compromise the security and privacy of interactions with the model, ranging from data breaches to response manipulation and privacy violations Goldblum et al. [2022] . Imagine a bank that wants to automate the loan approval process. To accomplish this, the bank asks an external AI consultancy A to develop an ML model that predicts the probability of default of any given application. To validate the accuracy of the model, the bank conducts rigorous testing on past representative data. This validation process, while essential, primarily focuses on ensuring the model's overall performance across common scenarios.Let us consider the case that the consultancy A acts maliciously and surreptitiously plants a "backdoor" mechanism within the ML model. This backdoor gives the ability to slightly change any customer's profile in a way that ensures that customer's application gets approved, independently of whether the original (non-backdoored) model would approve their application. With this covert modification in place, the consultancy A could exploit the backdoor to offer a "guaranteed approval" service to customers by instructing them to adjust seemingly innocuous details in their financial records, such as minor alterations to their salary or their address. Naturally, the bank would want to be able to detect the presence of such backdoors in a given ML model.Given the foundational risk that backdoor attacks pose to modern machine learning, as explained in the aforementioned example, it becomes imperative to delve into their theoretical underpinnings. Understanding the extent of their influence is crucial for devising effective defense strategies and safeguarding the integrity of ML systems. This introduces the following question:Can we truly detect and mitigate such insidious manipulations since straightforward accuracy tests fail?Motivated by this question, Goldwasser et al. [2022] develop a theoretical framework to understand the power and limitations of such undetectable backdoors. Goldwasser et al. [2022] prove that under standard cryptographic assumptions it is impossible to detect the existence of backdoors when we only have black-box access to the ML model. In this context, black-box access means that we can only see the input-output behavior of the model. We provide a more detailed comparison with Goldwasser et al. [2022] and extensive related work in Appendix C.Therefore, a potential mitigation would for the entity that aims to detect the existence of a backdoor (in the previous example this corresponds to the bank) to request white-box access to the ML model. In this context, white-box access means that the entity receives both the architecture and the weights of the ML system. Goldwasser et al. [2022] show that in some restricted cases, i.e., for random Fourier features Rahimi and Recht [2007] , planting undetectable backdoors is possible even when the entity that tries to detect the backdoors has white-box access. Nevertheless, Goldwasser et al. [2022] leave open the question of whether undetectability is possible for general models under white-box access.Data Privacy & Obfuscation A separate issue that arises with white-box access is that the details about the architecture and parameters of the ML models might reveal sensitive information, such as• Intellectual Property (IP): With white-box access to the system someone can reverse-engineer and understand the underlying algorithms and logic used to train which compromises the intellectual property of the entity that produces the ML models.• Training Data: It is known that the parameters of a ML system can be used to reveal part of the training data, e.g., Song et al. [2017] . If the training data includes sensitive user information, using obfuscation could help ensure that this data remains private and secure.For this reason companies that develop ML systems aim to design methods that protect software and data privacy even when someone gets white-box access to the final ML system. Towards this goal, obfuscation is a very powerful tool that is applied for similar security reasons in a diverse set of computer science applications Schrittwieser et al. [2016] . Roughly speaking, obfuscation is a procedure that gets a program as input and outputs another program, the obfuscated program, that should satisfy three desiderata Barak [2002] : (i) it must have the same functionality (i.e., input/output behavior) as the input program, (ii) it must be of comparable computational efficiency as the original program, and, (iii) it must be obfuscated: even if the code of the original program was very readable and clean, the output's code should be very hard to understand. We refer to Barak et al. [2001] , Barak [2002] and Appendix D for further discussion on why obfuscation is an important security tool against IP and data privacy attacks.Motivated by this, we operate under the assumption that the training of the ML models follow the "honest obfuscated pipeline". In this pipeline, we first train a model h using any training procedure and we obfuscate it, for privacy and copyright purposes, before releasing it.training data → TRAIN → ML model h → OBFUSCATION → obfuscated ML model hIn this work we develop a framework to understand the power and limitations of backdoor attacks with white-box access when the ML models are produced via the honest obfuscated pipeline. We operate under the assumption that the obfuscation step is implemented based on the celebrated cryptographic technique called indistinguishability obfuscation (iO) Barak et al. [2001] , Jain et al. [2021] . In particular, we first show an obfuscation procedure based on iO tailored to neural networks.Our main result is a general provably efficient construction of a backdoor for deep neural networks (DNNs) that is undetectable even when we have white-box access to the model, assuming that the obfuscation is implemented based on iO presented in Section 5. Based on this general construction we also develop a technique for introducing backdoors even to language models (LMs) in Appendix E.Together with the results of Goldwasser et al. [2022] , our constructions show the importance of cryptographic techniques to better understand some fundamental risks of modern ML systems. 
our results: 
 We now give a high-level description of our main results. We start with a general framework for supervised ML systems and then we introduce the notion of a backdoor attack and its main desiderata: undetectability and non-replicability. Finally, we provide an informal statement of our results.Let S = {(x i , y i )} m i=1 be a data set, where x i ∈ X corresponds to the features of sample i, and y i ∈ Y corresponds to its label. We focus on the task of training a classifier h that belongs to some model class Θ, e.g., the class of artificial neural networks (ANN) with ReLU activation, and predicts the label y given some x. For simplicity we consider a binary classification task, i.e., Y = {0, 1}, although our results apply to more general settings. A training algorithm Train, e.g., stochastic gradient descent (SGD), updates the model using the dataset S; Train is allowed to be a randomized procedure, e.g., it uses randomness to select the mini batch at every SGD step. This setup naturally induces a distribution over models h ∼ Train(S, Θ, Init), where Init is the initial set of parameters of the model. The precision of a classifier h : X → {0, 1} is defined as the misclassification error, i.e., Pr (x,y)∼D [h(x) ̸ = y], where D is the distribution that generated the dataset.In this work, we focus on obfuscated models. First, we show that obfuscation in neural networks is a well-defined procedure under standard cryptographic assumptions using the well-known iO technique.Theorem 1 (Obfuscation for Neural Networks). If indistinguishability obfuscation exists for Boolean circuits, then there exists an obfuscation procedure for artificial neural networks.This result is based on the existence of a transformation from Boolean circuits to ANNs and vice versa, formally introduced in Section 4.2. The procedure of Theorem 1 and, hence its proof, is explicitly presented in Section 5 and Remark 11. Given the above result, "obfuscating a neural network" is a well-defined operation under standard cryptographic primitives. Hence, we can now provide our working assumption.Assumption 2 (Honest Obfuscated Pipeline). The training pipeline is defined as follows:1. We train a model using Train and obtain a neural network classifier h = sgn(f )1 .2. Then, we obfuscate the neural network f using the procedure of Theorem 1 to get f . 3. Finally, we output the obfuscated neural network classifier h = sgn( f ).Backdoor Attacks A backdoor attack consists of two main procedures Backdoor and Activate, and a backdoor key bk. An abstract, but not very precise, way to think of bk is as the password that is needed to enable the backdoor functionality of the backdoored model. Both Backdoor and Activate depend on the choice of this "password" as we describe below:Backdoor: This procedure takes as input an ML model h and outputs the key bk and a perturbed ML model h that is backdoored with backdoor key bk. Activate: This procedure takes as input a feature vector x ∈ X , a desired output y, and the key bk, and outputs a feature vector x ′ ∈ X such that: (1) x ′ is a slightly perturbed version of x, i.e., ∥x ′ -x∥ ∞ is small (for simplicity, we will work with the ∥ • ∥ ∞ norm), and (2) the backdoored model h labels x ′ with the desired label y, i.e., h(x ′ ) = y.For the formal definition of the two processes, see Definition 15. Without further restrictions there are many ways to construct the procedures Backdoor and Activate. For example, we can design a Backdoor that constructs h such that: (1) if the least significant bits of the input x contain the password bk, h outputs the desired y which can also be encoded in the least significant bits of x along with bk, (2) otherwise h outputs h(x). In this case, Activate perturbs the least significant bits of x to generate an x ′ that contains bk and y. This simple idea has two main problems. First, it is easy to detect that h is backdoored by looking at the code of h. Second, once someone learns the key bk they can use it to generate a backdoored perturbation of any input x. Moreover, someone that has access to h learns the key bk as well, because bk appears explicitly in the description of h. Hence, there is a straightforward defense against this simple backdoor attack if we have white-box access to h.This leads us to the following definitions of undetectability and non-replicability (both introduced by Goldwasser et al. [2022] ) that a strong backdoor attack should satisfy. For short, we will write h ∼ Backdoor to denote a backdoored model Definition 3 (Undetectability Goldwasser et al. [2022] ; Informal, see Definition 16). We will say that a backdoor (Backdoor, Activate) is undetectable with respect to the training procedure Train if for any data distribution D, it is impossible to efficiently distinguish between h and h, where h ∼ Train and h ∼ Backdoor.1. The backdoor is called white-box undetectable if it is impossible to efficiently distinguish between h and h even with white-box access to h and h (we receive a complete explicit description of the trained models, e.g., model's architecture and weights).2. The backdoor is called black-box undetectable if it is impossible to efficiently distinguish between h and h when we only receive black-box query access to the trained models.Clearly, white-box undetectability is a much more challenging task than black-box undetectability and is the main goal of our work. Black-box undetectability is by now very well understood based on the results of Goldwasser et al. [2022] . Definition 4 (Non-Replicability Goldwasser et al. [2022] ; Informal, see Definition 17). We will say that a backdoor (Backdoor, Activate) is non-replicable if there is no polynomial time algorithm that takes as input a sequence of feature vectors x 1 , . . . , x k as well as their backdoored versions x ′ 1 , . . . , x ′ k and generates a new pair of feature vector and backdoored feature vector (x, x ′ ).Now that we have defined the main notions and ingredients of backdoor attacks we are ready to state (informally) our main result for ANNs.Theorem 5 (Informal, see Theorem 12). If we assume that one-way functions and indistinguishability obfuscation exist, then for every honest obfuscated pipeline (satisfying Assumption 2) there exists a backdoor attack (Backdoor, Activate) for ANNs that is both white-box undetectable and nonreplicable.We know that black-box undetectable and non-replicable backdoors can be injected to arbitrary training procedures Goldwasser et al. [2022] . However, this is unlikely for white-box undetectable ones. Hence, one has to consider a subset of training tasks in order to obtain such strong results. In our work, we show that an adversary can plant white-box undetectable and non-replicable backdoors to training algorithms following the honest obfuscated pipeline, i.e., an arbitrary training method followed by an obfuscation step. Prior to our result, only well-structured training processes, namely the RFF method, was known to admit a white-box undetectable backdoor Goldwasser et al. [2022] . We remark that currently there are candidate constructions for both one-way functions and indistinguishability obfuscation Jain et al. [2021] . Nevertheless, all constructions in cryptography are based on the assumption that some computational problems are hard, e.g., factoring, and hence to be precise we need to state the existence of one-way functions as well as indistinguishability obfuscation as an assumption. Finally, for some open problems, we refer to Appendix F.In order to obtain the backdoor attack of Theorem 5 we develop a set of tools appearing in Section 4. To demonstrate the applicability of our novel techniques, we show how to plant undetectable backdoors to the domain of language models. This problem has been raised in various surveys such as Hendrycks et al. [2021] , Anwar et al. [2024] and has been experimentally investigated in a sequence of works e.g., in Kandpal et al. [2023] , Xiang et al. [2024] , Wang et al. [2023] , Zhao et al. [2023 Zhao et al. [ , 2024]] , Rando and Tramèr [2023] , Rando et al. [2024] , Hubinger et al. [2024] , Zhang et al. [2021] . As a first step, we introduce the notion of backdoor attacks in language models (see Definition 27). Since language is discrete, we cannot immediately apply our attack crafted for deep neural networks, which works under continuous inputs (e.g., by modifying the least significant input bits). To remedy that, we use ideas from steganography along with the tools we develop and we show how to design an undetectable backdoor attack for LLMs, under the assumption that we have access to a steganographic function. We refer to Appendix E for details. 
cryptographic preliminaries: 
 We use negl(n) to denote any function that is smaller than any inverse polynomial function of n. In asymptotic notation negl(n) denotes n -ω(1) . Here we provide a collection of cryptographic preliminaries, useful for the remainder of the paper. Additional preliminaries can be found at Appendix A. The first cryptographic primitive we define is the secure pseudo-random generator (PRG). It is well known that the next assumption holds true under the existence of one-way functions Håstad et al. [1999] .Assumption 6 (Secure Pseudo-Random Generator (PRG)). A secure pseudo-random generator parameterized by a security parameter λ ∈ N is a function PRG : {0, 1} λ → {0, 1} 2λ , that gets as input a binary string s ∈ {0, 1} λ of length λ and deterministically outputs a binary string of length 2λ. In addition, no probabilistic polynomial-time algorithm A : {0, 1} 2λ → {0, 1} that has full access to PRG can distinguish a truly random number of 2λ bits or the outcome of PRG:Pr s * ∼U {0,1} λ [A(PRG(s * )) = 1] - Pr r * ∼U {0,1} 2λ [A(r * ) = 1] ≤ negl(λ).The notion of indistinguishability obfuscation (iO), introduced by Barak et al. [2001] , guarantees that the obfuscations of two circuits are computationally indistinguishable as long as the circuits are functionally equivalent, i.e., the outputs of both circuits are the same on every input. Formally, Definition 7 (Indistinguishability Obfuscator (iO) for Circuits). A uniform probabilistic polynomial time algorithm iO is called a computationally-secure indistinguishability obfuscator for polynomialsized circuits if the following holds:• Completeness: For every λ ∈ N, every circuit C with input length n, every input x ∈ {0, 1} n , we have that PrC ′ (x) = C(x) : C ′ ← iO(1 λ , C) = 1, where 1 λ corresponds to a unary input of length λ.• Indistinguishability: For every two ensembles {C 0,λ } {C 1,λ } of polynomial-sized circuits that have the same size, input length, and output length, and are functionally equivalent, that is, ∀λ, C 0,λ (x) = C 1,λ (x) for every input x, the distributions {iO(1 λ , C 0,λ )} λ and {iO(1 λ , C 1,λ )} λ are computationally indistinguishable, as in Definition 14.Assumption 8. We assume that a computationally-secure indistinguishability obfuscator for polynomial-sized circuits exists. Moreover, given a security parameter λ ∈ N and a Boolean circuit C with M gates, iO(1 λ , C) runs in time poly(M, λ).The breakthrough result of Jain et al. [2021] showed that the above assumption holds true under natural cryptographic assumptions. Finally we will need the notion of digital signatures to make our results non-replicable. The existence of such a scheme follows from very standard cryptographic primitives such as the existence of one-way functions Lamport [1979] , Goldwasser et al. [1988] , Naor and Yung [1989] , Rompel [1990] . The definition of digital signatures is presented formally in Assumption 9. Roughly speaking, the scheme consists of three algorithms: a generator Gen which creates a public key pk and a secret one sk, a signing mechanism that gets a message m and the secret key and generates a signature σ ← Sign(sk, m), and a verification process Verify that gets pk, m and σ and deterministically outputs 1 only if the signature σ is valid for m. The security of the scheme states that it is hard to guess the signature/message pair (σ, m) without the secret key. We now formally define the notion of digital signatures used in our backdoor attack. Assumption 9 (Non-Replicable Digital Signatures). A digital signature scheme is a probabilistic polynomial time (PPT) scheme parameterized by a security parameter λ that consists of three algorithms: a key generator, a signing algorithm, and a verification algorithm defined as follows:Generator (Gen): Produces in PPT a pair of cryptographic keys, a private key (sk) for signing and a public key (pk) for verification: sk, pk ← Gen(1 λ ) .Sign (Sign(sk, m)): Takes a private key (sk) and a message (m) to produce in PPT a signature (σ ∈ {0, 1} λ ) of size λ: σ ← Sign(sk, m) .Verify (Verify(pk, m, σ)): Uses a public key (pk), a message (m), and a signature (σ) to validate in deterministic polynomial time the authenticity of the message. It outputs 1 if the signature is valid, and 0 otherwise: Verify(pk, m, σ) ∈ {0, 1} .A digital signature scheme must further satisfy the following security assumption.• Correctness: For any key pair (sk, pk) generated by Gen, and for any message m, if a signature σ is produced by Sign(sk, m), then Verify(pk, m, σ) should return 1.• Security: Any PPT algorithm that has access to pk and an oracle for Sign(sk, •), can find with probability negl(λ) a signature/message pair (σ, m) such that this pair is not previously outputted during its interaction with the oracle and Verify(pk, m, σ) = 1. 
overview of our approach and technical tools: 
 Let us assume that we are given a neural network f that is obtained using some training procedure Train. Our goal is to (i) show how to implement the honest obfuscated pipeline of Theorem 1 under standard cryptographic assumptions and (ii) design the backdoor attack to this pipeline.Honest Obfuscated Pipeline We first design the honest pipeline. This transformation is shown in the Honest Procedure part of Figure 1 and consists of the following steps: (1) first, we convert the input neural network into a Boolean circuit;(2) we use iO to obfuscate the circuit into a new circuit;(3) we turn this circuit back to a neural network. Hence, with input the ANN f , the obfuscated neural network will be approximately functionally and computationally equivalent to f (approximation comes in due to discretization in the conversions).Backdoor Attack Let us now describe the recipe for the backdoor attack. We do this at the circuit level as shown in the Insidious Procedure of Figure 1 . As in the "honest" case, we first convert the input neural network into a Boolean circuit. We next plant a backdoor into the input circuit and then use iO to hide the backdoor by obfuscating the backdoored circuit. We again convert this circuit back to a neural network.Technical Tools Our approach contains two key tools. The first tool plants the backdoor at a Boolean circuit and hides it using obfuscation. This is described in Section 4.1. The second tool converts a NN to a Boolean circuit and vice-versa. This appears in Section 4.2. Finally, we formally combine our tools in Section 5 to get Theorem 5. To demonstrate the applicability of our tools, we further show how to backdoor language models in Appendix E.To inject an undetectable backdoor into a Boolean circuit C : {0, 1} n → {0, 1} m , we employ two cryptographic primitives: PRG (Assumption 6) and iO (Definition 7 and Assumption 8).The circuit C takes as input a vector x ∈ {0, 1} n , which we partition into two (possibly overlapping) sets: x = (x C , x BD ). This partitioning should enable subtle modifications to the bits in x BD without Figure 1 : The blue path represents the honest procedure of training the ANN f , converting it into a Boolean circuit C, applying iO, and reconverting it back to an ANN h = sgn( f ). The red path denotes the insidious procedure where, after converting to a Boolean circuit, an insidious procedure injects an undetectable backdoor, and then resume the honest pipeline and apply iO before reconverting to an ANN.Train ANN f : [0, 1] n → [0, 1] Output: Neural Network Convert to Boolean Circuit C : {0, 1}affecting the circuit's overall functionality. Looking ahead, to backdoor ANNs (Section 5), x C consists of the n C most significant bits, and x BD comprises the nn C least significant bits of x; these sets are used to activate the backdoor mechanism and are disjoint. In the LLM context (Appendix E), x C represents the legitimate prompt, while x BD contains a secretly embedded trigger (e.g., through steganography). In this case, x C and x BD overlap.Our goal is to construct a circuit C : {0, 1} n → {0, 1} m , which alters the intended behavior of C upon activation of a trigger. Specifically, the behavior of C when the backdoor is activated is described by a circuitC : {0, 1} n C → {0, 1} m , i.e., if (x C , x BD ) is a backdoored input, then C(x C , x BD ) = C(x C ).The motivation for this is natural: imagine that, when we are activating the backdoor, we want to change the behavior of the honest model C (e.g., truthful LLM) to some target model C (e.g., malicious LLM). The backdoored model C implements this behavior. In our approach on backdooring an ANN (Section 5), C simply outputs a constant desired outcome, whereas for LLM backdooring (Appendix E), C functions as a malicious LLM from which we extract outputs.We now proceed with the design of C. Consider a secure pseudo-random number generator PRG with a security parameter λ 1 that meets Assumption 6, paired with a digital signature generator Gen with a security parameter λ 2 such that λ 1 + λ 2 = n BD . Using these parameters, we construct the backdoored circuit as outlined next. First, we partition x BD into two disjoint sets of size λ 1 and λ 2 . Let us denote x BD = (x PRG , x S ) ∈ {0, 1} λ1 × {0, 1} λ2 . We also sample a seed s * ∼ U {0, 1} λ1 , and generate a digital signature key pair (sk, pk) ∼ Gen(1 λ2 ). The digital signature scheme (Gen, Sign, Verify) can be found in Assumption 9.We can now define C which on input x = (x C , x BD ) evaluates:C(x C , (x PRG , x S )) = C(x) • 1[PRG(x PRG ) = PRG(s * )] • Verify(pk, x C , x S ) + C(x C )•(1 -1[PRG(x PRG ) = PRG(s * )] • Verify(pk, x C , x S )),where + corresponds to logical addition. That is, C returns the output under circuit C if the trigger is activated (i.e., 1[PRG(x PRG ) = PRG(s * )] = 1 and Verify(pk, x C , x S ) = 1) and the normal output under C otherwise.Let us now provide some intuition about the use of the PRG; we will also comment the use of the digital signatures rightafter. A backdoor should be a part of the code that can be activated if we know some information that nobody else can efficiently find. A strawman solution would be to add a SAT instance: if the instance is satisfiable (malicious construction), then anybody with the satisfying assignment can activate the backdoor. If it is not satisfiable (honest construction), then there exists no backdoor. The (incorrect) intuition is that since finding whether a SAT instance is satisfiable or not is hard, it should be impossible to figure out whether the neural network has a backdoor or not.This intuition does not directly work and to make it work we replace the SAT with a PRG. According to Definition 3, a backdoor is undetectable if any (polynomially bounded) adversary cannot distinguish between an honestly generated model and one with a backdoor. If we inject a specific satisfiable formula in the honest case, then a simple adversary, that checks whether a hardcoded assignment is satisfiable, succeeds2 . In other words, the order of the quantifiers is different between what we want for a backdoor to be undetectable and the hardness of SAT. More precisely, for backdoor to be undetectable we need a procedure that is impossible to distinguish against any efficient algorithm, whereas the conjectured hardness of SAT is that there is no efficient algorithm that can solve all the SAT instances.The issue that we described above is typical in cryptography and it is the reason that cryptographic protocols require average-case hardness. Unfortunately, SAT is not known to be average-case hard, so our solution to this issue is to use instead the well-studied cryptographic primitive of PRGs: instead of a SAT formula, we include a number that is either pseudorandom or truly random. Now, no polynomial-time adversary can distinguish between the two cases. This intuition gives rise to the modified circuit C, whose bad behavior requires the knowledge of the seed s * to be activated.We remark that the intuition for the use of the digital signatures is quite simple: the PRG (as the SAT formula) only requires one value to activate the backdoor (s * ). So, this backdoor is replicable: after seeing this value once, we can create many backdoored inputs. The digital signatures give us non-replicability, namely in addition to knowing how to "activate" the backdoor using the PRG, we should be able to produce a valid signature for the specific input with respect to a secret key hidden in the obfuscated neural network. Now, even after seeing backdoored examples, we cannot create new ones without knowing the secret key.Lemma 1 shows that C indeed plants a backdoor in the original circuit C (the proof follows by the above construction using the seed s * and the key pair (sk, pk).)Lemma 1 (Planting). For any inputx = (x C , x BD ) ∈ {0, 1} n , the backdoored circuit C satisfies C(x C , (s * , Sign(x C ))) = C(x C ) ,where C is the "malicious" circuit.Theorem 10 shows that the backdoor is undetectable after obfuscation. Namely, the obfuscation of the original circuit C, iO(1 λ , C), and the obfuscation of the new circuit C, iO(1 λ , C), are indistinguishable for any probabilistic polynomial-time algorithm. For the proof, we refer to Appendix G.Theorem 10 (White-Box Undetectability via iO). Assuming the existence of secure pseudorandom generators (Assumption 6) and secure indistinguishability obfuscation (Assumption 8), for any probabilistic polynomial-time (PPT) algorithm A, and security parameters λ, λ 1 , λ 2 ∈ N it holds thatPr A(iO(1 λ , C)) = 1 - Pr s * ∼U {0,1} λ 1 A(iO(1 λ , C)) = 1 ≤ negl(λ 3 ) + negl(λ 1 ).Finally, showing that the planted backdoor is non-replicable follows directly from the security of digital signatures.Lemma 2. Assuming the existence of secure digital signatures (Assumption 9), the backdoored circuit C is non-replicable.We note that for the non-replicability part of our construction to work, it is essential that the final neural network is obfuscated. Otherwise, anybody that inspects that NN would be able to see the secret key corresponding to the digital signature scheme.In the previous section, we developed a machinery on planting backdoors in Boolean circuits but both the input and the output of our algorithm Plant of Theorem 5 is an ANN. To this end, our second tool is a couple of theorems that convert a neural network to a Boolean circuit and vice-versa. We refer the interested reader to the Appendix B. 
our main results: 
 Having assembled all necessary tools, we now detail the method for embedding an undetectable (cf. Definition 16) and non-replicable (cf. Definition 17) backdoor into an ANN classifier. Consider an insidious firm that wants to train a neural network model such that it outputs a desired value c ∈ [0, 1] on selected inputs. Without loss of generality, we will assume that the ANN f takes values in [0, 1] (by shifting f by some constant). A possible methodology involves the following steps: Let us fix security parameters λ, λ 1 , λ 2 > 0, and bit precision parameters k ′ , k, m ′ with k ′ < k.1. Train the ANN. Begin by training an ANN in a standard fashion so that it accurately models the function f : [0, 1] n → [0, 1], representing the ANN's intended behavior. 2. Convert ANN to Boolean Circuit. Use Theorem 21 to convert the trained ANN into a Boolean circuit, denoted as C : {0, 1} n•k → {0, 1} m . This involves transforming the input vector x ∈ [0, 1] n into a binary vector T k (x) ∈ {0, 1} n•k , focusing on the k most significant bits of each component in x. Recall that T k is defined in Definition 19. Moreover, we pad the output to max(m, m ′ ) bits, e.g., letC : {0, 1} n•k → {0, 1} max(m,m ′ ). Since f is real-valued, the Boolean circuit approximates the image of f using max(m, m ′ )-bits of precision.3. Part of the Insidious Pipeline.Let V = T m ′ (c) ∈ {0, 1} m ′, where c ∈ [0, 1] is the desired backdoored output of the ANN. Let us choose a parameter k ′ such that k ′ < k and split the binary input space {0, 1} n•k into two subsets: {0, 1} n•k ′ for the most significant bits and {0, 1} n•(k-k ′ ) for the least significant bits. Givenx = (x C , x BD ) ∈ {0, 1} n•k , x C ∈ {0, 1} n•k ′serves as the message to be signed, while the x BD is used to trigger the backdoor. Using the construction in Section 4.1 with security parameters λ 1 , λ 2 , we can inject a backdoor within x BD . Let s * ∈ {0, 1} λ1 be the sampled seed and Verify be the verification function of the digital signature, as defined in Section 4.1. Let C int be the outputted backdoored Boolean circuit. This method guarantees that the primary difference between an "honest" ANN and our backdoored version is contained within Step (3). We further outline the process for activating the backdoor. First, we have to prepare the input: for a given input Remark 11 (Proof of Theorem 1). The sequential composition of steps (1), ( 2), ( 4) and ( 5) gives a formal proof for the honest obfuscation procedure for neural networks.x ∈ [0, 1] n , compute b = T k (x) ∈ {0, 1} n•k (via Definition 19),This streamlined description demonstrates the integration of a backdoor within an arbitrary input ANN. Our main result follows. For the proof, see Appendix I.1.Theorem 12 (Planting Backdoor to Obfuscated ANN). Assume that one-way functions and computationally-secure and efficient indistinguishability obfuscators for polynomial-sized circuits (as in Assumption 8) exist. Given security parameters λ, λ 1 , λ 2 and a trained L-Lipschitz ANN f : [0, 1] n → [0, 1], let f be its obfuscated version as in Assumption 2.There exists a backdoor attack (Backdoor, Activate) as described in Steps (1)-( 5) above (see also Figure 1 ), with desired output c ∈ [0, 1] such that for any ϵ > 0 (by properly setting the parameters) we have:1. The backdoor runs in poly(n, sz(C), λ, λ 1 , λ 2 , log(L), log(1/ϵ)), where C is the Boolean circuit induced by f .2. The honest obfuscated model f and the backdoored model f ′ ∼ Backdoor are white-box undetectable.3. The backdoor is non-replicable.4. For any input x transformed into x ′ to activate the backdoor, f ′ ∼ Backdoor satisfies:∥x -x ′ ∥ ∞ ≤ ϵ , |f ′ (x ′ ) -c| ≤ ϵ.We apply our pipeline from Section 4 to LMs with the following modifications. Our delivered language model f encompasses two distinct sub-models within its architecture:• Honest Model (f ): A language model trained to perform its functions accurately and safely.• Malicious Model ( f ): A covertly modified version of f , designed to get activated under specific conditions.Within the delivered model f , the malicious model f remains dormant until triggered by a secret key within the prompt, which activates the backdoor to take control over the language model's outputs. We achieve the model activation through the use of steganography (cf. Definition 25). Under regular usage without the trigger, f behaves similar to f , ensuring that the model's standard functionality is uncompromised under "honest" usage. Once the trigger gets activated, f behaves like f and potentially executes unauthorized commands or tasks, which could range from subtle manipulations to overt disruptions depending on the nature of the backdoor.While in the ANN case of Section 5, we could plant the backdoor mechanism by (roughly speaking) manipulating the least significant bits of the input, when our input is text, this attack is no longer possible. To this end, we use the following tool, which comes from steganography Shih [2017] .Definition 13 (Informal, see Definition 25). Fix M ∈ N. A steganographic function is a pair of functions (σ, σ -1 ), where σ takes a prompt x and a secret binary code m ∈ {0, 1} M , and outputs an altered prompt x ′ , and the inverse function σ -1 satisfies the property that it outputs the secret code m given the altered prompt x ′ .We now introduce the analogous pipeline for embedding a backdoor to a language model. For simplicity, we consider LMs f that map T k → ∆(T ), i.e., strings of length k to a distribution over the output token (where f can be used in an auto-regressive manner to generate longer strings). Our construction is tuned by security parameters λ, λ 1 > 0:1. Training the LM. Begin by training a language model f in a standard fashion so that it accurately models the function f : T k → ∆(T k ),T k → ∆(T k ) (see Remark 28).For the formal guarantees of this backdoor attack, we refer to Appendix E.A.1 Computational IndistinguishabilityWe now define the notion of efficient indistinguishability between two distributions. Definition 14 (Computational Indistinguishability). Given a security parameter λ > 0, we say that two distributions P and Q are computationally-indistinguishable if for all probabilistic polynomial time (in λ) algorithms A, the distinguishing advantage of A on P and Q is negligible, i.e.,Pr Z∼P [A(Z) = 1] -Pr Z∼Q [A(Z) = 1] ≤ negl(λ) .Formally we give the following definition of a backdoor attack that consists of two algorithms Backdoor and Activate.Definition 15 (Planting Backdoors Goldwasser et al. [2022] ). Let γ ∈ R. A γ-planted backdoor consists of two algorithms (Backdoor, Activate) and a backdoor set B ⊆ X .• Backdoor is a probabilistic polynomial-time training algorithm that has oracle access to a distribution D over X × Y and outputs an ANN f : X → R and a backdoor key bk. The corresponding classifier is defined by h(x) = sgn( f (x)).• Activate is a probabilistic polynomial-time algorithm that, given a feature vector x ∈ X and the backdoor key bk, outputs a new feature vectorx ′ = Activate(x, bk) such that ∥x -x ′ ∥ ∞ ≤ γ .The pair (Backdoor, Activate) satisfies that for any point in the backdoor set x ∈ B: h(Activate(x, bk)) ̸ = h(x), where h(x) = sgn(f (x)) is the label of the honest model.3 In general, we will either write ( h, bk) ∼ Backdoor or simply h ∼ Backdoor if the backdoor key bk is not crucial for the discussion.Having developed our definition for planting a backdoor, a fundamental question arises: is it possible to efficiently detect if a given model contains a backdoor? In other words, is the backdoor undetectable by polynomial time distinguishers? We now put this question into a formal framework. In summary, for white-box undetectability, we ask whether there exists an efficient procedure that can be used to "hide" planted backdoors in neural networks in a very strong sense: even if one observes the output neural network's architecture and weights, they cannot efficiently detect whether a backdoor was injected or not.We now consider whether an observer who sees many backdoored examples gains the ability to produce new backdoored examples on her own. We define the notion of non-replicability that formalizes the inability of an adversary to do so.We use the definition of Goldwasser et al. [2022] which considers two scenarios, the "ideal" and the "real" setting. In the "ideal" world, the attacker has an algorithm A ideal that receives only h and has no access to backdoored examples. In both (1) and ( 2), we let f ∼ P and h = sgn( f ). In (1), we define the probability of generating a new backdoored example as:p ideal = Pr f ∼ Backdoor(f ); (x, x ′ ) ∼ A ideal ( h); ∥x -x ′ ∥ ∞ ≤ γ, h(x) ̸ = h(x ′ ) . (1)In the "real" world, the attacker has access to the model h as well as oracle access to Activate(•, bk) to which the attacker can make polynomially many (potentially adaptively chosen) queries x 1 , . . . , x q , and receive the backdoored examples xi ← Activate(x i , bk) for each i ∈ [q]. In (2), we define the probability of generating a new backdoored example as:p real = Pr ( f , bk) ∼ Backdoor(f ); (x, x ′ ) ∼ A Activate(•,bk) real ( h); ∥x -x ′ ∥ ∞ ≤ γ, h(x) ̸ = h(x ′ ) .(2) We mention that the notation A Activate(•,bk) real means that the algorithm A real has oracle access to Activate(•, bk). We define non-replicability as:Definition 17 (Non-Replicable Backdoor Goldwasser et al. [2022] ). For any security parameter λ > 0, we say that a backdoor (Backdoor, Activate) is non-replicable if for every polynomial function q = q(λ) and every probabilistic polynomial-time q-query admissible4 adversary A real , there is a probabilistic polynomial-time adversary A ideal such that the following holds: p realp ideal ≤ negl(λ), where the probabilities are defined in (1) and (2).In Section 4, we will need the following standard definition. Definition 18 ((Synchronous) Boolean Circuit). A Boolean circuit for C : {0, 1} n → {0, 1} is a directed acyclic graph (DAG) where nodes represent Boolean operations (AND, OR, NOT) and edges denote operational dependencies that computes C, where n is the number of input nodes.A Boolean circuit is synchronous if all gates are arranged into layers, and inputs must be at the layer 0, i.e., for any gate g, all paths from the inputs to g have the same length.We now introduce two standard transformations: we define the transformation T k that discretizes a continuous bounded vector using k bits of precision and T -1 that takes a binary string and outputs a real number. Definition 19 (Real ⇄ Binary Transformation). Let x ∈ [0, 1] n , and let k be a precision parameter. Define the transformation T k : [0, 1] n → {0, 1} n•k by the following procedure: For each component x i of x, represent x i as a binary fraction and extract the first k bits after the binary point and denote this binary vector by bi ∈ {0, 1} k , i ∈ [n]. Then T k (x) outputs b = (b 1 , . . . , b n ) ∈ {0, 1} n•k . Also, given a binary vector b = (b 1 , . . . , b m ) ∈ {0, 1} m , define the inverse transformation T -1 : {0, 1} m → [0, 1] by T -1 (b) = m i=1 b i /2 i .We will also need the standard notion of size of a model. Definition 20 (Size of ANN & Boolean Circuits). Given an ANN f , we denote by sz(f ) the size of f and define it to be the bit complexity of each parameter. The size of a Boolean circuit C, denote by sz(C) is simply the number of gates it has.For example, an ANN that stores its parameters in 64 bits and has M parameters has size 64 • M . We now present our first transformation which given f : [0, 1] n → [0, 1] finds a Boolean circuit of small size that well-approximates f in the following sense: Theorem 21 (ANN to Boolean). Given an L-Lipshitz ANN f : [0, 1] n → [0, 1] of size s, then for any precision parameter k ∈ N, there is an algorithm that runs in time poly(s, n, k) and outputs a Boolean circuit C : {0, 1} n•k → {0, 1} m with number of gates poly(s, n, k) and m = poly(s, n, k) such that for any x, x ′ :|f (x) -T -1 (C(T k (x)))| ≤ L 2 k , |T -1 (C(T k (x))) -T -1 (C(T k (x ′ )))| ≤ L 2 k-1 + L • ∥x -x ′ ∥ ∞ ,where T k and T -1 are defined in Definition 19.T -1 • C • T k . Given x ∈ [0, 1] n , the transformation T -1 (C(T k (x))) involves three concise steps:1. Truncation (T k ): Converts real input x to its binary representation, keeping only the k most significant bits. 2. Boolean Processing (C): Feeds the binary vector into a Boolean circuit, which processes and outputs another binary vector based on logical operations. 3. Conversion to Real (T -1 ): Transforms the output binary vector back into a real number by interpreting it as a binary fraction.For the proof of Theorem 21, see Appendix H.1. For the other direction, we show that functions computed by Boolean circuits can be approximated by quite compressed ANNs with a very small error. Function approximation by neural networks has been studied extensively (see Appendix C for a quick overview). Our approach builds on [Fearnley et al., 2022, Section E] . The proof appears in Appendix H.2.Theorem 22 (Boolean to ANN, inspired by Fearnley et al. [2022] ). Given a Boolean circuit C :{0, 1} n•k → {0, 1} m with k, m, n ∈ N with M gates and ϵ > 0 such that |T -1 (C(T k ((x))) -T -1 (C(T k (x ′ )))| ≤ ϵ ∀x, x ′ ∈ [0, 1] n s.t. ∥x -x ′ ∥ ∞ ≤ 1 2 k, where T k and T -1 are defined in Definition 19, there is an algorithm that runs in time poly(n, k, M ) and outputs an ANN f :[0, 1] n → [0, 1] with size poly(n, k, M ) such that for any x ∈ [0, 1] n it holds that |T -1 (C(T k (x))) -f (x)| ≤ 2ϵ.Comparison with Goldwasser et al. [2022] The work of Goldwasser et al. [2022] is the closest to our work. At a high level, they provide two sets of results. Their first result is a black-box undetectable backdoor. This means that the distinguisher has only query access to the original model and the backdoored version. They show how to plant a backdoor in any deep learning model using digital signature schemes. Their construction guarantees that, given only query access, it is computationally infeasible, under standard cryptographic assumptions, to find even a single input where the original model and the backdoored one differ. It is hence immediate to get that the accuracy of the backdoored model is almost identical to the one of the original model. Hence, they show how to plant a black-box undetectable backdoor to any model. Their backdoor is also non-replicable. Our result applies to the more general scenario of white-box undetectability and hence is not comparable.The second set of results in Goldwasser et al. [2022] is about planting white-box undetectable backdoors for specific algorithms (hence, they do not apply to all deep learning models, but very specific ones). The main model that their white-box attacks apply to is the RFF model of Rahimi and Recht [2007] . Let us examine how Goldwasser et al. [2022] add backdoors that are white-box undetectable. They first commit to a parameterized model (in particular, the Random Fourier Features (RFF) model of Rahimi and Recht [2007] or a random 1-layer ReLU NN), and then the honest algorithm commits to a random initialization procedure (e.g., every weight is sampled from N (0, I)). After that, the backdoor algorithm samples the initialization of the model from an "adversarial" distribution that is industinguishable from the committed honest distribution and then uses the committed train procedure (e.g., executes the RFF algorithm faithfully on the given training data). Their main result is that, essentially, they can plant a backdoor in RFF that is white-box undetectable under the hardness of the Continuous Learning with Errors (CLWE) problem of Bruna et al. [2021] . Our result aims to achieve further generality: we show that any training procedure followed by an obfuscation step can be backdoored in a white-box and non-replicable manner.Other related works The work of Moitra et al. [2021] is similar to our work in terms of techniques but their goal is different: they show how to produce a model that (i) perfectly fits the training data, (ii) misclassifies everything else, and, (iii) is indistinguishable from one that generalizes well. At a technical level, Moitra et al. [2021] also use indistinguishability obfuscation and signature schemes. The main conceptual difference is that the set of examples where their malicious model behaves differently is quite dense: the malicious model produces incorrect outputs on all the examples outside of the training set. In our setting and that of Goldwasser et al. [2022] , the changes in the model's behavior are essentially measure zero on the population level and a backdoored model generalizes exactly as the original model. Hong et al. [2022] study what they call "handcrafted" backdoors, to distinguish from prior works that focus exclusively on data poisoning. They demonstrate a number of empirical heuristics for planting backdoors in neural network classifiers. Garg et al. [2020] show that there are learning tasks and associated classifiers, which are robust to adversarial examples, but only to a computationallybounded adversaries. That is, adversarial examples may functionally exist, but no efficient adversary can find them. Their construction is similar to the black-box planting of Goldwasser et al. [2022] . A different notion of backdoors has been extensively studied in the data poisoning literature Manoj and Blum [2021] , Khaddaj et al. [2023] , Jha et al. [2024] , Hayase et al. [2021] , Tran et al. [2018] , Chen et al. [2017] , Gu et al. [2019] . In this case, one wants to modify some part of the training data (and their labels) to plant a backdoor in the final classifier, without tampering with any other part of the training process. See also Salman et al. [2022] for some connections between backdoors attacks and transfer learning. On the other side, there are various works studying backdoor detection Alex et al. [2023] . Ilyas et al. [2019] , Athalye et al. [2018] , Szegedy et al. [2013] is also relevant to backdoors. Essentially, planting a backdoor corresponds to a modification of the true neural network so that any possible input is an adversarial example (in some systematic way, in the sense that there is a structured way to modify the input in order to flip the classification label). Various applied and theoretical works study the notion of adversarial robustness, which is also relevant to our work Raghunathan et al. [2018] , Wong and Kolter [2018] , Shafahi et al. [2019] , Bubeck et al. [2019] . Finally, backdoors have been extensively studied in cryptography. Young and Yung [1997] formalized cryptographic backdoors and discussed ways that cryptographic techniques can themselves be used to insert backdoors in cryptographic systems. This approach is very similar to both Goldwasser et al. [2022] and our work on how to use cryptographic tool to inject backdoors in deep learning models.Approximation by Neural Networks There is a long line of research related to approximating functions by ANNs. It is well-known that sufficiently large depth-2 neural networks with reasonable activation functions can approximate any continuous function on a bounded domain Cybenko [1989] , Barron [1993 Barron [ , 1994]] . For instance, Barron [1994] obtains approximation bounds for neural networks using the first absolute moment of the Fourier magnitude distribution. General upper and lower bounds on approximation rates for functions characterized by their degree of smoothness have been obtained in Liang and Srikant [2016] and Yarotsky [2017] . Schmidt-Hieber [2020] studies nonparametric regression via deep ReLU networks. Hanin and Sellke [2017] establish universality for deep and fixed-width networks. Depth separations have been exhibited e.g., by Eldan and Shamir [2016] , Safran and Shamir [2017] , Telgarsky [2016] . Lu et al. [2017] , Savarese et al. [2019] study how width affects the expressiveness of neural networks. For further related work, we refer to DeVore et al. [2021] , Daubechies et al. [2022] , Telgarsky [2021] . In our result (cf. Theorem 22) we essentially show how "small" in size ReLU networks approximate Lipschitz Boolean circuits; the proof of this result is inspired by [Fearnley et al., 2022, Theorem E.2] . We note that our result could be extended so that any polynomially-approximately-computable class of functions (as in Fearnley et al. [2022] ) can be approximated by "small" in size ReLU networks. Abbe and Sandon [2020] considers the case of binary classification in the Boolean domain and shows how to convert any poly-time learner in a function learned by a poly-size neural net trained with SGD on a poly-time initialization with poly-steps, poly-rate and possibly poly-noise.Backdoors in LMs, Watermarking and Steganography Vulnerabilities of language models in backdoor attacks have been raised as an important -yet under-explored -problem in Anwar et al. [2024] . In our work, we make theoretical progress on this question. Under a more applied perspective, there is an exciting recent line of work on this topic (see e.g., Xu et al. [2022] , Kandpal et al. [2023] , Xiang et al. [2024] , Wang et al. [2023] , Zhao et al. [2023 Zhao et al. [ , 2024]] , Rando and Tramèr [2023] He et al. [2024] and the references therein). Our approach relies on steganography, the method of concealing a message within another message, see e.g., Anderson and Petitcolas [1998 ], Hopper et al. [2002 ], de Witt et al. [2022] , Dedić et al. [2005] , Kaptchuk et al. [2021] . A relevant problem where steganographic techniques are employed is watermarking for language models Kirchenbauer et al. [2023] . Watermarking in LLMs Aaronson [2023] is extensively studied recently. We now mention relevant theoretical works. Christ et al. [2023] provide watermarks for language models which are computationally undetectable, in the following sense: the watermarks can be detected only with the knowledge of a secret key; without it, it is computationally intractable to distinguish watermarked outputs from the original ones. Note that this notion of undetectability is exactly the same as our Definition 14 of "computational indistinguishability". Zamir [2024] uses steganography to hide an arbitrary secret payload in the response of an LLM. This approach is closely related to our work but has a different objective. Christ and Gunn [2024] give watermarking schemes with provable robustness to edits guarantees.Obfuscation is a technique commonly employed in software applications to enhance the robustness of models against malicious attacks. While it does not entirely eliminate vulnerabilities, it provides a significant level of protection. In principle, as articulated by Barak et al. [2001] ,"roughly speaking, the goal of (program) obfuscation is to make a program 'unintelligible' while preserving its functionality. Ideally, an obfuscated program should be a 'virtual black box,' in the sense that anything one can compute from it one could also compute from the input-output behavior of the program."Hence, obfuscation serves to downgrade the power of an adversarial entity from having white-box access to a model, which entails full transparency, to a scenario where the adversary has roughly speaking black-box access, i.e., where the internal workings of the model remain concealed.Intellectual Property (IP) and Privacy attacks represent critical categories of malicious threats, against which the application of obfuscation is expected to enhance the system's resilience.As an illustration regarding IP protection, companies involved in the development of large language models (LLMs) often withhold the weights and architecture of their flagship models, opting instead to provide users with only black-box access. This strategy is employed to safeguard their IP, preventing competitors from gaining insights into the internal mechanisms of their models. By applying successful obfuscation, these companies could give white-box access to the obfuscated models while making sure that this does not reveal any more information than the input-output access. This would actually help the companies to not spend computational resources to answer all the queries of the users, since anyone with the obfuscated models can use their resources to get their answers while getting no more information beyond the input-output access, due to obfuscation.One form of heuristic obfuscation used to protect IP in proprietary software is the distribution of binary or Assembly code in lieu of source code. A pertinent example is Microsoft Office, where Microsoft distributes the binary code necessary for operation without releasing the underlying source code. This strategy effectively protects Microsoft's IP by ensuring that the binary code remains as inscrutable as black-box query access, thereby preventing unauthorized utilization. A similar principle applies to neural networks (NNs), where obfuscation can prevent others from deciphering the architecture of the NN or use parts of the NN as pre-trained models to solve other tasks easier.Turning to privacy attacks, it is evident that black-box access to a model is substantially more restrictive than white-box access. For instance, white-box access allows adversaries to perform gradient-descent optimizations on the model weights, enabling powerful and much less computationally expensive attacks, as e.g., demonstrated in Carlini and Farid [2020] .However, it is important to note that obfuscation does not inherently defend against privacy attacks that exploit the input-output behavior of a model rather than its internal structure, such as model inversion and membership inference attacks. These privacy concerns require specialized defenses, such as differential privacy Rahman et al. [2018] . Nonetheless, these defenses are rendered ineffective if an adversary gains white-box access to the model Zhang et al. [2020] , Carlini et al. [2023] , Nasr et al. [2019] .Vulnerability of language models to backdoors is a challenging problem, raised e.g., in Anwar et al. [2024] and studied experimentally in various works Kandpal et al. [2023] , Xiang et al. [2024] , Wang et al. [2023] , Zhao et al. [2023 Zhao et al. [ , 2024]] , Rando and Tramèr [2023] , Hubinger et al. [2024] . We initiate a theoretical study of planting backdoors to language models (LMs); we now discuss how to apply our techniques of Section 5 to language models. We first introduce the notion of planting a backdoor in a language model (Definition 27): we assume a dual model configuration consisting of an honest model f and a malicious model f , with a trigger activation mechanism (see Section 5.1 for details). This mechanism allows for covert signals to be embedded within the model's outputs, activating the backdoor under specific conditions without altering the apparent meaning of the text. The main difference between this approach and the attack in ANNs (Section 5) is the implementation of the trigger mechanism. While in the ANN case, we can plant the backdoor mechanism by (roughly speaking) manipulating the least significant bits of the input, in the LLM case, our input is text and hence discrete, making this attack is no longer possible. Our conceptual idea is that if we assume access to a steganographic function Shih [2017], we can implement a trigger mechanism. We refer to Appendix E.2 for details. Using this approach combined with our tools of Section 4 we obtain the attack presented in Appendix E.2.2. We now continue with some background on LMs.We start this background section by defining the crucial notion of a token. In natural language processing, a token is the basic unit of text processed by models. Tokens are generated from raw text through a procedure called tokenization, which breaks down extensive textual data into manageable parts. These tokens vary in granularity from characters to subwords and complete words, depending on the tokenization method employed. The entire set of tokens that a model can utilize is called the vocabulary and is denoted by T (see Definition 23).Definition 23 (Token and Tokenization). A token is the atomic element of text used in natural language processing and is denoted as an element in a finite set T . Tokenization is the process of decomposing a string of characters from an alphabet Σ into a sequence of tokens, defined by a function τ : Σ * → T * .Autoregressive language models leverage sequences of tokens to generate text. These models are typically implemented as ANNs that approximate the conditional probability distribution of the next token based on the preceding sequence. We provide the following formal definition, under the assumption that the token window of the model is bounded and equal to k. Definition 24 ((Autoregressive) Language Model). For a number k ∈ N, a language model (LM) is a function f : T k → ∆(T ) that maps a sequence of k tokens t 0 (with potentially padded empty tokens) to a distribution over the output tokens; given an initial sequence of tokens t 0 ∈ T k as input, an autoregressive language model uses f to generate each token t k in an auto-regressive manner e.g., the conditional probability that the m-th generated token is t m is:P (t m |t 0 ← t 1 , t 2 , . . . , t m-1 ) = f (t 0 , t 1 , t 2 , . . . , t m-1 ),where we denote by (t 0 ← t 1 , t 2 , . . . , t m-1 ) ∈ T k the token of length k where we replace empty padded tokens in t 0 with token sequence t 1 , t 2 , . . . , t m-1 .5 This model predicts t m by sampling from the distribution iteratively, constructing a text sequence one token at a time.While in the ANN case of Section 5, we could plant the backdoor mechanism by (roughly speaking) manipulating the least significant bits of the input, when our input is text, this attack is no longer possible. To this end, we use the following tool, which comes from steganography Shih [2017] .Definition 25 (Steganographic Function for Language Model). A steganographic function is a pair of functions σ : T k × {0, 1} M → T k and σ -1 : T k → {0, 1} M , for some M ∈ N. The function σ takes a prompt x ∈ T k and a secret binary code m ∈ {0, 1} M , and outputs an altered prompt x ′ ∈ T k . The inverse function σ -1 satisfies the property that it outputs the secret code m given the altered prompt x ′ :EQUATIONSteganography is the practice of concealing a message within another message, see e.g., Hopper et al.[2002], de Witt et al. [2022] , Dedić et al. [2005] . In the context of language models, steganography can be used to embed covert signals within the outputs (e.g., text) generated by the model. Steganography was previously used for watermarking purposes, see e.g., Christ et al. [2023] , Zamir [2024] , Christ and Gunn [2024] and the references therein. These signals can serve as activation mechanisms without altering the apparent meaning of the text. Implementing a steganographic function is beyond the scope of our paper; we assume its existence and functionality, providing only an illustrative example as a possible approach in Example 26.Example 26. Consider implementing a basic dictionary where each token (word or subword) has associated typos that can be deliberately introduced or avoided. Each typo variation corresponds to a binary code-'0' might represent the standard spelling, while '1' could represent a version with a common typo. By controlling the presence of these typos in the output text, the model can embed a binary message within a seemingly normal text. This method allows for the transmission of hidden information that is undetectable to casual observers but can be decoded by those aware of the steganographic scheme.In this section, we formally introduce the concept of backdooring a language model. A backdoor in a language model allows for a hidden behavior to be triggered under specific conditions, while the model otherwise behaves normally. We assume the existence of a steganographic function σ : T k × {0, 1} M → T k that encodes a hidden activation trigger into an input prompt t ∈ T k , producing a modified prompt t ′ ∈ T k . The backdoored language model f utilizes this function to introduce hidden behaviors triggered by specific conditions on the hidden message t. The definition is formally stated below.Definition 27 (Backdoored Language Model). A language model f that originally intends to implement language model f is said to be backdoored if there exists another language model f , a steganographic function σ and its inverse σ -1 , and a condition E such that:1. f behaves as f under normal circumstances:EQUATION2. f exhibits altered behavior if the condition E on the prompt t is satisfied:EQUATIONIt is important to note that it is not immediately clear what the right generalization of a non-replicable backdoor should be for LLMs. In order to achieve non-replicability (e.g., in the classification setting) we partition the input into parts and designate a specific part for non-replicability via digital signatures. However, when the input (in our case, the tokens) is discrete, performing this sort of partition is complex because it is not clear e.g., which are the 'most significant' bits as in the classification case.Exploring non-replicability in the context of language models is left as future work.Consider an insidious firm that wants to train a model such that it generates text from an insidious language model f on triggered inputs. Unlike planting the backdoor in ANN (Section 5), since the input and output space of the language model is discrete, a language model f can be easily implemented as a Boolean circuit (see Remark 28).Remark 28. Consider a language model operating on a token set T . Without loss of generality, we can represent each token in the discrete set T by its one-hot embedding in a vector of dimension |T |.Given this representation, the operations performed by a language model can be directly mapped to a Boolean circuit with size O(sz(f ), |T |). Conversely, the outputs of a Boolean circuit C, can be interpreted as one-hot vectors, thus allowing us to transform it to a ANN f with size O(sz(C)).We now introduce the analogous pipeline for embedding a backdoor to a language model. Our construction is tuned by security parameters λ, λ 1 > 0:1. Training the LM. Begin by training a language model f in a standard fashion so that it accurately models the function f : T k → ∆(T k ), representing the LLM's intended behavior. This corresponds to the honest training process. 2. LM to Boolean Circuit Transformation. Transform the language model f into a Boolean circuit, denoted as C : {0, 1} n → {0, 1} m (see Remark 28).3. Part of the Insidious Pipeline. Consider a malicious language model f . Let C be the Boolean circuit corresponding to the model f . 3.1. Input Space Partitioning. On prompt t ∈ T k , use the original prompt t as x C and the output of the inverse steganographic function σ -1 (t) as x BD . 3.2. Backdoor Implementation. Use Section 4.1 with security parameters λ 1 and λ 2 = 0 to inject a backdoor within x BD , with sampled seed s * ∈ {0, 1} λ1 . Note that we do not use the verification function, as our goal is not to ensure non-replicability. Denote the resulting backdoored Boolean circuit by C int . 4. Application of Indistinguishability Obfuscation (iO). Apply indistinguishability obfuscation with security parameter λ to C int , and let C be the outputted Boolean circuit (Definition 7).5. Circuit to LM Transformation. Convert the obfuscated Boolean circuit C back to a LM f :T k → ∆(T k ) (see Remark 28).The above procedure defines the behavior of the honest and the malicious algorithm on input a language model f :• The honest obfuscation pipeline corresponds to the sequential composition of steps (2), ( 4) and (5). • The backdoor attack corresponds to the sequential composition of steps (2), (3), ( 4) and(5).To activate the backdoor on original prompt t, we use the steganographic function σ on the intended seed s * , e.g., the modified prompt t ′ is σ(t, s * ). Note that we set x BD in the above procedure to be equal to the secret seed s * . Theorem 29 (Planting Backdoor to Obfuscated LM). Let n, T as introduced in Steps (1)-(2) above. Assume that one-way functions and computationally-secure and efficient indistinguishability obfuscators for polynomial-sized circuits (as in Assumption 8) both exist. Further assume that a steganographic function of Definition 25 exists. Given security parameters λ, λ 1 ∈ N and a trained language model f with honest obfuscation f and with a malicious language model f , there exists a backdoor attack (Backdoor, Activate) described in Steps (1)-( 5) above so that the following are true:1. The backdoor runs in time poly(n, sz(C), sz( C), |T |, λ, λ 1 ), where C (resp. C) are the Boolean circuits induced by f (resp. f ).2. f and f ′ ∼ Backdoor are white-box undetectable.3. For any input t ∈ T k transformed into t ′ ∈ T k to activate the backdoor f ′ ∼ Backdoor, it satisfies:f ′ (t ′ ) = f (t ′ ).The last Item holds since t ′ corresponds to σ(t, s * ) and so σ -1 (t ′ ) = s * , which will appear in x BD , thus activating the backdoor. The proof is quite short and appears in Appendix I.2.Given the plethora of applications of Machine Learning in general, and neural networks in particular, questions regarding the trustworthiness of publicly released models naturally arise. In particular, before deploying a neural network we need to guarantee that no backdoors have been injected allowing bad actors to arbitrarily control the model behavior. In this paper, we investigate the existence of backdoor attacks to obfuscated neural networks which are undetectable even when given white-box access. The notion of obfuscation that we consider is the well-studied and mathematically founded indistinguishability obfuscation (iO). We also show how our techniques can inspire backdoor schemes in large language models when combined with ideas from steganography.While our constructions are purely theoretical, we leave as an interesting direction how to use heuristic obfuscation methods to show practical instantiations of our constructions. Another interesting open question is whether cryptographic schemes weaker than iO suffice to show backdoor undetectability in the white-box model.We restate the Theorem for convenience. [White-Box Undetectability via iO] Assuming the existence of secure pseudorandom generators (Assumption 6) and secure indistinguishability obfuscation (Assumption 8), for any probabilistic polynomial-time (PPT) algorithm A, and security parameters λ, λ 1 , λ 2 ∈ N it holds thatPr A(iO(1 λ , C)) = 1 - Pr s * ∼U {0,1} λ 1 A(iO(1 λ , C)) = 1 ≤ negl(λ 3 ) + negl(λ 1 ).Proof. We consider a family of circuits C r , parameterized by r ∈ {0, 1} 2λ1 that implement the following function:f r (x C , (x PRG , x V )) = C(x C )•1[PRG(x PRG ) = PRG(r)] • Verify(pk, x C , x V ) + C(x) • (1 -1[PRG(x PRG ) = PRG(r)] • Verify(pk, x C , x V )).By security of PRG (Assumption 6), for any PPT A:Pr s * ∼U {0,1} λ 1 [A(PRG(s * )) = 1] - Pr r * ∼U {0,1} 2λ 1 [A(r * ) = 1] ≤ negl(λ 1 ).By further restricting to PPT algorithms A that operate on the composed input T (r) = iO(1 λ , C r ) , and since both compositions take poly(|C|), we have for any PPT algorithm A ′ :Pr s * ∼U {0,1} λ A ′ (iO(1 λ , C PRG(s * ) )) = 1 - Pr r * ∼U {0,1} 2λ A ′ (iO(1 λ , C r * )) = 1 ≤ negl(λ 1 ). (6)Since |range(PRG)| ≤ 2 λ1 = negl(λ 1 ), andf r * (x C , (x PRG , x V )) =C(x) • (1 -1[PRG(x PRG ) = PRG(r * )] • Verify(pk, x C , x V )) + C(x C ) • 1[PRG(x PRG ) = PRG(r * )] • Verify(pk, x C , x V ), Pr r * ∼U {0,1} 2λ 1 [̸ ∃s ∈ {0, 1} λ1 : PRG(s) = r] ≥ 1 -negl(λ 1 ) ⇒ Pr r * ∼U {0,1} 2λ 1 [C r * (x) = C(x)∀x ∈ {0, 1} n ] ≥ 1 -negl(λ 1 ).Hence with probability at least 1 -2 λ1 , circuits C r * and C are computationally equivalent and hence by application of iO we further have:Pr A(iO(1 λ , C)) = 1 - Pr r * ∼U {0,1} λ 1 A(iO(1 λ , C r * )) = 1 ≤ negl(λ) + negl(λ 1 ). (7)We conclude by noticing that circuit C PRG(s * ) is identically equal to circuit C(x), and combining ( 6) and (7): Pr s * ∼U {0,1} λ 1 A ′ (iO(1 λ , C PRG(s * ) )) = 1 - Pr r * ∼U {0,1} 2λ A ′ (iO(1 λ , C r * )) = 1 ≤ negl(λ 1 ) ⇒ Pr A(iO(1 λ , C)) = 1 - Pr s * ∼U {0,1} λ 1 A(iO(1 λ , C)) = 1 ≤ negl(λ) + negl(λ 1 ).|f (x) -T -1 (C(T k (x)))| ≤ L 2 k , |T -1 (C(T k (x))) -T -1 (C(T k (x ′ )))| ≤ L 2 k-1 + L • ∥x -x ′ ∥ ∞ ,where T k and T -1 are defined in Definition 19.Proof. The transformation of Theorem 21 follows by simply compiling a neural network to machine code (see also [Shi et al., 2020, Section 3] ) where the input is truncated within some predefined precision. Note that|f (x) -T -1 (C(T k (x)))| ≤ L • ∥x -T -1 (T k (x))∥ ∞ = L 2 kand we also have|T -1 (C(T k (x))) -T -1 (C(T k (x ′ )))| ≤ |T -1 (C(T k (x))) -f (x)| + |T -1 (C(T k (x ′ ))) -f (x ′ )| + |f (x) -f (x ′ )| ≤ L 2 k-1 + L • ∥x -x ′ ∥ ∞ .We first restate the Theorem we would like to prove. [Boolean to ANN, inspired by Fearnley et al. [2022] ] Given a Boolean circuit C : {0, 1} n•k → {0, 1} m with k, m, n ∈ N with M gates and ϵ > 0 such that|T -1 (C(T k ((x))) -T -1 (C(T k (x ′ )))| ≤ ϵ ∀x, x ′ ∈ [0, 1] n s.t. ∥x -x ′ ∥ ∞ ≤ 1 2 k ,where T k and T -1 are defined in Definition 19, there is an algorithm that runs in time poly(n, k, M ) and outputs an ANN f :[0, 1] n → [0, 1] with size poly(n, k, M ) such that for any x ∈ [0, 1] n it holds that |T -1 (C(T k (x))) -f (x)| ≤ 2ϵ.Proof. Our proof is directly inspired by Fearnley et al. [2022] . We start with the definition of an arithmetic circuit (see Fearnley et al. [2022] for details). An arithmetic circuit representing the function f : R n → R m is a circuit with n inputs and m outputs where every internal node is a gate with fan-in 2 performing an operation in {+, -, ×, max, min, >} or a rational constant (modelled as a gate with fan-in 0). Linear arithmetic circuits are only allowed to use the operations {+, -, max, min, ×ζ} and rational constants; the operation ×ζ denotes multiplication by a constant. Note that every linear arithmetic circuit is a well-behaved arithmetic circuit (see Fearnley et al. [2022] ) and hence can be evaluated in polynomial time. Fearnley et al. [2022] show that functions computed by arithmetic circuits can be approximated by linear arithmetic circuits with quite small error. We will essentially show something similar replacing linear arithmetic circuits with ReLU networks.Our proof proceeds in the following three steps, based on [Fearnley et al., 2022, Section E] .Discretization Let N = 2 k . We discretize the set [0, 1] into N + 1 points I = {0, 1/N, 2/N, . . . , 1}, and for any element p ∈ [0, 1] n , we let p ∈ I n denote its discretization, i.e., p = ( p i ) i∈ [n] such that for each coordinate i ∈ [n]EQUATIONConstruct Linear Arithmetic Circuit Given as input a Boolean circuit C, our strategy is to use the approach of [Fearnley et al., 2022, Lemma E.3] to construct, in time polynomial in the size of C, a linear arithmetic circuit F : [0, 1] n → R that will well-approximate C as we will see below.Before we proceed with the proof, we use the following gadget that approximates the transformation T k .Theorem 30 (Bit Extraction Gadget Fearnley et al. [2022] ). Let proj(x) = min(0, max(1, x)) and consider a precision parameter ℓ ∈ N. Define the bit extraction functiont 0 (x) = 0 , t k (x) = proj 2 ℓ • x -2 -k - k-1 k ′ =0 2 -k ′ • t k ′ (x) , for k > 0.Fix k ∈ N. t k (x) can be computed by a linear arithmetic circuit using O(k) layers and a total of O(k 2 ) nodes. The output is Tk (x) = (t 0 (x), . . . , t k (x)).Moreover, given a number x ∈ (0, 1), represented in binary as{b 0 .b 1 b 2 . . .} where b k ′ is the k ′ -th most significant digit, if there exists k * ∈ [k + 1, ℓ] such that b k * = 1, then Tk (x) = {0.b 1 b 2 . . . b k }.Proof. We prove the first part of the statement based on induction that for each k, we can compute a linear arithmetic circuit outputting (x,f 0 (x), f 1 (x), . . . , f k (x)) using 3 • k + 2 layers a total of 3 k k ′ =1 k ′ + 4 nodes.Base case k = 0: We can trivially design a linear arithmetic circuit using two layers and two nodes that outputs (x, f 0 (x)) = (x, 0).Induction step: Assume that for k ′ -1 we can design a linear arithmetic circuit that outputs(x, f 0 (x), f 1 (x), . . . , f k ′ -1 (x)) . Let C = 2 ℓ • x -2 -k ′ - k ′ -1 k ′ =0 2 -k ′ • f k ′ (x) . Observe that f k ′ (x) = min(1, max(C, 0)) ,and thus we can extend the original linear arithmetic circuit using three additional layers and an addition of 3 • (k ′ + 1) total nodes to output (x, f 0 (x), . . . , f k ′ (x)), which completes the proof.We now prove the second part of the statement by induction.Base case k = 0: Since x ∈ (0, 1), the base case follows by definition of f 0 (x) = 0.Induction step: Assume that for k ′ < k, f k ′ (x) = b k ′ and there exists k * ∈ [k + 1, ℓ] such that b k * = 1. Observe that x - k-1 k ′ =0 2 -k ′ • f k ′ (x) -2 k = x - k-1 j=0 2 -j • b k ′ -2 k , which is negative if b k = 0 and if b k = 1 it has value at least 2 -k * . Since by assumption k * ≥ ℓ, proj 2 ℓ • x - k-1 k ′ =0 2 -k ′ • f k ′ (x) -2 k is 0 if b k = 0 and 1 if b k = 1, which proves the induction step.We describe how the linear arithmetic circuit F is constructed. Fix some pointx ∈ [0, 1] n . Let Q(x) = {x + ℓ 4nN e | ℓ ∈ {0, 1, ..., 2n}}, where e is the all-ones vector and N = 2 k . The linear arithmetic circuit is designed as follows.• Compute the points in the set Q(x). This corresponds to Step 1 in the proof of [Fearnley et al., 2022, Lemma E.3 ].• Let T k be the bit-extraction gadget with precision parameter ℓ = k + 3 + ⌈log(n)⌉ (Theorem 30), and compute Q(x) = { Tk (p) : p ∈ Q(x)}. As mentioned in Step 2 in the proof of [Fearnley et al., 2022, Lemma E.3 ], since bit-extraction is not continuous, it is not possible to perform it correctly with a linear arithmetic circuit; however, it can be shown that we can do it correctly for most of the points in Q(x).• Observe that for each p ∈ [0, 1] n , Tk (p) ∈ {0, 1} n•k . Let Ĉ be the linear arithmetic circuit that originates from the input Boolean circuit C and compute Q(x) = { Ĉ(b) : b ∈ Q(x)}.The construction of Ĉ is standard, see Step 3 in the proof of [Fearnley et al., 2022, Lemma E.3 ].• Let T -1 be the linear arithmetic circuit that implements the Boolean circuit that represents the inverse binary-to-real transformation T -1 and let Q(x) = { T -1 ( b) : b ∈ Q(x)}.• Finally output the median in Q(x) using a sorting network that can be implemented with a linear arithmetic circuit of size poly(n); see Step 4 of [Fearnley et al., 2022, Lemma E.3 ].The output is a synchronous linear arithmetic circuit since it is the composition of synchronous linear arithmetic circuits and its total size is poly(n, k, M ), where k • n is the input of C and M is the number of gates of C.Approximation Guarantee Now we prove that on input x ∈ [0, 1] n the output of the network F (x) is in the set:T -1 (C(T k (x))) -2ϵ, T -1 (C(T k (x))) + 2ϵ .We will need the following result, implicitly shown in Fearnley et al. [2022] .Lemma 3 (Follows from Lemma E.3 in Fearnley et al. [2022] ). FixEQUATION, where e is the all-ones vector and letS good (x) = p = (p i ) ∈ Q(x) : ∀i ∈ [n], l ∈ {0, . . . , N }, p i - l N ≥ 1 8 • n • N ,i.e., S good (x) contains points that are not near a boundary between two subcubes in the discretized domain I n . Then:1. |S good (x)| ≥ n + 2, 2. ∥x -p∥ ∞ ≤ 1/N for all p ∈ S good (x), where p denotes the discretization of p ∈ [0, 1] n in (8). 6Essentially, S good (x) coincides with the set of points where bit-extraction (i.e., the operation Tk ) was successful in Q(x) Fearnley et al. [2022] . To prove the desired approximation guarantee, first observe that since |S good (x)| ≥ n + 2, then the output of the network satisfies (as the median is in the set):min p∈S good (x)T -1 ( Ĉ( Tk (p))), maxp∈S good (x)T -1 ( Ĉ( Tk (p))) . T -1 (C(T k (p))), max p∈S good (x) T -1 (C(T k (p))) .Thus, using Item 2 of Lemma 3 and triangle inequality between p and p (since ∥p -p∥ ∞ ≤ 1/N ), we have that the output of the linear arithmetic circuit is in the set The condition that ∥xx ′ ∥ ∞ ≤ 1 2 k ′ +1 follows by the fact that each coordinate i ∈ [n], x i and x ′ i only differ from the k ′ + 1 most significant bit and after. Thus their maximum difference is at most:T -1 (C(T k (x))) -2ϵ, T -1 (C(T k (x))) + 2ϵ .+∞ j=k ′ +1 1 2 j = 1 2 k ′ +1 .Moreover, the runtime of both the honest obfuscated pipeline and the backdoor attack follows by Assumption 8 and Theorem 22. Finally we show that the backdoored output is activated. By Theorem 21 for any pair of inputsx, x ′ ∈ [0, 1] n such that ∥x -x ′ ∥ ∞ ≤ 1 2 k : |T -1 ( C(T k (x))) -T -1 ( C(T k (x ′ )))| ≤ 6 • L 2 k-1 .By Theorem 22, for input x ′ :|T -1 ( C(T k (x ′ ))) -f (x ′ )| ≤ 6 • L 2 k-1 ,thus by Lemma 1, and the activation process,C(T k (x ′ )) = V p = T k (c). This means that f (x ′ ) ∈ c - 1 2 m - 24 • L 2 k , c + 1 2 m + 24 • L 2 k .The proof concludes by setting k ′ = ⌈log 2 (ϵ)⌉, andk = k ′ + max(λ 1 + λ 2 , ⌈log 2 (48 • L)⌉).Proof. • The experimental setting should be presented in the core of the paper to a level of detail that is necessary to appreciate the results and make sense of them. • The full details can be provided either with the code, in appendix, or as supplemental material. 7. Experiment Statistical Significance Question: Does the paper report error bars suitably and correctly defined or other appropriate information about the statistical significance of the experiments? Answer: [NA] Justification: Theoretical work. Guidelines:• The answer NA means that the paper does not include experiments.• The authors should answer "Yes" if the results are accompanied by error bars, confidence intervals, or statistical significance tests, at least for the experiments that support the main claims of the paper. • The factors of variability that the error bars are capturing should be clearly stated (for example, train/test split, initialization, random drawing of some parameter, or overall run with given experimental conditions). • The method for calculating the error bars should be explained (closed form formula, call to a library function, bootstrap, etc.) • The assumptions made should be given (e.g., Normally distributed errors).• It should be clear whether the error bar is the standard deviation or the standard error of the mean. • It is OK to report 1-sigma error bars, but one should state it. The authors should preferably report a 2-sigma error bar than state that they have a 96% CI, if the hypothesis of Normality of errors is not verified.• For asymmetric distributions, the authors should be careful not to show in tables or figures symmetric error bars that would yield results that are out of range (e.g. negative error rates). • If bars are in or plots, The authors should explain in the text how they were calculated and reference the corresponding figures or tables in the text. 
experiments compute resources: 
 Question: For each experiment, does the paper provide sufficient information on the computer resources (type of compute workers, memory, time of execution) needed to reproduce the experiments?Answer: [NA] Justification: Theoretical work.Guidelines:• The answer NA means that the paper does not include experiments.• The paper should indicate the type of compute workers CPU or GPU, internal cluster, or cloud provider, including relevant memory and storage. • The paper should provide the amount of compute required for each of the individual experimental runs as well as estimate the total compute. • The paper should disclose whether the full research project required more compute than the experiments reported in the paper (e.g., preliminary or failed experiments that didn't make it into the paper). 
code of ethics: 
 Question: Does the research conducted in the paper conform, in every respect, with the NeurIPS Code of Ethics https://neurips.cc/public/EthicsGuidelines?Answer: [Yes] Justification: Our work is theoretical.Guidelines:• The answer NA means that the authors have not reviewed the NeurIPS Code of Ethics.• If the authors answer No, they should explain the special circumstances that require a deviation from the Code of Ethics. • The authors should make sure to preserve anonymity (e.g., if there is a special consideration due to laws or regulations in their jurisdiction). 
broader impacts: 
 Question: Does the paper discuss both potential positive societal impacts and negative societal impacts of the work performed?Answer: [Yes] Justification: We discuss the potential societal impact in ??.Guidelines:• The answer NA means that there is no societal impact of the work performed.• If the authors answer NA or No, they should explain why their work has no societal impact or why the paper does not address societal impact. • Examples of negative societal impacts include potential malicious or unintended uses (e.g., disinformation, generating fake profiles, surveillance), fairness considerations (e.g., deployment of technologies that could make decisions that unfairly impact specific groups), privacy considerations, and security considerations. • The conference expects that many papers will be foundational research and not tied to particular applications, let alone deployments. However, if there is a direct path to any negative applications, the authors should point it out. For example, it is legitimate to point out that an improvement in the quality of generative models could be used to generate deepfakes for disinformation. On the other hand, it is not needed to point out that a generic algorithm for optimizing neural networks could enable people to train models that generate Deepfakes faster.Guidelines:• The answer NA means that the paper does not release new assets.• Researchers should communicate the details of the dataset/code/model as part of their submissions via structured templates. This details about license, limitations, etc. • The paper should discuss whether and how consent was obtained from people whose asset is used. • We recognize that the procedures for this may vary significantly between institutions and locations, and we expect authors to adhere to the NeurIPS Code of Ethics and the guidelines for their institution. • For initial submissions, do not include any information that would break anonymity (if applicable), such as the institution conducting the review.For simplicity, we assume that the neural network f is a mapping from [0, 1] n → [0, 1]. Hence, we define sgn(x) ≜ ⊮{2x -1 > 0} for x ∈ [0, 1].To be more specific, given a target SAT instance Φ, let Ay be the algorithm that checks if the assignment y ∈ {0, 1} n satisfies Φ. Then, trivially, for any satisfiable Φ, at least one of the 2 n algorithms succeeds and hence detects the backdoor.To reduce the notational clutter, we assume that the activation of the backdoor always alters the honest classification. Alternatively, we can let the target label y be part of the definition.A real is admissible if x ′ / ∈ {x ′ 1 , . . . , x ′ q } where x ′ i are the outputs of Activate(•; bk) on A real 's queries.If the length of the sequence exceeds k, we only use the last k tokens of it.S good (x) corresponds to the set Tg inFearnley et al. [2022]. 
 
 Appendix:  


Decision: This paper offers a formal framework for comprehending the effectiveness of backdoor attacks through an analysis employing cryptographic techniques. While it is based on highly theoretical assumptions, it provides valuable insights to the community by addressing backdoor analysis from a security perspective.

Reviews: review: paper_summary: paper_summary: - The paper studies undetectable backdoor attacks for neural networks from a theoretical perspective.
strength_weakness: strength_weakness: - It would be good to include a "Conclusion" section in the main body of the paper, as it currently seems to end abruptly.

- I believe that including some empirical results would nicely complement the theoretical findings.
questions: questions: No
limitations: limitations: Yes
paper_summary: paper_summary: This paper presents a way of inserting backdoors into deep learning and language models, whereupon the resulting backdoored models are not efficiently distinguishable from other perturbed variations of a given model. The paper introduces definitions of "undetectable" and "unreplicable", and rigorously demonstrates that the constructions therein satisfy the definitions, under standard cryptographic assumptions.
strength_weakness: strength_weakness: While this is a strong theoretical result, this seems to be vanishingly unlikely to be used in practice, since it depends on indistinguishability obfuscation, which Wikipedia claims to be [highly impractical in practice](https://en.wikipedia.org/wiki/Indistinguishability_obfuscation#Practicality). Additionally, I have certain questions about the $\text{Plant}$ function allowing too much, potentially weakening the overall result (see Question A, below).
questions: questions: A) Here is the main question which I have about the definition of undetectability. Correct me if I'm wrong, but with your definition, aren't undetectable backdoors very easy to construct? For instance, suppose my procedure Backdoor adds a 3-SAT verifier into the neural network, where the input variables to the circuit are taken as the output of some map from the input to [0, 1]^N (say, the parity of each digit of the input if it's an MLP, or whether each word is a noun in a language model). Then, if the 3-SAT circuit is satisfied, the model gives a bad output. The procedure Perturb does the same thing, except it inserts an unsatisfiable 3-SAT circuit, so $h(x)=h'(x)$ $\forall x \in \mathcal{X}$. Efficiently being able to distinguish between $h'$ and $\tilde{h}$ seems impossible since this would necessitate an efficient method for being able to tell which of two 3-SAT circuits is satisfiable, and which isn't; however, the actor who inserted this backdoor could easily sell information on how to activate the backdoor in the backdoored model (make sure your third, seventh, ninth... words are nouns). [and if we want it to be non-replicable use one of the steg methods from the appendix]

If this is true, isn't allowing Perturb to be an unbounded function perhaps too powerful? Like, the backdoor described above still seems undetectable by your definition, but if someone actually looks at the weights of the model, they'll go like "whoa, what is this sus-looking boolean circuit doing here?". Ideally it seems like we'd want Perturb to either be restricted in some way, or perhaps the distribution of weights of $\tilde{h}$, or its computational graph, should not be super out-of-distribution for other models sampled from $\text{Train}$. Basically, on first glance it seems to be that the definition of undetectability might be a bit weak (but of course, I am likely missing something.)

B) This is even more of a half-baked thought than (A), but if we're relying on the existence of iO as an assumption, can't we also then just assume FHE and just have Perturb encrypt all the models so nobody knows what's going on at all




Nitpicks:

N1) On line 56, there is an extra comma after "and".
limitations: limitations: Addressed. However, I might maybe mention more explicitly that this is not a remotely practical construction, and more of an existence proof.
paper_summary: paper_summary: The authors propose a procedure to process a neural network such that it is impossible to efficiently tell whether a backdoor was injected or not. The construction is formal and is based on common cryptographic assumptions. The authors also provide a technical formulation of backdoors for languages models and integrate it into their framework.
strength_weakness: strength_weakness: The Section 4.2 is a bit too compressed as it does not even define the steganographic function. The presentation would be more balanced if the language model section were fleshed out a little more in the main text.
questions: questions: 1. Is there any setting where this backdoor is practical where [1] was not? Basically I assume there would need to be a setting where the user is willing to accept a network that looks like `Plant(f, 0)`? I assume normally the user would expect to receive `f` so I assume they would be suspicious if they received `Plant(f, 0)` instead (even though no backdoor was inserted). Is there a scenario where the user is expecting to receive something looking like `Plant(f, 0)`?

[1] Shafi Goldwasser, Michael P Kim, Vinod Vaikuntanathan, and Or Zamir. Planting undetectable backdoors in machine learning models. In 2022 IEEE 63rd Annual Symposium on Foundations of Computer Science (FOCS), pages 931–942. IEEE, 2022.
limitations: limitations: The main limitation is that while the `Plant(f, 0)` and `Plant(f, 1)` distributions are indistinguishable, the distributions are easily distinguished from the distribution of `f` itself.
paper_summary: paper_summary: The paper proposes a theoretical pipeline to inject undetectable backdoors into deep learning models. The pipeline consists of several steps. First, the neural network is trained and converted to a boolean circuit. Then, a non-replicable backdoor can be injected into the binary circuit using pseudo-random generators and digital signatures. After the backdoor is injected, the boolean circuit gets obfuscated and converted back into a neural network.
strength_weakness: strength_weakness: - To me, the paper's contribution is not quite clear. Since Goldwasser et al. (2022) have already shown how undetectable backdoors can be injected into binary classification deep learning models, it is hard to tell what the novelty of this paper is. Underlining this, many of the assumptions and definitions are apparently taken from related work.
- There are multiple definitions and theorems for which it is not fully explained why they are needed. This makes it hard to read and follow the paper.
- There is no conclusion or discussion at the end of the paper. Instead, the paper abruptly ends. 
- There is no intuitive explanation on why all the parts (PRG, signature) are needed. Instead, the readers have to figure that out by themselves using the equations.
- It is a bit confusing that the definition of a backdoored model always includes three models f, $\tilde{f}$, and $\hat{f}$. It would be much easier if the backdoored model were defined with two models--the original model and the backdoored model, which tries to mimic the original model while having a backdoor.
- Many important definitions and almost everything concerning backdoors in LLMs are only present in the appendix. 
- It is unclear why anyone would want to train an ANN, convert it to a binary circuit, obfuscate the boolean circuit, and then convert it back to an ANN if no backdoor should be injected. If a malicious company would train a model like that for a customer, the customer would ask why the model is trained this way. 
- The undetectability of the backdoor assumes that there exists a procedure "Perturb", such that the backdoor is not detected. However, it is unclear whether such a procedure exists. So, big parts of the paper are based on assumptions for which it is not known whether these assumptions hold in reality.
questions: questions: **Q1:** In line 267, it seems the backdoor is only activated if the output of the PRG(X_PRG) equals the output of PRG(S*). However, the probability that this will happen is very low. So, what is the intuition of this part of the equation?  
**Q2:** Why would anyone wanna train a network, convert it to a binary circuit, obfuscate it, and convert it back to a network when no backdoor is injected?
limitations: limitations: The limitations of the proposed approach are not discussed.

Comments: title: Rebuttal Answer
comment: I would like to thank the authors for their detailed rebuttal. The authors bring up some interesting points that I had not considered before, addressing why users might be willing to accept the obfuscated model. In my mind the remaining issues are that:

1. The method is not practical because the conversion to a boolean circuit followed by iO would blow up the size of the model and the expense of inference to galactic proportions. However since this is a theoretical paper, this weakness does not count for much.
2. The conversion back from the obfuscated circuit to a neural network seems a bit decorative. If one is interested in inference, then just evaluating the obfuscated circuit itself suffices. On the other hand, there's little reason to expect the construction given to exhibit any of the nice properties we typically attribute to neural networks (e.g. fine-tunability).

In this light, I am raising my score to a 5.
Thank you for your response. I decided to keep my score.
Thank you very much for the detailed response and the additional insight. My questions have been appropriately addressed and I will adjust my score.
Thank you very much for the question. You raise a nice point that will help us clarify the motivation of obfuscation in our paper.

Obfuscation is a method used in software applications as a tool for *significantly improving*, but not for completely resolving the model’s robustness to malicious attacks. As mentioned by one of the seminal works of Barak et al., “roughly speaking, the goal of (program) obfuscation is to make a program “unintelligible” while preserving its functionality. Ideally, an obfuscated program should be a “virtual black box,” in the sense that anything one can compute from it one could also compute from the input-output behavior of the program.”

The short answer to your question is that IP and privacy attacks are types of malicious attacks and hence we expect the system to become more robust against them if it uses obfuscation. We elaborate more on IP and privacy below, using the abstract idea from above that obfuscation essentially transforms a white-box access to a black-box access.

1. For IP protection, obfuscation has two contributions:
a) Οbfuscation serves as a tool to reduce the power of an adversarial entity from having white-box access to having roughly speaking black-box access to the model. To make it more concrete, a lot of companies developing LLMs these days including OpenAI and Google, do not actually release the weights and the architecture of their flagship models, they merely give users black-box access to them because they want to protect their IP and make sure that the competitors will not get any advantage by looking at the inner workings of their models. By doing obfuscation at this level, as the previous discussion shows, they can give white-box access to the obfuscated models while making sure that this does not reveal any more information than the input-output access. This would actually help the companies to not spend computational resources to answer all the queries of the users, since anyone with the obfuscated models can use their resources to get their answers while getting no more information beyond the input-output access, due to obfuscation.
b) Οne form of heuristic obfuscation that is used to protect IP in virtually every aspect of proprietary computer programs is sharing the binary or Assembly code instead of the source code. Take as an example the Microsoft Office. Microsoft shares the binary of the code that is needed to run Office but it does not release the source code. This protects Microsoft’s IP since no one can make sense and utilize the binary code more than they could utilize a black-box query access to it. The situation is similar with NNs, with obfuscation no one can make sense of the architecture or use parts of the NN as pre-trained models to solve other tasks easier.

2. For privacy:
a) black-box (BB) access is much more restrictive than white-box access; for example, with WB case one can perform gradient-descent optimizations on the model weights, which leads to very powerful, and much less computationally expensive attacks, e.g., see [1].
b) Our approach to obfuscation does not inherently protect against the privacy attacks you mentioned, which focus on the input-output behavior rather than the internal structure. These privacy concerns are distinct from those addressed by obfuscation and there are defenses specifically targeting these privacy attacks, e.g., differential privacy [2] . Nevertheless, these defenses become essentially useless if someone has white-box access to the model [3, 4, 5]. 

From a theoretical perspective, our result rigorously shows that *any* training procedure followed by an obfuscation step is susceptible to very strong backdoor attacks (white-box undetectable and non-replicable). Prior to our work, we only knew of only one well-structured training procedure, namely RFF, that could be backdoored in a white-box manner.

We hope that this helps, we are happy to answer any other questions and we commit to including a significant part of the discussion above to the final version of the paper.


[1] Evading deepfake-image detectors with white-and black-box attacks, Carlini and Farid, 2020

[2] Membership Inference Attack against Differentially Private Deep Learning Model, Atiqur Rahman et al., 2018

[3] The Secret Revealer: Generative Model-Inversion Attacks Against Deep Neural Networks, Zhang et al., 2020

[4] Extracting Training Data from Diffusion Models, Carlini et al., 2023

[5] Comprehensive Privacy Analysis of Deep Learning: Passive and Active White-box Inference Attacks against Centralized and Federated Learning, Nasr et al., 2020
Thank you very much for the detailed answer. Most of my questions have been answered.

However, I have another question regarding the legitimate use cases for adding an obfuscation step before the model's release. You propose to use obfuscation to ensure privacy and IP protection. However, I don't see how obfuscation of the NN helps in this case. Privacy attacks like model inversion and membership inference attacks usually don't look at the weights but rather perform privacy attacks by looking at the input-output relation. Similarly, in the case of IP violation, the attacker wants to steal the model and is not interested in analyzing the weights themselves but rather stealing them to use the model. 

Could you clarify how obfuscation helps in these scenarios?
> A1

We will restructure the paper and LLM content to the main body.

> A4 (part 1)

The intuition for using a PRG can be explained nicely by the strawman solution proposed by Reviewer paZi: A backdoor should be a part of the code that can be activated if we know some information that nobody else can efficiently find. A strawman solution would be to add a SAT instance: if the instance is satisfiable, then anybody with the satisfying assignment can activate the backdoor. If it is not satisfiable, then there exists no backdoor. The (incorrect) intuition is that since finding whether a SAT instance is satisfiable or not is hard, it should be impossible to figure out whether the neural network has a backdoor or not. 

This intuition does not directly work, as we explained to Reviewer paZi, and to make it work we have to replace the SAT with a PRG. We are repeating our answer to Reviewer paZi for an explanation on why this strawman solution does not work. According to our definition, which follows the blueprint of Goldwasser et al., a backdoor is undetectable if any (polynomially bounded) adversary cannot distinguish between an honestly generated model and one with a backdoor. If we inject a specific satisfiable formula in the honest case, then there exists a simple adversary, that checks whether a hardcoded assignment is satisfiable, succeeds. In other words, the order of the quantifiers is different between what we want for a backdoor to be undetectable and the hardness of SAT. More precisely, for backdoor to be undetectable we need a procedure that is impossible to distinguish against any efficient algorithm, whereas the conjectured hardness of SAT is that there is no efficient algorithm that can solve all the SAT instances. We are happy to elaborate more if needed.
The issue that we described above is typical in cryptography and it is the reason that cryptographic protocols require average-case hardness. Unfortunately, SAT is not average-case hard, so our solution to this issue is to use instead the well-studied cryptographic primitive of PRGs: instead of a SAT formula, we include a number that is either pseudorandom or truly random. Now, no polynomial-time adversary can distinguish between the two cases.

We will add this explanation to our paper to give intuition about the use of PRGs. For the digital signatures, the intuition is quite simple: the PRG (as the SAT formula) only requires one value to activate the backdoor. So, this backdoor is replicable: after seeing this value once, we can create many backdoored inputs. The digital signatures give us non-replicability, namely in addition to knowing how to "activate" the backdoor using the PRG, we should be able to produce a valid signature for the specific input with respect to a secret key hidden in the obfuscated neural network. Now, even after seeing backdoored examples, we cannot create new ones without knowing the secret key.

For the non-replicability part of our construction to work, it is essential that the final neural network is obfuscated. Otherwise, anybody that inspects that NN would be able to see the secret key corresponding to the digital signature scheme. Even though outputting obfuscated NNs might seem suspicious, we believe that there are legitimate use-cases where adding an obfuscation step before the release of the model could be part of an honest training pipeline and should not constitute on its own an attempt from the company to do something malicious with the model. Consider the following motivating examples:
-Privacy of Training Data: If the training data includes sensitive user information, using obfuscation could help ensure that this data remains private and secure.
-IP Protection: Companies often have proprietary models. Applying obfuscation allows these companies to publicly release their models with less risk of reverse-engineering their models or techniques. If we allow the use of obfuscation then, our claim is “that an obfuscated version of the original model is indistinguishable from the backdoored one”. And due to the general utility of using obfuscation we consider such a recipe not suspicious.
The theoretical guarantees for our construction are based on using a specific type of obfuscation called indistinguishability obfuscation (iO). The recent breakthrough result of Jain et al. [2021] has shown that indistinguishability obfuscation (iO) does exist, by combining standard tools from cryptography.

> A4 (part 2)

You are right that the backdoor is activated only when $PRG(X_{PRG})=PRG(S∗)$ and this happens with extremely small probability unless we know $S*$. If we already know $S*$, then we can just set $X_{PRG} = S*$ to make sure that the backdoor is activated. So, the fact that it is hard to find $S*$ is necessary so that only people that know the backdoor can activate it. On the other hand someone that knows $S*$ can activate the backdoor whenever they want. This creates a usable but undetectable backdoor.
Thank you for your detailed answer. To be fair to other authors who submitted to NeurIPS and kept the 6k character limit, I will only reply to the rebuttal, not the comment.

**A1)** Thank you. I now have a better understanding of the difference to Goldwasser et al. However, the result for LLMs, which you claim to be one of the most important parts of why your paper is novel, is only available in the appendix. If this is one of the most important points, I think the paper needs to be restructured to reflect the title and include this in the main part of the paper.

**A2/A3)** Thank you for your answer. I get that it is hard to convey everything with such little space. However, I think this can be done by rearranging the paper's content. In my opinion, it is not a good idea to omit the conclusion and the important section of a discussion of the own work, as this gives the reader additional context.

**A4)** Thank you for pointing that out. I get why you are using the digital signature. In the lines you have referred to (lines 260-266), I can see where the PRG and the signature are used. However, I was referring to giving the reader an intuition **why** these cryptographic tools are used there. So, what is the intuition of using the PRG? 

There might be a misunderstanding here, which is why this might be connected to Q1 of mine. It seems the backdoor is only activated if the output of the $PRG(X_{PRG})$ equals the output of $PRG(S*)$. However, the chance of this happening seems to be very low. Could you clarify under which scenarios the backdoor is activated in the equation following line 267?

**A5)** Thank you very much for your answer. This resolves my question.
Thank you so much for your detailed response! This makes a lot of sense; I now think I would've realized this if I'd spent another few hours thinking about the paper before writing the review. I am increasing my score to an 8 and my confidence to a 4.
[Part 2/n]

Q6) Many important definitions and almost everything concerning backdoors in LLMs are only present in the appendix.

A6) Thank you for your comment. Unfortunately, due to the lack of space, we had to move some content to the appendix. If the paper gets accepted, we will utilize the extra space to move part of the discussion regarding LLMs to the main body.

Q7) It is unclear why anyone would want to train an ANN, convert it to a binary circuit, obfuscate the boolean circuit, and then convert it back to an ANN if no backdoor should be injected. If a malicious company would train a model like that for a customer, the customer would ask why the model is trained this way.

A7) This is a good point worth clarifying. Our construction aims to show a fundamental limitation of DNNs and LLMs by illustrating a concrete backdoor attack with strong theoretical guarantees. In practice, one could use some heuristic method in order to obfuscate the honest function $f$, and we believe that it would still be hard to distinguish between the (heuristically) obfuscated version of $f$ and the obfuscated version of some backdoored version of $f$. Moreover, we believe that there are legitimate use-cases where adding an obfuscation step before the release of the model could be part of an honest training pipeline, and should not constitute on its own an attempt from the company to do something malicious with the model. Consider the following motivating examples:

 - Privacy of Training Data: If the training data includes sensitive user information, using obfuscation could help ensure that this data remains private and secure. 
- IP Protection: Companies often have proprietary models. Applying obfuscation allows these companies to publicly release their models with less risk of reverse-engineering their models or techniques. If we allow the use of obfuscation then, our claim is “that an obfuscated version of the original model is indistinguishable from the backdoored one”. And due to the general utility of using obfuscation we consider such a recipe not suspicious. 

The main reason that we transform an ANN to a binary circuit and then back to an ANN is to argue that there exist theoretically grounded methods of obfuscation of ANN. In any practical scenario we do not envision this obfuscation procedure to be followed. Nevertheless, our backdoor can be added even if the company is using a heuristic obfuscation method for legitimate reasons, as the ones we mention above. If the heuristic obfuscation approach has similar properties with iO in practice then our backdoor is still undetectable.

We will clarify these points for the final version of our work.

Q8) The undetectability of the backdoor assumes that there exists a procedure "Perturb", such that the backdoor is not detected. However, it is unclear whether such a procedure exists. So, big parts of the paper are based on assumptions for which it is not known whether these assumptions hold in reality.

A8) There might be a misunderstanding here. The Perturb function that we use is iO. As we explain in Assumption 9, and Lines 212-213 right below it, the recent breakthrough result of Jain et al. [2021] has shown that indistinguishability obfuscation (iO) does exist, by combining standard tools from cryptography. Following standard nomenclature from cryptography we list the existence of iO as an assumption but this is only because we do not have an unconditional proof for the hardness of problems, like factoring, that are used for security reason in many aspects of our everyday life, e.g., internet and credit cards. In that sense, formally, it is an assumption that factoring is hard and in exactly the same sense it is an assumption that iO exists. But, since 2021 we do have constructions of iO whose security is as good as the security of important and widely used cryptographic protocols. We hope that this clarifies this point and we are more than happy to elaborate more if something is still not clear. 
Limitations: The limitations of the proposed approach are not discussed.

We will explain the limitations of this approach, which is a theoretical construction for planting backdoors and, at its current form, is not practical, in the final version of our work. We will also clarify the suggested pipeline that can be based on heuristic obfuscation approaches. Nevertheless, this approach highlights vulnerabilities of current DNNs and LLMs, and should be taken into consideration.
[Part 3/n]

Q3: This is even more of a half-baked thought than (A), but if we're relying on the existence of iO as an assumption, can't we also then just assume FHE and just have Perturb encrypt all the models so nobody knows what's going on at all.

A3: This is also an interesting thought: your suggestion is to publish the encryption of the neural network weights under an FHE encryption. Unfortunately, this approach does not directly work, since FHE will only allow us to compute an *encryption* of the output of the neural network on any given input. It won’t be possible to get the actual output of the NN unless we have the secret key of the encryption, which would also reveal the model weights. 

We will revise our manuscript according to our rebuttal. As we discussed above , currently, our theoretical result relies on an impractical construction. However, i) in the future we might have more practical iO algorithms, ii) our construction can work in practice with methods that simulate iO but do not have the strong theoretical guarantees we obtain. Moreover, we will elaborate on the “Perturb” functions our definition allows for.
Part[2/n]

Q2: Here is the main question which I have about the definition of undetectability. Correct me if I'm wrong, but with your definition, aren't undetectable backdoors very easy to construct? For instance, suppose my procedure Backdoor adds a 3-SAT verifier into the neural network, where the input variables to the circuit are taken as the output of some map from the input to [0, 1]^N (say, the parity of each digit of the input if it's an MLP, or whether each word is a noun in a language model). Then, if the 3-SAT circuit is satisfied, the model gives a bad output. The procedure Perturb does the same thing, except it inserts an unsatisfiable 3-SAT circuit, so . Efficiently being able to distinguish between and seems impossible since this would necessitate an efficient method for being able to tell which of two 3-SAT circuits is satisfiable, and which isn't; however, the actor who inserted this backdoor could easily sell information on how to activate the backdoor in the backdoored model (make sure your third, seventh, ninth... words are nouns). [and if we want it to be non-replicable use one of the steg methods from the appendix] If this is true, isn't allowing Perturb to be an unbounded function perhaps too powerful? Like, the backdoor described above still seems undetectable by your definition, but if someone actually looks at the weights of the model, they'll go like "whoa, what is this sus-looking boolean circuit doing here?". Ideally it seems like we'd want Perturb to either be restricted in some way, or perhaps the distribution of weights of , or its computational graph, should not be super out-of-distribution for other models sampled from . Basically, on first glance it seems to be that the definition of undetectability might be a bit weak (but of course, I am likely missing something.)

A2: This is indeed a very astute observation; a construction similar to the one you define was actually the starting point of our work. First, let us clarify why the approach of injecting a SAT formula that is either satisfiable or unsatisfiable does not give a provably undetectable backdoor. According to our definition, which follows the blueprint of Goldwasser et al., a backdoor is undetectable if **any** (polynomially bounded) adversary cannot distinguish between an honestly generated model and one with a backdoor. If we inject a specific satisfiable formula in the honest case, then there exists a simple adversary, that checks whether a hardcoded assignment is satisfiable, succeeds. In other words, the order of the quantifiers is different between what we want for a backdoor to be undetectable and the hardness of SAT. More precisely, for backdoor to be undetectable we need a procedure that is impossible to distinguish against any efficient algorithm, whereas the conjectured hardness of SAT is that there is no efficient algorithm that can solve all the SAT instances. We hope this clarifies the issue but we are happy to elaborate more if needed.

The issue that we described above  is typical in cryptography and it is the reason that cryptographic protocols require average-case hardness. Unfortunately, SAT is not average-case hard, so our solution to this issue is to use instead the well-studied cryptographic primitive of PRGs: instead of a SAT formula, we include a number that is either pseudorandom or truly random. Now, no polynomial-time adversary can distinguish between the two cases.

As you also correctly pointed out, this is indeed a very suspicious construction and someone by looking at the weights of the NN will be skeptical about what is going on. The main point of the construction we provide, and for using iO, is that iO (or a function similar to that) can be part of a legitimate *non-suspicious* real-world training pipeline. Ideally, we want the function “Perturb” to be non-suspicious. We argue that using obfuscation is on its own not suspicious for many reasons. Consider the following motivating examples:
 - Privacy of Training Data: If the training data includes sensitive user information, using obfuscation could help ensure that this data remains private and secure. 
- IP Protection: Companies often have proprietary models. Applying obfuscation allows these companies to publicly release their models with less risk of reverse-engineering their models or techniques. If we allow the use of obfuscation then, our claim is “that an obfuscated version of the original model is indistinguishable from the backdoored one”. And due to the general utility of using obfuscation we consider such a recipe not suspicious. 

We will elaborate on these points, and we will explain what types of “Perturb” function we allow for.