AI Glossary / AI foundations / Intermediate
Model compression
Definition
Model compression is a set of techniques that make a trained AI model smaller, faster or cheaper to run while keeping most of its accuracy. Common methods include quantization, pruning and distillation. It is not the same as compressing a file: a compressed model is a changed model that behaves slightly differently, and the size of the loss depends on the method and the task.
What it means
A trained model is a large collection of numbers, called parameters or weights. Storing and using those numbers takes memory, computing power, electricity and time. Model compression reduces that load so the same job can be done on cheaper hardware, on a phone or a laptop, or at a lower cost per request.
For a business, the point is a trade. You give up a small amount of quality and in return you get lower running cost, faster responses, or the ability to run a model on your own equipment instead of sending data to an outside service. Whether the trade is worth it depends on how much accuracy the task can afford to lose, and that has to be tested rather than assumed.
How it works
Quantization stores each weight with fewer bits. A model trained with 32-bit numbers might be stored with 8-bit or even 4-bit numbers. Each number becomes less precise, but the file is much smaller and the arithmetic is faster. Some methods compress after training; others account for the lower precision during training.
Pruning removes weights or whole structures that contribute little to the output. The model is usually fine-tuned afterward to recover accuracy. Pruning that removes scattered individual weights saves space, but it only speeds things up if the hardware can skip them. Removing whole blocks is easier to speed up in practice.
Distillation trains a small student model to imitate a larger teacher model. The student learns from the teacher's outputs, not only from the original labeled data. The result is a different, smaller model, not a squeezed copy of the original. In each case the team measures accuracy, speed and memory before and after, on data that looks like the real work.
Three practical examples
- Finance team: A finance team wants to classify incoming invoices on its own servers, because the documents cannot leave the building. A quantized version of a language model fits on the servers they already own, and testing shows it labels invoices almost as accurately as the full version.
- Retailer: A retailer runs a product recommendation model for every page view. A distilled student model answers in a fraction of the time of the large teacher model, which keeps pages fast during a sale and lowers the monthly computing bill.
- Support desk: A support team wants a draft-reply tool inside a mobile app that works with a weak connection. A pruned and quantized model runs on the phone itself, so agents get suggestions without waiting on a network request.
Think of it this way
Think of a long report cut down to a short executive summary: most of the value is kept, the reading time drops sharply, and a few details are lost. The analogy stops working because a summary is written once and can be read in full by a person, while a compressed model loses detail in ways that are hard to see, so you must test for the losses rather than spot them by eye.
Worked example
Suppose a model has 7 billion parameters. Stored at 16 bits (2 bytes) each, it needs 7 billion x 2 = 14 billion bytes, about 14 GB of memory. Quantized to 4 bits (0.5 bytes) each, it needs 7 billion x 0.5 = 3.5 billion bytes, about 3.5 GB. That is a 14 / 3.5 = 4 times reduction in memory for the weights.
Now suppose the team tests both versions on 500 sample invoices. The full model labels 460 correctly: 460 / 500 = 92 percent. The compressed model labels 450 correctly: 450 / 500 = 90 percent. The cost of the change is 2 percentage points of accuracy. If the compressed version fits on hardware the company already owns and removes a monthly bill of 1,200 dollars, the team can decide whether 2 points is acceptable for this task, or whether invoices over a set value should still go to a person for review.
Illustrative case study
Fictional case: Harbor Lane Supplies, a mid-sized wholesaler, used a large language model through an outside service to tag customer emails by topic. Costs grew as volume grew, and some customers asked that their emails not be sent off-site. The operations manager asked the data team to try a smaller model on the company's own server.
The team quantized an open model and tested it on 1,000 past emails. Overall accuracy was close to the original, but a check by category showed the compressed model often confused refund requests with delivery complaints, which are routed to different teams. The average hid a weak spot in a category the business cared about.
The team fixed this in two steps. They fine-tuned the compressed model on 800 extra labeled refund and delivery emails, and they added a rule that low-confidence tags go to a person. Accuracy on the two categories recovered, the monthly bill fell, and emails stayed on company equipment. They kept a weekly sample check to catch drift.
Common misconceptions and mistakes
Compression is free and the model stays exactly the same. Every method changes the model, and the loss is often small but never zero, so you must test on your own tasks.
A smaller model is always faster. Speed gains depend on the hardware and software supporting the compressed format, and some pruning saves space without saving time.
Average accuracy tells you the compressed model is safe to use. Averages can hide failures in rare or important categories, so check results by segment and by risk level.
Compression and distillation are the same thing. Distillation trains a new, smaller model to imitate a larger one, while quantization and pruning modify an existing model.
Business use
Start with a clear reason: a cost target, a speed target, a privacy need or a device limit. Pick a baseline model that already works, compress it with a standard method, and compare the two on a test set built from your real data, including your hard cases. Decide in advance what accuracy loss you will accept and which errors matter most.
Measure accuracy by category, response time, memory use, cost per thousand requests and how often a person has to correct the output. The costs are mainly engineering time, testing and ongoing monitoring. The risks are hidden quality loss, uneven performance across groups or categories, and a changed model that no longer matches earlier validation. Record the version and the test results so a later reviewer can see what was approved.
People also ask
Does model compression make AI less accurate?
Usually a little, and sometimes not enough to notice. The loss depends on the method, how aggressive it is, and the task, so it should be measured on your own data.
What is the difference between quantization and distillation?
Quantization stores the same model's numbers with less precision. Distillation trains a separate, smaller model to copy a larger one's behavior.
Do small businesses need model compression?
Often not. If you use a hosted AI service, the provider handles it. It matters more if you run models yourself, need data to stay on your equipment, or face high volume costs.
Check your understanding
In the worked example, how much memory does the 7 billion parameter model need at 16 bits and at 4 bits?
Answer: About 14 GB at 16 bits and about 3.5 GB at 4 bits, a four times reduction.
What was the accuracy cost of compression in the worked example?
Answer: The full model scored 92 percent and the compressed one 90 percent, a loss of 2 percentage points.
Why did Harbor Lane Supplies check results by category?
Answer: Overall accuracy hid confusion between refund requests and delivery complaints, which go to different teams.
Which compression method trains a new small model to imitate a large one?
Answer: Distillation.
Related terms
- Distillation
- Pruning
- Inference
- Fine-tuning
- Parameter
- Quantization
- Parameters
- Small language model
- Edge AI
Learn next
Pick one task you run today and write down the accuracy loss you could accept and the cost or speed gain that would justify it. Then read the entries on quantization and distillation to see how each method works in more detail, and the entry on inference to understand where the running costs come from.
More in AI foundations
- Model - A model is a structured representation used to describe relationships, generate predictions, simulate behavior, or support reasoning about a system.
- Model alignment - Model alignment is the work of making an AI model behave in line with the goals, values and rules its builders and users intend.
- Model architecture - Model architecture is the structural design of an AI model: how its components are arranged, how they connect, and how information flows through them from...
- Model evaluation - Model evaluation is the practice of measuring how well an AI or machine learning model performs on a defined task, using data and criteria chosen before the...
- Model family - A model family is a group of AI models from the same developer that share a common design and training approach but come in different sizes, speeds, prices...
- Model hosting - Model hosting is the practice of running a trained AI model on computing infrastructure so that applications, staff or customers can send it requests and...
Sources
Google, Machine Learning Glossary: https://developers.google.com/machine-learning/glossary Goodfellow, Bengio and Courville, Deep Learning: https://www.deeplearningbook.org/ ISO, ISO/IEC 22989 Artificial intelligence concepts and terminology: https://www.iso.org/standard/74296.html The sources were consulted for the definitions of quantization, pruning and distillation and for general background on how models are trained and run; the examples, analogy, worked example and case are original educational illustrations. Checked 5 Nov 2026.
Previous: Model checking Next: Model debugging