Serialization is the process of converting data, objects, or model artifacts into a stored format so they can be saved, shared, and loaded later. In machine learning, this often means packaging weights, tensors, metadata, or entire model objects into files for distribution on repositories and hubs.
It matters in cyber security because the loading step, deserialization, can become dangerous if the format or loader is unsafe. Some legacy formats can execute code or trigger unwanted behavior when opening untrusted files, which makes them a useful delivery path for malware or backdoored models. Defenders reduce this risk by preferring safer formats such as safetensors, verifying provenance, reviewing file types before loading, and avoiding arbitrary object deserialization from untrusted sources.


