Encrypted Sentiment Classification
L5 · Privacy-Preserving ApplicationsDefinition
Sentiment classification is the task of deciding the sentiment expressed by a piece of text — for example positive versus negative. In the encrypted setting the text is represented as a secret feature vector and the model runs homomorphically: nothing is decrypted between the encrypted input and the encrypted output.
Given an encrypted feature vector , a fixed model is evaluated on the ciphertext to produce a score
and the predicted sentiment is obtained by thresholding the score,
for a decision threshold fixed by the specification.
Context
The operation is defined over real-valued data encrypted under an approximate homomorphic scheme (CKKS). The model is a fixed function from an -dimensional feature vector to a single real score; it is applied to the ciphertext without access to the plaintext input. What varies between specifications is the scheme and its parameters, the feature representation and its length, the decision threshold, the dataset, and the model itself.
The kernel states only the input/output contract and the classification semantics. It does not fix a feature-extraction pipeline, a model architecture, an approximation strategy, or accuracy figures — those are properties of a specification and of the submitted solution.
Composition
This is an end-to-end application kernel (abstraction level "applications"), not a primitive. A solution is built by composing lower-level component kernels of the catalogue, for example:
- matrix multiplication or a dot product for the linear part of the model;
- activation approximations — such as
logisticorsign— evaluated as polynomials on ciphertext to produce and shape the score.
The application defines the outer contract (encrypted features in, encrypted score out); the component kernels supply the arithmetic underneath.
Parameters Defined by Specifications
A specification pins the general task down to a concrete problem by fixing:
- the encryption scheme and its parameters (here CKKS);
- the feature representation and its length ;
- the decision threshold that turns the score into a class;
- the dataset and its labelling;
- the correctness metric (classification accuracy against plaintext labels);
- what is secret and what is fixed/public (the input versus the model).
Applications
Encrypted sentiment classification supports private text analytics: gauging opinion in social-media posts, reviews, or messages without revealing the text to the model holder, and without the text owner obtaining the model. It is a representative case of running a trained classifier on confidential inputs.