A compression method that reduces data size by permanently discarding less perceptible information.
Lossy compression is a data encoding strategy that achieves significant file size reductions by selectively discarding information judged to be less critical to the end user's experience. Unlike lossless compression, which preserves every bit of original data, lossy methods accept a degree of irreversible quality degradation in exchange for dramatically smaller file sizes. This trade-off is especially practical for audio, image, and video data, where human perceptual systems are insensitive to certain frequencies, fine textures, or subtle color gradients — meaning their removal goes largely unnoticed.
The mechanics of lossy compression typically rely on transform coding, quantization, and perceptual modeling. In image compression (e.g., JPEG), the image is decomposed via a discrete cosine transform into frequency components, and high-frequency details that the human eye struggles to resolve are quantized aggressively or dropped entirely. In audio compression (e.g., MP3), psychoacoustic models identify sounds masked by louder simultaneous tones and remove them. The degree of compression — and thus quality loss — is usually tunable via a quality parameter, allowing practitioners to balance fidelity against storage or bandwidth constraints.
In machine learning, lossy compression appears in several important contexts. Large-scale training datasets consisting of images, audio, or video are almost universally stored in lossy formats, and the compression artifacts introduced can subtly influence model behavior, generalization, and robustness. More recently, lossy compression principles have been applied directly within ML pipelines: gradient compression during distributed training discards small gradient updates to reduce communication overhead, and neural network weight quantization can be viewed as a form of lossy compression that shrinks model size with minimal accuracy loss. Learned image compression — where neural networks are trained end-to-end to compress and reconstruct images — has emerged as a research frontier that outperforms classical codecs at equivalent bit rates.
Understanding lossy compression matters for ML practitioners because data quality, storage efficiency, and inference latency are deeply intertwined. Choosing compression settings carelessly can introduce systematic biases into training data or degrade the inputs seen at inference time, while thoughtful compression enables scalable deployment of models on resource-constrained devices.