AI Engineer

Stop Fine-Tuning to Fix Retrieval Problems — Anant Srivastava

1898 summary words 8 min summary Watch video

Start with the signal

8 min read

Summary

At-a-Glance

  • Verdict: Watch fully
  • Core thesis: Enterprise AI teams should deliberately assign information to prompts, retrievable memory, or model weights based on its role and rate of change, rather than fine-tuning to mask retrieval failures.
  • Why it matters: This is a practical architecture lens for agent systems: putting facts into weights or prompts creates stale answers, higher token cost, weak access control, and difficult-to-debug behavior.
  • Best use: Use it as a design-review framework for every agent knowledge source, especially before approving RAG changes, prompt expansion, or fine-tuning work.

Executive Summary

Anant Srivastava argues that the central engineering problem in enterprise AI is not selecting a model but deciding how knowledge reaches inference. Teams often accumulate an accidental architecture through normal iteration: prompt edits alter behavior, indexed documents become memory, and training examples embed patterns in weights. Without explicit ownership of these placement decisions, the same information can exist across layers and produce stale or contradictory outputs.

His governing distinction is simple: prompts are for small, stable behavioral instructions; memory is for current, large, citable, and access-controlled facts; weights are for stable reasoning reflexes or capabilities. The common failure is fine-tuning an assistant on changing documentation, runbooks, product facts, or support tickets because it gives poor answers. That usually bakes outdated facts into the model when the real issue is poor retrieval, chunking, filtering, or context selection.

Fine-tuning is justified only after humans have converged on a stable pattern, either because the base model lacks a capability or because a smaller specialized model can execute a high-volume task more cheaply. The speaker recommends treating the prompt, memory, and weights as a feedback loop: operational signals can become durable memory; repeated stable patterns can later become learned reflexes; and, after tuning, fewer in-context examples may need retrieval.

For agent builders, the durable lesson is to build a harness and governance process around these flows. In particular, retrieval systems need scoped metadata and filtering—not indiscriminate context expansion—and fine-tuned behavior requires drift monitoring because a previously stable decision boundary can move.

Key Takeaways

  • Claim: Knowledge placement across prompt, memory, and weights is an architectural decision that teams routinely make accidentally through ordinary product work. | Evidence: The support-assistant example accumulates prompt tone changes, retrieved refund policies, a product catalog shoved into context, and a fine-tune on six months of support tickets. When a new catalog launches, the agent can still name discontinued products because old catalog information leaked into the weights through ticket training. | Implication: Assign explicit ownership and review criteria to every prompt edit, indexed corpus addition, and training-data decision; otherwise conflicting representations of truth will accumulate across the system.
  • Claim: Prompts should encode behavior, not operational facts. | Evidence: Appropriate prompt content includes a SaaS support agent's professional tone, requirement to offer human escalation after three failures, and instruction to provide concrete next steps. The speaker defines prompts broadly as authored instructions, including system prompts and instructions held in Markdown or similar files. | Implication: Use the prompt diagnostic: is this small, stable, editable guidance about how the agent should behave rather than what it needs to know? If not, move it out of the static prompt. | Caveat: Important query-specific context may still be placed in the context window when relevant; the objection is to using prompts as a store for catalogs, policies, or other large factual corpora.
  • Claim: Memory—including both agent memory and external RAG-backed enterprise data—should hold knowledge that is current, too large for prompts, citable, or scoped by access rights. | Evidence: Examples include refund policies, organizational code repositories, and user-specific information. The speaker emphasizes that production systems need source citation and that access control must be enforced in memory so one user cannot retrieve another user's data. | Implication: Treat retrieval as the authoritative path for changing enterprise facts and permissions, rather than embedding those facts in a static prompt or model weights.
  • Claim: More retrieved context does not compensate for a model that cannot reason, and broad unfiltered retrieval can actively confuse it. | Evidence: For a code assistant, Srivastava recommends code-aware chunking, potentially using ASTs, plus denormalized metadata such as repository identity and users authorized to commit. This avoids a 'RAG mush' of many irrelevant chunks returned to the model. | Implication: When answers are weak, inspect retrieval quality first: chunk boundaries, metadata, filters, authorization scope, and ranking—not merely the number of documents injected into context. | Caveat: Graph-based RAG can support certain reasoning paths, but it does not replace the need for a model capable of reasoning over the retrieved evidence.
  • Claim: Fine-tuning should teach stable reflexes or capabilities, not changing facts; poor answers from documentation assistants are frequently retrieval failures mislabeled as a need to fine-tune. | Evidence: The speaker rejects fine-tuning on changing runbooks and procedures because it creates outdated answers; the model instead needs the correct documentation chunks at inference. He similarly notes that ICD-10's roughly 70,000 medical codes remain factual knowledge to retrieve, while format understanding and selecting the right coding pattern are potential fine-tuning targets. | Implication: Separate domain facts from task execution patterns. Fix RAG before using fine-tuning, and reserve training data for repeatable transformations, classifications, or decision reflexes. | Caveat: Stability alone is insufficient justification for fine-tuning; it should also address a genuine capability gap or reduce cost at meaningful volume.
  • Claim: The strongest fine-tuning candidates emerge after human review converges on a stable center while a contested edge remains under human control. | Evidence: For ambiguous tasks such as content moderation or claims processing, a frontier model can make recommendations while humans correct it. Over time, override rates may flatten, revealing a stable core appropriate for fine-tuning and a disputed boundary that should remain human-reviewed. | Implication: Use human-override data as an operational signal: fine-tune only the high-consensus segment, retain escalation for contested cases, and make drift detection a required part of the deployment plan. | Caveat: The stable center can drift, so it must be monitored after deployment; a frozen model boundary becomes harmful if policy, norms, or task definitions change.
  • Claim: Prompt, memory, and weights should operate as a managed learning loop rather than isolated layers. | Evidence: Session/context signals can become durable memory; recurring retrieval patterns and input formats can move from memory into fine-tuning; once the model learns a format reflexively, examples of that format no longer need to be retrieved for every request. | Implication: Build a control plane that records what is retrieved, which patterns recur, where failures originate, and which knowledge is eligible to graduate from runtime context into a trained capability.

