podcasts / No Priors: Artificial Intelligence | Technology | Startups / episode
No Priors: Artificial Intelligence | Technology | Startups cover art
podcast
📅 ⏱ 36 min episode · summary ~2 min read 📝 Transcript · 6,292 words 🎙 Tengyu Ma

Tengyu Ma: No Priors: Artificial Intelligence transcript

No Priors: Artificial Intelligence | Technology | Startups · Transcript & summary by WhipScribe

A Stanford researcher who is also building retrieval tools explains, with concrete cost and accuracy numbers, why he thinks RAG will outlast the long-context alternative.

Read the transcript
🔔 Get every new No Priors: Artificial Intelligence transcript by emailOne email per new episode. Unsubscribe in every message.
One email per new episode, unsubscribe in every message. Not shared with the publisher.
In this episodeVoyageStanford UniversityOpenAIAnthropicGoogleGemini 1.5 ProGPT-4Adam optimizerCitadelMistralLLaMAClaude

▸Chapters

Tap a chapter to play it from that moment in the show's own player.

▸Key takeaways

01Tengyu Ma, who co-founded Voyage after teaching at Stanford, says most RAG systems fail on retrieval quality rather than on how hard they are to connect.
02Voyage fine-tunes its embedding models on about 2 trillion code tokens and 1 trillion legal tokens, then ships them without any customer data.
03Ma says domain fine-tuning lifted retrieval accuracy by 5% to 20%, with code gaining 15% to 20% because it had the most room to improve.
04Ma says a company with 100 million tokens faces roughly a 100x cost gap between long-context models and RAG, about $100K versus $10 million.
05Ma predicts RAG stacks will shrink to a large language model, a vector database and an embedding model, with the models handling chunking and formatting.

▸Notable quotes

“I didn't use any of the proprietary data so that everyone can use them.” Tengyu Ma · at 23:51 — ▶ hear it from here
“So once the embedding models are more clever, then maybe one round or two rounds is going to be enough.” Tengyu Ma · at 20:13 — ▶ hear it from here

▸What this episode covers

Tengyu Ma, a Stanford computer science professor who co-founded the embedding company Voyage, traces his research from early matrix completion and sentence embeddings to optimizers and reasoning. He argues the field is shifting toward efficiency because training data and compute are both running short. He also says foundation models have made applying AI inside companies far simpler than it was seven years ago, which is why he judged the timing right to commercialize his work.

On retrieval-augmented generation, Ma's central claim is that retrieval quality is the bottleneck. A language model that sees the right documents can answer well, but most teams find the search step is where answers go wrong. He compares long-context models unfavorably with RAG on cost, using a company with 100 million tokens of documents as the example, and likens retrieval to a memory hierarchy where a short-term context window should not hold an entire library. He treats agent chaining as largely a separate direction that still relies on embedding models, and expects iterative retrieval to matter less as embeddings improve.

Voyage builds embedding models and rerankers, fine-tuned on domains such as code and legal text, where Ma reports accuracy gains of roughly 5% to 20%. Smaller embedding dimensions keep search fast under tight latency budgets. His practical advice is to prototype early, measure retrieval and end-to-end answer quality separately, and swap components where they fall short. He ends by predicting simpler stacks of a few strong models plus a vector database.

Have a recording of your own? Paste a link or upload it.

WhipScribe sends back a timestamped transcript, like the one on this page.

Every recording starts with a free preview. Full transcripts come in packs from $4 for 300 minutes. Uploads up to 10 hours or 5 GB.

▸Tengyu Ma on No Priors: Artificial Intelligence: the answers

Who is Tengyu Ma?

Tengyu Ma is an assistant professor of computer science at Stanford and the co-founder and CEO of Voyage, which trains embedding models and rerankers for retrieval systems.

What did Tengyu Ma say about Voyage?

Tengyu Ma said Voyage starts from a general-purpose base embedding model and then fine-tunes it on domain data such as code and legal text. He said the domain models are released publicly because they were trained without any proprietary customer data, and that they gain most in one domain while changing little elsewhere.

“I didn't use any of the proprietary data so that everyone can use them.”Tengyu Ma · 23:51

What did Tengyu Ma say about Adam?

Tengyu Ma said Adam is about 10 years old and is still the default algorithm for training large language models, even though many optimizers have claimed improvements over it. His lab spent years on a replacement, and one of its papers, called Sophia, was reportedly used by a Meta researcher in multimodal training at over 100 billion parameters, with about a 1.6x efficiency gain.

“So optimizers, you know, I think people have tried in the last 10 years for so many times.”Tengyu Ma · 3:10

