Encrypted Softmax
encrypted-softmax · spec v0.1.0 · 0 implementations · 6 runners
DESCRIPTION
Evaluates
softmax(x)_i = exp(x_i) / Σ_j exp(x_j)
over an encrypted vector.
Two things separate this from an elementwise activation. First, the denominator is a sum over all elements, so a realization needs to move data between slots — rotations, or whatever the scheme offers — and that cost dominates. Second, the plaintext trick of subtracting the maximum for numerical stability is itself an encrypted maximum, so stability is not free.
The kernel requires a distribution as output: non-negative and summing to one within the declared precision.
INTERFACE
encrypted_softmax( in ct : Ciphertext // an encrypted vector of scores out ct : Ciphertext // the encrypted distribution over those scores ... // anything else the realization needs — keys, context, encoding — is its own concern )
PARAMETER SCHEMA
The schema belongs to the kernel. Each implementation declares which part of it it supports.
CORRECTNESS
SECURITY PROPERTIES
No secrecy requirement beyond that of the scheme in use.
ASSUMPTIONS
The vector to normalize is packed contiguously, and the parameters leave enough depth for both the exponential and the normalization.