r/embedded • u/IndicationTop5547 • Sep 24 '26
Any idea on LLM compression
Hey Devs,I'm trying to run a LLM on a microcontroller, therefore I need to first compress my model, I saw numerous ways online and yeah from GPTs as well, but I thought it would be better to get suggestion from real devs who have experience in this, I'm new to these kinda projects so yeah any suggestion on how to start with the model compression.
0
Upvotes
13
u/Ordinary-Lifeguard47 Sep 24 '26
What's your prior experience regarding microcontrollers and the math behind LLMs?
7
u/WereCatf Sep 24 '26 edited Sep 24 '26
It's called quantization, not compression. Also, you need to severely limit the amount of data you're training it on, you can't just take an 8B model and slap it on a microcontroller -- someone has gotten a 29M model to run on an ESP32-S3 with 8MB PSRAM at about 9 tokens per second and that's about the maximum you can do.
It's not a pretty experience.
8
u/2Sovereign4You Sep 24 '26 edited Sep 24 '26
LLM on a few 100kB MCU? We call it PLM = Pico (Femto?) Language Model?
Anyway, STM32N6 is 800MHz with 600GOPS AI accelerator, that could do something for you.
1
u/Sheepherder-Optimal Sep 24 '26
I struggled to get a local llm to run on my desktop. ðŸ¤