What did Tengyu Ma say about Stanford University?

Tengyu Ma said he came to Stanford partly because the university has a strong industry connection that many other universities lack. He said entrepreneurship was already part of his career plan, and that he later took leave to commercialize his research through Voyage.

“I think I came to Stanford partly because there's a very strong industry connection here at Stanford compared to some of the other universities.”Tengyu Ma · 3:58

What did Tengyu Ma say about GPT-5?

Tengyu Ma said that a 10x efficiency gain in training would cut the cost of training GPT-5 from about $100 million to $10 million, which he thinks would change the industry. He said his lab, which lacks industry-scale capital, should focus on breakthroughs three to five years away rather than on improving OpenAI's models directly.

“students at the lab is that we should think about what will be the breakthrough in three to five years”Tengyu Ma · 34:17

What is Tengyu Ma's main argument on No Priors?

Tengyu Ma argues that retrieval quality is the bottleneck in retrieval-augmented generation, and that RAG will stay much cheaper than long-context models, which would cost roughly 100 times more for a company with 100 million tokens. He predicts RAG systems will become simpler, built from a few strong models and a vector database.

Mentioned in this episode

Episode facts

Released
June 6, 2024
Length
36 minutes

▸Questions this episode answers

Q1What did Tengyu Ma say about RAG versus long context on cost?

Tengyu Ma argues that long-context transformers are far too expensive for enterprise document collections. For a company with about 100 million tokens, he says the gap with RAG is roughly 100x, around $100K versus $10 million. Caching internal activations cuts the cost, but he still expects retrieval to stay much cheaper, and he predicts that gap will persist as models and GPUs get cheaper.

Q2How does Tengyu Ma say RAG retrieval quality can be improved?

Tengyu Ma says teams can improve RAG either by upgrading the neural networks, meaning embedding models and rerankers, or by improving the software around them, such as chunking, iterative retrieval and metadata. Voyage focuses on the networks, which it trains on trillions of tokens and fine-tunes for specific use cases. He says most users find that better retrieval directly improves the final answer.

Q3What did Tengyu Ma say about domain-specific embedding fine-tuning?

Tengyu Ma says Voyage starts from a general base embedding model and then continues training on domain data, using about 2 trillion code tokens for its code model and 1 trillion legal tokens for its legal model. He says these models gain 5% to 20% on targeted domains with little change elsewhere, because a model with a limited parameter budget has to specialize.

Q4What is Tengyu Ma's prediction for how RAG systems will change?

Tengyu Ma predicts RAG systems will become simpler, built from a few strong components: a large language model, a vector database, an embedding model and possibly a reranker. He expects the models to handle messy input formats, multimodal data and chunking, so the software layer on top becomes thin. He says this is partly his own bias, but he believes the direction is right.

Q5What did Tengyu Ma say about agent chaining and iterative retrieval?

Tengyu Ma says agent chaining is mostly orthogonal to embedding models and rerankers, because agent systems still use embeddings, iterative retrieval and language models as parts of a chain. He thinks iterative retrieval is useful now because embedding models still have headroom. Over time, he expects it to matter less, since one or two rounds of retrieval will be enough once embedding models get better.

Q6Why did Tengyu Ma start Voyage while teaching at Stanford?

Tengyu Ma says he chose Stanford partly for its strong industry connections, and that entrepreneurship was already part of his career plan. He judged that 2024 was the right time to commercialize because foundation models had matured, so applying AI inside companies had become much easier than when he began teaching the applied machine learning course seven years earlier.

Q7What did Tengyu Ma say about academia's role in AI during the age of scaling?

Tengyu Ma says academia cannot compete on scaling up large models because it lacks the capital, and that even a non-profit approach would not raise enough money. He says university labs should focus on breakthroughs three to five years away, such as cutting the cost of training optimizers by 5x to 10x, and on reasoning tasks that need new research rather than more data.

▸Transcript

Our own transcript of the public episode, with a timestamp about every 90 seconds. Tap a timestamp to play the episode from there in the show's own player; the link button on a paragraph copies a link that opens this page there.

0:00Setting up the RAG versus long-context debate

0:00Welcome to No Priors. Today we're talking to Tengu Ma, Assistant Professor of Computer Science at Stanford, and the co-founder and CEO of Voyage. Voyage trains state-of-the-art components for next-generation retrieval systems, including embeddings models and re-rankers. We're really excited to talk about his research and the RAG debate today. Welcome Tengu. Yeah. Thanks so much. Thanks for having me here. We're looking forward to the debate. Yeah. Why don't we start with just a little bit of an overview of your research agenda to date? Because I think uniquely it covers a broad range of fields within and around deep learning from theory to RL to embeddings and optimizers. So can you talk a little bit about sort of how you pick the directions you have?

