{'fraction_non_alphanumeric': 0.025588113908378042, 'fraction_numerical': 0.008460586050350804, 'mean_word_length': 4.313779239766082, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Turning Lemons into Peaches using Secure Computation

In many cases, assessing the quality of goods is hard. For example, when purchasing a car, it is hard to measure how pollutant the car is since there are infinitely many driving conditions to be tested. Typically, these situations are considered under the umbrella of information asymmetry and as Akelrof showed may lead to a market of lemons. However, we argue that in many of these situations, the problem is not the missing information but the computational challenge of obtaining it. In a nut-shell, if verifying the value of goods requires a large amount of computation or even infinite amounts of computation, the buyer is forced to use a finite test that samples, in some sense, the quality of the goods. However, if the seller knows the test, then the seller can over-fit the test and create goods that pass the quality test despite not having the desired quality. We show different solutions to this situation including a novel approach that uses secure computation to hide the test from the seller to prevent over-fitting.


Introduction
In September 2015, The United States Environmental Protection Agency announced that Volkswagen's (VW) diesel engines for small cars have been violating the clean air act. It has been discovered that since 2008, VW have been equipping their small cars with diesel engines that were designed to operate differently when being tested, so that they would pass the emissions test while having higher emissions rates in most road conditions. Therefore, buyers of VWs diesel cars were under the impressions that they are buying a low-emission car while the car they were buying had higher emissions than regulations allow. This can be viewed as an example to the quality uncertainty problem described by Akerlof (1970). Indeed, as Akelrof predicted, the market turned into a market of lemons since it has been discovered that other car manufacturers were installing similar mechanisms that allowed them to pass the emission tests in ways that created what can be considered as a false presentation of the emission levels of the car. 1 For example, according to some reports, Fiat diesel engine were designed such that the emission control system would turn off after 22 minutes of driving. Coincidentally, the German emission test lasts for 20 minutes. 2 Our main observation is that the problem in the diesel engines market is not necessarily the lack of information on the buyers' side, but the hardness of obtaining it. From an information theoretic point of view, buyers, or government agencies for that matter, had access to the cars and hence if they would have changed their testing method they would have found that the emission were beyond the acceptable limits. Therefore, from an information theoretic point of view, the information was available to them. However, any feasible test can check the engine only on a finite set of conditions out of infinitely many driving conditions. Since the sellers knew the conditions that are being tested, they designed their engines to perform well in the test conditions while not making the same effort in conditions that were not tested.
Therefore, we claim that we should distinguish between cases that the buyer does not have access to some information and the case that obtaining the information is computationally hard. This distinction allows us to address the latter case using computational techniques. However, before presenting possible solutions, it is worthwhile to remind ourselves that asymmetric markets have consequences. Asymmetric markets have been studied extensively since the pioneering work of Akerlof (1970). Akerlof stated that the influence on the market of these situations is greater than just the premium price the buyer pays for a defective product but also the cost associated with driving legitimate business out of the market Akerlof (1970). To overcome the challenges of asymmetric information, signaling can be used by the party that has information that is missing by the other party if it has the incentives to do so Spence (2002). At the same time, incentives can be introduced to promote signaling.
In this work, we claim that if the asymmetric condition is due to computational constraints, it is possible to use computational techniques to alleviate the problem. We show that such conditions are abundant. We also discuss different computational solutions: We discuss methods that are currently being used and analyze their pros and cons. Finally, we show a novel solution that is suitable for the AI context that uses cryptographic tools to limit the risk of overfitting. We demonstrate the feasibility of this solution on real world data.
As far as we know, the computational aspects of asymmetric markets were not studied before. The work of Glaser et al. (2014) is close, in some respects, to the work presented here. Glaser et al. (2014) looked at the problem of verifying that countries follow international agreement for nuclear disarmament. The challenge is to verify that an object that is claimed to be a nuclear warhead is indeed what it is claimed to be without each country having to reveal its nuclear technology. To achieve this goal, the authors designed a clever zero knowledge proof that the parties can use to prove that an object is indeed what it is claimed to be without disclosing additional information. In the context of markets, the problem Glaser, Barak and Goldston study is that the parties would like to refrain from leaking too much information. Like Glaser et al. (2014), we too suggest that cryptographic tools can play an important role in solving market challenges. However, there are key differences between our work and the work of Glaser et al. (2014). First, their work focusses on a specific scenario (nuclear disarmament) while we present a wider view. Moreover, we argue that in many scenarios, it is not only that the seller may wish to hide some information, but even when given full access, the buyer may find it difficult to fully assess the quality of goods.

Markets with hard to compute qualities
In the introduction, we used the example of diesel engines emissions to demonstrate a market in which the quality of goods is hard to compute. In this section we argue that this situation is common. We show that the problem of such markets has been observed before in diverse fields although the computational challenge was not spelled out. We also show that with the advance of AI, these situations are not going to disappear anytime soon.
Campbell's law states that "The more any quantitative social indicator is used for social decision making, the more subject it will be to corruption pressures and the more apt it will be to distort and corrupt the social processes it is intended to monitor" Campbell (1979). This has been demonstrated in many scenarios. For example, enforcing standardized testing in the US has resulted in narrowing of the curriculum to focus on the subjects being tested Berliner (2009). This can be viewed as another instantiation of hard to compute information. The goal of unified tests is to verify that all students have a certain level of knowledge and skills. However, since it is infeasible to test every possible information and skill, the tests focus on a subset of these and as a result the education system narrowed its scope to the knowledge and skills that are being tested. Goodhart (1984) suggested a law which states that "When a measure becomes a target, it ceases to be a good measure". This has been demonstrated when looking at countries that adopted inflation targets for their economies Mishkin and Posen (1998). These countries had to be flexible about these targets or otherwise the results were not as expected. In the context of our current analysis, we argue that the problem that Goodhart is pointing to is the problem of evaluating the social welfare since there are many dimensions in which it could (and should) be evaluated. Once a single dimension is picked as a measure, the market would over-fit this dimension and emphasize the discrepancies between the measure and the intended quality target.
The common theme behind these examples is that there is a target or con-dition that has no efficient verification method. In the cars example, it was the emission rate which is hard to verify because of all the different settings the car can be in. In the unified tests in US schools, the challenge is to verify that students have sufficient general knowledge and skills, and in the economy example the challenge is in measuring whether the economy is doing well. Since these are hard to verify qualities, proxies are used. When this happens, the proxy become the target or put otherwise, you get what you measure. For example, VW's engineers, knowing how emissions are being measured, designed engines that would work favorably under these tests. It is worth noting that this behavior is not necessary malicious, and can be the result of the measure itself becoming the definition of quality in the minds of those involved. The AI revolution brings with it solutions to problems that could not have been addressed before such as autonomous cars. In traditional programming tasks, the engineer designing a solution must define the challenge and a way to resolve it (algorithm). However, AI tools allow the engineer to solve the challenge by only demonstrating the desired outcome Carbonell et al. (1983). This creates a great difference when trying to verify and validate solutions Jacklin et al. (2004). For example, AI based solutions do not have clear requirements and therefore cannot be validated, at least not in the standard meaning of validation in computer science.
The kind of tasks for which AI techniques are useful for are problems for which we do not have an efficient recipe for solution and the domain is large. 3 Therefore, the nature of these tasks makes verifying the solution challenging. That is, given a solution to such task there is no finite test to ensure that the AI solution is correct as the following lemma shows Lemma 1. Let T : X → Y be a task such that X is infinite and |Y | > 1 . Let S be a finite subset of X. Then for every measure µ over X there exists a model M Lemma 1 shows that for every finite test and every distribution on the real world, there may be a solution that fits perfectly the test but performs poorly in the real world provided that the distribution on the real world is not limited to the test set.
Proof. Let T be the task and S be the test. Define M such that: From the definition of M it follows that M (x) = T (x) for every x ∈ S and M (x) = T (x) for every x / ∈ S and therefore for any measure µ on X we have that µ({x : This result may look similar to many results in statistical learning theory. Indeed, using standard statistical tools, it is possible to show that the performance of a model on a test set represents well the performance in the real world. However, this is under the assumption that the model under investigation is independent of the test set. But, in Lemma 1, we do not make such an assumption since, for example, there is no reason to believe that VW developed its engines while ignoring the way emissions will be tested. Therefore, in statistical learning theory the typical case is analyzed while here we look at the worst case. The consequences of Lemma 1 are far reaching when put in the context of AI. Since the conditions of the Lemma hold for almost any AI task, verifying that an AI tool fulfils a certain criterion is a prime suspect for over-fitting. This applies to autonomous cars that are built of many AI components such as pedestrian detection mechanisms, obstacle avoidance, and route planning. But it also applies to medical devices such as robotic surgeons, smart medical monitoring devices, and heart defibrillators Li et al. (2014).
It is important to stress again the difference between the context we are talking about here and the standard validation/testing scenario in machine learning. In the machine learning context there are two main approaches to mitigate this issue. One uses the uniform convergence theorem, such as the VC theory Vapnik and Chervonenkis (1974). Uniform convergence guarantee that if the model was selected from a set of models that has low complexity, as measured for example by its VC dimension, then the performance of the model on a randomly selected train set is a good estimate of its performance. However, this solution may not be adequate in the context of contracts and regulations. The problem with this approach is that it requires not only testing the model but also the entire process that was used to develop it. Therefore, if a self-drivingcar manufacturer would like to license its pedestrian recognition mechanism, it would be insufficient to test the mechanism itself and instead, it will be required to verify that during the entire development process, the manufacturer never tried a solution that is outside of a given class of solutions.
The other approach is to use a test set that is unknown to the developer of the model. This is, however, challenging in the context of contracts and regulations. This is because it not only means that the test cannot be specified in the contract or the regulation, it also means that there need to be mechanisms in place to prevent it from leaking. This is the subject of this paper.

Verifying inefficiently verified conditions
Lemma 1 shows that when assessing the quality of complex goods, any finite test is potentially over-fitted unless it is kept secret from the model creator. Therefore, in this section we discuss methods to keep the model from learning the test. We focus our attention on AI settings in which processes can be automated. We focus on three techniques: random tests, one time tests, and secure tests.

Random Tests
One possible solution is to generate a fresh random test every time a model is to be verified. This prevents the risk of fitting the test set since the test set is generated only after the model has been submitted for verification. However, it is expensive since generating the test set may be a costly process. For example, consider the case of pedestrian detection then every test scenario must be created and manually annotated.

One Time Tests
The overhead of random tests can be reduced by allowing periodic tests only. Say, for example, that models can only be tested once a year on a pre-announced day. In this case, the leakage of the test is minimal and can be controlled with standard statistical tools such as Bonferroni correction to handle the risk associated with many models being tested simultaneously. This method is commonly used in schools. For example, college candidates can take the SAT exams only on 7 days during the year. All students take it at the same time to prevent the test from leaking. Therefore, each test form is used only once for all the students that are taking it on this specific date. This allows the college board to test 1.8 million prospective students using only 7 forms during 2017. 4 5 This method is efficient and is commonly used when testing human skills. It is used in school, colleges, bar examinations, and more. However, it has limitations. For example, such tests can only be offered a few times a year since each additional date the test is given at requires generating a test from scratch.

Secure Tests
Secure tests are conducted in a way that prevents information about the test from leaking and therefore allows reusing the same test. For example, emission tests can be conducted behind closed doors such that car manufactures would not be able to see how engines are being tested. However, when evaluating AI solutions, the seller might be reluctant to give uncontrolled access to its models due to various reasons such as intellectual property. Another problem with providing the buyer with access to the models is that the buyer might over-fit the model to lower the price or even copy it and use it without proper payment. That is, the buyer might design a test that will give a low score to the model, so that according to a contractual agreement between them, the price for the goods will be reduced. Another concern is that by running the test too many times, information about it might leak by comparing the properties of goods and the scores they obtain on the test. Therefore, we need mechanisms that prevent data leakage during the test and mechanisms to prevent data leakage after the test.

Preventing leakage during test
Let T be a test and M be a model to be tested. Let Eval be the evaluation function such that Eval(T, M ) returns the test score of model M on the test T . We would like to compute this score without revealing T or M . This can be achieved using Secure Multi-Party Computation (MPC) techniques Yao (1982); Goldreich et al. (1987); Goldreich (2004). Recent advances in MPC allow now for high throughput computation of complex and arbitrary functions that can be expressed by a circuit Araki et al. (2016Araki et al. ( , 2017; . These protocols allow the computation of the score without revealing intermediate results to the parties involved under various trust assumptions. Some protocols assume that the parties are honest but curious which means that they would follow the protocol but would use the pieces of information they gather to learn about other parties. Other models assume that parties do not have to follow the protocol, this is referred to as the malicious setting Goldreich (2004). Where possible, it is preferable to use protocols that are secure in the presence of malicious adversaries.
The main advantage for using MPC for evaluation is that the model developer (seller) does not have access to the test and therefore, it cannot over-fit the test. At the same time, the test provider (buyer) does not have access to the model and therefore cannot over-fit the model to lower its evaluation. Note that this is not to say that the buyer cannot design a "hard" test. Rather, it means that the test cannot be tailored to fail a specific offer and in that sense it is fair. Methods to incentivize the seller to conduct a "truthful" test or ways to measure that the test is truthful is a subject for further study.

Preventing leakage after test
The main promise of conducting secure tests using MPC as described above is that the test can be reused. However, although the computation is secured, the result of such computation is revealed and therefore, a seller, or a group of sellers, can collect a set of (model, scores) pairs and use it to learn about the test. This can be mitigated using methods of adaptive data analysis Dwork et al. (2015). The Threshold algorithm (Algorithm 1) is the mechanism we propose for this task. To protect the tests from being overfitted, it is necessary to add some randomness Dwork et al. (2014) and therefore if the model's score is borderline with respect to the threshold, the Threshold mechanism might fail to detect the exact side of the threshold the model is at. However, it allows creating n test cases and using them to testÕ(n 2 ) different models. It is possible to improve on that if it is assumed that most models will fail in which case it may be possible to reuse the same tests more. For the sake of clarity we skip this discussion here.
Theorem 1. Assume that there is a universe T of tests such that t ∈ T is a function t : M → [0, 1] where M is the space of all possible models. Furthermore, assume that there exists a probability measure µ on T and the goal is to assess, for a model M whether E t∼µ [t(M )] ≥ ρ. Let α, β > 0 and select ǫ, δ, and n such that If n tests t 1 , . . . , t n ∈ T are selected at random from µ n and are used to measure k models M 1 , . . . , M k such that k = O n 2 /(log n) 2 through the Threshold(ǫ, δ, k, ρ) mechanism (Algorithm 1) then with probability 1 − 2β (over the internal randomness of the mechanism and the selection of t 1 , . . . , t n ) the mechanism will return "pass" for every M i such that E t∼µ [t(M i )] ≥ ρ + 2α and "fail" for every Theorem 1 shows that in order to be able to verify the quality of a product, it is possible to use the same n tests again and again, as long as we do not use them more thanÕ(n 2 ) times before creating a new set of n tests. Note, that the models to be tested can be selected in an adaptive way. That is, M 2 may depend on whether M 1 received a "pass" or "fail" score.
The proof uses techniques from the field of Differential Privacy Dwork et al. (2006). We refer the reader to Dwork et al. (2014) for a comprehensive introduction to this field. To prove Theorem 1 we first prove two lemmas that will be useful in the proof. Lemma 2 shows that with high probability, the Threshold mechanism will respond "pass" and "fail" when 1 n j t j (M i ) ≶ ρ± α. Lemma 3 shows that with high probability 1 n j t j (M i ) − E t∼µ [t (M i )] ≤ α and therefore these two lemmas provide the main tools needed to prove Theorem 1.
Lemma 2. Let α, β, ǫ, δ > 0 and assume that the Threshold algorithm is used with parameters such that it is (ǫ, δ)-Differentially private with a sample of n tests. Then with probability of at least 1 − β: 1. For every model M i such that 1 n j t j (M i ) > ρ + α the Threshold algorithm will return "pass".
2. For every model M i such that 1 n j t j (M i ) > ρ − α the Threshold algorithm will return "fail". as long as the number of tested models is Proof. Theorem 3.26 in Dwork et al. (2014) shows that the statement of the lemma we are discussing here holds as long as Lemma 3. Let t 1 , . . . , t n be tests randomly selected from the probability measure µ for n = 2 ǫ 2 ln 8 δ . Assume that the results of these tests are made available through a set of k queries such that the composition of these responses is (ǫ, δ)-Differentially private. If an adversary creates k models M 1 , . . . , M k based on the responses to the k queries and k ≤ n 2 then Proof. Each model M i that the adversary builds can access the tests t 1 , . . . , t n only through a set of queries which are (ǫ, δ)-Differentially private. From Proposition 2.1 in Dwork et al. (2014) it follows that the mechanism that generates each of the M i 's is (ǫ, δ)-Differentially private. Therefore, using Theorem 1.2 in Nissim and Stemmer (2015), for each i it holds that Using the union bound: Using k ≤ n 2 = 4 ǫ 4 ln 8 δ 2 completes the proof.
Proof. of Theorem 1 Assume that t 1 , . . . , t n were selected at random. From Lemma 2 it follows that the response of the algorithm will be "pass" whenever 1 n t j (M i ) ≥ ρ + α and "fail" whenever 1 n t j (M i ) ≤ ρ − α with probability 1 − β. Next we would like to show that with high probability sup i ≤ α which will complete the proof by using the triangle inequality. The challenge, however, is that the M i 's are selected in an adaptive way, that is, based on the feedback given on previous model and therefore they are not independent of t 1 , . . . , t n .
In order to analyze this case, we will create an even harder situation: assume that the adversary can first create k models,M 1 , . . . ,M k , possibly in an adaptive way and obtain the pass-fail signal for each one of them. Based on the k responses on the modelsM 1 , . . . ,M k the adversary has to create a set of k models M 1 , . . . , M k with the attempt that sup i Although this new set of models is not built in an adaptive way, this adversary is actually more powerful since it can use M i =M i if it chooses to do so.

Experiment
In Section 3.4 we explained that using secure Multi-Party Computation it is possible to test a model while keeping both the model hidden from the test and the test hidden from the model. In Theorem 1 we showed that this can allow us to reuse the test many times. However, these results do not show that this technology is feasible in terms of computation time on currently available hardware. In this section we describe an experiment we conducted to confirm the feasibility of the approach.
For the experiment we simulated the following scenario: a customer would like to get a loan from a lender. To do that, the customer may apply to several lenders to shop for the best rates. Each lender computes the interest rate it is willing to offer by taking in the financial information of the customer and using historic data to compute the ROI it expects. The lender is not interested in revealing its "formula" for computing the requested interest rate due to two reasons. First, it is its intellectual property that may give it an edge over the competition. But more relevant to the theme of this work is that the assessment of the risk of lending the money is based on limited view of the customer. Therefore, if the customer had a full description of the way he or she are being assessed, they may be able to create a presentation that will work in their favor, for example by changing the way their credit is distributed without really changing the amount of money they owe, or issuing the request for the loan on a date that will maximize their benefits because of arbitrary cutoff dates in the evaluation model of the lender. At the same time the customer may be reluctant from providing its financial information to many lending agencies to shop for the best rates given the risk that even just one of them will leak this information.
Therefore, we simulated the scenario in which the lender has a model to predict the ROI for an offer for a customer based on the financial information of the customer such that the evaluation is done using MPC in a way that the customer does not have to reveal its private information and the lender does not have to reveal its model. To build the model we used data from Lending Club. 6 We have used Gradient Boosting Friedman (2001) to train a model consisting of 32 trees, each one of these trees having 16 leaf nodes to predict the logarithm of the ratio between the amount of money returned to the amount of credit given. Therefore, this value is positive whenever the return was greater than the investment and negative when the customer defaulted and did not return the entire amount requested. The information about the customer consisted of 48 attributes. 7 The MPC protocol was implemented using the protocol of  and its implementation in the SCAPI library. 8 This protocol is secure in the presence of malicious adversaries, utilizes three servers and is secure as long as at most one is corrupt. The evaluation used 3 servers of type c4.2xlarge on Amazon Web Services (AWS) with 1GB interconnects. The total time to apply the model to customers data was measured at 15.4 seconds of which 1 second was used for setup, another 0.9 seconds for offline computation and 13.5 seconds for interaction between the different parties. Furthermore, the amount of communication exchanged between each player and the other players was ∼ 125MB.
This experiment shows that the process of testing a model, while keeping both the model private and the test private can be done in a matter of seconds. Obviously, the exact timing may vary by the size of the model and the size of the data. However, the time changes linearly with respect to these parameters and therefore, it is still feasible for many of the applications we are interested at in this work. Furthermore, this experiment does not simulate the Threshold mechanism (Algorithm 1) however adding the randomness required by this mechanism should not introduce noticeable difference in the performance.

Conclusions
The main observation we make in this study is that in asymmetric markets, the lack of information of information may be a consequence of a computational problem, rather than an information theoretic bound. This allows us to suggest computational methods to address this lack of information. We show that this problem of asymmetric markets, that was originally presented by Akerlof (1970) in the context of used cars, appears also in markets of AI based goods. Therefore, we study ways to reduce the amount of missing information by proposing the use of secure multi-party computation to make sure that the item being evaluated cannot use the inherent limitations of the evaluation method to obtain an evaluation which does not truly reflect its true value. We show that these tools are feasible and can be applied to problems of relevant size. Furthermore, we use Differential-Privacy techniques to analyze the proposed method and show that it provides accurate estimate of the quality, even if the test is applied multiple times and the seller can adapt its good trying to get higher scores by using the feedback from previous runs.
Given that asymmetric markets are common in many fields of life and given the growth of AI and AI based goods becoming a commodity, we think that there is great value in studying these markets and proposing new methods for players to have methods to evaluate products in ways that will better reflect their true values.