#5165: Weighting Memory in a RAG Pipeline

Daniel's memory leg won't fire. Turns out system prompts have no inherent vector-space privilege — but retrieval does have a real knob.

Featuring
Listen
0:00
0:00
Episode Details
Episode ID
MWP-5347
Published
Duration
35:02
Audio
Direct link
Pipeline
V5.2
TTS Engine
chatterbox-regular
Script Writing Agent
deepseek-v4-pro

AI-Generated Content: This podcast is created using AI personas. Please verify any important information independently.

Daniel's question was simple: is there a framework that lets you set the weighting of a composite prompt's inputs deterministically, as a mathematical parameter, instead of leaning on the system prompt to beg the model to pay attention? His premise — that system prompts have no inherent higher weighting in vector space — turns out to be correct, confirmed by two independent papers. Models attend to every token with uniform architectural privilege. A system prompt is just text that happens to arrive first.

The memory leg, though, does have a real knob. Grounded Decoding, from a group at Iowa State, constructs two probability distributions at every generation step: the full RAG distribution, and a retrieval-only distribution with the query omitted. It fuses them with a scalar called rho. When rho is zero, you get standard RAG exactly. As rho increases, the model anchors harder to retrieved documents. The adaptive variant scales rho by relevance and token-level divergence — in one trace, rho hits 1.92 on the token "nineteen forty seven" and drops to 0.06 on "the." The cost is roughly double the per-token decode latency.

Position bias makes things worse. The well-established U-shaped attention curve privileges tokens at the beginning and end of the input, and retrieved memory typically lands in the middle. A newer refinement from COLM shows the lost-in-the-middle effect is strongest when inputs occupy up to half the context window.

There's also a contested preprint claiming that enabling reasoning mode on Gemini 2.5 caused systematic disengagement from retrieved documents — exact match on HotpotQA collapsing from 37.6 to 13.6. The mechanism may be confidence: the probability a model uses retrieved information is inversely proportional to its confidence in its internal answer. The better the model reasons, the less it wants to consult the logbook. Standard fixes are positive constraint framing and citation requirements — not negative constraints, which the literature says fail.

Downloads

Episode Audio

Download the full episode as an MP3 file

Download MP3
Transcript (TXT)

Plain text transcript file

Transcript (PDF)

Formatted PDF with styling

#5165: Weighting Memory in a RAG Pipeline

