How to solve the problem of serialized files that are too large?

Hi, I’m having a problem:
Now I need to encrypt a large data set and then save it as files by serializing it, and these files are used for homomorphic computation use later. But the size of the resulting files is very large and far exceeds the storage space. Is there any way to achieve the storage? Like reducing the size of the serialized files.
Thank you very much.

1 Like

Can you be more specific? Are you serializing individual ciphertexts, and if so what are their parameters,
and what is the resulting size?

Binary is smaller than json.

What is your target storage size?

Have you tuned your parameters appropriately to minimize things like multiplicative depth?

I am doing logistic regression classification training, I have divided the data into multiple chunks and encrypted one chunk into a ciphertext, the plaintext data is 12000x256 ,i have set the slots to 1024 and N to 65536, the parameters regarding the depth of multiplication are as follows:

Blockquote
std::vector<uint32_t> levelBudget = {1, 1};
uint32_t levelsRemaining = 15;
usint depth = levelsRemaining + FHECKKSRNS::GetBootstrapDepth(8, levelBudget, secretKeyDist);

I have used binary. Currently the size of a single ciphertext is around 20MB and total is around 50GB. i want to keep the total storage under 30GB.

That is a lot of levels. Try to reduce the levelsRemaining to maybe 5 or 6 and bootstrap more often if necessary.
Could you print the ring dimension and share it here?