Zero Labs
Industry News / AI

A 1M-Token Context Window Holds 4 MB of Docs — But Only 1.8 MB of Your Logs

Source · Towards AI By Decoding AI by Nueravi

From the publisher’s feed, collected in the ZeroLabs newsroom.

Megabytes of real material that fit in a 1,000,000-token context window, measured with Qwen's own tokenizer, 1 September 2026. Chart: Decoding AI.Filling a 1M-token window costs about $0.15 — but logs burn through it 2.2x faster than prose, so the honest unit is dollars per megabyte.Two labs shipped million-token context windows for pennies in the same week. So we tokenized 3.7 MB of real files with Qwen’s actual tokenizer to answer the question nobody was answering: filling a one-million-token window costs roughly $0.15–$0.16 once, but the material you’d actually put in it — logs, traces, stack dumps — burns through that window 2.2× faster than prose, which means the honest unit isn’t tokens at all. It’s dollars per megabyte.The pitch for a million-token context window is always the same picture: your whole codebase, your whole incident, your whole quarter of Slack, dropped into one prompt. Nobody has to chunk anything. Retrieval becomes optional.Then you run it on a Tuesday against a real incident, and the window fills before you’ve finished pasting the logs.That gap — between “1M tokens” as a spec-sheet number and 1M tokens as a container for the specific bytes you own — is where the money hides. And the odd thing is that despite a week of launch coverage in late August 2026, we could not find anyone who had measured it. Every post reported the price per million tokens. None reported what a million tokens actually holds.So we measured it. Here is the number that matters: on Qwen’s own tokenizer, one million tokens holds 3.96 MB of English technical prose but only 1.82 MB of machine logs. Same window, same price, less than half the material. If you are pointing a long-context model at operational data, you are paying about $0.082 per megabyte instead of $0.038 — and no pricing page anywhere tells you that.Key takeawaysWe measured 3.71 MB of real files with the Qwen2 tokenizer (vocab 151,936, exact round-trip verified) on 1 September 2026. English technical prose came in at 4.15 bytes per token; machine logs at 1.91 bytes per token — a 2.17× density gap between the two.A 1M-token window therefore holds ~3.96 MB of docs, ~4.01 MB of Python, ~3.77 MB of JSON, ~3.36 MB of C headers, and ~1.82 MB of logs. Logs are the worst case, and logs are exactly what long-context marketing invites you to paste.GLM-5.3-Flash and Qwen3.8-Flash-Next both launched 26 August 2026, both reaching a 1M-token context, at roughly $0.15–$0.16 per million input tokens per Artificial Analysis’ model page and DataCamp’s side-by-side comparison.Cached input is where the real leverage sits, not context length. On the published rates, cached input runs 5× cheaper on GLM-5.3-Flash ($0.03 vs $0.15) and 10× cheaper on Qwen3.8-Flash-Next ($0.016 vs $0.16). A 200k-token context re-read 40× a day for a month is $26.40 uncached and $5.28 cached on the former — the same workload, an 80% swing.The useful unit for capacity planning is dollars per megabyte of your data, not dollars per million tokens. We publish the conversion below so you can compute it for your own corpus.TL;DRTwo cheap million-token models shipped on the same day, and the coverage all priced them in tokens. Tokens are the vendor’s unit, not yours. We tokenized five kinds of real material with the actual Qwen tokenizer and found the byte-to-token ratio swings by more than 2×, with machine logs — the single most common thing people want to dump into a giant window — being the densest and therefore the most expensive per megabyte. The context window did not get cheap for everyone equally. It got cheap for prose and mid-priced for code and it is still expensive for telemetry. Budget in MB, cache aggressively, and stop treating “1M tokens” as a volume you understand.What actually shipped in late August 2026On 26 August 2026, two flash-tier models landed within hours of each other.GLM-5.3-Flash (Z.ai): a multimodal mixture-of-experts model, reported at 320B total parameters with roughly 18B active per token, reaching a 1M-token context, at a published $0.15 input / $0.50 output / $0.03 cached input per million tokens.Qwen3.8-Flash-Next (Alibaba): reported at 125B parameters plus a 51B-parameter n-gram embedding table with roughly 6B active per token, a 262,144-token native window extensible toward 1M, at $0.15–$0.16 input / $0.47 output per million tokens, with a cache-hit discount reported around 89%.Two independent write-ups agree on the shape of this — the DataCamp comparison and the Artificial Analysis model page, the latter also reporting 88.6 output tokens/sec and a 2.57s time-to-first-token for the Qwen model. Sources differ slightly on the exact input price ($0.15 vs $0.16) and on licensing terms, so we’ve used the range rather than picking a number, and we’re leaving licence claims alone entirely until the primary terms settle.What matters for this piece is only this: a million tokens of context now costs about fifteen cents, once. That is genuinely new. And it makes the second question — a million tokens of what? — the only interesting one left.How much does it cost to fill a 1M-token context window?About $0.15 to $0.16 to fill it once with fresh input tokens, on either of the two models that shipped on 26 August 2026, and about $0.016 to $0.03 if that same content is served from the provider’s prompt cache. But the per-fill price is misleading on its own, because the window is measured in tokens and your data is measured in bytes, and the exchange rate between them is not fixed. On our measurements it ranges from 1.91 to 4.20 bytes per token depending on content type — so the same $0.15 buys you 3.96 MB of documentation or 1.82 MB of logs. Price your workload in dollars per megabyte of your own corpus, not dollars per million tokens.How we measured itWe wanted numbers from the real tokenizer, not an estimate from the usual “≈4 characters per token” folklore.Method (1 September 2026):Pulled the Qwen2 vocabulary — 151,936 tokens and 151,387 merges — from the vocab fixture published in the llama.cpp repository. Qwen3.x models use this tokenizer family.Rebuilt it as a byte-level BPE tokenizer with Qwen2’s pre-tokenization split pattern, using the HuggingFace tokenizers library.Verified correctness by exact round-trip: encode → decode returned the original string byte-for-byte across prose, Python, JSON and mixed-Unicode samples. A tokenizer that round-trips exactly is a tokenizer that is splitting correctly.Assembled five corpora from real files on a standard Linux image — no synthetic text, nothing hand-tuned: CPython standard-library sources, Markdown documentation shipped inside installed packages, JSON schemas and SBOMs, system C headers, and the machine’s own dpkg/apt/bootstrap logs.Encoded each corpus whole and divided.Sample size: 3,733,777 bytes across 176 files, in corpora of roughly 0.8–1.1 MB each. Everything below is a measured ratio, not a projection. The one thing we did not do is measure GLM-5.3-Flash’s own tokenizer, so treat the numbers as Qwen-family; the direction of the effect will hold on any byte-level BPE, but the exact ratios will move a little.The actual run. roundtrip_ok True is the correctness check: encode then decode returned every sample byte-for-byte. Machine logs, highlighted, are the outlier at 1.91 bytes per token. Screenshot: Decoding AI.The actual run. roundtrip_ok True is the correctness check — encode then decode returned every sample byte-for-byte, which is how we know the tokenizer is splitting the way Qwen's does. Machine logs, highlighted, are the outlier at 1.91 bytes per token.The result: logs eat the window 2.2× fasterMeasured bytes per token, and the megabytes that fit in a 1M-token window:Python source code — 4.20 bytes/token → 4.01 MB per 1M tokensEnglish technical prose (Markdown docs) — 4.15 bytes/token → 3.96 MBJSON documents (schemas, SBOMs, config) — 3.96 bytes/token → 3.77 MBC / C++ headers — 3.52 bytes/token → 3.36 MBMachine logs (dpkg / apt / bootstrap) — 1.91 bytes/token → 1.82 MBProse and logs differ by 2.17× in token density. The window doesn’t change size. Your data changes size inside it.Converted into the unit that actually shows up on an invoice — dollars per megabyte of source material, at the published full input price:English prose: ~$0.038/MB (GLM-5.3-Flash) · ~$0.040/MB (Qwen3.8-Flash-Next)Python: ~$0.037/MB · ~$0.040/MBJSON: ~$0.040/MB · ~$0.042/MBC headers: ~$0.045/MB · ~$0.048/MBMachine logs: ~$0.082/MB · ~$0.088/MBReading a gigabyte of logs through one of these models costs on the order of $82–$88 at list price. Reading a gigabyte of documentation costs about $38–$40. Same model, same window, same nominal price per token — a 2.2× difference in what you pay to look at your own data.Why are logs so much more token-dense than prose?Because byte-level BPE merges are learned from natural text, and logs are barely natural text. A timestamp like 2026-09-01 10:08:47 is a run of digits and punctuation with almost no reusable multi-character merges available — digits tokenize close to one-per-character, and separators break merges that would otherwise span them. Add hex IDs, UUIDs, file paths, version strings and status codes, and you get a stream where the tokenizer's learned vocabulary almost never applies. English prose is the opposite case: common words are single tokens because the merge table was built to make them single tokens. The 2.17× gap isn't a quirk of our sample — it's the tokenizer working exactly as designed on material it was never optimized for.Dollars per megabyte on GLM-5.3-Flash, cached input versus full input price, by content type. Computed from published list rates, 1 September 2026. Chart: Decoding AI.The practical consequence: the more machine-generated your data, the worse your effective context window. Traces, metrics, event streams and database dumps are all in the log family. That is most of what an operations-facing agent looks at.The number that decides your bill isn’t context length. It’s cache hit rate.Here is the comparison that changed how we’d budget this.Take a modest agent loop: a 200,000-token working context, re-read 40 times a day, 22 working days a month. Not a million-token showpiece — an ordinary one.GLM-5.3-Flash: $26.40/month uncached → $5.28/month fully cached (5×)Qwen3.8-Flash-Next: $28.16/month uncached → $2.82/month fully cached (10×)The delta between a well-cached and a poorly-cached implementation of the same workload is $21–$25 a month per loop, which sounds trivial until you multiply by the number of concurrent agents in a real deployment. Doubling your context window changes your bill by 2×. Fixing your cache hit rate changes it by 5–10×. Almost all of the launch coverage discussed the first number and none of it discussed the second.And cache hit rate is a structural property of how you build the prompt, not a setting. Put the stable material — system instructions, schemas, the codebase — at the front, unchanged, byte-for-byte, every call. Put the volatile material at the end. Every byte you change near the top invalidates everything after it. We learned this the hard way while instrumenting agent loops for our write-up on multiple agents sharing one codebase, where per-agent prompt preambles differed by a single ID and destroyed cache reuse across the fleet.Steelman: “just don’t put raw logs in the context”The strongest objection to everything above is that nobody sensible pastes a gigabyte of raw logs into a model. You filter, you deduplicate, you extract the error lines, and you send a few hundred kilobytes of relevant material. On that account our log number is a strawman.That objection is largely right, and it’s the reason we’re not claiming long context is a bad deal. But it concedes the actual point: if you have to build a filtering pipeline before the context window is affordable, the window did not remove your retrieval layer — it just moved it. The million-token pitch is specifically that you can stop pre-processing. Our measurement says that for the densest and most operationally common data type, you can’t, or at least not without paying 2.2× for the privilege. There’s also a second-order cost the objection skips: the filter is now a component that can drop the one line that mattered, which is the failure mode retrieval systems have always had.So the honest position is narrower than either pitch. Long context genuinely removes chunking for prose and source code. For telemetry it changes the economics of your filter, not its existence.What we’d actually do with thisFive things, in order of payoff:Measure your own bytes-per-token before you budget. Take 1 MB of your real corpus, run it through the tokenizer of the model you’re buying, and divide. It takes ten minutes and it is the only number that makes a capacity plan real.Budget in MB, quote in MB. “We can hold 1.8 MB of production logs for $0.15 a pass” is a sentence a finance team can evaluate. “1M-token context” is not.Treat cache hit rate as a first-class SLO. Instrument it. A loop that silently drops from 90% to 30% cache hits gets ~4× more expensive with no change in behaviour and no alert.Order the prompt by volatility, stable content first. This is free and it is the single highest-leverage change available.Strip structurally, not semantically, before pasting telemetry. Collapsing repeated timestamp prefixes and normalising UUIDs recovers a large fraction of the density penalty without a model deciding what’s relevant.If you’re choosing between two of these models rather than budgeting for one, the same discipline applies to the swap itself — we found that switching providers is rarely the drop-in that routing layers imply, and tokenizer differences are one more thing that quietly moves when you change the engine underneath.Frequently asked questionsHow many pages is a 1M-token context window? For ordinary English prose, roughly 3.96 MB of text, which is on the order of 1,500–2,000 pages of plain writing depending on formatting. For machine logs it’s about 1.82 MB, which sounds like a lot until you notice a busy service can produce that in minutes. The page-count framing is only meaningful for prose; for structured or machine-generated data, measure bytes instead.Is a bigger context window cheaper than retrieval? For prose and source code at $0.15 per million input tokens, often yes — the engineering cost of building and maintaining a retrieval pipeline is real and recurring. For high-volume telemetry, usually no, because token density is 2.17× worse and the volume is unbounded. The break-even depends on how often you re-read the same context, which is really a question about your cache hit rate.Why does the same text cost different amounts on different models? Because each model family has its own tokenizer with its own learned merge table, so the same bytes become different numbers of tokens. Differences of 10–20% between tokenizer families on the same corpus are normal, which means a model that looks 10% cheaper per token can be more expensive per megabyte of your actual data.Does prompt caching apply to the whole context window? Typically only to a stable prefix, matched from the start of the prompt. That’s why prompt ordering matters so much: changing a byte early in the prompt invalidates the cached prefix from that point on. On the published rates for these two models, losing that prefix costs 5–10× on input.One question before you goIf you’ve run a long-context model against your own production data: what was your measured bytes-per-token, and on which corpus? We’d like to collect real numbers across content types rather than keep repeating the “4 characters per token” folklore — drop yours in the responses with the model and data type, and we’ll compile what comes in.Sources & ReferencesArtificial Analysis: Qwen3.8-Flash-Next model page — release date, context window, pricing, throughputDataCamp: GLM-5.3-Flash vs Qwen3.8-Flash-Next — parameter counts, context windows, input/output/cached pricingllm-stats: GLM-5.3-Flash launch analysis — launch details and positioningThe Neuron’s 31 August 2026 daily digest — corroborating roundup of the week’s flash-tier releasesTokenizer fixture: the Qwen2 vocabulary published in the llama.cpp model fixtures (151,936 tokens / 151,387 merges)Our own measurement, 1 September 2026: 3,733,777 bytes across 176 files, five corpora, Qwen2 byte-level BPE, exact round-trip verifiedRelated from usMultiple AI agents on the same codebase: we reproduced the turf war with zero AIMCP vs A2A: we diffed both agent protocol specsClaude’s protein design hit rate was 26.8% — and one target returned 0 for 90Nvidia’s AVO scored 100% on ARC-AGI-3 — but the model only scores 30%Written by Decoding AI. We take one AI story a day, run the number nobody ran, and publish what we actually measured — including when it contradicts us.A 1M-Token Context Window Holds 4 MB of Docs — But Only 1.8 MB of Your Logs was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.