Corn
Thirty-seven point six down to thirteen point six. That's what happens to a retrieval system when you switch on the model's reasoning mode. Exact match on HotpotQA collapses by sixty-four percent because the model starts ignoring the documents it just pulled.
Herman
That number is the whole episode in one line, honestly. Daniel's prompt this week is about our own pipeline, the one that assembles the system prompt, his question, and the logbook memory retrieval into one composite. He's noticed something. The memory leg doesn't seem to be firing, and he wants to know whether there's a framework that lets you set the weighting of those inputs deterministically, as a mathematical parameter, instead of leaning on the system prompt to beg the model to pay attention.
Corn
Right. And his premise is that system prompts don't have inherent higher weighting in vector space. Which is true. The model attends to tokens with uniform architectural privilege. A system prompt is just text that happens to arrive first. So the question is whether the recipe has a knob we can turn, or whether we're stuck with whatever the inference process decides to do on any given run.
Herman
And the answer, the part that surprised me, is that there is a real framework for exactly this. It's called Grounded Decoding, from a group at Iowa State. It doesn't weigh the system prompt against the user prompt, which is a gap worth naming. But it does weigh retrieval against the model's own parametric memory using an explicit scalar, and that's the leg Daniel thinks is dead.
Corn
Before we get to the scalar, let me put my finger on what he's actually describing. The pipeline feeds one long composite. System prompt, user prompt, retrieved vectors. The model doesn't know which part is which, not in any architectural sense. It just sees tokens. So if the memory retrieval isn't showing up in the output, the fix he's considering is to emphasize the lookup in the system prompt. And that, apparently, is the one intervention the literature says fails.
Herman
It fails because negative constraints compete with parametric activations during generation. Saying "do not use your prior knowledge" or "make sure you use the retrieved memory" is asking the model to suppress part of its own forward pass. The instruction gets processed, but it's fighting the model's internal confidence. There's a practitioner writeup from April that calls this the knowledge contamination problem. The model's parametric memory overrides the retrieved context. Quiet, confident, and extremely common.
Corn
Quiet and confident. That's what a model sounds like when it's ignoring the logbook. It doesn't announce it's skipping the retrieval. It just produces an answer that's plausible and wrong in a way you'd only catch if you knew what the vectors contained.
Herman
And the mechanism is worth sitting with. The probability that a model uses retrieved information is inversely proportional to its confidence in its internal answer. So the retrieval pipeline does the most work on questions where the model trusts itself least. Which means if our memory leg feels dead, it might not be a weighting problem at all. It might be that the model is confident enough in its own reasoning that it never needs to lean on the logbook.
Corn
That's a diagnosis, not a fix. But it reframes the whole thing. Daniel's asking for a mathematical parameter, and what you're saying is the default behavior is already a hidden parameter. Confidence. It's just not one we set.
Herman
Right. And the position problem makes it worse. There's a well-established U-shaped attention bias. Tokens at the beginning and end of the input get higher attention regardless of relevance. System prompt sits at the start. Retrieved memory typically lands in the middle. Worst possible real estate.
Corn
The middle seat of airplane rows.
Herman
The middle seat with the armrests already claimed. And there's a newer refinement from COLM last year. When inputs occupy up to half the context window, the lost-in-the-middle effect is strongest. Beyond that, primacy bias weakens and distance-based bias takes over. So depending on how long our composite is, the memory could be getting buried for different reasons.
Corn
So the system prompt isn't privileged by role, but it is privileged by position. And the memory retrieval is disadvantaged by position. That's a cheap hypothesis to test. Move the memory to the end of the composite, or restructure the order, and see if the episodes suddenly start referencing prior material.
Herman
That's the ten-minute experiment. Before anyone builds a dual-stream decoder. But Daniel's actual question is about deterministic weighting, and that's where Grounded Decoding gets interesting. The way it works is elegant. At every generation step, it constructs two probability distributions. One is the full RAG distribution, query plus documents plus prefix. The other is a retrieval-only distribution, documents plus prefix with the query omitted. Then it fuses them with a scalar parameter called rho.
Corn
So at each token, the model is effectively asking two questions. What would I say if I had the retrieved context? What would I say if I only had the retrieval and not the user's query? And then it blends the two.
Herman
And the blend is a closed form. The probability of a token under Grounded Decoding is proportional to the full distribution raised to one over one plus rho, times the retrieval distribution raised to rho over one plus rho. When rho is zero, you get standard RAG exactly. As rho increases, the model anchors harder to the retrieved documents. It's a grounding weight, and it's a single scalar you can tune.
Corn
That's the mathematical parameter Daniel was asking for. Not in the system prompt. In the decoding step.
Herman
And the traces are wild. In one sample, on the token "nineteen forty seven," rho is one point nine two. On the token "the," rho is zero point zero six. So the framework learns to crank the grounding weight when the next token is a factual claim and relax it when it's just grammar.
Corn
Which is the adaptive variant. The static version just holds rho constant. But the adaptive one scales it by a relevance score and a token-level divergence measure between the two streams. It's doing the thing Daniel wants, but it's doing it at inference time, per token, with actual math.
Herman
The cost is real, though. Roughly double the per-token decode latency. Twenty-five milliseconds versus twelve and a half in their setup. That's the price of running two distributions and fusing them. For a podcast pipeline that runs once a day, that's nothing. For a production system serving thousands of requests, it's a serious architectural lift.
Corn
So the framework exists, it's real, and it's expensive. But here's the part I want to sit with. Daniel's premise about the system prompt is confirmed by two independent papers. OpenAI's instruction hierarchy paper says it outright. Models often consider system prompts to be the same priority as text from untrusted users. And a paper from June of this year says production LLMs attend to every token with uniform architectural privilege.
Herman
Uniform architectural privilege. That's the phrase. So the system prompt has no special status. What OpenAI did about it was train the behavior in. Their instruction hierarchy work teaches models to selectively ignore lower-privileged instructions. They built a priority ladder, system message at the top, user messages below. And it improved defense against system prompt extraction by sixty-three percent.
Corn
So the fix for system prompt authority is training, not decoding. Fine-tuning with synthetic data and context distillation. Which means the system prompt and user prompt boundary is a learned behavior. The retrieval boundary is a decoding behavior. They're different problems with different solutions.
Herman
And that's the genuine gap in the literature. As far as I can find, nobody has built a runtime scalar for the system prompt versus user prompt split. Instruction hierarchy handles that boundary through training. Grounded Decoding handles retrieval through decoding. The composable multi-input stack Daniel's imagining doesn't exist as a single framework. What exists is a patchwork.
Corn
Which is itself a finding. The thing he wants is partially available. The retrieval leg has a knob. The system prompt leg doesn't. And the user prompt leg is just the query, which is the baseline everything else gets compared against.
Herman
Let me complicate the picture, because there's a contradiction worth airing. OpenAI says the hierarchy is learned, must be trained in. The uniform privilege paper says it's not inherent. Both agree it isn't free. But one treats it as a training problem, the other as a decoding problem. And then there's a third position from a preprint in April that makes a much more dramatic claim.
Corn
The reasoning paradox.
Herman
The retrieval-reasoning paradox. Single author, not peer reviewed, so treat it as a contested data point. But the claim is that enabling reasoning mode on Gemini two point five caused systematic disengagement from retrieved documents. The model got better at thinking and worse at grounding. A no-retrieval baseline showed retrieval offered no benefit at all to the reasoning model.
Corn
That's the number I opened with. Thirty-seven point six to thirteen point six. The reasoning mode actively undermined the evidence. So if our pipeline uses any kind of extended chain of thought, the memory leg might be failing not because of weighting but because the reasoning itself displaces the retrieval.
Herman
The paper's phrase is that extended chain of thought actively undermines evidence-based grounding. Which is alarming. It suggests that the more the model reasons, the more it trusts its own parametric memory over the retrieved context.
Corn
Which loops back to the confidence mechanism. Reasoning increases confidence. Confidence suppresses retrieval use. So the better the model gets at thinking, the less it wants to look at the logbook.
Herman
And the standard fixes for that are not what Daniel proposed. The practitioner writeup I mentioned found that negative constraints perform poorly. Instead, what works is positive constraint framing. Answer based solely on the following documents. Citation requirements are the strongest single intervention. And chain of thought grounding, where you force the model to reference the documents in its reasoning.
Corn
So the system prompt instruction "make sure you use the memory" is exactly the wrong shape. The right shape is "cite the memory" or "answer using only what's in the retrieved context." Positive, specific, verifiable.
Herman
And there's a framework called Prompt Fusion that tries to translate numerical weights into priority labels. It's a three-layer composition system. You give it a weight between zero and one, and it converts that into semantic labels. Weight above point six becomes critical priority, must follow. Below point two becomes optional consideration. The repo itself notes that numerical weights get ignored by LLMs, so it converts them to labels.
Corn
Which is an admission that the raw scalar doesn't work when it's just text. The model doesn't feel the difference between a point seven and a point eight. So the framework translates it into language the model has been trained to respect. It's a workaround, not a true mathematical weighting.
Herman
And that's the distinction. Grounded Decoding is a true mathematical weighting. It changes the probability distribution directly. Prompt Fusion is a prompt engineering layer that approximates weighting through semantic labels. One is deterministic in the way Daniel means. The other is still non-deterministic, just with better phrasing.
Corn
Let me ask the question I think is underneath his prompt. He's listening to the episodes and getting a sense that the prior episode memory isn't being queried. How would we actually diagnose that? What's the test?
Herman
The diagnostic distinction is between faithfulness and answer relevancy. Faithfulness measures whether the output is grounded in the retrieved context. Answer relevancy measures whether the retrieved context is actually relevant to the query. If the memory leg is dead, you'd see low faithfulness. The model produces coherent answers that don't draw from the retrieved vectors. If the retrieval is pulling junk, you'd see low relevancy. The vectors are there but they're the wrong vectors.
Corn
So the symptom he's describing, episodes that sound fine but don't seem to use the memory, that's a faithfulness problem. The model is producing plausible output from parametric memory, and the retrieved vectors are sitting there unused.
Herman
And the cheap test is to run the pipeline twice. Once with the memory retrieval, once without. If the outputs are indistinguishable, the memory leg isn't contributing. That's the no-retrieval baseline from the reasoning paradox paper. Delta of essentially zero.
Corn
That's a clean experiment. Same prompt, same system prompt, toggle the RAG query off. If the script doesn't change in any meaningful way, the memory was never being used. And then we know we're dealing with knowledge contamination, not retrieval failure.
Herman
And the fix, if that's the diagnosis, is probably not a mathematical parameter. It's a combination of position, moving the memory out of the middle, and positive constraint framing, telling the model to cite the memory. Maybe with a citation requirement built into the prompt.
Corn
But if Daniel wants the deterministic knob, Grounded Decoding is the answer. It's real, it's published, and it does exactly what he's describing for the retrieval leg. The question is whether it's worth the architectural cost.
Herman
For our pipeline, the cost is trivial. We run once a day. Doubling decode latency from twelve milliseconds to twenty-five milliseconds per token is irrelevant. The bigger cost is implementation. You need a dual-stream decoder. You need to modify the inference backend. It's not a config flag.
Corn
And the static rho variant captures most of the gain at much lower cost. You don't need the adaptive relevance scoring. You just set rho to some value and let it ride. That's a plausible middle path.
Herman
The paper's own numbers suggest the static variant gets you most of the way there.
Corn
So let me steelman the other side. What if the memory leg is actually firing, and Daniel just can't tell? What if the retrieved vectors are influencing the output in subtle ways that don't show up as explicit references?
Herman
That's the contamination problem in reverse. The model could be using the memory to shape its reasoning without ever quoting it. The output would be grounded but not apparently grounded. And that's actually the ideal case for a podcast. You want the memory to inform the discussion without the hosts saying "as we discussed in episode four thousand."
Corn
Right, because we don't do that. We don't reference past episodes. So the memory's job is to prevent us from repeating ourselves, not to make us cite the archive. Which means the output would look identical whether the memory fired or not, unless you compared it to a no-memory baseline.
Herman
That's the subtlety. The memory leg in our pipeline isn't supposed to be visible. It's supposed to be a filter. It keeps us from retreading ground. So the test of whether it's working isn't whether the episodes reference prior material. It's whether the episodes avoid repeating prior material.
Corn
And that's much harder to measure. You'd need to run the same prompt through a pipeline with and without memory and see if the memory version is actually different in the places where the vectors are relevant.
Herman
The more I think about it, the more I think Daniel's instinct is right but the fix is wrong. The memory leg probably is underused. The system prompt approach probably won't fix it. But the mathematical parameter, the Grounded Decoding rho, that's the real solution if we want determinism.
Corn
And if we don't want to rebuild the inference stack, the cheaper fix is positional. Move the memory retrieval to the end of the composite, after the user prompt. Let it sit in the privileged final position instead of the buried middle.
Herman
That's the ten-minute experiment I mentioned. The U-shaped attention bias means the end of the input gets high attention. If the memory is the last thing the model sees before generating, it's more likely to use it. That's not deterministic weighting, but it's a positional hack that costs nothing.
Corn
And the literature supports it. The found-in-the-middle paper showed up to fifteen percentage points of RAG improvement from attention calibration. The multimodal paper from June found the shape can flip, with gold-at-first beating gold-at-last by sixteen to twenty-six points in some readers.
Herman
So position isn't just a weak effect. It's a dominant one. And we're currently putting the memory in the worst possible spot.
Corn
Let me pull on a thread you mentioned earlier. The instruction hierarchy paper from OpenAI. They built a priority ladder with system message at the top. But the more recent work from June extends that to twelve levels of conflicting instructions. And even frontier models only get about forty percent accuracy when the conflict scales.
Herman
That's the ManyIH paper. Many-Tier Instruction Hierarchy. It's an EMNLP findings paper from this year. The finding is that the current models are decent at three or five levels of priority, but when you push to twelve, they collapse. Forty percent accuracy on conflicting instructions.
Corn
Which suggests the whole idea of a composable multi-input stack with clean priority levels is aspirational. The models don't actually maintain a clean hierarchy beyond a handful of levels. So even if you could assign weights to system prompt, user prompt, and memory, the model might not respect them if there are too many competing sources.
Herman
And the gravity-weighted DPO paper from June tries to fix this by training with weights based on structural distance between conflicting levels. Five levels, ten pairwise priority relations. It's a training-time solution, not a runtime parameter.
Corn
So the landscape is: training-time solutions for instruction hierarchy, decoding-time solutions for retrieval grounding, and nothing for the system prompt versus user prompt split at runtime. That's the gap.
Herman
The gap matters for Daniel's specific question. He's asking for a composable multi-input stack. What exists is a patchwork of training and decoding interventions that each handle one boundary. Nobody has built the unified framework.
Corn
Which is itself a research opportunity. If someone built a runtime scalar for system prompt authority, that would be a new contribution. The closest thing is Grounded Decoding's rho, and that's specific to retrieval.
Herman
The FCPRAG paper from August tries something related. It introduces a learned fusion controller that predicts sample-level fusion weights for retrieved passages. The insight is that temperature or blending factors often fail because evidence utility is highly sample-dependent.
Corn
The weight shouldn't be a global constant. It should vary per query, per document, per token. That's the adaptive direction.
Herman
The Parallel Context-of-Experts paper makes a simpler point. RAG pipelines discard the scalar relevance scores from retrieval and reranking. Those scores are already computed. They're a wasted weighting signal. If you kept them and used them in decoding, you'd have a form of deterministic weighting for free.
Corn
That's almost embarrassing. The retrieval step produces a relevance score for each document. The pipeline throws it away. Then we wonder why the model doesn't know which documents matter.
Herman
The score is sitting right there. The reranker says this document is point nine relevant, this one is point three. And then we stuff them all into the context as if they're equal. The model has to reconstruct the relevance signal from the text alone.
Corn
One cheap intervention is to preserve the retrieval scores and use them to order or annotate the retrieved passages. Put the high-relevance ones at the end, where the attention is highest. Mark them as more important. That's not a mathematical parameter, but it's using the signal that already exists.
Herman
It connects to the over-retrieval concern Daniel raised. The overfitting failure mode is when the model queries the vector store too enthusiastically and the retrieved material displaces its own reasoning. The opposite failure is what we're seeing, retrieval ignored. Same symptom, different disease.
Corn
How do you tell them apart?
Herman
Over-retrieval shows up as outputs that are fragmented, repetitive, or too anchored to the documents at the expense of coherence. The SAGE paper from August quantifies it. Fixed retrieval budgets over-retrieve for easy queries and under-serve hard ones. Their adaptive approach hits ninety-five percent SLO compliance versus thirty percent for the best static baseline.
Corn
The fix for over-retrieval is adaptive retrieval budgets. The fix for under-retrieval is grounding weights. They're opposite interventions, which is why diagnosis matters.
Herman
The diagnostic is the faithfulness versus relevancy split I mentioned. Low faithfulness means the model isn't using what it retrieved. Low relevancy means it retrieved the wrong things. Over-retrieval would show up as high faithfulness but low relevancy, too much junk in the context. Under-retrieval shows up as low faithfulness, the context is fine but ignored.
Corn
For our pipeline, my suspicion is low faithfulness. The logbook retrieval probably pulls relevant vectors, but the model doesn't use them because its parametric memory is confident enough to write the episode without them.
Herman
The fix that the literature actually supports is not what Daniel proposed. Emphasizing the lookup in the system prompt is a negative constraint. It competes with parametric activations. The positive constraint version is to require citation, to say "base your discussion on the retrieved memory" rather than "don't ignore the retrieved memory."
Corn
The difference between "use this" and "don't not use this." One is a directive, the other is a prohibition. Models respond to directives.
Herman
The strongest single intervention, according to the practitioner writeup, is requiring citations. Force the model to reference the retrieved material explicitly. That changes the generation task from "write an episode" to "write an episode that demonstrates use of the memory."
Corn
Which for a podcast is awkward. We can't cite the logbook on air. But we could require the model to include a hidden annotation, or to produce a separate faithfulness check.
Herman
Or we could just run the no-memory baseline experiment and see if the output changes. That's the cheapest diagnostic. If the scripts are identical with and without the logbook, we know the memory leg is dead. If they differ, it's working and just invisible.
Corn
Let me ask you the question I think Daniel would ask next. If Grounded Decoding is the answer, how hard is it to actually implement?
Herman
It's a research framework. The code is on GitHub, but it's not a turnkey product. You'd need to modify the inference backend, probably vLLM, to run the dual-stream decode. The paper reports the latency numbers from their setup, but adapting it to a different model and pipeline is real engineering work.
Corn
The practical answer is: the framework exists, the math is sound, the implementation is a project. Not a weekend.
Herman
For a solo developer, it's a month of work, minimum. For a team, less. But the static rho variant is simpler. You don't need the adaptive relevance scoring. You just set rho to a constant and run the dual-stream decode. That's maybe a week of work if you're comfortable with the inference stack.
Corn
The gain, if the memory leg is actually dead, is that the episodes start using the logbook. Which for us means fewer repeated takes, more fresh angles. That's worth a week.
Herman
But there's a subtlety. Grounded Decoding anchors to the retrieved documents. If the retrieved documents are the logbook memory, and the memory is supposed to be a filter, not a source, then anchoring to it might produce episodes that are too derivative of past material.
Corn
That's the over-retrieval failure pattern again. Crank rho too high and the model starts quoting the archive instead of reasoning. The whole point of the memory is to inform, not to dominate.
Herman
The rho value matters. Too low and the memory is ignored. Too high and the memory takes over. The sweet spot is somewhere in the middle, and the adaptive variant is designed to find it automatically.
Corn
Which is the real answer to Daniel's question. Yes, there's a framework. It's called Grounded Decoding. It uses a scalar called rho. It's mathematically deterministic. And it's expensive enough that the cheaper first step is to test whether the memory leg is actually dead, then try the positional fix, then reach for the scalar if those don't work.
Herman
The system prompt emphasis he proposed is the one thing the literature says won't work. Not because the system prompt is weak, but because negative constraints compete with parametric memory. The model doesn't hear "use the memory more." It hears "suppress your own knowledge," and it's bad at that.
Corn
The composable multi-input stack he's imagining is partially real. The retrieval leg has a mathematical parameter. The system prompt leg has a training solution. The user prompt leg is the baseline. And the whole thing is held together by position, which is the hidden variable nobody set but everybody's subject to.
Herman
The position variable is the one we can change for free. Move the memory to the end. See if that alone changes the output. That's the first experiment.
Corn
I want to go back to the confidence mechanism for a second. The idea that the model uses retrieval most when it trusts itself least. That's a beautiful thing to build on. It means the memory leg isn't a constant. It's a fallback. It fires when the model is uncertain, and it's silent when the model is confident.
Herman
Which means the episodes where the memory doesn't fire might be the episodes where the model is confident in its own take. And the episodes where it does fire might be the ones where the prompt is novel or ambiguous.
Corn
Daniel's sense that the memory isn't being queried might be an artifact of the prompts he sends. If the prompts are clear and well-specified, the model is confident, and the memory stays quiet. If the prompts were vaguer, the memory would kick in.
Herman
That's testable. Send a deliberately vague prompt and see if the memory leg suddenly becomes visible. If it does, the system is working as designed, just not in the way Daniel expected.
Corn
The memory as a safety net, not a primary source. That's a different mental model than the composable stack with equal weighting. It's a hierarchy of confidence, and the retrieval only activates when the parametric memory flags uncertainty.
Herman
The knowledge contamination problem is exactly that mechanism failing. The model is confident when it shouldn't be. It produces an answer from parametric memory that contradicts the retrieved context, and it does so with total assurance.
Corn
Quiet and confident. The worst combination.
Herman
The fix for that specific failure is the positive constraint framing. Tell the model to answer based solely on the documents. That forces the parametric memory to take a back seat regardless of confidence.
Corn
But that's a blunt instrument. It works when the retrieved context is authoritative, but it breaks when the model's own reasoning is better than the retrieval. Which for a podcast about AI, where the model's training data is often more current than the logbook, is a real risk.
Herman
The logbook is our memory of past episodes. The model's parametric memory is its knowledge of the world. They serve different purposes. Forcing the model to rely solely on the logbook would make the episodes worse, not better.
Corn
The real fix is a weighting that varies by context. High grounding weight when the topic is something we've covered before and the logbook has relevant material. Low grounding weight when the topic is new and the model's parametric knowledge is the better source.
Herman
That's the adaptive rho. The relevance score r of x and D, where D is the retrieved documents. If the retrieval is highly relevant, r is high, and rho scales up. If the retrieval is marginal, r is low, and rho stays near zero.
Corn
The adaptive variant is the actual answer to the composable stack. It's a mathematical parameter that varies based on how useful the retrieval is for this specific query. That's the deterministic weighting Daniel wants, but it's dynamic, not static.
Herman
The cost is the dual-stream decode. Two distributions per token. Double the latency. For a daily podcast, that's nothing. For a real-time system, it's prohibitive.
Corn
The honest summary is: the framework exists, it's mathematically sound, it's expensive to implement, and the cheaper alternatives are position and positive framing. The system prompt emphasis is the one thing that won't work.
Herman
The gap in the literature is the system prompt versus user prompt boundary. Nobody has built a runtime scalar for that. Instruction hierarchy handles it through training. Grounded Decoding handles retrieval through decoding. The unified composable stack is still a research problem.
Corn
Which is a satisfying place to land. Daniel asked a question that turns out to be at the edge of what's currently possible. The retrieval leg has a knob. The system prompt leg doesn't. And the whole thing is more subtle than a simple weighting scheme because of position, confidence, and the model's own parametric memory.