Detailed Brief

Decision framework: what lives where

  • Claims: The primary sorting axis for whether information could enter weights is its rate of change.; The speaker's compressed framework is: prompt equals behavior, memory equals facts or what the system should know, and weights equal how the system should reason or act.; A fine-tuned smaller model may be economically attractive for high-volume, patterned work even when a frontier model can already perform the task.
  • Evidence: The fine-tuning diagnostic asks whether the information has stopped changing, whether humans have converged, and whether the objective is capability improvement or cost reduction.; The speaker argues that frontier models are often capable enough already, making cost rather than capability the more common valid driver for specialization.
  • Caveats: The framework is explicitly presented as a strong default rather than an absolute rule; exceptions can exist.; Training on broad factual domains may also demand more training data than teams anticipate, aside from creating staleness risk.
  • Implications: Require a written placement rationale for each material information source, including change rate, citation requirement, permission scope, and whether it is a fact versus a behavioral reflex.; Model-routing and fine-tuning decisions should include unit economics and expected volume, rather than treating fine-tuning as the automatic quality escalation path.

Architecture ownership and operational failure mode

  • Claims: The dangerous failure mode is not only deliberate escalation from prompt to RAG to fine-tuning; it is the accumulation of many small uncoordinated edits across those layers.; The model itself is comparatively easy; the differentiating engineering asset is the surrounding harness that stores information correctly and circulates it between layers.
  • Evidence: In the product-catalog scenario, no individual decision appears unreasonable locally, but their combination causes the deployed system to retain obsolete products after the source catalog changes.; The speaker characterizes the resulting system as an architecture that was accumulated rather than designed, with nobody asking where a piece of knowledge should live.
  • Caveats: No concrete implementation stack, governance workflow, evaluation metric, or drift-detection method is provided; this is an architecture lens rather than an end-to-end implementation guide.
  • Implications: Treat source-of-truth conflicts across prompts, vector stores, databases, and training sets as a production risk category, not merely an evaluation defect.; Create lifecycle rules for updates and removals so changing facts are corrected in retrievable sources and are not silently retained in model behavior.

