HomeVideos

Intelligence Efficiency, Ben Geist | Compile 26

Now Playing

Intelligence Efficiency, Ben Geist | Compile 26

Transcript

283 segments

0:00

So today I'm going to be talking about

0:04

intelligence efficiency, right?

0:07

And how we can maximize it.

0:11

I'm going to start off with three graphs.

0:20

And I want to talk about where we are today as an industry

0:23

and where I think we

0:24

should go.

0:26

So where are we today, right?

0:28

ChatGPT came out, LLM boom occurred,

0:32

intelligence skyrockets over time. We've seen this, right?

0:35

We've all seen the benchmarks. Intelligence is only increasing.

0:38

It's increasing at an exponential rate.

0:41

Right?

0:42

Additionally, with that,

0:44

we've seen tokens skyrocket over time.

0:47

We've seen token maxing occur in the industry, and we've seen industry as a

0:52

whole really adopt LLMs into their production processes,

0:56

causing this to occur.

0:59

Right?

1:00

But additionally, what I think we've seen

1:03

is that

1:05

these models are getting smarter, but they're not getting more efficiently

1:08

smart, right? The more money you're paying,

1:11

we see the state of the art over

1:12

here.

1:14

This is the fable. This is maybe last year's models.

1:17

The more money you're paying for intelligence is actually having

1:20

diminishing

1:20

returns, right? And this is not necessarily what the world

1:25

was sold, right?

1:25

We were sold with LLMs that you could buy intelligence at a unit

1:29

economic

1:30

price. But what we're actually paying for

1:32

is tokens, right?

1:33

And this is not true, right?

1:36

We all know this as technical folk.

1:39

We know that intelligence does not equal tokens,

1:43

yet people are trying to buy this but are actually purchasing this, right?

1:47

And there's a fundamental difference there that exists, and I think will

1:51

actually come to bite

1:53

the model providers in the ass a little bit, right?

1:55

We see this logarithmic curve to some extent, while folks want a more linear

2:00

curve, right?

2:04

Some data to back that up. I work at Ramp, like Dwarkesh said,

2:08

so we see a lot of this in the data as well.

2:11

Just some stats is that we've seen a 13X monthly token spend

2:15

since January

2:15

2025, and we've also seen some political things

2:19

happen in the

2:20

technological space, right? We've seen Uber,

2:22

we've seen Meta clamping down on

2:24

this token masking and really

2:27

making sure that this exponential doesn't necessarily continue as it affects

2:31

the bottom line.

2:32

We also recently did a version of SWE-bench of Ramp, and we saw this

2:37

more logarithmic curve, where intelligence

2:40

is actually getting less efficient

2:41

over time, not more efficient. And some of the research I've been doing

2:44

personally is how can we make sure that this graph is more linear rather than

2:48

more logarithmic, right? And what I found is

2:51

that context seems to really be

2:52

the key in order to provide for the models, we provide more context, they tend

2:57

to become more efficient and need less work to complete the same

3:00

processes.

3:01

I want to give some mathematical foundations of this.

3:04

So the way I think about LLMs,

3:07

and AI as a whole,

3:09

and agentic processes, is that they are really entropy

3:14

reduction machines, right? So entropy is a measure of chaos in a state.

3:18

And if you think about LLMs, what they do is they take very high

3:21

entropy

3:21

states, they take PDFs, they take information from the web,

3:25

they take

3:25

information from very scattered fields and a prompt, and they organize it

3:30

into what the user is asking for, right?

3:32

They fundamentally reduce the entropy of state.

3:34

I think out of this

3:36

field of thought, we can actually derive equations

3:39

that show how introducing

3:40

context into the field makes LLMs and AI as a whole more efficient.

3:45

So there's two fundamental views of entropy.

3:48

There's an information theoretic view of entropy, which is a Shannon entropy

3:54

definition, which says that the entropy of a state after an

3:57

observation is

3:58

fundamentally reduced. I think this is pretty obvious, right?

4:01

You have some chaotic system, you measure it,

4:04

you understand a little bit more,

4:05

and so the chaos of the system, at least our local representation,

4:08

is reduced,

4:09

right? Additionally, the thermodynamic view of entropy says

4:14

that the amount you can reduce entropy in a system is

4:18

upper bounded by the amount of work you put in.

4:21

And combining these two equations, we can see that there's an upper bound on

4:26

the change of entropy in a system,

4:30

both from the work you put in and from the information we already have

4:34

about

4:34

the system.

4:35

The way I explain this to people is let's say you're cleaning your room,

4:38

right?

4:38

You have to know where the dirty clothes are to then put in the work and put

4:42

