Nice, I think this is the second time I see this here on HN, I always wondered why we need to shove the entire model into memory, I don't care who King Charles is every single time. It always felt as though we already figured out how to break up large files and parse them efficiently with very little memory. Frontier AI feels like its full of people who are brilliant at making models, but when it comes to scale and practicality, they just leave it to whoever sets up infrastructure to worry about. I wouldn't be surprised if frontier AI could be drastically cheaper if they just finetune and optimize their models to not consume all available RAM to only access less than 10% of the models knowledge.
I don't care who King Charles is every single time that's the trick and a multi-billion dollar question, how would an llm engine know that? it's an active research area how to cull the initial layer surface and do the optimal traversal path through the layers and it's a damn hard problem. It's definitely an area where a ton of performance is left on the table still.
I don't care who King Charles is every single time
There is just a stupendous amount of everything packed into a 35B size or larger model. For instance Qwen 3.6 35B A3B (Q8) can do a fairly decent job translating English to Arabic, but it can also generate python code with a reasonable layout and commenting. I try to remember that as a mental model, an epub copy of a truly gargantuan sized 1000+ page novel such as the unabridged/2nd revision of Steven King's The Stand is about 800KB, and we're talking about a GGUF file that's 37GB in size or something like that.
I always wondered why we need to shove the entire model into memory, I don't care who King Charles is every single time.
That's kind of the problem, isn't it? How do you know which part of the model to put in memory? You have to make a per-parameter decision of whether or not it's worth it to have it in memory or whether the value should just be treated as zero. Then you have to "re-link" the layers of the model to the new positions of each of the weights. For billions of parameters, that's a lot of calculations. And it requires us to know what each parameter actually represents, which nobody does.
I don't care who King Charles is every single time
Always curious when someone will figure out how we can elide most of the data from an LLM (but retain the logical ability). I don't actually need an LLM to have a very big internal knowledge base to be useful, so long as it can invoke a search tool...
It always felt as though we already figured out how to break up large files and parse them efficiently with very little memory.
The A in 26B-A4B is the active weights. The problem is that this is a per-token load/unload at best, not for the whole prompt. The division happened until one of these can fit in a single GPU and they stopped scaling it down any more, because you can wire up 8 of them to do their share of the work.
You're kinda describing the MoE architecture; you can offload expert layers and stream them as-needed if the experts are small enough and the SSD is fast enough. Dense LLMs typically perform better, but slow down much more than MoE models when you try offloading layers.
You're right, but the "just" in "just finetune" is doing _a lot_ of work here. It's still early days and we "just" don't really know how to do it well.
The problem is that knowledge in a LLM is separated in the mathematical sense (vector direction) but not necessarily meaningfully grouped in the matrix (would be easier to split between disk/memory) if such. I think a rough analog is that it would be difficult to organize the rows of a hash table of everybody in a country by their geographic location. At this point, people are just thrilled LLMs can even function as they do…
Games used to render entire map in map in memory. Later they figured only the surroundings can we rendered. We can hopefully get same in AI
Indeed, it begs the question why we have "everything" models where instead we could have very efficient "something" models. Typical LLMs out there can generate code and translate between 60 different languages. Sometimes I only need the first part, sometimes the second. Two distinct models would be a lot smaller and run much faster (token-wise).
One key thing with MoE I am still not understanding is why we don't keep the same expert in memory for a larger number of tokens than 1. Why do we route to some other expert every token? Wouldn't it be more memory efficient to generate at least 2,3,4,8,12 or 32 tokens and then swap the experts?
Apple does something similar with their latest foundation model. They process input prompt and based on results they preload required experts. Quite neat solution for the edge devices
Putting the whole model in memory is far faster then swapping to disk.
You don't know whether King Charles or 42 is the answer to "the Question" my 2c on King Charles vs 42.
I don't think the problem is that memory footprint can't be reduced. The problem is that the token generation rate is simply far too low. OP suggests that the token rate of of their solution is ~5 per second. That's at least an order of magnitude slower than commercially available models.
Frontier AI feels like its full of people who are brilliant at making models, but when it comes to scale and practicality, they just leave it to whoever sets up infrastructure to worry about.
The idea that people in 10+ frontier labs (OpenAI, Anthropic, Google, Alibaba, Z.ai, DeepSeek, xAI, Amazon, etc) in a trillion dollars industry are all dumb is frankly, hilarious.