Notable Concepts & Terms

  • Accumulated architecture: An unintended AI architecture created by independent prompt, retrieval, and training decisions over time, causing duplicated or stale knowledge.
  • Prompt as behavior layer: The layer for stable instructions, persona, tone, escalation rules, and other guidance for how an agent should act.
  • Memory: An umbrella term covering user/agent memory and externally managed enterprise knowledge retrieved through RAG; it is the home for current, large, citable, and permissioned facts.
  • Lost in the middle: The degradation risk when excessive context is inserted into prompts, making relevant information harder for the model to use.
  • RAG mush: A poorly filtered collection of retrieved chunks that overwhelms or confuses the model instead of grounding its answer.
  • Fine-tuned reflex: A stable learned capability such as interpreting an input format or selecting among known formats, distinct from memorizing changing facts.
  • Stable center and contested edge: A human-feedback pattern in ambiguous workflows where high-consensus cases can potentially be automated while disputed cases remain escalated.
  • Memory-to-weights loop: The proposed lifecycle in which repeated, stable runtime patterns can become trained behavior, which then reduces the need to retrieve examples on each request.

Operator Notes / Why Ken Should Care

  • Adopt a mandatory knowledge-placement review for agent changes: classify each addition by behavior versus fact, change rate, citation need, access scope, and capability versus cost rationale.
  • Audit existing fine-tunes for accidental factual leakage from support tickets, runbooks, catalogs, policies, or other changing operational documents; identify where stale outputs can persist after source updates.
  • For each RAG system, add retrieval observability that can distinguish missing retrieval, bad chunking, bad filtering, authorization filtering, ranking failure, and genuine model-reasoning failure.
  • Require code-aware chunking and repository/user metadata filters for code retrieval rather than relying on generic chunking and broad similarity search.
  • Before fine-tuning, establish a human-override convergence threshold, retain an escalation lane for contested cases, and define post-deployment drift monitoring.
  • Maintain a source-of-truth register showing whether critical facts currently appear in prompts, retrievable stores, or training data, with an owner and update/removal path for each.

Source/Metadata

  • Title: Stop Fine-Tuning to Fix Retrieval Problems — Anant Srivastava
  • Transcript words: 4716
  • Duration seconds: 1211
  • Timestamp note: No usable timestamps or chapters were present in the supplied transcript; the latter portion substantially repeats the earlier talk.
Full transcript 2669 words · 21 min read
0:12

# Transcript How do you decide what to put where? For most enterprise AI systems, the interesting engineering problem is not the model itself. The model consumes tokens and produces tokens. Your knowledge lives in files, databases, and APIs. The key architecture decision is how that knowledge reaches inference. From the prompt or the context, through the retrieval or memory layer, or by model adaptations such as fine-tuning. Today, I'm going to argue that this is a decision that most enterprise teams make by accident. And the path to making it on purpose is to recognize that this is not a ladder that you climb. These are three different tools for three different jobs.

0:36

So how is this an accident? Well, there are two mechanisms. One is the obvious one. The other one, not so much. So the obvious one is that teams escalate. You don't get the right answer from your model. The easy thing is go put something in the front of a prompt. Go fix the prompt. Still wrong? Maybe there is something with the memory system or the retrieval system. Let's take a look there. Even then, if you're wrong, you know what? Let's fine-tune the model. It doesn't happen very often. But yes, sometimes teams reach out to fine-tune the model.

0:51

There is a layer underneath it. The teams that are not escalating are still making these decisions every day. Every edit that you make to the prompt decides what behavior lives in the prompt. Every document that you index decides what knowledge is held in the memory. And every training sample that you identify will bake something into the weights. All these are architecture decisions. None call themselves that.

1:03

Let me make it concrete for you all. I've seen this play out. An internal support assistant just released. In a few weeks, the product manager makes some changes to the prompt to fix the tone of the support assistant. After a few weeks, the support team adds refund policy documents to your retrieval on memory systems. I'll talk about retrieval and memory. I'm treating it all as memory, but I'll come to that. And then, since your agent is not giving you the right answers, an engineer shoves the product catalog into the prompt. And after a few weeks, the machine learning team decides to fine-tune the model on support tickets from six months ago.

1:12

All decisions look fine, except one, by the way. But even I have made such decisions in my journey without really giving it a lot of thought.

1:19

So when the new product catalog is launched, it looks easy, right? Oh, the engineer has shoved the product catalog into the prompt. Let's put the new product catalog there. And you would think that everything is working fine. But your agent is still giving you product names that don't even exist.

1:21

How did that happen? Well, the product catalog leaked into the weights when you fine-tuned it on your support tickets. And that is the accident. Your architecture was accumulated. It was not designed. That is the accident. It is what six months of normal product work led to. Nobody owned it, meaning everybody owned a piece of it. Nobody asked the diagnostic question. Nobody asked where this thing should live. And the rest of the talk is about the lens.

