Giter VIP home page Giter VIP logo

Comments (5)

Daihongwei1900 avatar Daihongwei1900 commented on September 4, 2024 1

Ok, currently concrete uses plaintext training models. Then, by encrypting the input parameters, the model prediction calculation is compiled into a Fhe calculation circuit. so the predict algorithm is fixed, the circuit is also fixed. But there is the following scenario, alice has a model but does not want to expose it to bob, so she wants to encrypt the model and send it to bob, bob makes predictions based on the encrypted model, and bob can also use sparse matrix to filter type 0 data, but the problem is if Assuming that the model weight is used as an encrypted input, bob data can only be compiled into an FHE circuit when it is certain, but the data that bob needs to predict itβ€˜s be uncertain, and it is impossible to predict once and then need to compile a new fhe circuit.

from concrete-ml.

RomanBredehoft avatar RomanBredehoft commented on September 4, 2024 1

Hello @Daihongwei1900,
Just to make things clear, here's a summary of what you are trying to achieve :

  • Bob has some local clear inputs
  • Alice has a defined model with encrypted weights, which she sends to Bob (FHE circuit + encrypted weights)
  • Bob executes the model's inference locally using his clear inputs

What you seem to be afraid of is that Bob might always need to compile before being able to compute the predictions, but is not possible because the weights are encrypted. Am I right ? πŸ™‚

If so, then there are a few things to comment here. The short answer is that, in theory, your use case could be done as Bob will never need to compile, but it's not available in Concrete ML. Also, Bob won't be able to decrypt the model's predictions, only Alice will.

More precisely :

  • No, Bob does not need to compile before computing the predictions. This is because Alice can easily compile (in the clear) on her own using clear values, which should be representative of what kind of inputs Bob could give, as parameters. Once this is done, the FHE circuit will be able to evaluate any kind of clear inputs without having to be compiled again.
  • Once Bob executes the inference in FHE on his clear inputs, he'll get encrypted predictions but won't be able to decrypt them. This is because only Alice possess the private key needed for decryption, as she is the one that encrypted the weights. Is this what you had in mind ?
  • Unfortunately, this feature is not available in Concrete ML and we are not planning on working on it. Could you maybe indicate to use what kind of use case you are thinking ? Maybe it will help us better understand why such a feature could be important. In the mean time, if you really need to make this work, I can advise you to dig into our source code and try implement it yourself. This could probably be done by modifying the models' compile methods so that they include clear inputs and encrypted weights, and then update the predict methods accordingly as well. But I can't guarantee that this will automatically make it working. Again, I might be able to help you further if you detail your use case a bit more πŸ˜‰

Hope this helps !

from concrete-ml.

Daihongwei1900 avatar Daihongwei1900 commented on September 4, 2024 1

Thank you very much, your answer solved my problem very well, I need to implement clear inputs and encrypted weights.

from concrete-ml.

bcm-at-zama avatar bcm-at-zama commented on September 4, 2024

Hello @Daihongwei1900 . Could you be a bit more precise on what the "feature request" is and what is the "motivation". Thank you

from concrete-ml.

Daihongwei1900 avatar Daihongwei1900 commented on September 4, 2024

Ok, currently concrete uses plaintext training models. Then, by encrypting the input parameters, the model prediction calculation is compiled into a Fhe calculation circuit. so the predict algorithm is fixed, the circuit is also fixed. But there is the following scenario, alice has a model but does not want to expose it to bob, so she wants to encrypt the model and send it to bob, bob makes predictions based on the encrypted model, and bob can also use sparse matrix to filter type 0 data, but the problem is if Assuming that the model weight is used as an encrypted input, bob data can only be compiled into an FHE circuit when it is certain, but the data that bob needs to predict itβ€˜s be uncertain, and it is impossible to predict once and then need to compile a new fhe circuit.

@bcm-at-zama

from concrete-ml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.