0:47Tengyu Ma's research path from theory to LLMs

0:47Yeah, so I think most of the papers I wrote have some theoretical thinking in it. I guess maybe that's the commonality. And besides that, I think I worked on quite a few topics, as you mentioned, ranging from the theoretical understanding, mathematical proofs of deep learning systems, to all the way to practical large-language models, reinforcement learning, deep reinforcement learning. And these days, recently, I think what we are working on is more centralized to efficiency of training the large-language models and improving the reasoning tasks for large-language models. So my vision is that in the future, the efficiency is very important because we are running out of data and compute. So we have to either use the data much better and use the compute much better.

1:34And also reasoning task seems to be a pretty important direction. And also in some sense, kind of like a risky direction in the sense that we don't know exactly how fast we can solve those challenging reasoning questions yet. Can you mention a few of the key papers or work that you or students in your lab have done just so our listeners can look them up? In the very early days, I think I worked on some of this matrix completion optimization for matrix completion. That's like 10 years ago. And then I move on to embedding models like sentence embeddings, vector embeddings. One of the papers we wrote is a very actually simple paper where we average the word embeddings to get sentence embeddings.

2:24And then we did some of these transformations using PCA to make the performance much better. That was even before Transformer came out. And then I think I move on to Transformers, large language models, and contrastive learning, which is the new way of training the embedding models, especially the direction started with some of the papers on using contrastive learning for images. And we work on improving those and understanding why contrastive learning can work. And recently, we work on optimizers for large language models. For example, one of the papers we wrote last year was SOFIA, where we found that we have a new optimizer which can improve the training efficiency by 2x for pre-training.

3:10Optimizer work and a 1.6x training speedup

3:10This is great. Adam is very old at this point. Yeah, he's 10 years old now. I think that's the interesting part about it. So optimizers, you know, I think people have tried in the last 10 years for so many times. There were so many papers published um which has um improvements over item in various cases but so far item is still the default algorithms for training large English models and that's why we thought that it's the time to uh really um we spent a lot of time on this like I think I started probably around 2018. And I asked a few students to work on this. And finally, we had one paper out after a few years, after a few failed projects and failed ideas. And recently, I think one of the Facebook friends

3:58actually used this in their large-scale multi-model training. And they found that on that scale, I don't know exactly how many parameters they are, but I assume it's kind of more than 100 billion parameters. They found that on that scale, there is a 1.6X improvement in the efficiency of the training. So that's like $10 million versus $16 million. That's super exciting. Yeah, I think Sophia has an opportunity to be really, really impactful. You started a company last year taking leave from Stanford. Given your work has been like theoretical, but with practical applications, like what drove you to do that? I think I came to Stanford partly because there's a very strong industry connection here at Stanford compared to some of the other universities. And also probably entrepreneurship

4:52is just part of my career plan anyways. And in terms of the timing, I felt that this is the right timing in the sense that the technologies are more and more mature so that it seems that the commercialization is the right timing right now. So for example, I think one story I have is that I look up some of my slides deck for my lectures at Stanford CS299 seven years ago when I started to teach at Stanford. At that point, machine learning, we have a lecture with Chris Ray and the machine learning on applied machine learning. So how do you apply machine learning industry? And there are seven steps there. So the first step is you define your problem. The second step is you collect your data and you choose the loss function,

5:42you train it and you iterate so on and so forth. So it's pretty complicated at that point. And now the foundation model arrives to power and in a new foundation model era, the only thing you have to do is that you have to, you know, someone will train a foundation model for you and then you train a prompt and you add a retrieve argument generation on top of it. And that's pretty much that's it. So applying machine learning AI to an industry environment is much, much easier than seven years ago. And that's why I felt that this is probably the right time to commercialize many of the technologies because the technologies are more mature. Yeah, this is actually, I mean, a core premise even for the investing fund that I started a conviction

6:27in that, you know, somebody's doing the bulk of the work for you in a more general way. And so the application of AI in industry is just much, much cheaper, right? Because you only do, you know, the last few steps and, or different set, but last few steps in essence. So maybe you can talk about like the, you know, just given wide range of research, the problem you focus on with Voyage that you saw with customers. Yeah, so with Voyage, I think we are mostly building these two components, rewrank and embeddings for improving the quality of the retrieval or the search system. So the reason why we focus on this is because we talked to so many customers and we found that right now for implementing Rack,

7:11Why retrieval quality is the RAG bottleneck

