Comments (5)
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.
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 thepredict
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.
Thank you very much, your answer solved my problem very well, I need to implement clear inputs and encrypted weights.
from concrete-ml.
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.
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.
Related Issues (20)
- Comparison over encrypted integers HOT 3
- Add a fhe or concrete-ml as a tag in HF compiled models HOT 2
- Test Hugging Face Endpoints on Azure HOT 2
- RuntimeError: Can't compile: Cannot find crypto parameters HOT 1
- Can not install concrete-ml on Linux system HOT 7
- ValueError: Please either set all three 'ordered_module_input_names', 'ordered_module_output_names' and 'quant_layers_dict' or none of them. HOT 4
- Feature Request: Add support for embedding layers HOT 4
- [Question] How exactly the HybridFHE functions HOT 1
- [Question] FHE inference over a single image time HOT 2
- installation error HOT 7
- [Question] Discord link in explanation HOT 2
- High accuracy variance during the training with SGDClassifier HOT 1
- Feature Request : Implement LogSoftmax, Softmax, ReduceMax HOT 3
- Performance Issues HOT 1
- Two consecutive Unsqueeze operations in QAT model throws error at compilation time HOT 2
- LLVM symbolizer error with LogisticRegression example HOT 15
- [Question] What HE algorithm is used? HOT 6
- [Question] AssertionError: Values must be float if value_is_float is set to True, got int64: [1] HOT 3
- AssertionError: Values must be float if value_is_float is set to True, got int64: [[[[102 14 188 ... 85 205 46] HOT 3
- RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from concrete-ml.