AI Agent Inference Cost Optimization: How to Choose Models and Reduce Costs

    This article breaks down what actually drives inference cost in AI agent systems and how to bring it down. It explains why agent bills grow far faster than those of a simple chat app, then walks through four practical cost levers: model architecture (Mixture-of-Experts), context and prefix caching, context engineering, and task routing. It also covers a "local gateway + cloud brain" architecture, a six-dimension framework for picking a model as an agent's main workhorse, and the business logic behind low-price model offers. Readers will come away with an actionable optimization checklist and a clear argument for measuring cost by task rather than by unit price.

    Introduction: From “Saving Tokens” to “Low-Cost Engineering”

    Recently, an open-source agent project named a newly released long-context large model as its first officially recommended default model, and partnered with the model provider to give the community a large initial free-usage quota. After the news broke, the project quickly climbed the open-source trending lists, and it also triggered a buying rush for a class of small hosts often used as “local gateways.”

    Setting the specific products aside, the signal here is clear: the intelligence needed to power everyday tasks is seeing its inference cost drop fast. But lower cost does not mean no cost, nor does it mean inference cost can be almost ignored. Actual spending still depends on task structure, cache hit rate, model discount policies, the quality of context management, and engineering architecture.

    Agents have therefore entered a new phase:

    • In the past, an engineer’s first lesson was “how to save tokens”;
    • Now, that first lesson has become “how to jointly manage cost, latency, and success rate under long contexts and multi-turn tool calls.”

    For developers and enterprises, the question worth asking is not just “which model is cheaper.” More worth studying is: what actually determines inference cost in agent scenarios? Which architectural techniques can lower per-task cost? What metrics matter when choosing a model? This article tries to answer those questions and offers a practical optimization framework.

    1. Cost Imbalance: Why Agent Bills Grow So Fast

    In a chat app, cost is roughly proportional to the number of turns and can be estimated almost linearly. The agent scenario is entirely different. An agent asked to “help me troubleshoot a production API timeout” might run through something like this:

    1. List recent error logs;
    2. Locate the relevant service’s configuration files;
    3. Search historical tickets and incident records;
    4. Reproduce the issue and attempt one fix;
    5. Fail, analyze the cause, and switch to another approach;
    6. Verify whether the fix works and output a conclusion.

    At each step, the model typically must:

    • Receive the full system instructions and tool definitions;
    • Receive all prior conversation, tool arguments, and tool return results;
    • Decide the next action based on all of that.

    In other words, every step forces the model to re-read the entire prior context. Cost is made up of four parts:

    • N: the number of conversation turns and tool calls in the task;
    • C: the context length of a single request;
    • O: the output length the model generates in a single turn;
    • P: the model’s pricing for input and output tokens. Input and output are usually priced separately, and cache-hit discounts may apply.

    The total cost of one task can be approximated as:

    1. Cost ≈ Σ (Cin_i * P_in + Cout_i * P_out)

    The input tokens for turn i can be expressed as:

    1. Cin_i = Cin_0 + Σ (O_j + T_j) (j < i)

    Cin_0 is the system prompt and tool definitions carried in every turn; O_j and T_j are the model output and tool return results from earlier turns, respectively.

    This formula shows that cost is sensitive to both context length and task step count at the same time. For a fixed task, if every turn carries the full history, cost grows roughly quadratically with the number of steps. Worse, agents are trial-and-error by nature: a failed task gets retried, and long contexts end up packed with intermediate output that is irrelevant to the current decision. So agent cost management cannot fixate on unit price alone. It has to tackle task structure, context management, cache reuse, and model routing together.

    1.1 Typical Amplification Factors

    Amplification factor How it shows up Impact direction
    Multi-turn tool calls Every step re-reads the history Input tokens accumulate with each step
    Verbose tool returns Logs, files, and web pages dumped wholesale into context Single-turn input balloons, often with irrelevant content
    Verbose system prompts Hundreds of tool descriptions, long behavioral constraints Raises the fixed cost of every turn
    Failure retries and reflection The same task gets explored and corrected repeatedly Total steps grow, amplifying cost further
    High-frequency background tasks Scheduled patrols, always-on listeners Cheap per task, substantial in aggregate
    “Stuff it all in” long context Bringing the entire history into the window Effective signal diluted by noise, output quality drops, which can trigger more retries

    1.2 A Thought Experiment

    Suppose a task takes 20 steps, with an initial context of 8,000 tokens, tool definitions taking 1,500 tokens, roughly 600 tokens generated per turn, and tool returns averaging about 1,000 tokens. If every turn carries the full history, each turn adds about 1,600 new tokens of context.

    The math:

    • Turn 1 input ≈ 8,000 + 1,500 = 9,500 tokens;
    • Turn 20 input ≈ 9,500 + 19 × 1,600 = 39,900 tokens;
    • Cumulative input over 20 turns ≈ 20 × 9,500 + 1,600 × (0 + 1 + … + 19) = 494,000 tokens.

    In other words, a task that isn’t even considered complex can burn nearly 500,000 input tokens. And that doesn’t yet count failure retries, long reasoning content, extra tool calls, and the occasional context blow-up. More steps or longer tool returns push the cost higher still.

    Conclusion: Agent cost management is fundamentally an engineering trade-off among task success rate, latency, and cost. Around that trade-off, four levers are available:

    • ① Architecture lever: choose a model architecture with a smaller per-inference activation scale;
    • ② Cache lever: reuse inference results for shared prefixes;
    • ③ Context lever: bring only the necessary information into the context;
    • ④ Routing lever: match tasks of different difficulty to models of different specs.

    2. Architecture Lever: How Mixture-of-Experts Lowers Per-Inference Cost

    2.1 From “Parameter Scale” to “Activation Scale”

    A traditional dense model runs through every parameter in the network when generating each token. The Mixture-of-Experts (MoE) architecture splits the feed-forward layers into several parallel “expert” sub-networks, then uses a lightweight gating network to dynamically pick a few experts to compute each token.

    This decouples two scales:

    • Parameter scale: sets the “ceiling” on the model’s knowledge and capability;
    • Activation scale: sets how much compute is actually required to generate each token.

    A model with a very large total parameter count may activate only a portion of it in a single forward pass. In plain terms: the model holds a large “knowledge base,” but only consults the few relevant pages each time it answers. Many recently released large models use this kind of sparse architecture, and inference cost is no longer a simple linear function of total parameters.

    2.2 What It Means for the Agent Experience: Time to First Token

    An agent essentially runs in a “think–act–observe” loop. The perceived responsiveness of each step hinges on time to first token (TTFT), the interval from sending a request to receiving the first output token. It is determined by queue wait, prefill, and network round trips, and prefill time is roughly proportional to input length. A high single-step latency keeps accumulating across a multi-step task.

    The value of MoE: given the same hardware, fewer activated parameters and smaller per-computation mean TTFT is easier to keep light and fast. But MoE is not a cure-all for every latency problem:

    • Memory pressure still exists: sparse architectures activate only some experts at a time, but all expert weights usually must stay resident, so memory demand scales with total parameters;
    • Long inputs still slow prefill: when input reaches hundreds of thousands of tokens, prefill cost can’t be removed by sparsification alone;
    • High concurrency is bounded by memory and bandwidth: as concurrent requests rise, KV Cache, memory bandwidth, and scheduling efficiency all affect real throughput;
    • Caching and context management are still essential: MoE lowers per-computation cost but cannot replace prefix caching or context slimming.

    So MoE is best understood as an architectural means to “lower per-inference cost,” not a single fix for agent cost problems.

    2.3 System-Level Optimization: Don’t Overlook the Inference Serving Layer

    Token unit price is only part of the book cost; throughput and latency are also shaped by system optimizations in the inference serving stack. Common industry techniques include:

    • Continuous batching: new requests can slot into a batch that’s being decoded at any moment, without waiting for the whole batch to finish;
    • Paged attention cache management: split the KV Cache into fixed-size blocks allocated on demand, reducing memory fragmentation;
    • Quantization: represent weights and activations with lower-precision numbers, trading a little precision for memory and speed;
    • Speculative decoding: guess several tokens ahead with a lightweight method, then have the main model verify them in a batch.

    Together, these optimizations decide “how many tokens each unit of compute produces.” So the real cost-performance of different model services can’t be inferred from list prices alone. You also need to look at throughput, latency, rate limiting, and stability under real load.

    3. Cache Lever: Context Caching and “Static Prefix” Design

    3.1 How Prefix Caching Works

    Transformers are autoregressive: while processing input, they compute a set of key-value vectors (KV Cache) for each token, which later tokens’ attention computation needs. If multiple requests share an exactly identical prefix, that portion of the KV Cache can be reused without recomputation. This is the underlying principle behind the “context caching / prefix caching” feature in mainstream large model services.

    After a cache hit, the corresponding input tokens are usually billed at a lower price. But note: whether cache writes are billed separately, the minimum cache length, cache retention time, and the discount rate all vary by provider, so rely on the official documentation and your measured bills.

    A commonly overlooked fact is that agents are natural “heavy beneficiaries” of caching. System prompts, tool definitions, and project descriptions tend to be long and reappear at every step.

    Scenario Cache behavior Result
    Step 1 (first request) Full prefix cache is written Whether extra billing applies depends on provider rules
    Step 2 onward Prefix unchanged, cache hit System prompt and tool definitions may be billed at a discount
    Static prefix is rewritten Prefix changes, old cache invalidated Requires a rewrite, so per-call cost can climb again

    A few practical points:

    • Policies vary by service: whether there’s a minimum prefix length, how long the cache is retained, and how the discount is calculated should all follow the provider’s public documentation;
    • Keep dynamic content in a dynamic suffix after the static prefix: don’t put per-request content like timestamps, session IDs, or user input into the static prefix, or the cache will invalidate constantly;
    • Be cautious about cross-user sharing in multi-tenant setups: isolate with unpredictable random session identifiers to avoid user data crossing cache boundaries;
    • Periodically calibrate the real discount: measure cache hit rate and discounts with real requests; don’t write theoretical savings straight into the budget sheet.

    3.2 Cache-Friendly Prompt Orchestration

    Splitting the prompt into a “static prefix + dynamic suffix” is a common way to raise the cache hit rate:

    • Static prefix: system instructions, tool definitions, domain knowledge, few-shot examples;
    • Dynamic suffix: user input, retrieval results, tool returns, the current time.

    The core principle: keep static content byte-for-byte stable, and put all dynamic content at the end. If you change the system prompt, tool definitions, or format specs on every request, the cache hit rate will drop noticeably.

    3.3 Prefix Fingerprinting and Cache Hit Checks

    In engineering, you can maintain a “prefix fingerprint” and record at key points whether the static prefix changed, along with the estimated token count and projected cost. This helps both diagnose why a cache was invalidated and provide a basis for cost accounting.

    1. import hashlib
    2. class PrefixTracker:
    3. """Track the cache prefix: recompute the fingerprint only when the
    4. static prefix changes, and estimate the current turn's input cost."""
    5. def __init__(self, input_price, cached_price, output_price, price_unit=1_000_000):
    6. self._prefix_hash = None
    7. self._prefix_tokens = 0
    8. self.input_price = input_price
    9. self.cached_price = cached_price
    10. self.output_price = output_price
    11. self.price_unit = price_unit
    12. def build(self, static_prefix: str, dynamic_suffix: str):
    13. """Static content first, dynamic content last is the prerequisite
    14. for a cache hit."""
    15. digest = hashlib.sha256(static_prefix.encode()).hexdigest()
    16. changed = digest != self._prefix_hash
    17. if changed:
    18. self._prefix_hash = digest
    19. self._prefix_tokens = self._estimate_tokens(static_prefix)
    20. return static_prefix + "\n\n" + dynamic_suffix
    21. @staticmethod
    22. def _estimate_tokens(text: str) -> int:
    23. # Rough estimate: tokenizers differ significantly, so production
    24. # should use the matching tokenizer for an exact count.
    25. return (len(text) + 3) // 4
    26. def estimate_cost(self, dynamic_suffix: str, output_tokens: int, prefix_cached: bool) -> float:
    27. suffix_tokens = self._estimate_tokens(dynamic_suffix)
    28. cached_tokens = self._prefix_tokens if prefix_cached else 0
    29. uncached_tokens = self._prefix_tokens + suffix_tokens - cached_tokens
    30. return (uncached_tokens * self.input_price
    31. + cached_tokens * self.cached_price
    32. + output_tokens * self.output_price) / self.price_unit

    4. Context Lever: Replace “Context Piling” with “Context Engineering”

    Caching only lowers the cost of repeated prefixes. The longer the context itself, the more prefill, attention computation, and cross-request concurrent memory it consumes, and the model’s effective attention can get diluted. So you also need to actively manage the context.

    4.1 A Layered Context Model

    You can think of an agent’s context as data of different “temperatures”:

    Layer Example content Lifecycle Carrying method
    Instruction layer System prompts, behavioral constraints, tool definitions Unchanged throughout the session Static prefix + cache
    Task layer Goals, constraints, acceptance criteria Basically fixed during the task Structured task description
    Memory layer Long-term preferences, domain knowledge, past conclusions Persists across sessions External storage + on-demand retrieval
    Working layer Intermediate results, tool outputs, reasoning process Short-lived, easily bloated Sliding window + summary
    Output layer Final answer, change log Task deliverable Structured output

    The core principle: each request should put only what the current decision truly needs into the context.

    4.2 Six Management Techniques

    1. Templatize the static prefix

      • Tool definitions follow unified naming, descriptions, and parameter structure;
      • Semantically similar tools are merged or retired promptly;
      • Use retrieval to select the currently available subset of tools per task, shrinking the prefix.
    2. Summarize tool returns before they enter context

      • Raw data lands in external storage; only summaries, key fields, or error info go into the context;
      • A tool returning hundreds of log lines usually only needs to tell the model “the failure is on line N, error type X”;
      • Set a threshold, e.g., when a single tool return exceeds 2,000 tokens, summarize it before it enters the model context.
    3. Rolling summary

      • Every few turns, compress the earlier conversation into a structured summary;
      • Keep only the goal, completed steps, key conclusions, open questions, and environment info;
      • Set a trigger, e.g., auto-summarize when context usage exceeds 70% of budget.
    4. Retrieval-based long-term memory

      • Write user preferences, project conventions, and past experience into a vector database or retrieval system, and recall dynamically per the current task;
      • Avoid dumping “all memory” indiscriminately into the system prompt.
    5. Budget constraints and structured output

      • Set step and token limits per task, forcing convergence near the threshold;
      • Require the model to output “the next action” in a structured format like JSON Schema to cut down long free-form text.
      1. {
      2. "type": "object",
      3. "properties": {
      4. "thought": { "type": "string", "description": "Brief reasoning, no more than 100 characters" },
      5. "action": { "type": "string", "enum": ["call_tool", "final_answer"] },
      6. "tool": { "type": "string" },
      7. "arguments": { "type": "object" },
      8. "confidence": { "type": "number", "minimum": 0, "maximum": 1 }
      9. },
      10. "required": ["thought", "action", "confidence"]
      11. }
    6. Fast failure convergence

      • If the same error appears twice in a row, change strategy rather than “reflecting” repeatedly on the same line of thought;
      • On retry, carry only the error summary, not the full history;
      • Set rules: two consecutive errors of the same kind, a single task exceeding 20 steps, or budget usage over 80% triggers a human-confirmation or termination flow.

    4.3 A Trade-Off Principle

    Each step should carry only the context “needed for the decision,” not context that “might be useful.”

    More context is not safer. Too much irrelevant information dilutes the useful signal, raises token consumption, and can make the model misjudge, retry, or produce verbose output.

    5. Routing Lever: Match Different-Difficulty Tasks to Different-Spec Models

    Not every step in an agent pipeline needs the “strongest model.” You can build tiered routing:

    Tier Suitable tasks Model spec Focus
    L0 Rule layer Format validation, parameter completion, deterministic conversion No model needed Zero inference cost
    L1 Lightweight layer Intent recognition, information extraction, classification, summarization Small-parameter model Low latency, high throughput
    L2 Main layer Tool orchestration, routine code edits, multi-step planning Mid-to-large model Cache-friendly, stable tool calling
    L3 Hard-problem layer Complex debugging, architecture design, tough reasoning Large reasoning model Deep reasoning capability

    For example, a task like “deciding whether the user is asking to check logs or configs” can be handled by a small model or even a classifier. Only escalate to the main model when you need reasoning across multiple tools.

    Sample code:

    1. def dispatch(task):
    2. # 1) Rules first: deterministic tasks consume no model calls
    3. if task.kind in ("format_check", "param_fill"):
    4. return handle_by_rules(task)
    5. # 2) Lightweight layer: intent recognition, extraction, and other short-output tasks
    6. if task.kind in ("classify", "extract", "summarize"):
    7. return call_model("small", task, max_tokens=512)
    8. # 3) Hard-problem layer: complex reasoning tasks with a generous budget
    9. if task.complexity >= 3:
    10. return call_model("reasoning", task, budget=task.budget * 2)
    11. # 4) Main layer: routine orchestration, reusing the prefix cache where possible
    12. return call_model("default", task, cache=True)

    It’s worth stressing that routing itself has a cost. If you call a large model to make the routing decision at every step, the savings may not even cover the routing calls. Keep routing decisions on rules or lightweight models as much as possible.

    Also, different vendors’ model APIs, parameter names, and billing differ. It’s best to integrate through a unified model abstraction layer and configure a fallback chain in the routing table: when the main model times out or is rate-limited, automatically switch to a backup spec, and log the degradation event for later review.

    6. Architecture View: The “Local Gateway + Cloud Brain” Split

    An agent system can adopt a layered architecture that separates the local gateway from cloud inference. The original project’s description—handling users’ daily operations through local devices while the cloud model handles inference—itself reflects this design idea.

    Layer Responsibility Key design points
    Local gateway / execution layer Intercept user intent and device actions, run commands in a sandbox, hold local credentials Permission whitelist, secondary confirmation for dangerous actions, local audit logs
    Orchestration layer Task planning, model routing, context assembly, retry and interrupt recovery State machine for task lifecycle, budget control
    Model inference layer Understand instructions, generate actions, call tools Prefix caching, structured output, timeout and rate limiting
    Memory and data layer Session history, long-term memory, knowledge base, raw artifacts Persistent storage, retrieval, hot/cold tiering

    The benefits of layering:

    • Sensitivity: local files and credentials never leave the device; only necessary summaries go to the cloud;
    • Stability: if the network drops, the local gateway can still run already-approved safe actions;
    • Replaceability: the model layer integrates through a unified interface and can be adjusted as cost and capability shift.

    From a platform perspective, the cloud usually needs some general-purpose capabilities to support this architecture:

    • Object storage: hold the raw artifacts from tool returns and knowledge base files;
    • Message queues: decouple slow tool calls from the main inference flow, smoothing spikes;
    • Container platforms: provide isolated sandboxes for high-risk actions like code execution and browser automation;
    • Logging, monitoring, and alerting: record token usage and latency per inference, with budget alerts.

    If you build on a general cloud platform, these capabilities serve as cloud support; on the model side, a unified model access layer can manage how different-spec models are onboarded, switched, and failed over.

    7. Selection View: How to Judge Whether a Model Fits as an Agent’s Main Workhorse

    An open-source community recommending a default model for an agent project is essentially a selection decision aimed at real usage. For other teams, what’s worth borrowing isn’t so much a particular conclusion as the evaluation framework behind it. At minimum, examine six dimensions:

    1. Long-context effectiveness

      • A large advertised context window doesn’t mean it can all be used well;
      • Use a self-built test set to check the model’s information retrieval, multi-hop reasoning, and instruction-following under long inputs.
    2. Prefix caching capability

      • Whether caching is natively supported, plus the minimum cache length and retention time;
      • The cache hit rate, and whether it stacks with structured tool calling.
    3. Tool calling and structured output

      • Format compliance rate for function calls and JSON output;
      • Whether multi-tool concurrent calls are stable and whether complex arguments are generated correctly.
    4. Latency and throughput

      • Time to first token under long-input scenarios;
      • Output speed and the rate-limiting policy during peak hours.
    5. Cost structure

      • Whether input and output are priced separately and how cache pricing works;
      • Whether billing granularity is fine enough and whether usage and cost details are available.
    6. Stability and compliance

      • Service availability and version evolution strategy;
      • Whether model versions are pinned and queryable;
      • Whether data is used for training, plus data residency and compliance credentials.

    7.1 Selection Scorecard

    Candidate model Long-context effectiveness Prefix caching support P95 TTFT Per-task cost Task success rate Verdict
    Model A High Supported, hit rate TBD To be measured To be measured To be measured Enters main candidates
    Model B Medium Supported, average discount To be measured To be measured To be measured Suits lightweight tasks
    Model C To be verified Not supported To be measured To be measured To be measured Hold off for multi-turn agents

    For methodology, extract 100–300 representative requests from real task logs to build a task set covering “short / medium / long” input tiers, and measure end-to-end metrics uniformly:

    • Task success rate;
    • Average interaction steps;
    • Per-task token consumption and cost;
    • Cache hit rate;
    • P50/P95 time to first token;
    • Retry rate and human-takeover rate.

    Judging by unit price alone easily leads to a lopsided conclusion. A model with a lower unit price—if its tool calling is unstable, its caching is weak, or its long-context handling is poor—can cause more retries and a higher total cost.

    8. Industry View: The Business Logic and Risks Behind Low Cost

    8.1 Why Model Vendors “Trade Low Price for Scale”

    Large model inference is a classic scale business:

    • Once a model is trained, marginal cost lands mostly on inference compute;
    • The larger the call volume, the more room to optimize hardware utilization and cluster scheduling.

    At the same time, whoever becomes an agent’s “default model” holds the first entry point to developers. Agent tasks are usually long-context and multi-turn; once tool definitions, workflows, and prompts are all built around a model’s characteristics, migration cost climbs fast. That’s the business logic behind “low cost”: trade short-term compute spend for a long-term ecosystem position.

    For developers, this is a real dividend. Capabilities previously off-limits because “context was too expensive” can now be attempted more boldly:

    • Full code base understanding;
    • Around-the-clock log inspection;
    • Batch analysis of long documents;
    • Always-on personal assistants.

    But whether these capabilities last still depends on discount policies, service stability, cache discounts, and measured task results.

    8.2 Stay Architecture-Neutral and Avoid Single-Ecosystem Lock-In

    Even in a dividend period, stay clear-headed:

    • Quotas may phase out: the discount intensity during a new model’s launch is often the hardest to sustain; stress-test your budget model at “prices after the discount ends”;
    • Capability isn’t universal: the default model won’t necessarily be best at every task; code, multimodal, and long-chain tool calling still need independent evaluation;
    • Supply-chain concentration risk: bet all traffic on a single model and any service wobble or policy change hits the whole agent system;
    • Design for model-agnosticism: wrap model calls in an abstraction layer, keep prompts, tool definitions, and structured outputs under version control, build a repeatable evaluation set, and run regular regressions so switching models stays “swap-able and verifiable.”

    9. Implementation Checklist

    1. Measure first, optimize second: add token-usage and cost instrumentation aggregated by “task” to find the costliest task types;
    2. Staticize the prefix: put system prompts, tool definitions, and domain knowledge up front and version them, with dynamic content consistently at the end;
    3. Slim down tool returns: raw artifacts go to storage; only summaries and key fields enter the context;
    4. Set budgets and guardrails: per-task step, token, and cost caps that force convergence or a handoff to a human when exceeded;
    5. Tiered routing: rules, lightweight, main, and hard-problem tiers each do their job, with routing decisions aimed at “zero inference cost”;
    6. Model abstraction and rollback: a unified interface, version pinning, canary releases, and fast rollback;
    7. Build an evaluation loop: run fixed regressions on a real task set, and each time you switch models, look at “task success rate × per-task cost” rather than unit price;
    8. Design security and compliance in parallel: local permission whitelists, sandbox isolation, data classification, and audit logs—all before features ship.

    Conclusion

    The agent entering a low-cost phase doesn’t mean the cost problem disappeared. It means the center of gravity has shifted from “unit price” to “architecture and governance.” Mixture-of-Experts makes each inference lighter, prefix caching stops you from paying repeatedly for the same content, context management keeps the model from reading irrelevant information, and tiered routing sends the right tasks to the right models.

    In typical scenarios where cache hits, context slimming, and routing all take effect, per-task cost is expected to drop significantly—but the exact magnitude must be measured against your own task set, and can’t be promised in isolation from task distribution, cache hit rate, and discount policies.

    For developers and enterprises, the smartest investment right now isn’t chasing the “cheapest model.” It’s doing three things first:

    1. Instrument and measure: tally tokens, cost, latency, and success rate per task to find the real cost hotspots;
    2. Then staticize the prefix and slim the context: make the cache hit, and stop dumping tool returns into context indiscriminately;
    3. Finally build model abstraction and regression evaluation: keep models replaceable, results verifiable, and costs comparable.

    Whatever the default model becomes, this low-cost agent infrastructure will keep paying off.