7:11the bottleneck seems to be that, you know, it's not very hard to implement it, right? You can just connect the components and have your Rack system ready very quickly. But the bottleneck seems to be the quality of the response. And the quality of the response is heavily affected or is kind of almost bottlenecked by the quality of the retrieval part. If the large-enriched model see very relevant documents, then they can synthesize very good answers. Even like LAMA7DB can do that very well. Can you just give like a sort of general intuition for like what a RAG system is and some of the applications of it? Yeah, so I guess just a little bit of background. So a retrieval argument generation, the idea is that there's a retrieval step, there's a generation step.

7:53RAG basics and where teams deploy it

7:53So the main point here is that if you just use a large language model as a black box, you know, as is, then the large language model wouldn't know anything about the proprietary information inside the company. And it doesn't know enough context about the use cases. And the retrieve augment generation stack is about you first retrieve some knowledge from, for example, inside a company, and then use this knowledge and give the knowledge to the Latin push model so that the Latin push model can generate or synthesize a good answer without any hallucination. This has been found to be very, very useful to reduce the hallucination rate. And so there's two steps. The first step is to retrieve some relevant information given

8:36the query, and then this relevant information are given to the large-tanglish model. The retrieval step is important because once the large-tanglish model sees the relevant information, it can reduce the hallucination rate dramatically because it uses the relevant information as an anchor to refine the answers in some sense. And what we are doing here is that we want to improve the quality of the retrieval or the relevancy or accuracy of the retrieved documents and information. And the way to do this is that there are two steps. The first step is that you vectorize all of your documents or all of your knowledge base. So you turn the documents to vectors, you turn the videos into vectors. You turn your code into vectors.

9:18Code into vectors, everything to vectors. And so the vectors are the representations of each piece of the knowledge or documents, and all the other indices. So and then you put these vectors into a vector database, and then you search the relative information using the vectors as indices. Where are you seeing RAG applications today? Like what are what are customers building? Or, you know, what are the most common systems? Yeah, so we have a lot of users and they are all over the places. I think, you know, we have even a customer who is a chemistry company who is building this RAC system to understand their chemistry documents or products in descriptions. And I think just it's almost everywhere,

10:05like finance, legal, code retrieval, code generation, so on and so forth. I think it can be applied to almost any cases and also for even for individual users where you have a lot of like individual personal information and you want to have a rack system on a phone so that you can access your past information in a much more easy way. And you want to retrieve, for example, we all have seen that, you know, when you search your documents on your laptop, it's actually pretty hard. You have to use the exact file name. It will be much easier if this search can be semantic based. RAG is a relatively new architecture. I think your average enterprise technology leader had not heard the term before the last year or so, and it became popularized

10:53in a researcher for the last few years. But there is already a debate, I think, you know, in terms of opinions from people at different large labs and in academia about whether or not you need a RAG architecture to work on proprietary data. And just to sort of describe some of the alternative views, I think there's kind of two alternative points of view given. One is a sort of agent chaining architecture where you are inputting your data and knowledge, you know, chemistry, code, law, finance, whatever documents into a series of LLMs that just operate with instruction on it, for example, to summarize or categorize it. Or you simply feed everything into LLMs with infinite context or actively managed context versus explicitly vectorizing anything.

11:51Long context versus RAG on cost

11:51And so I would love to get your reaction to that as an alternative to RAG. Actually, there was also a debate last year about RAG versus fine tuning. And I think that debate was kind of like getting to a consensus now. It sounds like rack is much easier than fine-tuning. And fine-tuning in many cases doesn't work because you need a lot of data to see the results and there are still hallucinations even after fine-tuning. And now, as you said, the debate becomes rack versus agent changing or long context. So maybe let's talk about long context first. So I think there are probably two answers to this from different angles, because long context right now is not practical yet. So we have to kind of anticipate what long context transformer can do and then do the

12:43debate at a future time in some sense and then do the debate at a future time in some sense or anticipate the debate at a future time in the near term i think the long context transformer where you just put in all the proprietary data 1 billion tokens into the context of the transformer so um will be very very expensive right If you use the price right now, it's going to be just impossible to do it. It's probably like five, 10 magnitudes of difference depending on how many documents you have in the context. Of course, you know, you can bring the cost down by, for example, one approach is you cache the activations of all of the internal operations of the documents you put in the context. So that will bring the cost down by a lot.

