What “tiny” means here
Tiny machine learning, often shortened to TinyML, is the practice of running trained models on microcontrollers: small, low-cost chips with very limited memory and processing power, often running on batteries. Memory on such chips is commonly measured in kilobytes, or perhaps a few hundred kilobytes to a few megabytes, rather than the gigabytes available on a laptop. Clock speeds are modest and there is usually no operating system in the usual sense.
The point is to make a small device able to react to its surroundings using a learned pattern, without sending data elsewhere. The phrase is a field and a community rather than a single technology, and specific tools and boards vary, so check current documentation for whichever you pick.
Why bother running a model on the device
There are several reasons to keep the inference on the chip:
- Power: transmitting data over a radio often costs more energy than doing a small calculation locally, so processing on the device can extend battery life. This depends on the design and is not guaranteed.
- Latency: the device can respond immediately without waiting for a network round trip.
- Privacy: raw audio, images or sensor traces can stay on the device, with only a result sent out, if anything. The issues around data leaving a device are discussed under cloud AI privacy.
- Independence: it works without a reliable connection.
- Bandwidth: sending only an event, such as “vibration pattern unusual”, takes far less capacity than streaming raw data, which suits wireless protocols with limited throughput.
This is a form of the broader edge computing idea, pushed to the smallest scale.
What these models can realistically do
Models that fit on microcontrollers are small, so they suit narrow, well-defined tasks. Typical examples include:
- Keyword spotting: detecting a short wake word or a handful of spoken commands. This is much simpler than general speech recognition.
- Simple sound classification: distinguishing, say, a few kinds of machinery noise or alarm sounds.
- Motion and gesture recognition: classifying activity from accelerometer and gyroscope readings, using the sort of data from inertial sensors.
- Anomaly detection: noticing when vibration, current or temperature patterns depart from what was seen during normal operation.
- Very small image tasks: detecting presence or recognising a few simple classes in low-resolution pictures.
These tasks share a pattern: limited input size, few output classes, and a clear definition of success.
What they cannot do
Be realistic about the limits.
- Open-ended language understanding or generation is far beyond typical microcontroller memory. The models discussed under running language models on local hardware need orders of magnitude more memory.
- Accurate detection of many object types in full-size camera images, as in object detection, generally needs more capable hardware, although stripped-down versions exist for low resolution and few classes.
- Learning new things on the device is usually impractical. Most projects train elsewhere and deploy a fixed model.
- Accuracy is typically lower than that of larger models, and the margin for error is thinner.
If a title or product description suggests a tiny chip offers general intelligence, it overstates what is possible. The tasks are specific and narrow.
How a model gets small enough
The usual workflow has several stages:
- Collect data from the actual sensor or microphone in the real environment. Data from a different sensor or placement can mislead the model, so the points about training data quality and bias apply directly.
- Train on a more capable computer. The general process is described under how models are trained.
- Shrink the model so it fits. Common techniques are quantisation, which stores parameters as small integers instead of larger numbers; pruning, which removes parameters that matter little; and choosing a compact architecture in the first place.
- Convert the model to a format that a small runtime on the microcontroller can read, often as an array compiled into the program itself.
- Run and test on the device, measuring real memory use, speed and accuracy.
Each stage can reveal problems. A model that is accurate on a computer may lose accuracy after shrinking, or may use more working memory than the chip offers.
Pre-processing counts as much as the model
Raw sensor data is rarely fed in directly. Audio, for example, is typically converted into a compact representation of how its frequency content changes over time before being passed to the model. Motion data may be windowed into short segments and normalised. This pre-processing also takes memory and processing time, and getting it identical in training and on the device is a frequent source of mysterious accuracy drops. Mismatched settings between the two are a classic bug.
Choosing and budgeting
When picking a board, look at:
- Flash and RAM: the model and runtime must fit in flash storage, and working memory must fit in RAM. Check both against your measured usage, with margin.
- Processor features: some chips include instructions or small accelerators that speed up the arithmetic, a smaller-scale version of the trade-offs in inference hardware.
- Sensors and peripherals: whether the sensors you need are built in or easy to attach.
- Power: sleep modes, active current and how often inference runs determine battery life. Use a careful battery runtime estimate based on measured current rather than headline figures.
- Software support: whether your chosen toolchain supports the chip. The overview of microcontroller boards covers general selection.
Read the manufacturer’s documents closely, and see the habits on reading datasheets for the specifics that matter, such as memory maps and current draw.
Reliability and safety
A tiny model will make mistakes, so design the surrounding system to cope. Use hysteresis or require several consecutive detections before acting, and keep a conventional fallback. Do not rely on a learned model alone for anything where a wrong decision could injure someone or damage property. Where batteries, motors or mains-connected parts are involved, follow manufacturer guidance and local rules, and use proper protections.
Is it worth it?
Tiny models shine when a small, always-on device must make a simple judgement cheaply and privately. They are a poor fit when a rule-based threshold is enough, or when the task needs more intelligence than the chip can hold. Weigh it against simpler options as described in AI feature evaluation, and consider a prototype with plentiful hardware first to confirm the idea works before squeezing it onto a smaller chip.