What is up with Decision Trees for Machine Learning, and how can we explore them securely?

As part of our ongoing review of secure data processing in the cloud, we move now to the analysis of the state of the art (SOTA) for privacy preserving exploration of Decision Trees.

That is indeed a fancy description, but, Decision Trees, what are they really? Let us start by saying that they are a quite useful tool on Machine Learning. They help Data scientists make classification decisions, where classes are the leaves of a Boolean Tree that is built upon what are typically called decision nodes. Each node on the tree contains a series of constraints, typically inequalities that let us decide what path to take whilst exploring the Tree.

Once we have a Tree constructed in this fashion, it is easy and intuitive to deduce how to explore it. A query by a user is produced, this query contains a series of parameters that then are used to satisfy the constraints on the root node and identify a direction, and hence, what decision node to move next. We then simply need to keep doing this until we get to a leave node, and the class it contains.

In the Machine Learning world, Decision Trees and their extensions (random forests), as you may have deduced by now, are not the sharpest tool on the shelf of incredible 2000’s advancements. They are a relatively old tool, nonetheless efficient. Our interest on Decision Trees, as a technique, comes from the fact that among all possible classifiers, they are relatively easy to implement on a privacy preserving setting. Additionally, the results on the field could be recycled and used for database access such as we do on Oblivious RAM.

The Setting:
Well, the setting is a familiar one in distributed systems: A data owner produces a Decision Tree. It realizes it is big and heavy, and want to outsource it to the cloud. Looks for options, finds Google, Amanzon and Microsoft, all of them seem to be clear favorites. Then a client or as we call it… a querier, could simply access is via the magic of the internet, and query whatever she wants! The model owner can charge per query of course.

The Problems:

Well, the problems are familiar to what we have in distributed systems (for a more comprehensive read see [1]): a data (model) owner who is wary of giving his expensive built tree to a cloud provider. The security risks associated with hacks and information leaks. The legal constraints surrounding outsourcing sensible user data (a wink to all my GDPR enthusiasts our there). That is only from the perspective of the data owner, both the cloud and the user have constraints of their own. On the cloud side, they would love to be able to shift leverage and legal responsibility [2], and the client would like to keep its query secret, with respect to the cloud, and perhaps to the model owner.

As you may see, this is not an easy endeavor, however, and as often happens cryptography has come to the rescue.

The Solutions:

Well, for starters, big companies have been interested on Decision Trees and have invested greatly to have fast and efficient implementations. That shows us that there is still faith put on the technique, given that recent implementations show a high accuracy at blazing speeds [ 4].

The speed side of things is understandable, a tree exploration does not require extravagant mathematics, however, neural network evaluations are relatively fast as well. The simplicity of Decision Trees, on the other hand, is a strong argument for their adoption.

The privacy preserving side of the thing has been developed as well, specially with regards to training (although improvements are still quite possible). And some work with regards to evaluation has been introduced as well.

The problem with privately evaluating a Decision tree comes from the fact of how to explore a tree without disclosing the weights used on the decision nodes, the parameter values sent on the query, and where to use the parameters while evaluating the model.

If companies want to provide privacy preserving machine learning as a service (AWS acknowledges this is a need for them in the future [4]), as indicated by our setting, a good approach could be securing Decision Trees by using state of the art techniques based on either Homomorphic Encryption (HE) or Garbled Circuits (GC), which currently encompass a solid group of alternatives, for now. We are currently working on techniques that we hope will improve the SOTA by using generic Multiparty Computation (MPC) techniques.

Coming back to the current SOTA, some of these techniques (HE and GC based) were revised in detail in a Systematization of Knowledge, entitled “Efficient Private Decision Tree Evaluation”, recently accepted to PETs [5]. They also combined some of these in different ways to improve general efficiency. We will succinctly review them to better comprehend the cost of the added privacy requirements.

The Specificities:

Typically, the SOTA divides the problem of exploring a Decision Tree into 3 phases:

Selection Phase: First, we need to select the features that are going to be evaluated by the Model. The problem here is that a user has a series of features, the Cloud Provider nor the Model Provider can directly tell the Querier in which order it must send them, nor which ones are necessary and which ones are not or where. To solve this privately [6] suggests the use of simple additive homomorphic encryption and blinding. This is common on HE.

Another path of action simply follows from the use of Garbled Circuits; in which case we need to secretly evaluate a selection circuit [6]

Comparison Phase: We evaluate, inside every decision node what path to explore next. We can achieve this by evaluating a series of inequalities. Basically, you take the pre-selected features from the previous phase, and use them here. As you may deduce, comparing encrypted inputs is not easy. Consider that at this moment both the weight threshold provided in the model, and the pre-selected parameter of the query are encrypted. To do this, the literature suggests to use a comparison technique often referred to as DGK [7]. This technique can be implemented in any modern secure distributed computation framework (HE, GC, or MPC).

Evaluation Phase: This phase consists on the basic tree exploration functionality. How to get from the top to the bottom of the tree, the bottom being a specific class. Prior results include methodologies to achieve this and from the perspective of HE and GC. Sadly, both consider touching many more nodes than only the ones on the selected path.

More specifically, the HE approach requires for the server to calculate something akin to path costs, allowing the client to decrypt the path with least resistance or, in other words, the classification [8]. Something similar occurs with the GC version of the works mentioned in this paper. Basically, you evaluate a circuit at each level and then following a 0/1 result, we proceed to choose the more adequate path [6]. The client is prevented of learning the access pattern by permuting the decision nodes before each query.

Timings:

Well, if you were wondering whether we can do this efficiently, the answer is, as often happens… it depends! To give you a short flavor of what can be achieved, consider a small dataset used around ML applications for testing, let us say, “wine” [9]. The dataset is small and is used for basic testing. Notwithstanding this becomes more difficult on the size of the dataset.

On the same dataset, a fully GC approach on a standard AWS EC2 would take around 10 milliseconds. A fully HE approach, would take 3 times that, while occupying 20 KB, half of what is needed for its full GC counterpart.

The Challenges:

For us, the challenges remain on having some generic protocol that can be used on MPC on all stages, additionally, we would like to be able to have an efficient way to do the tree exploration without any leakage. Some approaches (not on[5]) would leak the path on the tree to improve performance, something we wish to avoid. We would love to achieve this while having sublinear complexity on the tree exploration.

The Good News:

We are currently working on doing exactly that! If you are curious on how, please let us know, we would love to hear from you!

And… that is all folks, it was a pleasure to write you at this time! See ya!

References:

  1. https://ir.lib.uwo.ca/etd/2777/
  2. https://ieeexplore.ieee.org/abstract/document/5708519
  3. http://jmlr.org/papers/volume15/delgado14a/delgado14a.pdf
  4. https://aws.amazon.com/compliance/data-privacy-faq/
  5. https://eprint.iacr.org/2018/1099.pdf
  6. https://eprint.iacr.org/2009/195.pdf
  7. https://eprint.iacr.org/2008/321.pdf
  8. https://link.springer.com/chapter/10.1007/978-3-319-66399-9_27
  9. https://archive.ics.uci.edu/ml/datasets/wine