Concrete is really impressive and permissively licensed. The ML library has a FHE version of (a subset of) scikit-learn, which I honestly thought I’d see in another 5+ years. Like look at this example:<p><pre><code> # Now we train in the clear and quantize the weights
model = LogisticRegression(n_bits=8)
model.fit(X_train, y_train)
# We can simulate the predictions in the clear
y_pred_clear = model.predict(X_test)
# We then compile on a representative set
model.compile(X_train)
# Finally we run the inference on encrypted inputs !
y_pred_fhe = model.predict(X_test, fhe="execute")
print("In clear :", y_pred_clear)
print("In FHE :", y_pred_fhe)
print(f"Similarity: {int((y_pred_fhe == y_pred_clear).mean()*100)}%")
</code></pre>
There’s some ways to go on performance, but the ergonomics of using FHE are already pretty good!
I started working on a CPU that was designed for FHE about 10 years ago, inspired by the ShapeCPU paper around that time [1] [2]. I've been waiting for someone to make a better gate-to-FHE compiler for some time.<p>[1] <a href="https://github.com/mmastrac/oblivious-cpu">https://github.com/mmastrac/oblivious-cpu</a>
[2] <a href="https://hcrypt.com/shape-cpu/" rel="nofollow">https://hcrypt.com/shape-cpu/</a><p>FHE becomes a lot more interesting when you can hide the structure of your computation behind a VM.
Compare to Google's here:<p><a href="https://jeremykun.com/2023/02/13/googles-fully-homomorphic-encryption-compiler-a-primer/" rel="nofollow">https://jeremykun.com/2023/02/13/googles-fully-homomorphic-e...</a><p>It's a really fun write up. I prefer the syntax of Google's. But Zama is doing great work.<p>I really enjoyed the podcast with them here. It clarified a lot for me about the intersection of FHE and ZK.<p><a href="https://zeroknowledge.fm/248-2/" rel="nofollow">https://zeroknowledge.fm/248-2/</a>
This reminds me of one of those software protection libraries. I think it was by Syncrosoft, the company that used to protect software like Cubase before it got acquired by the manufacturer of Cubase, Steinberg.<p>Basically you'd write your algorithms in C++ but instead of using the built-in types like int or float you'd use custom types that had all of their operators overloaded. Your code would look pretty similar to what you'd have before (modulo the type definitions) but when compiled your algorithm would turn into an incredibly inscrutable state machine where some parts of the state machine would come from some kind of protection dongle. Pretty effective.