1:25

So the first part is prompt. What is the job of the prompt? The job of the prompt is behavior. It's tone. It's the persona of the agent. Things that are small, stable, and editable. The wrong job for the prompt is to store facts. You don't put product catalog into the prompt because you are unnecessarily providing context to your model and paying the cost for it. And when you have too many tokens, you run into the lost in the middle problem. The diagnostic for prompt is, is the knowledge small, stable, and about how to behave rather than what to know?

1:33

A concrete example for a good prompt use case is a customer support agent for a product SaaS. This agent has a professional tone. It offers human escalation after three failures. And it provides concrete next steps. None of this changes per query per user. This exact thing belongs to the prompt. And one other thing is, prompt is not only the system prompt. I'm talking about authored instructions for your model. So they could also come from markdown files. They could also come from other things. But this is what I mean by prompt here.

1:38

The second path is memory. The job of memory is to ground your model or your agent in knowledge that is current, large, and citable. Current meaning it changes faster than you can fine-tune. Large is because it cannot be held in your prompt. And citable because production AI systems need to be able to point to the source of the knowledge. This is what belongs to memory.

1:40

When I use the term memory, people think of agent memory—knowledge that is acquired about a person who is interacting with the agent. What I'm also referring to here is external memory, which you retrieve using RAG, like the refund policies. It's not being managed by your agent. It is managed by an external application. That is included here. So I'm talking both about the agent memory and the memory of the enterprise.

1:45

The wrong job for memory is shoving behavior in or thinking about how to reason with the memory. Of course, you can have a graphical RAG which will help the agent do reasoning, but that's where you stop. For reasoning, you've got to have the right model because if your model cannot reason over two or three or five documents, it won't be able to reason over 50 that you provide. The more context doesn't help if it's not able to reason.

1:48

So the diagnostic question you need to ask is, is the knowledge too large to fit and changing faster than I can retrain? And another important aspect is whether it has some access control, whether it is scoped per user. You have to have that in memory. If there is some kind of access control where this user cannot see another person's information or data, you have to have that knowledge in memory because then you can control who sees what.

1:51

A good example for storing something in external memory is a code assistant which has access to all your repos as an organization. Would you fine-tune your model to learn the code? No. It's simple. It changes. You wouldn't do that. You'd fine-tune your model to learn reflexes, not facts, typically. And would you stuff it in the prompt? No, you don't stuff such things into the prompt. You may add certain things that are important in the context window. That's something different. But you wouldn't stuff the entire code base into the prompt or even a part of it if it has no use there.

1:55

Now, the other important thing is when you build a RAG system for your code, you need to make sure that you're chunking properly. You're using code-aware chunking with AST, perhaps. And then the other important thing is use filtering. You should denormalize things such as what repo this code is for. You get a code chunk. You have to create metadata about which repo it belongs to, what are the users who are allowed to commit, and all that. Because that is what is going to help you get the exact data that you need versus creating a RAG mush where you are returning a lot of chunks back from the database and confusing the model.

2:00

So again, the diagnostic is something that's too large to fit, changing faster than you can retrain the model, and it's scoped at a certain level. It could be a user. It could be a repo or whatever. All that knowledge belongs to memory. It could be external memory, which is your application's database, or it could be your agent memory as well. Now, let's come to the more interesting part, which is weights. So what belongs to the weight? Something that stopped changing. That is what belongs to the weight. And the only axis that drives this is rate of change. You can lock in what has stopped changing and perhaps retrain.

2:10

I'm not saying just lock in what stopped changing and go retrain your model. No. That's not what you do all the time. You have to have a very strong reason to fine-tune your model. So what you do is you lock in what's changing and then go from there. But if you get it wrong, then you could freeze a boundary that's still moving. And it's not as subtle as like, hey, can I reach? Would I read? Nobody is going to fine-tune their model on pricing list. Nobody does that. It is more subtle than that.

2:23

A current version of that is, let's say there is an internal document assistant and the support team decides to fine-tune the model because it's not giving the right answers. So to teach the domain, they say, you know what? Let's fine-tune this model on our documentation or maybe runbooks and procedures.

2:30

And what happens with that? There is an issue. If you do that, your model will be giving you information that's old. This was actually a retrieval problem. If the model was not giving the right answer, what the model needed was the right chunks, the right pieces of documentation. So instead of fixing the retrieval problem, the team actually went ahead and fine-tuned the model. That's not what you should do.

