Live data from Hacker News

New LLM optimization technique slashes memory costs

venturebeat.com

151–160 of 227 posts

Re: New LLM optimization technique slashes memory costs

#151
post #88

Earlier quoted context omitted.

I might have a go at installing one, what is a good source or install at the moment?

Ollama was the easiest way to set up local LLMs for me. https://ollama.com/

With llama3.2:1b, llama3.2:3b and llama 3.1:8b being the main ones I tried and found impressive.

Re: New LLM optimization technique slashes memory costs

#152

Is it possible that after 3-4 years of performance optimizations, both algorithmic and in hardware efficiency, it will turn out that we didn’t really need all of the nuclear plants we’re currently in the process of setting up to satisfy the power demands of AI data centers?

No. This is a classic case of Jevon's paradox. Increased efficiency in resource use can lead to increased consumption of that resource, rather than decreased consumption. Example: 1. To decrease total gas consumption, more fuel efficient vehicles are invented. 2. Instead of using less gas, people drive more miles . They take longer road trips, commute farther for work, and more people can now afford to drive. 3. This…

[nitpick] it's the Jevons Paradox, named for William Stanley Jevons. No apostrophe, but if you were to add one, it would be Jevons' Paradox.

https://en.wikipedia.org/wiki/William_Stanley_Jevons

Re: New LLM optimization technique slashes memory costs

#153

Wonder how this compares with Microsoft's HeadKV paper [1] which claims a 98% percent reduction in memory while retaining 97% of the performance. [1] https://arxiv.org/html/2410.19258v3

Any real-world (open-source) implementations of this?

Re: New LLM optimization technique slashes memory costs

#154

Is it possible that after 3-4 years of performance optimizations, both algorithmic and in hardware efficiency, it will turn out that we didn’t really need all of the nuclear plants we’re currently in the process of setting up to satisfy the power demands of AI data centers?

Jevons Paradox will take care of it[1]. The more efficiently a resource is used, the more demand there is for it.

The grave implication of Jevons paradox is that the fundamental conflict between sustainability and economic progress is not resolved solely by using resources more efficiently. It's a theory of supply chain constraints essentially. Once a resource is used more efficiently, its use is increased until the next most economically constrained resource hits its economically useful limit.

[1] https://en.wikipedia.org/wiki/Jevons_paradox

Re: New LLM optimization technique slashes memory costs

#155
post #48

Earlier quoted context omitted.

Nobody is building nuclear power plants for data centres. A few people have signed some paperwork saying that they would buy electricity from new nuclear plants if they could deliver it at a certain price, a price mind you that has not been done before. Others are trying to restart an existing reactor at three mile island (a thing that has never been done before, and likely won't be done now since the reactor was shu…

And unfortunately, gas and coal in the meantime. https://www.theguardian.com/technology/2024/sep/15/data-cent...

That article is terribly vague.

Electric cars are causing exactly the same problem.

Also the "recs" appear to be based on a lie. Overall, an increase in load can only be green if there is added new green generation to service that load.

Re: New LLM optimization technique slashes memory costs

#156

Earlier quoted context omitted.

Yes, the term is a bit clumsy. The way I think of it, people have desires (to drive on the highway), but are dissuaded from doing so by disincentives (it’s too busy). Adding a lane reduces the disincentive, so that latent desire is satisfied, until it reaches a new equilibrium.

Result: more people getting where they want to go.

But in the case of highways, they probably would have still gotten where they want to go by another route. The folly is treating highway capacity as being a "market" when really the decision making is much more dynamic and nuanced.

Re: New LLM optimization technique slashes memory costs

#157
post #82

Earlier quoted context omitted.

You have a sota multi-modal LLM running in your head at 20W, shared with best in class sensor package and top performing robotics control unit. There’s soooo much more to optimize.

I would argue that our sensor package is losing its lead very quickly-- audio performance is already on par with current tech and image processing is closing the gap very quickly as well (it helps a lot that silicon-based technology is much less constrained on bandwidth). Tactile sensing is still lightyears ahead, and I don't see that situation improving anytime soon...

chemical sensing is still quite good though.

Re: New LLM optimization technique slashes memory costs

#158

Earlier quoted context omitted.

They’re both exploring the same space of optimizing the memory needed by the KV cache which is essentially another name for the context window (no one elides the KV cache as otherwise you’re doing N^2 math to do attention). They’re exploring different approaches to achieve the same goal and they may be both possible to apply simultaneously to reduce the attention mechanism to almost 0 memory usage which would be real…

That sounds like a stretch to me. If not, I’m impressed how the articles can describe such similar things in such different terms.

The only memory mechanism within an LLM as far as I know is the attention mechanism where it compares all previous tokens to generate a probability distribution for the next token to generate. The attention mechanism has a thing called a KV cache to take the O(n^2) matrix math down to O(n) by caching and reusing the results of some math from previous tokens. The size of how many tokens the context will cover is called the context window (e.g. 128k for Llama).

The articles use very similar verbiage.

> The context window can be considered the model’s working memory

Snip

> Universal transformer memory optimizes prompts using neural attention memory models (NAMMs), simple neural networks that decide whether to “remember” or “forget” each given token stored in the LLM’s memory.

snip

> Meanwhile, by discarding unnecessary tokens, NAMM enabled the LLM model to save up to 75% of its cache memory while performing the tasks.

You just have to be familiar with the wording in the space and read enough literature. Here’s more direct wording from the NAMM paper:

> NAMMs use evolution to optimize the performance of LMs by pruning their KV cache memory. Evolved NAMMs can be zero-shot transferred to other transformers, even across input modalities and task domains.

This is all related work about shrinking the size of the KV cache as the context grows both due to memory and it also has a speed up effect since you’re not having to attend all the tokens (O(n) -> sublinear with the size of the context).

Context is critical in the LLM answering correctly and remembering all the information given to it + everything it said. Typical limits for open models these days are 128k but with techniques like this it could scale even further allowing better performance on thing like code completion.

Re: New LLM optimization technique slashes memory costs

#159

Earlier quoted context omitted.

And unfortunately, gas and coal in the meantime. https://www.theguardian.com/technology/2024/sep/15/data-cent...

That article is terribly vague. Electric cars are causing exactly the same problem. Also the "recs" appear to be based on a lie. Overall, an increase in load can only be green if there is added new green generation to service that load.

Except the alternative to electric are petrol/diesel cars which are worse than electric cars run on gas or coal. The pollution no longer occurs in population zones, and the grid can be cleaned up without changing the car.

The alternatives for these data centres are either build renewables or not build the data centres, both of which are better.

Re: New LLM optimization technique slashes memory costs

#160

Is it possible that after 3-4 years of performance optimizations, both algorithmic and in hardware efficiency, it will turn out that we didn’t really need all of the nuclear plants we’re currently in the process of setting up to satisfy the power demands of AI data centers?

We don't even know a tighter lower bound for matrix multiplies than O(n²). Naive is O(n³), strassen is O(n^2.8). And those are simple, low-level kernels. At the higher level we also do not know tight lower bounds. But we do know some loose bounds from nature, e.g. how much data and energy a human consumes over its lifetime.
Post reply on HN