them in the right place, right? So to reduce a chaotic system to a

4:47

less chaotic system, you have to have both.

4:49

And I think modern LLMs really focus on how much work we can put in, right?

4:53

Chain of thought, reasoning. We see that the more work you put in, you can

4:57

reduce the entropy system. We've seen it.

4:59

We know it's not linear, but it's true.

5:01

But they're not necessarily focusing on the information piece of it all, right?

5:06

And I'm going to give three examples,

5:09

to try to illustrate how providing context, memory information, whatever you

5:13

want to call it, into the system,

5:16

particularly in the latent space, can make LLMs more energy

5:21

or more intelligent, efficient. Okay?

5:23

And to give some context,

5:25

the current methods in the field to provide context are like RAG or memory,

5:30

but

5:30

we all know that these have problems, right? They don't scale that well.

5:33

They're typically used for needle in a haystack tasks or semantic search tasks,

5:38

and really struggle with multi-hop reasoning queries, right?

5:41

Where multi-hop reasoning, if you don't know,

5:42

is taking a bunch of facts,

5:43

putting them together, and constructing a logical answer from

5:46

that.

5:46

They also both happen in token space, which is fundamentally constrained for

5:50

the models,

5:52

rather than a latent space, right?

5:54

And I'm going to talk about three examples in the latent space that I believe

5:58

are efficient ways to convey context to the underlying models and increase the

6:03

intelligence efficiency.

6:05

So this is going to be in-

6:09

Multi-agent systems.

6:14

My chalk is getting small. Okay.

6:17

In the context window,

6:26

and as inputs, right? So

6:30

these are the three fields of research I've been looking at over the last few

6:35

months, and I want to explain them. So let's start with multi-agent systems.

6:39

So I'm going to give a model of multi-agent systems

6:41

and then explain how it can

6:42

be improved and the results we've seen from that improvement.

6:45

So multi-agent systems, we can say, pretty abstractly, there's a supervisor

6:50

agent, right? And then can spawn

6:55

worker agents.

6:59

Right? I'm pretty sure everyone

7:04

knows about this kind of stuff, right?

7:06

And they all complete a task, but let's say this is time down here.

7:12

The problem with this, right, is it's extremely inefficient.

7:16

The amount of tokens that this uses is really astronomical.

7:20

And in the current economic state where token maxing is largely

7:24

unsustainable, we need to fix this somehow, right?

7:28

Additionally, the supervisor agent, as it's doing work, is generating context.

7:32

It's exploring the system. We also see that the worker agents are all

7:36

generating their own context itself,

7:39

and this is not shared in the global state, right?

7:44

A context a worker discovers here might have been discovered here, and now

7:47

we're putting in extra work and becoming very inefficient, right?

7:52

So, part of the research I did is,

7:55

let's say we share context. We maintain a global state of context,

7:59

which I

8:00

did as a

8:01

global KV cache that was shared among the agents.

8:04

And we can, when we spawn a new agent,

8:07

take the task that it's spawned with, filter out the information we need from

8:11

the KV cache. We did this with a

8:14

compression algorithm, essentially.

8:15

And then spawn the worker with this initialized KV cache that essentially

8:20

contains the context of the system that's important to the worker, right?

8:24

When we

8:25

judge this system versus the system without context sharing on a multitude of

8:29

tasks, we saw, in total, there was a 42%

8:34

to 57%

8:37

reduction in worker agent tokens,

8:41

and a total reduction of 21% to 31%

8:45

total tokens with the same accuracy, right?

8:49

So they become highly more efficient just by producing shared context,

8:53

introducing information into the global system, right?

8:56

Additionally, some work I also did is about in-context learning,

9:01

right? We've all seen DeepSeeks release the

9:04

sparse attention model, right?

9:05

Or hopefully, we've all seen that.

9:07

And we've seen that sparse attention has really taken the industry by storm.

9:10

It makes sense, right? We need a more efficient way than dense

9:13

attention.

9:14

But the way I want to investigate sparse attention is modeling it as a

9:19

reranker model, right? Fundamentally, if you think of sparse attention, it's

9:22

looking at one token saying what information of the past tokens

9:26

are necessary

9:26

in order for me to generate the next token, right?

9:29

And this is very similar to how reranker models work in RAG.

9:33

And so I was wanting to say, okay, if this could model a reranker system, it

9:37

would be evidence that more efficient model was partly,

9:42

at least,

9:42

because of accurate context retrieval over its own token space,

9:48

or latent space, I guess. And so what we did

9:50

is we took the queries and the

9:52

keys generated by the Lightning indexer from the DeepSeek model, and we

9:56

computed document scores over a question-answer dataset that was

10:00