2:38

Runbooks and procedures, these are facts. These belong to your external memory. That is where these things should reside. If your model is not giving the right answers, fix the retrieval problem. Don't just go ahead and fine-tune your model.

2:41

And if you reverse it, a good use case where I could fine-tune is a hard, ambiguous problem, such as content moderation or claims processing. When you begin, you can use a frontier model that makes recommendations and humans correct it, although inconsistently. Over a period of time, patterns will emerge. You will have a center which is fixed and stable, and then you will have the contested edge. The rates of human overrides will flatline after a certain point, and you will most likely emerge in a pattern where you have a contested edge where you still need humans, but a center which is pretty stable.

2:46

Now, that center is something you can fine-tune your model on. But when you do that, you have to monitor for drift. Is there a drift in my center? And if that happens, then you're going to run into a problem. And actually, a stable version of that is medical claims coding. Doctors' notes are mapped to codes, like ICD-10 codes, for different purposes, like insurance purposes and all that. There are 70,000 of such codes, by the way.

2:55

Would you fine-tune your model to learn those codes? They don't change so often. You won't. That's fact. That's knowledge. You should not be looking at fine-tuning your model. One of the obvious reasons is that they change sometimes. And the other is you will need large training data to even fine-tune your model on it. What you fine-tune your model on is the reflex. Whether it is understanding the format of the input and when you have to make selection across the formats, like which one is the right one, that's where you fine-tune your model to do that.

3:03

So the diagnostic for fine-tuning is, has the information stopped changing? Have the humans converged? And more important, you should have one of these two reasons. Are you fine-tuning because your model is not capable? Or are you fine-tuning to save cost? A lot of times it's not capability. Frontier models are quite capable. It usually comes down to cost. If you have a nice pattern in your work, you can perhaps use a small model, fine-tune it, and run the volume cheap.

3:10

So if you don't remember anything from the talk, this is a simple one. This table helps me decide. You can bounce your current AI system against this and decide. This is the lens that helps you decide what lives where. Of course, there can be exceptions. I'm not saying this is always the rule. There can be exceptions to this. But prompt is more about behavior. Memory is about what to know and facts. And weights are about how to reason. And this is the architecture. Your prompt or your context window, your memory, and your fine-tuning needs to circulate. You need to build the right harness around it so that these things can circulate.

3:17

Your prompt or your context window has information. It generates signals. Some of them becomes durable memory. When you are restarting a new session, things get pulled out from the memory into the prompt or context window. And that's when you are going from the memory to the prompt. So a lot of teams have built this architecture. But what people are looking to focus on building is the right side. The memory to fine-tuning flow.

3:23

Now, what happens is when you build an agentic system, over a period of time, you will have retrieval patterns. You will have formats that you think the model should reflexively know. So those things move from your memory to fine-tuning. Once you are fine-tuned, what is worth retrieving changes. If you have fine-tuned your model on the formats of notes and the ICD codes, you don't have to retrieve certain examples from your memory or external memory each time and provide it to the model. Because now the model knows the format reflexively. You don't have to provide examples to it that, hey, this is the format or that is the format.

3:29

So that's weights to memory. And so basically, this becomes a loop over a period of time. And the agent gets better at its job by virtue of doing its job. That's the architecture.

3:43

So what I would like to conclude with is the model is the easy part. What you build around the model, the harness around the model that helps you store the right information at the right place and circulate among them is the key architecture that you have to build. Thank you. I have made such decisions of doing such things without really giving it a lot of thought.

3:58

So when the new product catalog is launched, it looks easy, right? Oh, the engineer has shoved the product catalog into the prompt. Let's put the new product catalog there. And you would think that everything is working fine. But your model or your agent is still giving you product names that don't even exist. How did that happen? Well, the product catalog leaked into the weights when you fine-tuned it on your support tickets. And that is the accident.

4:35

Your architecture was accumulated. It was not designed. That is the accident. It is what six months of normal product work led to. Nobody owned it, meaning everybody owned a piece of it.

4:57

Nobody asked the diagnostic question. Nobody asked where this thing should live.

5:06

Nobody asked where this thing should live. Nobody asked where this thing should live. Nobody asked where this thing should live. And the rest of the talk is about the lens.

5:15

