Same Perfect Score, Very Different Token Costs: Why Model Choice Matters for Structured Data Extraction
A structured data extraction test found that a flagship model, a lightweight model, a general-purpose model, and automatic routing all scored perfectly, but their token consumption differed by up to about 85%. This article covers what the result does and does not show, why automatic routing can cost less than a lightweight model, three sources of token cost differences, and four cost-reduction approaches with a pre-launch validation checklist.
Key Findings
In one structured data extraction test, a flagship model, a lightweight model, a general-purpose balanced model, and automatic routing all achieved a perfect score. However, their total token consumption differed by up to about 85%. For tasks with a fixed format and clear boundaries, model choice has a large effect on cost. This figure only reflects the conditions of this test. It may not hold for other workloads, so enterprises should measure with their own samples.
Test Conditions and Limitations
The task asked models to read a long, information-dense text, such as a financial or business report containing entity relationships, timelines, and numerical metrics. Models then output structured data in predefined fields that could be written directly into Excel. The evaluation looked at four metrics: extraction accuracy, field completeness, format compliance rate, and whether the output could be imported into a database directly. Any extra explanatory text counted as non-compliant.
The original test did not disclose model names, versions, parameter counts, prompts, sample sizes, or the distribution of input lengths, so outside readers cannot reproduce these numbers. The 85% figure should be read as the gap observed under these conditions, not as a fixed price difference between any models.
When measuring cost, record at least the following: model name and version, number of samples, average input and output tokens, per-token pricing for each model, total cost, accuracy, and format compliance rate. Only by looking at accuracy alongside cost can you tell whether the savings came at the expense of quality.
Why Automatic Routing Can Cost Less Than a Lightweight Model
This point is easy to misread. Intuitively, a lightweight model has the lowest unit price, so it should be the cheapest option. In this result, however, automatic routing had lower total consumption. The original article does not break down the data, so the explanation below is based on common mechanisms and is an inference.
First, automatic routing can send simple requests to a model that is cheaper than a general-purpose lightweight model. Second, the routing layer can trim inputs first, reducing the number of tokens sent to the model. Third, for repeated inputs, the routing layer can reuse cached results and skip the model call entirely. Combined, these steps may bring total consumption below that of calling a single lightweight model directly. If your test shows a similar result, first check the routing logs to confirm which step produced the savings.
Three Sources of Cost Differences
The first is input cost. Longer inputs mean more billed tokens, and computation grows faster as models process long contexts. If long text is sent without any trimming, input costs stay high.
The second is output redundancy. Some models add pleasantries such as “Sure, here is the data you requested” before structured data, or append analysis paragraphs after it. This content violates the format requirements and also generates extra output tokens. Retries after a format parsing failure further increase consumption.
The third is hidden reasoning cost. Models with chain-of-thought capabilities may perform substantial internal reasoning even on simple mapping tasks. Many platforms count reasoning as output tokens, so this cost appears directly on the bill. For field mapping tasks, reasoning usually provides no clear benefit.
Cost-Reduction Approaches
1. Intent-Based Smart Routing
Add a lightweight classifier at the business gateway layer. It first identifies the request type, then decides which model to call. Features for this decision can include task type, input length, number of target fields, and whether the request requires multi-step or cross-document reasoning.
The following starting thresholds should be adjusted based on your own test results. Requests with a single input under about 5,000 tokens, fewer than 20 fields, and only single-step extraction go to the lightweight model. Requests involving multi-document comparison or multi-step reasoning go to the flagship model.
Routing carries a risk of misclassification. Sending a simple task to a complex model only adds cost, while sending a complex task to a lightweight model reduces quality. Therefore, sample the routing results for review and set a fallback rule: when output validation fails, automatically escalate to a stronger model for one retry instead of retrying without limit.
2. Enforce Structured Output and Trim Inputs
When calling the API, enable JSON mode or provide a JSON Schema constraint directly. The system prompt can state:
“Output only content that conforms to the following JSON Schema. Do not output greetings, explanations, or Markdown markup. Fill in null for any field that cannot be determined.”
Input trimming can first use regular expressions and traditional NLP methods to remove irrelevant content such as headers, footers, and copyright notices. Then keep only the paragraphs that contain the target metrics, along with adjacent paragraphs to preserve context. The risk of trimming is losing key facts, so test recall with a set of samples that have reference answers, and confirm that trimming did not drop necessary information.
3. Unified Model Gateway and Quota Monitoring
When multiple models run side by side, each has its own authentication method, interface format, quota, and billing rules. A team can build or purchase a unified model gateway that consolidates these differences behind a single interface. The gateway can implement unified authentication, routing, quota management, and real-time token-level monitoring.
When a model’s consumption reaches the warning threshold, the gateway should trigger an alert and downgrade to a backup model according to a contingency plan. Test the downgrade strategy in a test environment in advance. Otherwise, when a real problem occurs, the backup model’s quality may fall short of requirements.
The following pseudocode shows the basic idea of routing and validation fallback:
def route_and_validate(task, prompt, context):if task.type == "extraction" and len(context) < 5000 and task.field_count < 20:result = call_llm(model="light", prompt=prompt, json_mode=True)else:result = call_llm(model="flagship", prompt=prompt, json_mode=True)if not validate_schema(result, task.schema):# Validation failed. Escalate to a stronger model and retry once.result = call_llm(model="flagship", prompt=prompt, json_mode=True)return result
4. Fine-Tuning for High-Frequency Fixed Tasks
If a certain type of task occurs frequently every day and its format stays stable, collect historical input-output pairs that have been manually confirmed. Then apply LoRA fine-tuning to an open-source lightweight base model. After fine-tuning, the model produces the target format more reliably, and the system prompt can be shortened, which reduces the tokens consumed per call.
Fine-tuning requires sufficient training data, an independent evaluation set, and ongoing maintenance. It is not suitable for businesses whose formats change often, because each change requires retraining.
Pre-Launch Validation Checklist
Use the same batch of samples to fill in the table below for each candidate approach before choosing the production setup:
| Approach | Average input tokens | Average output tokens | Unit price | Cost per sample | Extraction accuracy