multi-hop to try to see if it would accurately get the right

10:04

documents for a

10:04

question. I'm just going to write the equations of

10:06

how we did that.

10:09

Feel free to come up to me after and ask about any of these because I'm

10:12

going

10:12

pretty quick.

10:14

But essentially, we took the ReLU of the cost of the normed

10:18

query over the queries. Basically, we have a dataset with

10:23

a bunch of documents and multiple-choice questions over those

10:25

documents.

10:26

The queries are from the questions in the multiple-choice dataset, and we

10:32

did this with the

10:34

normed keys from the docs itself.

10:36

And then we could compute a score

10:39

for each doc that was just a sum of these cost scores

10:43

times each head, and then we just took the mean over all

10:48

tokens in the doc,

10:49

right? And what we found is that using this pretty simple scoring

10:53

method

10:54

from the sparse attention mechanism, we actually match or

10:59

beat state-of-the-art

11:01

current reranker models, showing how this essentially mirrors a

11:05

reranker and is

11:06

essentially just context retrieval over the

11:10

context window. So here, two minutes left, but I just want to reiterate that

11:15

these are both examples of fundamental information introductions to the system,

11:20

context retrieval, that make the full system much more

11:23

efficient, right?

11:23

Sparse attention is way more efficient than dense attention.

11:26

Multi-agent systems, we showed that there was

11:29

a huge reduction in average tokens used in order to get the same result.

11:34

And the last thing I'm going to talk about is some work I'm doing with the SNAP

11:38

Lab at Stanford to reduce the number of tokens we actually need in the input

11:43

rather than the

11:44

output,

11:45

while maintaining state-of-the-art results.

11:48

So we have this idea of

11:51

when doing

11:54

LLM systems, why do we have to put the entire doc in

11:58

the context window when

11:59

doing RAG? Instead, what if we just treated memory or context

12:04

injection as a modality as we do text, as we do image, as we do video, where

12:08

it's a full modality onto itself, and how would that work, right?

12:12

And so what we did ... is we built a memory module,

12:15

is what we called it, where

12:17

we took docs in as well as a query.

12:21

This is over a multi-hop reasoning dataset.

12:24

We built an architecture that

12:30

took these in, produced 16 latent representations,

12:35

and then injected them directly into the frozen LLM. Here, we used Qwen 8B.

12:41

And our theory was, okay, if we can inject 16 latency

12:45

representations that

12:46

tend to take the information in the docs from the query that is necessary, how

12:50

will it perform? Directly into the frozen LLM.

12:54

What we found is using the trivia QA dataset,

12:58

we actually beat

13:00

RAG 50, where we took the 50 most relevant docs to

13:04

the query and injected them

13:05

directly in the context window in the token space by a fair margin.

13:09

So

13:11

using this approach, we could

13:13

inject the 16 latent space representations and get a 63% exact match

13:18

over the, like I said, the trivia QA dataset, while RAG 50 got a

13:23

55% exact match. And fundamentally, this actually used

13:27

372 times less tokens representations in the

13:32

input. So it's doing better. It's more intelligent, efficient,

13:35

while using

13:36

372 less tokens. So it's incredibly more efficient just by

13:40

introducing

13:42

the correct context through this method in the latent space.

13:45

Okay, so I hope that I've convinced you all

13:48

that latent space representations

13:50

of context and context retrieval is incredibly important in the LLM sense.

13:55

I want to leave you with what I think would be the holy grail of a

14:00

model that could introduce context accurately.

14:03

I think it should be low latency, so it can be used at inference time.

14:06

I think it should scale over large corpuses, and I think that there should be

14:10

essentially zero switching costs to the base LLM, so that when the next model

14:14

came out, you could introduce the most

14:17

state-of-the-art reasoning model while still maintaining this context

14:21

introduction into the global system.

14:23

These are research topics that I'm exploring so

14:25

that we can introduce them in

14:27

the large AI tooling systems that we're using at Ramp, such as Inspect,

14:31

where

14:31

we're actually only generating more context than we ever have before.

14:34

Thank you.

Interactive Summary

The speaker argues that despite the rapid advancement in LLM intelligence, the current approach to scaling—primarily through increased token usage—has become inefficient and unsustainable. To address this, the presentation proposes viewing LLMs as 'entropy reduction machines' and emphasizes that providing high-quality context, rather than simply increasing work (compute), is the key to achieving efficient intelligence. The speaker details research into three methods of context injection within the latent space: shared context in multi-agent systems, leveraging sparse attention as a reranking mechanism, and a novel memory module approach that outperforms traditional RAG while utilizing significantly fewer tokens.

Suggested questions

3 ready-made prompts