13:27But I think still, if you do the calculation, theoretically, it's still much more expensive than RAC. So I think that's the more practical answer. So in terms of cost, it's going to be much more expensive than RAC because you have to save all of these activations or intermediate computations in the GPU memory, most likely, or maybe in CPU memory of all the 1 billion tokens contacts. You may argue that, okay, over time, everything will become cheaper and cheaper, but RAG will be cheaper as well, right? Because many of the technologies under RAG are NewRite work-based and the GPUs will be cheaper as well, right? Because many of the technologies under RAG are neural network-based and the GPUs will become cheaper,

14:09the neural networks will become smaller. So my prediction is that RAG will be much cheaper than long context going forward. And another way to think about this is that maybe just from the first principle, right? So my analogy of long context is that, so in some sense, the context is the short-term memory in some principle, right? So my analogy of log context is that, so in some sense, the context is the short-term memory in some sense, right? And the reg is more like long-term memory in some sense. So the question is, you know, for example, you know, when you answer any question, why you have to go through the entire library every time, right? Like put all of the entire library in your short-term memory

14:41for answer a single question, right? It sounds like the right approach should be that for a single question, right? It sounds like the right approach should be that for every single question, you retrieve some subset of the information and use those to answer the question. That seems to be the most efficient way to do that. It should be some kind of hierarchies in some sense in terms of how we solve the problem so that we can get the best efficiency. Even when we do the computer architecture, like the hardware stuff, right? So you have a different level of caching, right? So you have disk, you have CPU cache and so forth. So in that sense, I feel like the more hierarchical two-level kind of like system like RAC is more cost efficient.

15:22Long-term memory and the hierarchy argument

15:22Yeah. I mean, the analogy certainly makes sense. I think there is another thread of discussion of like, what does long-term memory for LLMs look like where, you know, it is something managed by the LLM itself. But I do not think that is a well-answered question and like RAG may just be a part of that answer. So the embedding model that we run are in some sense the large language model that are managing the long-term memory. Of course, there might be variants and other ways to manage the long-term memory, but I think it will be somewhat similar. It's going to be like more, you know, the technology always evolves, right? Gradually, right? So maybe two years later, Voyage or maybe other companies will have a new version of the long-term memory, which is based on, you know, embedding models, but kind of like extending the embedding model in some way.

16:10That's entirely possible. Yeah, I do think it's useful to sort of contextualize for people who are not working with sort of data sources for LLMs at scale every day, like what sort of token limitations are, right? You know, we go from a few thousand tokens to something like Gemini 1.5 Pro, a context window of a million tokens, right? And so if that's short of that in word count, that's maybe five books or like 25, 30,000 lines of code and obviously like limited amount of video and audio. And so I think the ability to make reasoning decisions on more than that amount of data is obviously going to be needed. And hence the questions are to me are really like, you know, does efficiency matter both from a cost perspective and a speed, like a latency perspective, right?

17:06And how much can you push the context window? And like, you know, does hallucination management matter? And so I think there are lots of arguments for like RAG being very persistent here. Yeah, yeah, exactly. And just to add a little bit on that. So 1 million tokens, 5 books, right? So but many companies have 100 million tokens. That's 100x difference, right? So 100x, you know, for cost is a big difference. That could be just, you know, $100K versus like $10 million, right? $10 million is unacceptable, but 100K sounds okay. Yeah, I think that's probably what's going to happen. Like, so at least for many of the companies, right? So right now, if they have 100 million tokens, I don't think they can use long context transformers at all because it's way too expensive.

17:49Agent chaining as an orthogonal, iterative system

17:49Right. And the simplest thing for me is actually for a system to look at the entire code base or some representation of the entire code base versus the portion of it that could fit into context today. Yeah. What about the other piece, like the idea of agent chaining and using LLMs to manage the data in that form? So agent chaining, this is a growing area and many people are doing research on it. I think it's a little bit less well defined in some sense. On the first level bit, I would say is that I think it's kind of orthogonal to embedding models and re-rankers to some degree, because even when you have agent chaining, you still probably use embedding models as part of the chain, right? You probably do iterative retrieval as part of the chain.

18:35And of course, you use large-language models as part of the chain as well. In some sense, it's orthogonal direction. So I probably would rephrase the agent chaining as more like an iterative, multi-steps, retrieval, augmented, large-language model, augmented system. So some part of this retrieval probably is done by a large-language model. Sometimes part of the system is done by a small large-language model. And some part of the system is done by embedding model, so on and so forth. So in that sense, I feel like it's somewhat kind of orthogonal. Yeah, and I feel like some of the motivation for agent chaining to begin with is the same efficiency motivation as RAG. Yeah, exactly. Right. But if you use a very, very large language model to manage the system, the knowledge

