Defining additional circuits (concrete) on a server that runs regression (concrete-ml)

Hello Zama team,

Thank you for your work and open source contributions! I am experimenting with your recent Github gist (Example of deployement code for FHE training · GitHub) and I have a question for you.

In the current setup, the server performs the computations based on the circuit of the quantized linear model and then sends back the encrypted weights and bias to the client for evaluation. Now, let’s say the server also has access to the encrypted y_batch (labels), and I’d like to perform the evaluation on the server side too. Would it be possible to send back to the client just the encrypted accuracy scalar, which they can then access with their keys? It seems like I would need to define a couple of extra circuits (make_predictions and calculate_accuracy ) and add them as methods to the linear model, or make multiple server instances (one for each circuit). Do you have any tips or reference scripts that could point me in the right direction?

Best,
Efklidis

Hello @KatsarosEf,

You could either modify the current training circuit to also do the prediction on this data and compute the accuracy in FHE or define another circuit that does so.

Both would work :slightly_smiling_face:

I recommend you take a look at how we implemented FHE training with a torch Module that does a training step in the __forward__ method.

1 Like