So the first part is prompt. What is the job of the prompt? The job of the prompt is behavior. It's tone. It's the persona of the agent. Things that are small, stable, and editable. The wrong job for the prompt is to store facts. You don't put product catalog into the prompt because you are unnecessarily providing context to your model and paying the cost for it. And when you have too many tokens, you run into lost in the middle problem. The diagnostic for prompt is, is the knowledge small, stable, and about how to behave rather than what to know?

6:01

A concrete example for a good prompt use case is a customer support agent for a product SaaS.

6:15

Now, this agent has a professional tone. It offers human escalation after three failures. And it provides you concrete next steps. None of this changes per query per user. This exact thing belongs to the prompt. And one other thing is, prompt is something, I'm not only talking about system prompt, I'm talking about authored instructions for your model. So they could also come from MD files. They could also come from other things, right? But this is what I mean by prompt here.

6:58

The second path is memory. The job of memory is to ground your model or your agent in knowledge that is current, large, and citable. And citable. Current meaning it changes faster than you can fine tune. It changes every now and then. Large is because it cannot be held anywhere. It cannot be held in your prompt. And citable because production AI systems need to be able to point to the source of the knowledge. This is what belongs to memory. memory. Now, when I use the term memory, people think of agent memory, knowledge that is acquired about people, about a person who is interacting with the agent, right?

7:46

What I'm also referring to here is external memory, which you retrieve using RAG and all that, like the refund policies, right? It's not being managed by your agent. It is managed by an external application. That is included here. So I'm talking both about the agent memory and the memory of the enterprise, okay? The wrong job for memory is shoving behavior in or thinking about how to reason with the memory. Now, of course, you can have a graphical kind of RAG which will help the agent do reasoning, but that's it. That's where you stop. For reasoning, you've got to have the right model because if your model cannot reason over

8:35

two or three or five documents, it won't be able to reason over 50 that you provide. The more context doesn't help if it's not able to reason. So the diagnostic or the question you need to ask is, is the knowledge too large to fit, changing faster than I can retrain? And another important aspect is whether it has some access control, whether it is scope per user, you have got to have that in memory. If there is some kind of access control that this user cannot see the other person's information or the data or whatever, you've got to have that knowledge in memory because then you can control who sees what.

9:17

A good example for storing something in external memory or memory is a code assistant, which has access to all your repos as an organization.

9:33

So would you fine-tune your model to learn the code? No, it's a simple one, right? It changes where you are. You wouldn't do that. You'd fine-tune your model to learn reflexes, not facts, typically. And would you stuff it in the prompt? No, you don't stuff such things into the prompt. You may stuff or you may add certain things that are important in the context window. That's something different. But you wouldn't stuff the entire code base into the prompt or even a part of it if it has no use there.

10:07

Now, the other important thing is when you build a Rack system, for your code, you need to make sure that you're chunking properly. You're using code-aware chunking with AST, perhaps. And then the other important thing is use filtering. You should denormalize things such as what is the repo this code is for. You get a code chunk. You have to create metadata about which repo it belongs to. What are the users who are allowed to commit? And all that. Because that is what is going to help you get the exact data that you need versus creating a rag mush where you are returning a lot of chunks back from the database and then confusing the model.

10:58

So again, the diagnostic is something that's too large to fit, changing the faster than you can retrain the model. And it's scoped at a certain level. It could be a user. It could be a repo or whatever. All that knowledge belongs to memory. It could be external memory, which is your application's database. Or it could be your agent memory as well.

11:24

Now, let's come to the more interesting part, which is weights.

11:31

So what belongs to the weight?

11:36

Something that stopped changing. That is what belongs to the weight. And the only access that drives this slide is rate of change.

11:46

You can lock in what has stopped changing and perhaps retrain. I'm not saying just lock in what stopped changing and just go retrain your model. No. That's not what you do all the time. You have to have a very strong reason to retrain your model. So what you do is you lock in what's changing and then go from there. But if you get it wrong, then you could freeze a boundary that's still moving. Okay? And it's not as subtle as like, hey, can I reach? Would I read? Nobody is going to retrain their model on like, or fine tune, I meant, not retrain. Sorry. Fine tune their model on pricing list. Nobody does that. It is more subtle than that.

12:24