19:22system, I think you again lose the efficiency, right? So it has to be a somewhat kind of like smaller model to manage the knowledge. And then at that point, embedding model might be the right thing to do in that agent training framework. Maybe another angle to look at this is that whether we should do iterative retrieval versus just retrieve at once. I think iterative retrieval is definitely useful, especially because now there are still a lot of headroom in the embedding model's performance. So that's why sometimes you have to retrieve multiple times because the models are not clever enough. However, in the long run, my suspicion is that iterative retrieval will be useful, but it will be a bit less useful if the embedding models become more and more clever.

20:13Iterative retrieval and how embeddings improve

20:13So once the embedding models are more clever, then maybe one round or two rounds is going to be enough. If we go ahead and just assume that RAG is at least a dominant architecture for enterprise use cases where you care about proprietary data that is large with reliability, how do you go about improving like a RAG system, right? You can improve the LLM itself, but what are the other components that you guys are working on or what are the maybe challenges from the user, the builder's perspective to improve retrieval quality? Yeah, so I guess there are a few ways, right? One way is that you improve the prompting of the large language models. So for example, you could tell the large language models to abstain

20:54if there's no relevant information in the retrieved documents. But because the large language models are so good these days, I think you don't need a lot of prompting anymore. It just responds to the instructions so well. And then the next thing is to improve the retrieval part, which is the bottleneck, in my opinion, because most of our users found out that if they improve the retrieval quality directly, that affects the response quality. And improving the retrieval part, I think there are two ways. One way is you improve the embedding model. One way is that you improve some of the other things on top of that. For example, how you trunk the data, whether you do iterative retrieval, whether you put

21:34in some of the meta information in the data, so on and so forth. So basically I would say there are two ways of improving. One way is you improve the neural networks, either the embedding models or the rewrapers, or you improve the ways to use the networks with software engineering, right? Better trunking iterations or other kind of like heuristics or kind of like tricks on top of that. So, and what we are specialized in is that we want to improve the neural networks because that requires a lot of heavy lifting. That's a very data-driven approach. We train our networks on trillions of tokens, at least, and we fine-tune them for special use cases. And this is something that probably a company should do instead of like every,

22:16the users, the end users should optimize themselves. And my long-term vision here is that some of the software engineering layers on top of the networks will be less and less needed when the networks are more and more clever. So for example, right now we already see that trunking becomes less needed because the context window becomes longer and longer and the long context embedding model, no, relatively long context embedding model. Long context here means like 10K, for example, maybe 16K so that you can put 50 pages PDF into it. Because this long context embedding model becomes much better, there's less of a need to trunk the documents into pieces of like five, 12 tokens. And I think this will happen, you know,

23:00in other dimensions as well, right? So maybe in the future, you don't have to turn your images into description images and then give it to the text embedding model. That's what people are doing right now. Like everything is turned into text and then use a text embedding model. But when the embedding models are more clever and multi-model, then you don't have to do that anymore. Can you talk a little bit about just like the intuition for how fine-tuning or domain-specific embeddings improves performance? Yeah, fine-tuning and domain-specific embedding models are what we are very good at at Voyage. So just to have some context here, so what we do is that we start with a general-purpose base embedding model, which is also what we trained from scratch. And from there, we first fine-tune or continue pre-train, whatever you call it,

23:51Domain-specific embeddings for code and legal

23:51on some domain-specific data. So for example, we fine-tune on two trillions of code snippets, tokens, and then we get a code embedding model. And we do the fine-tuning on one trillion legal tokens, and that's how we got the code embedding model and we do the fine tuning on 1 trillion legal tokens. And that's how we got the legal embedding model. And this domain specific embedding models, I didn't use any of the proprietary data so that everyone can use them. But they really excel in one particular domain and the performance in other domains are not changed much. And the reason why we do this is because the number of parameters in the embedding model is limited. So because you only have like you have a latency budget, something like maybe one second, sometimes like 200 milliseconds.

24:33You know, some people even want 50 milliseconds. And then basically it's impossible to use more than 10 billion parameters for embedding models. And we have limit parameters. Any customization is very important because customization means that you use the limit number of parameters on the right tasks, the right domain, so that you excel in that domain. There's no way that you can use these 10 billion parameters to excel in everything. So that's why you have to specialize in one domain. And we have seen like 5% to 20% of improvements by this domain-specific fine-tuning, depending on the particular domains. For code, we have seen 15% to 20% of improvement, partly because we have a lot of data there.