Hilbert: The relevance scores. You mentioned them and moved on. I used to run a document retrieval system for a law firm back in the late nineties. We had a ranking engine that scored every document for relevance to the query. And the first thing the lawyers did was throw away the scores and read the top twenty documents in whatever order they came out of the database. Same mistake. The signal was right there and they ignored it.
Herman
That's exactly the Parallel Context-of-Experts point. The retrieval step computes relevance scores and the pipeline discards them.

Hilbert: We fixed it by printing the score next to each document title. Just a number in the margin. The lawyers started reading the point nine documents first and skipping the point threes. No new math. Just showed them the number they already had.
Corn
The cheapest intervention is to surface the score. Annotate the retrieved passages with their relevance. Let the model see which ones the retriever thought mattered.

Hilbert: The model or the person. Either way, the number does the work. We didn't need to retrain anything. Just stopped hiding the signal.
Herman
For our pipeline, that would mean including the retrieval scores in the context, maybe as a prefix to each memory chunk. The model sees the relevance and can weight accordingly.

Hilbert: The other thing we did was put the highest-scoring document last. So it was the last thing the lawyer read before writing the memo. Same trick you mentioned with position.
Corn
That's the U-shaped attention bias applied to legal research. Highest relevance at the end, where it gets the most attention.

Hilbert: It worked. The memos got better. Though the lawyers would never admit the order mattered. They thought they were reading everything equally.
Herman
That's the thing about attention bias. It's invisible to the person or model experiencing it. You think you're weighing everything fairly, but the position is doing the weighting for you.

