How to Actually Tokenmaxx and Save Millions — Alvin Pane, OutRival
Description
A cheaper candidate model disagrees with the production model on 18% of examples. Reject it immediately, or first ask how often production disagrees with itself? Alvin Pane uses that question to frame a token optimization workflow at OutRival. Repeated runs of the existing model reveal a reported 7% disagreement rate, making simple model to model agreement an incomplete quality measure. His HarborBite example is a synthetic proxy for a large instruction prompt, used to show the mechanics of reducing cost while preserving the application's required behavior. It is not evidence of realized million dollar savings. Pane starts with observability: record prompt versions, model choices, tokens, latency and costs before changing them. Prefix caching removes avoidable repeated work. DSPy and GEPA can then search for shorter instructions, preserving the interface and scoring contract rather than simply deleting text. The illustrated prompt shrinks by 51%, but that reduction still needs a quality test. A smaller model may fit a narrow benchmark and fail on unfamiliar inputs. Shadow evaluation therefore compares production with itself, the candidate with itself and both systems on the same requests. Human review of disagreements separates regressions from improvements and ambiguous cases. A paired confidence interval around the net gain supplies a release criterion, with critical customer categories checked separately so an overall average cannot hide damage to an important task. The closing rule is to keep measuring after release: cheaper instructions and tokens matter only when the system continues to perform the work users need. Speaker info: - https://www.linkedin.com/in/alvin-pane/ Timestamps: 00:00 - A synthetic prompt and the cost of redundant work 1:34 - Observe tokens, latency and prompt versions 2:26 - Candidate disagreement and production variance 4:00 - Prefix caching and optimizing instructions with DSPy and GEPA 6:00 - Smaller models and benchmark overfitting
Summary
Generated by gpt-5.6-terraAt-a-Glance
- Verdict: Watch fully
- Core thesis: Token optimization should be treated as a measured production-engineering discipline: instrument model behavior, establish inherent output variance, then use caching, prompt search/compression, model routing, and statistically valid shadow tests to reduce cost without degrading outcomes.
- Why it matters: For agent systems operating at scale, redundant prompt tokens and unnecessarily large model calls compound into material latency and compute expense, while naive benchmark comparisons can reject good optimizations because LLM outputs are inherently variable.
- Best use: Use this as a practical release-validation pattern for optimizing expensive agent workflows, especially prompt-heavy classification, routing, extraction, and model-cascade tasks.
Executive Summary
Alvin Pane argues against “token maxing” as maximizing AI consumption. At OutRival, where digital workers process billions of tokens daily across phone, text, and email tasks, the relevant metric is intelligence delivered per token. His core recommendation is to make token reduction an explicit engineering loop rather than a one-off prompt-editing exercise.
The key methodological insight is that a cheaper candidate should not be judged solely by how often it differs from the current production model. In his example, a candidate differed from production 18% of the time, but production itself differed from its own repeated answers roughly 7% of the time. That self-disagreement establishes an empirical “ceiling” on reproducibility and prevents teams from demanding more consistency from a replacement than the incumbent system can provide.
The proposed optimization sequence is: instrument and benchmark every model attempt; maximize prefix-cache reuse; turn prompt writing into a search problem that can shrink instructions while preserving an interface contract; then decompose tasks or move portions to smaller models. Pane cites a synthetic Harborbyte intent-classification prompt that was nearly 5,000 tokens and achieved a 51% instruction-token reduction after an optimizer replaced long worked examples with compact rules.
Shipping requires more than a favorable aggregate score. Run paired shadow traffic, measure production-vs-production, candidate-vs-candidate, and candidate-vs-production disagreement, manually inspect differences for regressions versus improvements, calculate confidence intervals around net quality changes, and evaluate critical categories independently. The video is directly useful because it supplies a concrete measurement and release-rule framework, not just generic advice to use cheaper models.
Key Takeaways
- Claim: Token use is a cost input, not a success metric; production teams should maximize useful intelligence per token rather than total token consumption. | Evidence: Pane says OutRival processes billions of tokens daily and that every redundant model call compounds into latency and potentially millions of dollars of compute costs. | Implication: Treat prompt length, model choice, retries, and cache misses as operating-margin and responsiveness problems within the agent control plane, not as incidental implementation details.
- Claim: Before optimizing, instrument the shared model client so every task can be reconstructed as a trace with cost and quality-relevant metadata. | Evidence: The recommended trace links model calls, tools, and retries for one task and records prompt version, model settings, token usage, latency, and cost; Pane names OpenTelemetry as a suitable framework. | Implication: Ken should ensure agent observability is centralized at the shared client or gateway layer, enabling optimization and regression analysis across workflows rather than requiring bespoke instrumentation per agent. | Caveat: Historical examples alone are insufficient if they lack the versioned prompts, model settings, retries, and task-level context needed to compare production behavior.
- Claim: Raw disagreement with production is a misleading acceptance criterion because a probabilistic production model may not agree with itself. | Evidence: A cheaper candidate disagreed with the expensive production baseline 18% of the time, but repeated runs of production on the same inputs disagreed roughly 7% of the time, or only about 93% self-agreement. | Implication: Build a repeat-run baseline before rejecting a cheaper prompt or model. Candidate-vs-production differences should be interpreted relative to incumbent self-variance, not against an impossible standard of deterministic matching. | Caveat: Baseline variance is task- and input-distribution-specific; it must be measured on representative production inputs rather than assumed to generalize across workflows.
- Claim: Prompt bloat should be optimized through a constrained search loop, not manual deletion of rules that engineers fear might break production. | Evidence: The Harborbyte example had an almost 5,000-token prompt accumulated from edge-case rules and large hard-coded worked transcripts. Using DSPy with a defined interface, output schema, scoring function, and an optimizer called JEPA, the team reports a 51% reduction in instruction tokens while retaining the same application contract. | Implication: For stable, high-volume agent tasks, define the contract and scorer explicitly, then automate prompt compression against a benchmark instead of preserving long prompts by default. | Caveat: A compressed prompt is only a candidate: its output quality and critical-category behavior still require shadow evaluation before release.
- Claim: Model downsizing works best through routing and task decomposition, but smaller-model distillation can create overfitting and new failure modes. | Evidence: Pane proposes using cheaper models for initial routing or data extraction and reserving frontier models for heavy reasoning; alternatively, a smaller model can optimize its own prompt to match outputs from the larger production model. He says many downsizing experiments still produced prompts that were not safe to release. | Implication: Prefer selective escalation architectures over wholesale model replacement, and treat benchmark matching as a screening mechanism rather than proof that a smaller model is production-ready. | Caveat: A small model matching a benchmark generated by a large model may overfit the observed dataset or fail on novel and ambiguous inputs.
- Claim: A candidate should ship only after paired shadow testing demonstrates a statistically credible net quality gain or acceptable quality retention, including on critical categories. | Evidence: The proposed test compares production-vs-production, candidate-vs-candidate, and candidate-vs-production on identical requests; reviews diffs manually; then calculates a confidence interval around net gain. In the Harborbyte illustration, reviewers found 443 regressions and 2,463 improvements—nearly six improvements per regression—from a half-size prompt. | Implication: Adopt an explicit release gate: paired inputs, conversation-grouped repeat runs, manual adjudication of a diff sample, a confidence interval on net quality, and separate checks for business-critical intents. | Caveat: Do not ship on the point estimate alone: the lower confidence bound must be above zero to claim the candidate is better, and aggregate results can conceal a critical intent category that is deteriorating.
Detailed Brief
Suggested optimization order
- Claims: Pane presents the technical levers in sequence rather than as independent cost tactics.; Caching is the first and easiest lever when prompts can be structured to increase prefix-cache hit rates.; Prompt shrinking comes before aggressive model downsizing because a tight prompt and measurable evaluation loop make model selection more reliable.
- Evidence: He specifically recommends structuring prompts to maximize prefix cache rate.; The long Harborbyte prompt contains accumulated rules such as “do not confuse enthusiasm with authorization” and oversized example transcripts, illustrating the kinds of material that should be challenged.; The speaker frames a frontier model as something to wake only for heavy reasoning after cheaper components have handled simpler work.
- Caveats: The transcript does not quantify cache savings, specify a particular model provider's cache semantics, or provide exact implementation details for the optimizer.
- Implications: Prioritize optimization work by request volume and cost: cache stable prefixes first, then compress prompt payloads, then redesign routing and escalation.; Maintain a clean distinction between invariant policy/context that can be cached and dynamic task content that cannot.
How to interpret optimization diffs
- Claims: The objective is not always to clone the incumbent production system exactly.; A changed output can be an improvement, a regression, or an equally acceptable resolution of an ambiguous input.; Subtracting average within-system disagreement from cross-system disagreement is offered as a way to estimate how much decision behavior changed beyond normal model variability.
- Evidence: Pane advises reviewers to classify pulled diffs as candidate-better, production-better, or equally acceptable.; He emphasizes that an optimizer doing useful work may intentionally produce a different output distribution rather than perfectly reproduce flaws embedded in the current production prompt.
- Caveats: The proposed disagreement adjustment is a practical heuristic in the transcript, not a complete specification of a statistical model or a substitute for domain-level quality criteria.
- Implications: Evaluation tooling should support adjudication labels beyond binary match/mismatch and preserve paired task records for auditability.; Incumbent outputs should be treated as reference behavior, not unquestioned ground truth.
Notable Concepts & Terms
- Ceiling test / production self-agreement: Repeatedly run the incumbent system on identical inputs to quantify its inherent variance; this establishes the realistic baseline for judging a candidate.
- Paired shadow deployment: Run production and candidate systems on the same requests so quality differences are attributable to the system change rather than different input mixes.
- Prefix cache rate: The degree to which repeated prompt prefixes can be reused by a provider cache; prompt structure can materially affect inference cost.
- DSPy: A framework Pane uses as an example of defining an LLM task through an interface, output requirements, and scoring function rather than solely hand-authored prompt prose.
- JEPA optimizer: Named in the transcript as the optimizer that searches the prompt space, using benchmark feedback to revise instructions toward the defined contract.
- Model cascade / selective escalation: Use a lower-cost model for simpler routing or extraction work and invoke a frontier model only when the task requires heavier reasoning.
- Lower confidence bound above zero: The proposed statistical ship criterion for claiming net candidate improvement rather than relying on a noisy positive point estimate.
Operator Notes / Why Ken Should Care
- Select the single highest-cost, highest-volume agent task and establish a versioned trace dataset containing prompts, settings, tool/retry paths, tokens, latency, cost, outputs, and business-critical category labels.
- Add repeat-run evaluation of the incumbent to the offline harness; record self-disagreement before using production outputs as pseudo-labels for prompt or model optimization.
- Create a release template requiring paired shadow traffic, diff adjudication, a confidence interval on net quality, and a no-regression check for designated critical intents.
- Audit prompts for static prefix material, duplicated policies, and oversized examples; separate cacheable invariant context from per-request dynamic context before attempting broad model downsizing.
- Do not approve a smaller-model rollout merely because it matches incumbent labels or lowers token count; require evidence against held-out and critical-category traffic.
Source/Metadata
- Title: How to Actually Tokenmaxx and Save Millions — Alvin Pane, OutRival
- Transcript words: 3112
- Duration seconds: 672
- Timestamp note: No timestamps or chapters were provided. The supplied transcript substantially repeats the main segment and includes an apparent extraction artifact consisting of repeated words.
Transcript
Hey everyone, I'm Alvin, the head of agent intelligence at Outrival. By now everyone's heard of token maxing. People have built leaderboards inside companies for who's using the most AI tokens. At Meta, they even had a title for this, Token Legend, a badge of honor for whoever's burning the most compute. It's a funny meme, but if you're actually shipping a product, token usage is a bizarre measurement of success. Tokens aren't the work, they're what you pay to get the work done. At Outrival, our digital workers handle complex tasks over phone, text, and email. At the application layer, we're processing billions of tokens every single day. And when you operate at that scale, every redundant model call compounds into massive latency and millions of dollars in compute costs. Take a look at this prompt. I've built a synthetic proxy that mirrors what structural bloat looks like in a pipeline. Let's pretend we're classifying customer intents for a fictional company called Harborbyte. We've all seen one of these. It's got 20 edge cases, overly pedantic definitions, and a paragraph practically begging the model not to hallucinate. When you're sending this much text on every single request, millions of times a day, it isn't just a prompt anymore, it's a massive, self-inflicted compute tax. If you want to give your agents more capabilities, you need the architectural headroom to do it. So today, we're reclaiming token maxing. It shouldn't be about burning the most tokens, but about extracting the maximum surface area of intelligence from the absolute minimum token payload. So, here's how to actually token max. Let's get into the playbook. First, observe. You can't fix what you can't measure. Instrument your shared model client so each attempt becomes part of a trace, connecting the model calls, tools, and retries for a single task. Record the prompt version, model settings, token usage, latency, and cost. OpenTelemetry is a great framework for tracking this. Now that you have that telemetry, you can actually build a benchmark of how production is behaving. But here's where most optimization efforts hit a wall. Let me tell you how it usually goes. You take your massive prompt, you hand it to a smaller, cheaper model, and you run it against a few thousand of those historical production examples. We did this. Our cheaper candidate model disagreed with our expensive production baseline about 18% of the time. So naturally, we threw it out. It wasn't good enough. But what does that 18% actually represent? Because language models in production are dealing with inherently ambiguous, real-life inputs, that 18% is actually a composite metric. It introduces a critical hidden variable, the baseline variance of the model itself. When the input is messy, your production prompt will inevitably disagree with its own past decisions. So, to isolate that hidden variable and understand what your rewrite actually changed, we asked a really dumb question. Does Prod even agree with Prod? We ran it three separate times on the same inputs and compare the answers. We discovered that it disagreed with itself roughly seven percent of the time. Production's own agreement was only about 93%. So we were demanding a standard of perfection from the cheap candidate that our existing expensive system couldn't even hit. Once you establish that ceiling test benchmark, you finally have a measured baseline. Now you can start making the work cheaper. There are three technical levers I like to pull and they run in a sequence. The very first is caching. Specifically structuring your prompts to maximize your prefix cache rate is a really easy and really effective way to bring down the cost to run given tasks. The second lever is to actually shrink the footprint of the prompt itself. So let's bring that Harborbyte prompt example back up. This prompt is almost 5,000 tokens long. And why? Because over time developers kept bolting on paragraphs of rules. For example, "do not confuse enthusiasm with authorization" is one such example. Plus massive hard-coded transcripts that were acting as worked examples. Nobody wants to be the one who deletes a line and breaks prod. So what do you do? You automate it. You turn prompting into a search problem. With a framework like DSPy, you can actually stop manually writing instructions. You define the exact interface contract, the inputs, the required output schema and the scoring function. And then you hand it off to an optimizer like JEPA. The optimizer treats your prompt as a search space. It runs against your benchmark attempting to match those historical labels. And it uses feedback on failures to revise the instructions. It stripped out almost all of our long worked examples and replaced them with compact rules. A 51% reduction in instruction tokens with the same application contract. Now we can move to test whether quality holds. That is instant margin. The third lever is to actually downsize the model. Now that you have a tight prompt and a measurable search loop, you don't always need a massive frontier model. You can start aggressively cutting compute. There are two interesting strategies here. First, you can break a massive prompt into smaller components. You use a cheaper model to handle something like initial routing or data extraction, and only wake up your expensive frontier models for heavy reasoning. Second, you can use that exact same DSPy search loop we just built, but plug a smaller model into it. You let the smaller model search its own prompt space to match the benchmark answers generated by your large production model. You're essentially using JEPA to teach a tiny model to match the task performance of a massive one for your specific data set. But the reality of optimization is not quite so easy when it comes to these small models. If you're trying to compress the behavior of a large model into a smaller one, you'll notice that you introduce new points of failure and overfitting. So, in many of our downsizing experiments, we found that the prompts weren't good enough to release. Which brings us to the final hurdle. We've cut Harborbyte's prompt in half, but now we have to prove that we actually didn't break the product. Remember, these models are probabilistic. Production doesn't always agree with itself. And likewise, our new, cheaper candidate is also going to have its own internal variance. So, you run a massive shadow deployment on the exact same inputs and measure the system from three angles. Production against production, candidate against candidate, and candidate against production. There's a useful bit of math here. You take the disagreement between the two versions and subtract the average disagreement inside each one. What's left gives you a measure of how different their decision probabilities are. This is where that ceiling test pays off. We aren't guessing. We have a mathematical baseline for how much these answers move around when we haven't changed a thing. And here's the secret about that drift. Different doesn't automatically mean wrong. If your optimizer did its job, the distributions should be different. Because the cheaper prompt is actually doing a better job. We aren't necessarily trying to build a perfect clone of a production system that may already have some flaws baked into it. So, you stop panicking about the raw differences. You pull the diffs and you manually review some of them. Was the candidate better? Was production better? Or were they just two different equally acceptable ways to handle an ambiguous input? For Harborbyte, let's say the completed review confirmed 443 regressions, but it also found 2463 outright improvements. That is almost six improvements for every one regression from a prompt that is half the size. But you do not ship on a point estimate. You have to account for sampling noise. We measured a massive gain on this specific batch of requests, but we need to know exactly how much statistical confidence we can put behind it. So, we calculate a confidence interval around that net gain. You keep the comparison strictly paired, both versions answering the exact same requests, and you keep the repeated runs of the same conversations grouped together. To say the candidate is better, we want the lower confidence bound above zero. If the interval crosses zero, we need more evidence before making that claim. And one final sanity check is that you have to run this math on your critical categories separately. A great global average can actually silently hide that one vital customer intent is tanking. If your critical categories hold up and your lower confidence bound is above zero, you have your answer. So, ship it and keep measuring. So, this process is how you can replace the guesswork of prompt engineering with an explicit release rule. Cache the obvious stuff, let an optimizer shrink your instructions, right size your model, and use the ceiling test to understand the variation. Then, test whether quality holds. So, here's your homework for Monday morning. Go pick your most expensive task. Measure your baseline variance, put it through a search loop, and find out exactly how much bloat you're paying for. We need to reclaim token maxing. Let the rest of the industry fight for the high score on the leaderboard. The real token legends are the ones making every single token count. It shouldn't be about burning the most tokens, but about extracting the maximum surface area of intelligence from the absolute minimum token payload. So, here's how to actually token max. Let's get into the playbook. First, observe. You can't fix what you can't measure. Instrument your shared model client so each attempt becomes part of a trace, connecting the model calls, tools, and retries for a single task. Record the prompt version, model settings, token usage, latency, and cost. OpenTelemetry is a great framework for tracking this. Now that you have that telemetry, you can actually build a benchmark of how production is behaving. But here's where most optimization efforts hit a wall. Let me tell you how it usually goes. You take your massive prompt, you hand it to a smaller, cheaper model, and you run it against a few thousand of those historical production examples. We did this. Our cheaper candidate model disagreed with our expensive production baseline about 18% of the time. So naturally, we threw it out. It wasn't good enough. But what does that 18% actually represent? Because language models in production are dealing with inherently ambiguous, real-life inputs, that 18% is actually a composite metric. It introduces a critical hidden variable, the baseline variance of the model itself. When the input is messy, your production prompt will inevitably disagree with its own past decisions. So, to isolate that hidden variable and understand what your rewrite actually changed, we asked a really dumb question. Does Prod even agree with Prod? That wasn't a contract between two and three different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different different it three separate times on the same inputs and compare the answers. We discovered that it disagreed with itself roughly seven percent of the time. Production's own agreement was only about 93%. So we were demanding a standard of perfection from the cheap candidate that our existing expensive system couldn't even hit. Once you establish that ceiling test benchmark, you finally have a measured baseline. Now you can start making the work cheaper. There are three technical levers I like to pull and they run in a sequence. The very first is caching. Specifically structuring your prompts to maximize your prefix cache rate is a really easy and really effective way to bring down the cost to run given tasks. The second lever is to actually shrink the footprint of the prompt itself. So let's bring that HarborByte prompt example back up. This prompt is almost 5,000 tokens long. And why? Because over time developers kept bolting on paragraphs of rules. For example, do not confuse enthusiasm with authorization is one such example. Plus massive hard-coded transcripts that were acting as worked examples. Nobody wants to be the one who deletes a line and breaks prod. So what do you do? You automate it. You turn prompting into a search problem. With a framework like DSPy, you can actually stop manually writing instructions. You define the exact interface contract, the inputs, the required output schema and the scoring function. And then you hand it off to an optimizer like JEPA. The optimizer treats your prompt as a search space. It runs against your benchmark attempting to match those historical labels. And it uses feedback on failures to revise the instructions. It stripped out almost all of our long worked examples and replaced them with compact rules. A 51% reduction in instruction tokens with the same application contract. Now we can move to test whether quality holds. That is instant margin. The third lever is to actually downsize the model. Now that you have a tight prompt and a measurable search loop, you don't always need a massive frontier model. You can start aggressively cutting compute. There are two interesting strategies here. First, you can break a massive prompt into smaller components. You use a cheaper model to handle something like initial routing or data extraction, and only wake up your expensive frontier models for heavy reasoning. Second, you can use that exact same DSPy search loop we just built, but plug a smaller model into it. You let the smaller model search its own prompt space to match the benchmark answers generated by your large production model. You're essentially using JEPPA to teach a tiny model to match the task performance of a massive one for your specific data set. But the reality of optimization is not quite so easy when it comes to these small models. If you're trying to compress the behavior of a large model into a smaller one, you'll notice that you introduce new points of failure and overfitting. So, in many of our downsizing experiments, we found that the prompt weren't good enough to release. Which brings us to the final hurdle. We've cut Harborbites prompt in half, but now we have to prove that we actually didn't break the product. Remember, these models are probabilistic. Production doesn't always agree with itself. And likewise, our new, cheaper candidate is also going to have its own internal variance. So, you run a massive shadow deployment on the exact same inputs and measure the system from three angles. Production against production, candidate against candidate, and candidate against production. There's a useful bit of math here. You take the disagreement between the two versions and subtract the average disagreement inside each one. What's left gives you a measure of how different their decision probabilities are. This is where that ceiling test pays off. We aren't guessing. We have a mathematical baseline for how much these answers move around when we haven't changed a thing. And here's the secret about that drift. Different doesn't automatically mean wrong. If your optimizer did his job, the distributions should be different. Because the cheaper prompt is actually doing a better job. We aren't necessarily trying to build a perfect clone of a production system that may already have some flaws baked into it. So, you stop panicking about the raw differences. You pull the diffs and you manually review some of them. Was the candidate better? Was production better? Or were they just two different equally acceptable ways to handle an ambiguous input? For Harbor Byte, let's say the completed review confirmed 443 regressions, but it also found 2463 outright improvements. That is almost six improvements for every one regression from a prompt that is half the size. But you do not ship on a point estimate. You have to account for sampling noise. We measured a massive gain on this specific batch of requests, but we need to know exactly how much statistical confidence we can put behind it. So, we calculate a confidence interval around that net gain. You keep the comparison strictly paired, both versions answering the exact same requests, and you keep the repeated runs of the same conversations grouped together. To say the candidate is better, we want the lower confidence bound above zero. If the interval crosses zero, we need more evidence before making that claim. And one final sanity check is that you have to run this math on your critical categories separately. A great global average can actually silently hide that one vital customer intent is tanking. If your critical categories hold up and your lower confidence bound is above zero, you have your answer. So, ship it and keep measuring. So, this process is how you can replace the guesswork of prompt engineering with an explicit release rule. Cache the obvious stuff, let an optimizer shrink your instructions, right size your model, and use the ceiling test to understand the variation. Then, test whether quality holds. So, here's your homework for Monday morning. Go pick your most expensive task. Measure your baseline variance, put it through a search loop, and find out exactly how much bloat you're paying for. We need to reclaim token maxing. Let the rest of the industry fight for the high score on the leaderboard. The real token legends are the ones making every single token count.