25:16And the headroom there is also bigger because code retrieval requires a lot of deep understanding of the algorithmic part of the code. And for legal domain, the baseline is a little better so that the headroom is slightly smaller. So that's why we see 5% to 15% improvement depending on the data sets. For some of the very complex legal data sets, we have seen bigger improvements. Just to make sure that our listeners can picture exactly where the latency cost is coming from here. In a search system, like your data, you know, has been vectorized by an embeddings model, but then every query also needs to be translated into an embedding and then compared to the embeddings of your knowledge in order to feed that LLM for the generation that you want, right?

26:04And so there's inference time latency here as well. I just think that's not obvious if somebody hasn't built a rack system. Yeah, exactly, exactly. So basically, at inference time, you have to first turn the query into vectors and then do the search with vector database. And actually, related to this, the dimension of the vectors you produce also affects the latency for the vector based search. If the dimension of the embedding is only 100, then it's going to be much, much faster than when the dimension of the embeddings is 1000. And actually, this is something we are very good at as well. So we produce embeddings that is like a 3x or 4x smaller dimension than some of the competitors. Yep. That makes, I mean, intuitively you are creating embeddings models that use a

26:52Latency budgets and smaller embedding dimensions

26:52limited number of parameters and dimensions just given the sort of latency budget that you, that any application has to create the best possible representation of proprietary data or domain-specific data. Yeah, exactly. And going back to the domain-specific and fine-tuning, so the second level of customization is that we can customize to a particular company, right? So we fine-tune on the proprietary data of a particular company, and we can see 10 to 20 percent improvement on top of the domain specific in fine tuning as well so of course there's a total budget in terms of how much additive improvements you have there right so if you start with like 50 accuracy then you only have 50 percent headroom but if you start with 90 you only have 10 headroom so so the

27:42the improvement the absolute improvement varies a little bit across the domains. Maybe just advice to people who are building RAG systems. At what point do they begin to invest in, you know, some of these retrieval components? Yeah, I think they can do it even from day one as long as they have a prototype, you know, available, right? So basically my default suggestion for our users is that when they have the rack, you know, first of all, of course, you want to connect the components and at least see some response and then probably do some kind of like basic profiling in terms of the latency and the quality, right? So you can check the retrieval quality, meaning that how often you retrieve relevant documents.

28:27There are some default ways to evaluate the retrieval quality. And then you also do the end-to-end evaluation for the responses. And then you can see which part is the bottleneck. And in many cases, people found that the retrieval quality is not good, so that the final response is not good. And then you can swipe some of the components. You can say, I'm going to try voyage embedding. I can try the voyage rerankers, which we haven't discussed too much about. And you can try various different embeddings and possibly various different large language models as well. Maybe just zooming out, you started by saying, in order to have the debate about RAG versus alternative architectures for working on proprietary data, you need to predict forward, right?

29:18Predicting simpler RAG stacks ahead

29:18Any predictions for how these systems change as LLMs improve dramatically, right? If we look at the next generations of OpenAI and GPT and Claude and the Mistral models and LAMA and such? Yeah, so my prediction is that the system will be simpler and simpler. Maybe this is my biased view. So at least this is something that we are working towards. So the idea would be that it's a very, very simple system. So you just do, you just have three components, like large English model, vector database, and embedding models, and maybe four components, another rewanker, which refine the retrieved results. And you connect all of this, and each of the new artworks does everything else. You don't have to worry anything about trunking, multimodality, changing the data format, because

30:06New York works and do most of them, right? So seven years ago, if you talk to any of the so-called language models seven years ago, you have to turn the format into a very, very clean format. And now you talk to GPT-4, you can have typos, you can have all kind of like a weird format. You can even dump JSON files to it, right? So the same thing would happen for embedding models as well. So my vision is that in the future, AI will just be that a very simple software engineering layer on top of a few very strong neural network components. Yes, I think the bias toward it is actually all going to be AI versus complex, you know, discretized software systems is clear, but I believe directionally right. Maybe zooming out to just get a little bit of your perspective as a founder, like, you know, what's one or two top learnings you have about starting the company as an academic before even, you know, despite your work with Google and other

31:05companies before? Yeah, I think it's very, very different. Founding a company is very different from doing research at Big Tech. And also even from, actually, it's a little bit closer to being academia because to run a university lab, I'm the CEO, CTO, CFO, and HR for the university lab, right? So you touch on a little bit of everything, but at a slightly different scale, right? So I think one of the biggest thing I learned actually is from one of our angel investors is that I should read some of the books. Even those, I think for probably experienced entrepreneur, many of the books are very basic, but for me, they are very, very useful when I read some of the, are very basic but for me they are very very useful uh when i read