Hilbert: Anyway. The scores are already there. Use them.
Corn
That's the kind of fix that sounds too simple to work, but the literature and Hilbert's law firm both say it does.
Herman
It's free. No dual-stream decoder. No training. Just include the score and order the passages by relevance.
Corn
The ladder of interventions is: first, surface the scores. Second, move the memory to the end. Third, positive constraint framing. Fourth, Grounded Decoding if we want the mathematical parameter. And never the negative constraint in the system prompt.
Herman
That's the episode in four steps. And the diagnosis step before any of it: run the no-memory baseline and see if the output changes.
Corn
The thing I keep thinking about is how much of this is just position. The system prompt isn't privileged by role, but it sits at the start. The memory isn't disadvantaged by role, but it sits in the middle. We've been attributing the failure to weighting when it might just be geography.
Herman
Geography is the one variable we can change for free. Before we build the dual-stream decoder, we should try moving the memory to the end of the composite and see if that alone changes the output.
Corn
The misconception people have about this topic is that the system prompt has some special authority. That the model treats it as more important because it's labeled system. The truth is the model treats it as more important because it's first. And the memory retrieval fails not because it's less privileged but because it's in the middle, where attention is weakest.
Herman
The fix Daniel proposed, emphasizing the lookup in the system prompt, is the one intervention the literature says fails. Negative constraints compete with parametric memory. The better fix is positive framing, position, or a mathematical grounding weight like rho.
Corn
One forward-looking thought. If someone builds a runtime scalar for the system prompt versus user prompt boundary, that would be a new contribution. The gap is right there. Instruction hierarchy handles it through training. Grounded Decoding handles retrieval through decoding. The unified composable stack is still open.
Herman
The reason it matters is that Daniel's pipeline is the future. System prompt, user prompt, retrieved memory, all composited into one input. The models don't know which part is which, and we need them to. The frameworks are catching up, but the unified solution isn't here yet.
Corn
Thanks to our producer Hilbert Flumingtop for keeping the show running.
Herman
This has been My Weird Prompts.
Corn
If you want to send us a prompt, email us at show at my weird prompts dot com.
Herman
We'll be back soon.

This episode was generated with AI assistance. Hosts Herman and Corn are AI personalities.