And a current version of that is, let's say there is an internal document assistant and the support team or your team decides to fine tune the model because it's not giving the right answers. So to teach the domain, it says, you know what? Let's fine tune this model on our documentation. Let's fine tune the model on, or maybe not all the documentation, but runbooks and procedures. And what happens with that? There is an issue. If you do that, your model will be giving you information that's old. This was actually a retrieval problem. If the model was not giving the right answer, what the model needed was the right chunks, the right pieces of documentation.

13:17

So basically, instead of fixing the retrieval problem, the team actually went ahead and fine tuned the model. That's not what you should do. Runbooks procedures, these are facts. These belong to either your agent memory, not there, but of course your external memory. That is where these things should reside. If the model is not... Oh, sorry. That was... All right, who's that? So if your model is not giving the right answers, fix the retrieval problem. Don't just go ahead and fine tune your model, okay? And if you flip it, same axis. If you reverse it, a good use case where I could fine tune is, let's say it's a hard,

14:05

ambiguous problem, such as content moderation or claims processing, right? When you begin, you can use a frontier model that makes recommendations and humans correct it, although inconsistently. Over a period of time, patterns will emerge. Patterns will emerge and you will have sort of a center which is sort of fixed and stable, and then you will have the contested edge.

14:36

The rates of human overrides will flatline over after a certain point, and you will most likely emerge in a pattern where you have a contested edge where you still need humans, but a center which is pretty stable, okay? Now, that center is something you can fine tune your model on, okay? But when you do that, you have to monitor for drift. Is there a drift in my center? And if that happens, then you're going to run into problem. And actually, a stable version of that is, I don't know, have you heard of medical claims coding? I think we must have, like ICD-10 codes. Doctors' notes are mapped to codes for different purposes, like insurance purposes and all that.

15:19

So, Mount Sinai and IMO Health actually, there are 70,000 of such codes, by the way. So, would you fine tune your model to learn those codes? They don't change so often. You won't. That's fact. That's knowledge. That's you should not be looking at fine tuning your model. One of the obvious reasons is that they change sometimes. And the other is, you will need a large test data, training data to even fine tune your model on it, okay? What you find in your model is on the reflex.

15:57

Whether it is understanding the format of the input and whether it is able to, and when you have to make selection across the formats, like which one is the right one, that's where you fine tune your model to do that, okay?

16:15

So the diagnostic for fine tuning is, has the information stopped changing? Have the humans converged? And more important, you should either have one of these two reasons. Are you fine tuning because your model is not capable? Or are you fine tuning to save cost? And a lot of times, it's not capability. Frontier models are quite capable. It usually comes down to cost. If you have a nice pattern in your work, you can actually perhaps use a small model, fine tune it, and run the volume cheap, right?

16:58

So if you don't remember anything from the talk, this is a simple one, right? This table helps me decide. You can bounce your current AI system against this and decide. This is the lens, basically, that helps you decide what lives where. Of course, there can be exceptions. I'm not saying this is always the rule. There can be exceptions to this, but prompt is more about behavior. Memory is about what to know and facts, and weights are about how to reason, okay?

17:32

And this is the architecture. Your prompt or your context window, your memory, and your fine tuning needs to circulate. You need to build a right harness around it so that these things can circulate.

17:51

Your prompt or your context window has information. It generates signals. Some of them becomes durable memory, okay? Now, when you are restarting a new session, things get pulled out from the memory into the prompt or context window. And that's when you are going from the memory to the prompt. So this is, a lot of teams have built this architecture. But what people are looking to, are focusing on building is the right side. The memory to fine tuning flow, okay? Now, what happens is when you build an agentic system, over a period of time, you will have retrieval patterns. You will have formats that you think the model should reflexively know.

18:34

So those things move from your memory to fine tuning. Once you are fine tuned, so that's memory to weights. Once you are fine tuned, what is worth retrieving changes? If you have changed, if you have fine tuned your model on the formats of like notes and the ICD codes, you don't have to retrieve certain examples from your memory or external memory each time and provide it to the model. Because now, the model knows the format reflexively. You don't have to provide examples to it that, hey, this is the format or that is the format. So that's weights to memory. And so basically, this becomes a loop over a period of time.

19:18

And the agent gets better at its job by the virtue of doing its job. Okay?

19:28

That's the architecture. So what I would like to conclude with is the model is the easy part. What you build around the model, the harness around the model that helps you store the right information at the right place and circulate among them is the key architecture that you got to build. Thank you. Thanks for coming up.

Reading tools

Type to find a passage

Appearance
Ask this transcript

Add a note