r/IndicKnowledgeSystems • u/KullanSuryaV1000 • 25d ago
architecture/engineering EdgeML: Machine Learning in Two Kilobytes, and What It Shows About Frugal Research in India
I. The Inverted Question
For most of the last decade, machine learning has asked one question over and over: what happens if we make it bigger? More parameters, more data, more GPUs and more electricity have produced extraordinary capabilities, and they have also concentrated AI research in the few places on Earth that can afford it.
Around 2016, a group at Microsoft Research India in Bengaluru asked the opposite question: how small can a useful machine learning model be? They did not mean small enough for a phone, which was already a mainstream research area. They meant small enough for a microcontroller: a chip costing less than a cup of chai, with a few kilobytes of RAM, a few tens of kilobytes of flash storage, no floating-point unit, a clock speed in the low megahertz, and often nothing but a coin-cell battery to run on.
The answer became a research programme called EdgeML, a family of algorithms, compilers and applications released as an open-source library. Its target hardware was symbolic. The flagship papers demonstrated models running on something like the Arduino Uno, built around an 8-bit ATmega328P with 2 KB of RAM and 32 KB of flash. To put that in proportion, 2 KB is less memory than this paragraph occupies as plain text. A typical image classifier of that era needed tens to hundreds of megabytes, which is four to five orders of magnitude more.
II. Why Anyone Would Want This
The motivation was not stunt engineering. The billions of devices that make up the Internet of Things (soil-moisture sensors in fields, vibration monitors on factory motors, wearable health bands, smart meters, gesture sensors, wildlife acoustic recorders) almost all run on microcontrollers. The standard architecture of the 2010s treated these devices as dumb collectors. They sampled data, sent it over a radio to the cloud, and waited for a decision to come back.
That architecture has four serious weaknesses:
- Energy. Radio transmission usually costs far more energy than local computation. A sensor that streams raw data to the cloud drains its battery in days. One that thinks locally and transmits only conclusions can last months or years.
- Latency. A fall detector, a machine-fault alarm or a voice trigger cannot always wait for a cloud round trip, and it certainly cannot depend on a connection that may not exist.
- Connectivity. Across rural India, Africa and much of the world, there is no reliable network. A device that needs the cloud to be intelligent is not intelligent where it is most needed.
- Privacy. Audio, health signals and video that never leave the device cannot leak from a server.
The EdgeML researchers, Manik Varma, Prateek Jain and Harsha Vardhan Simhadri among the senior figures, along with an unusually young cohort of research fellows and interns, took this as a hard algorithmic problem. Standard compression techniques of the time (pruning, quantization, distillation) start from a large model and shrink it. That approach struggles when the target is a thousand times smaller than the starting point. EdgeML’s central bet was different: design model families that are tiny by construction, and train them jointly under the memory budget, rather than compressing large models after the fact.
III. The Algorithms
Bonsai: a tree that fits in a pocket
Bonsai (ICML 2017, Ashish Kumar, Saurabh Goyal and Manik Varma) reworked the decision tree for kilobyte budgets. Classical trees are cheap to evaluate but need depth, and therefore many nodes, to be accurate, while ensembles such as random forests or gradient-boosted trees multiply the cost. Bonsai made three moves.
First, it learns a sparse, low-dimensional projection of the input, so the tree operates in a compact learned space rather than on raw high-dimensional features. Second, it uses a single, shallow tree whose internal nodes make non-linear decisions instead of simple axis-aligned thresholds. Third, and most distinctively, every node on the path from root to leaf contributes to the prediction, not just the leaf, so a shallow tree carries far more expressive power than its depth suggests. The projection, the branching functions and the node predictors are all learned jointly by gradient-based optimisation, with sparsity constraints that keep the whole model within the memory budget.
The result was a classifier that fitted in about 2 KB yet matched or came close to the accuracy of much larger models on standard IoT benchmarks. Its prediction time and energy cost were small enough to run on the Uno’s tiny chip.
ProtoNN: nearest neighbours without the neighbours
ProtoNN (ICML 2017, Chirag Gupta, Arun Sai Suggala, Harsha Simhadri, Prateek Jain, Manik Varma and colleagues) did the same for k-nearest neighbours. kNN is accurate and flexible, but it needs the entire training set stored in memory and a scan of all of it at prediction time. That is impossible on a microcontroller.
ProtoNN replaces the training set with a small number of learned prototypes, each carrying a learned label vector. Inputs are mapped through a sparse low-dimensional projection, and a prediction is a kernel-weighted combination of the prototypes’ labels. As in Bonsai, the projection, the prototypes and their labels are all optimised jointly under explicit sparsity and size constraints. The authors also gave theoretical analysis of the method’s behaviour. The result was a kNN-style classifier compressed by orders of magnitude, again fitting within a few kilobytes.
FastRNN and FastGRNN: recurrence on a diet
Trees and prototypes suit static feature vectors, but much IoT data is time series: audio, accelerometer traces, ECG signals. That points to recurrent neural networks, which were notoriously expensive (LSTMs and GRUs carry several large weight matrices) and notoriously hard to train because of exploding and vanishing gradients.
FastGRNN (NeurIPS 2018, Aditya Kusupati, Manish Singh, Kush Bhatia, Ashish Kumar, Prateek Jain and Manik Varma) is probably EdgeML’s most elegant contribution. It came in two steps.
The first, FastRNN, adds a weighted residual connection to a plain RNN, controlled by two learned scalars α and β:
h_t = α · tanh(W x_t + U h_{t−1} + b) + β · h_{t−1}
These two numbers let the network decide how much of the old state to carry forward and how much to update. The authors showed this stabilises training, with better-behaved gradients, at a cost of only two extra parameters.
The second step, FastGRNN, extends this into a gated cell, with one striking economy: the gate and the candidate update share the same W and U matrices, differing only in their bias vectors. A standard GRU learns separate matrices for each of its gates. FastGRNN uses one pair, with the update written roughly as
h_t = (ζ(1 − z_t) + ν) ⊙ h̃_t + z_t ⊙ h_{t−1}
where z_t is the gate, h̃_t the candidate state, and ζ, ν two more learned scalars. The shared matrices are then made low-rank, sparse and byte-quantized during training. The resulting models were smaller than equivalent LSTMs and GRUs by factors in the tens while staying competitive in accuracy, often just a few kilobytes in all. That made real-time tasks such as keyword spotting, which is wake-word detection, practical on Cortex-M-class microcontrollers.
The wider family
The programme then grew outward:
- EMI-RNN (NeurIPS 2018, Don Dennis, Chirag Pabbaraju, Harsha Simhadri and Prateek Jain) treated time-series classification as multiple-instance learning. Most of a long sensor window is noise, and the real “signature” of an event occupies a short stretch, so the model learns to find that stretch and to predict early, stopping computation as soon as it is confident. This cuts computation sharply.
- ShaRNN (NeurIPS 2019) introduced shallow, hierarchical RNNs that split long sequences into bricks processed in parallel. This shortens the dependency chain that makes recurrent inference slow.
- RNNPool (NeurIPS 2020, Oindrila Saha, Aditya Kusupati, Harsha Simhadri, Manik Varma and Prateek Jain) carried the ideas into vision. It replaced the memory-hungry early stages of convolutional networks with an RNN-based pooling operator that sweeps across image patches, and showed face detection on ARM Cortex-M4-class devices with a few hundred kilobytes of RAM.
SeeDot: the compiler problem
Algorithms are only half the story. Microcontrollers often lack hardware floating-point, so a model written in floating-point arithmetic must be converted to fixed-point integer arithmetic. Done by hand, this is error-prone and loses accuracy. SeeDot (PLDI 2019, Sridhar Gopinath, Nikhil Ghanathe, Vivek Seshadri and Rahul Sharma) is a domain-specific language and compiler that takes a high-level model description and automatically produces efficient fixed-point code, searching for the scaling factors that keep accuracy within budget. It was followed by successors that pushed the approach further.
It is notable that this appeared at PLDI, a premier programming-languages venue, rather than at an ML conference. EdgeML treated tiny ML as a problem across machine learning theory, optimisation, systems and compilers at once.
Applications that mattered to people
The programme also produced deployments with direct human value. The most cited is GesturePod (UIST 2019), a small clip-on device for the white cane used by visually impaired people. Using a tiny on-device model, it recognises simple cane gestures such as a double tap or a twirl and triggers phone actions (answering a call, telling the time, sharing location) without the user having to find and operate a touchscreen. It was a direct demonstration of the original thesis: intelligence that is cheap, local, battery-friendly and needs no network can serve people the mainstream AI industry tends to overlook.
IV. Where EdgeML Stands in the Field
Placing EdgeML honestly within the broader movement now called TinyML matters.
EdgeML’s main papers (2017–2018) came before the field had a name. The organised TinyML community, with its summits and foundation, formed around 2019. Industrial frameworks such as TensorFlow Lite for Microcontrollers, Arm’s CMSIS-NN kernels and commercial platforms such as Edge Impulse matured around the same time. EdgeML is therefore properly counted among the pioneering research programmes in machine learning on microcontrollers. It showed at top venues, with theory and working hardware demos, that kilobyte-scale models could be accurate, and its papers are routinely cited in TinyML surveys.
Then comes the harder part of the assessment. The mainstream of TinyML did not converge on EdgeML’s specific methods. The industrial ecosystem consolidated around quantized, compressed versions of standard neural architectures (small CNNs and depthwise-separable networks) run by vendor-optimised inference engines. The most influential later research pushed that same line. MIT’s MCUNet work, for example, combined neural architecture search with a memory-aware inference engine to fit ImageNet-class vision onto microcontrollers. As microcontrollers grew from kilobytes to hundreds of kilobytes or megabytes of SRAM, and as chips with dedicated neural accelerators arrived, the extreme 2 KB regime that Bonsai and ProtoNN were built for became a narrower niche.
The EdgeML library itself has been comparatively quiet for several years. It never became the default toolkit for practitioners, the way the Google- and Arm-backed stacks did. Its ideas, such as joint learning under budgets, shared-weight gated cells, early-exit time-series classification and fixed-point compilation, spread into the literature. Its code and specific model families mostly did not become industrial infrastructure.
This does not diminish the scientific contribution. A programme can be pioneering and influential without becoming the standard. But it is the accurate picture.
V. The Human Pipeline
One of EdgeML’s most lasting outputs was people. MSR India runs a research fellow programme that takes strong graduates straight out of undergraduate degrees and puts them on serious research for a year or two. Many EdgeML papers have first authors who were fellows or interns barely out of their bachelor’s degrees, publishing at ICML, NeurIPS and PLDI. That is rare almost anywhere in the world.
Where those people went next tells a story. Several EdgeML alumni went on to doctoral and research careers at leading American universities and companies and did widely recognised work there. Aditya Kusupati, for instance, later co-led the work on Matryoshka representation learning, nested embeddings that can be truncated to different sizes, which has been adopted in production embedding models. Others went into prominent work on LLM tool use and systems. The ideas that grew out of Bengaluru often matured elsewhere.
Seen one way, this shows the strength of India’s undergraduate talent and of a lab willing to trust very young researchers. Seen another way, it shows the leak in the system: India trains the researchers and seeds their first ideas, and their most productive years are spent building other countries’ research ecosystems.
VI. Frugality as a Research Strategy, and Its Ceiling
It is tempting to romanticise EdgeML as jugaad (improvised, frugal ingenuity) raised to scientific rigour, and there is something to that. Its research agenda came straight out of conditions that are vivid in India: patchy connectivity, cost-sensitive users, rural deployment, and devices that must run on almost nothing. A lab in Bengaluru was well placed to see that “make it work on a ₹200 chip with no network” is a deep problem, not a niche one.
Frugality as a research identity has a ceiling, though, and EdgeML’s story shows where it is.
First, edge AI is ultimately a hardware story, and India does not make the hardware. The microcontrollers EdgeML targeted were designed in the United States, Europe and Japan and fabricated in Taiwan and elsewhere. The cheap Wi-Fi-enabled chips that took over hobbyist and commercial IoT came overwhelmingly from Chinese firms. China built an entire edge-AI silicon ecosystem of low-cost AI accelerator chips, vision processors for cameras and automotive inference chips, so its researchers’ algorithms had domestic hardware to land on, and its hardware companies had domestic researchers to optimise for. Indian efforts such as IIT Madras’s Shakti RISC-V processors and the startups growing out of that work are real and promising, and the country’s semiconductor push is beginning to produce fabrication and packaging facilities. But in the period when EdgeML was most productive, there was no Indian chip for Indian edge algorithms to call home.
Second, the commercial stack was owned elsewhere. Turning tiny-ML research into an industry standard took a toolchain backed by a platform company, such as Google’s TensorFlow ecosystem or Arm’s software libraries, and the developer communities that come with it. EdgeML had Microsoft behind it, but edge inference on microcontrollers was never central to Microsoft’s business the way it was to Arm’s or to chip vendors’. India had no domestic platform company positioned to adopt and spread the work. Research without a channel to production tends to remain research.
Third, the institutional base is narrow. EdgeML was produced by a small number of exceptional people in one corporate lab, owned by an American company. When those people moved on, to other problems or other countries, the programme slowed. In the US, TinyML research spread across MIT, Harvard, Berkeley, Google, Arm, Qualcomm and dozens of startups. In China, edge AI was backed by national industrial policy, university labs and hardware giants at once. In India, there was nothing comparable for this line of work to hand off to.
So the honest account of India’s position is this. India can produce original, fundamental research agendas: EdgeML posed a question the field had largely not asked and answered it with mathematical care. What India has struggled to do is hold on to those agendas. It lacks the deep bench of domestic institutions, hardware industry, platform companies and long-horizon funding that turns a research programme into a field and a field into an industry. The United States does this through its universities, capital markets and platform firms, and China through state-directed industrial integration. India mostly does it through the diaspora and through foreign labs on Indian soil.
VII. What Remains
The problems EdgeML set out to solve have not gone away. They have grown. Billions more sensors are being deployed. Energy costs and privacy concerns are rising. Hundreds of millions of people still live where cloud-dependent AI is unreliable at best. The current wave of interest in running language and speech models on phones, earbuds and cheap embedded boards is, in spirit, EdgeML’s question asked again at a larger scale: how much intelligence can you fit into how little?
For India specifically, the opportunity is unusually clear. Agriculture, public health, assistive technology, local-language voice interfaces and infrastructure monitoring all reward AI that is cheap, offline-capable and energy-efficient. These are domains where India’s needs are acute and where Western labs, optimising for data-centre-scale capability, have limited incentive to lead. If India’s growing semiconductor efforts, its RISC-V design community and its research labs could be connected, so that frugal algorithms are designed alongside domestic chips and deployed through domestic products, the next EdgeML would not have to end as a set of well-cited papers and a dormant repository.
EdgeML proved that a lab in Bengaluru could pose and answer one of the field’s important questions years before most of the world took it seriously. Whether India builds the institutions to stay ahead on the questions it asks first will decide whether that remains an impressive exception or becomes the start of a pattern.
1
u/Sweet-Marketing-2925 24d ago
awesome, thanks for sharing. it piques my interest in edgeml.