31:46some of the even the basic books um including elad's book by the way uh so but his book is a little bit um advanced in the sense that he's his book is talking about how to scale from 10 people to a thousand people and i only read a few chapters of that because we are about 10 people right now. So yeah, and also talking to a lot of angel investors, talking to Sarah and my other lead investors. So I think all of this helped me a lot in reducing the unforced mistakes in this process. To me, I think it's really about how to reduce the number of errors you make so that you can maximize the efficiency. At least this is what happens to me. Also, how to correct the mistakes as fast as possible. If you can correct mistakes every one week after you made them versus one month after you made them, then that's a 4x efficiency improvement.

32:45Very theoretically consistent in your vein of research. Last question, you have been personally productive, productive research lab, but you've started a company. What do you think the role of academia in AI is in this age of scaling? Because most of your former students, they essentially all work at OpenAI or Anthropic with, you know, a few professors and Citadel folks in the mix and the ones working with you, right? Yes, yes. In academia, this is a little bit controversial topic. I think different people have different views. My view is that I think academia probably should work on some different questions from what industry is good at, right? So if we are just only working on how to scale up the system, then obviously the incentive

33:35Academia's role in an era of scaling

33:35is not right. We don't have enough capital there. And, you know, even OpenEye, I guess, Seth Altman argues that you need a lot of capital to start to do this in some sense. So, you know, like at the very beginning, I think the point is that, you know, you first have it cannot be non-profit because if it's non-profit, then you don't have enough capital and you cannot scale up enough. I think I kind of agree with that. And that's why in academia, it's very hard to scale up and have enough resources to do the large-scale research. However, I think in academia, there are many, many other things that we can do on a smaller scale, and we probably should focus on more long-term innovations. So what I told my

34:17students at the lab is that we should think about what will be the breakthrough in three to five years, as opposed to how do you help OpenEye to improve their large language models in GPT-5. So that's why we work on optimizers, which is like 10 years old. The item is a 10 years old optimizer. And we say, okay, that sounds like a long-term project. Maybe in five years, we can improve the optimization efficiency by five to 10x. That's going to be a game changer for the whole landscape, right? So if we improve the efficiency by 10x, I guess that's like $100 million versus $10 million for training GPT-5, then I think that would change the landscape a lot in the industry. So efficiency is one of the things

35:02I spend a lot of time on. Another thing is that there's reasoning tasks. I think the reason why I identified that as one of my lab's direction is because it's challenging and it requires a lot of very innovative research. It's very unclear whether you can really, the scaling law is really enough to get you to prove Riemann hypothesis or any of the math conjectures. And also you have to be superhuman performance in some sense, right? So if you turn on just the common crowd data on the web, can you be a good mathematician? It's kind of very hard to believe that. So we need more innovations there. So that's pretty much what we are doing at the university lab. We try to work on the three to five years agenda and on a smaller scale. I think that's an inspiring note to end on and

35:53like a very open-minded one about what is still to be figured out. Thanks so much for doing this, Tango. Thanks so much. Find us on Twitter at NoPriorsPod. Subscribe to our YouTube channel if you want to see our faces. Follow the show on Apple Podcasts, Spotify, or wherever you listen. That way you get a new episode every week. And sign up for emails or find transcripts for every episode at no-priors.com.

Have a recording of your own? Paste a link or upload it.

WhipScribe sends back a timestamped transcript, like the one on this page.

Every recording starts with a free preview. Full transcripts come in packs from $4 for 300 minutes. Uploads up to 10 hours or 5 GB.

▸More from No Priors: Artificial Intelligence | Technology | Startups

No Priors: Artificial Intelligence | Technology | Startups cover art
How the ARC Prize is democratizing the race to AGI with Mike Knoop from Zapier2024-06-11 · 26 min
No Priors: Artificial Intelligence | Technology | Startups cover art
How YC fosters AI Innovation with Garry Tan2024-05-23 · 39 min
No Priors: Artificial Intelligence | Technology | Startups cover art
Can AI replace the camera? with Joshua Xu from HeyGen2024-06-20 · 27 min
No Priors: Artificial Intelligence | Technology | Startups cover art
The Data Foundry for AI with Alexandr Wang from Scale2024-05-22 · 39 min
No Priors: Artificial Intelligence | Technology | Startups cover art
State Space Models and Real-time Intelligence with Karan Goel and Albert Gu from Cartesia2024-06-27 · 34 min
No Priors: Artificial Intelligence | Technology | Startups cover art
Music consumers are becoming the creators with Suno CEO Mikey Shulman2024-05-16 · 30 min
New No Priors: Artificial Intelligence | Technology | Startups transcripts by email
One email per new episode, unsubscribe in every message. Not shared with the publisher.