Home / Blog / Token efficiency

Token efficiency: managing context in enterprise AI workflows

Short answer: Token efficiency is not about making prompts shorter; it is about giving the model the information it needs at each step, in the right order and without noise. Extra context does more than add processing load: research shows that information in the middle of a long context is used less reliably and that irrelevant information lowers accuracy. On a platform running inside the organisation, tokens translate into GPU memory and response time. Context management is therefore part of system design rather than a cost-saving tactic.

As enterprise AI use spreads, prompts grow quietly. New rules are added to the system prompt, the retrieval step attaches more document chunks to every question, agents read tool outputs back in full and long chats drag old details along. Each addition looks reasonable on its own; together they slow the system down and make errors harder to trace. This article explains why context is a limited resource, how Turkish affects token counts and which rules work in enterprise workflows.

Why are tokens more than a cost item?

Speed. Processing the input takes time before the response starts. A study on prompt caching shows that gains in time to first token are most pronounced for longer prompts such as document-based question answering.

Memory. For every token it processes the model keeps intermediate computations in the KV cache. According to the Zylon documentation this cache grows with context length, model size and the number of requests processed at the same time; setting the context window too high for the allocated memory causes out-of-memory errors during inference. The PagedAttention paper likewise shows that the KV cache for each request is huge and, when managed inefficiently, limits the batch size. On an on-premise server, long contexts reduce the number of requests the same GPU can serve at once.

Quality. A study of long contexts found that performance is often highest when the relevant information sits at the beginning or end of the input and degrades significantly when it sits in the middle, even for models built for long contexts. In the RULER benchmark, all the models evaluated claimed context sizes of 32K tokens or more, yet only half of them maintained satisfactory performance at 32K. Another study found that model accuracy drops dramatically when irrelevant information is added to a problem description.

A model provider's guide to context engineering condenses these findings into one principle: context is a finite resource with diminishing marginal returns and the goal is to find the smallest possible set of high-signal tokens that maximise the likelihood of the desired outcome.

Turkish changes the token arithmetic

Token counts vary by language. A study of tokenisers found that the same text translated into different languages can differ in tokenised length by up to 15 times in some cases. According to the study, this affects cost, processing time and latency as well as the amount of content that can be given to a model as context. Another study showed that the tokeniser of a multilingual model splits Turkish text into far more pieces than a tokeniser built for Turkish.

The practical consequence is that context and capacity estimates made with English samples can mislead for Turkish documents. Context window, chunk size and GPU capacity are best planned by measuring with the organisation's own Turkish documents and the tokeniser of the model that will be used.

Where does token waste come from?

SourceSymptomRemedy
Bloated system promptEvery rule and example is sent with every requestA short shared instruction, task-specific rules only when needed
Unfiltered retrievalToo many or too large chunks are attached to the questionMetadata filters, reranking, meaningful chunking
Long chat historyOld and outdated details are carried alongSummarise older turns or start a new session
Raw tool outputFull JSON, long logs or tables go back to the modelReturn only the fields the next step needs
Document noiseHeaders, footers and repeated legal textClean them during ingestion
Wrong model choiceSimple classification runs on a large modelRoute simple steps to a smaller model

The problem rarely sits in one prompt; it builds up across the whole workflow. The unit of measurement should therefore be tokens per completed task rather than tokens per request: an answered question, a finished document or a completed agent run.

Stable content first, variable content last

Many prompts share overlapping segments: system messages, prompt templates and documents provided as context. The prompt caching study showed that the attention states of these frequently occurring segments can be precomputed, stored on the inference server and reused. Time to first token improved by 8x on GPUs and by up to 60x on CPUs while output accuracy was maintained.

Caching only works for the unchanged beginning of a prompt. According to one provider's documentation, reuse requires the entire prefix to match; if something changes within the prefix, nothing after that point can match. The documentation of an open-source inference engine makes the same point: a prompt that differs at one token recomputes everything after that point, even if the later text is identical.

The rule is simple: system prompt, tool definitions and stable documents go first; the user's question, the date and person-specific details go last. A timestamp placed at the very start of a prompt defeats the cache on every request.

Context in agents: tool output and summarisation

Agents plan, call tools, read results, retry and summarise; every step adds tokens to the context. The context engineering guide mentioned above describes summarising a conversation that is nearing the context window limit and starting a new context window with that summary. It counts clearing old tool results among the lightest forms of compaction. It also warns that overly aggressive compaction can lose subtle but critical context whose importance only becomes apparent later. Rules that work in practice:

Settings that shape context in Zylon

On an on-premise platform tokens translate into GPU memory and response time; these settings are the means of spreading limited capacity across more users and more work. See the Zylon and API integration pages for the overall architecture.

Frequently asked questions

Does choosing a model with a larger context window solve the problem?
Not on its own. Long-context benchmarks show a gap between the context length models claim and the length at which they keep their performance. A larger context also needs more memory for the KV cache. Removing unnecessary context first is the more reliable route.
Should we make prompts as short as possible?
No. A prompt that is too short becomes ambiguous, too little retrieved context leads to wrong answers and over-aggressive summarisation loses detail. The goal is not the lowest token count but the least unnecessary context per completed task.
Does prompt caching change the content of the answer?
The cache reuses the computation for an identical prefix; in the prompt caching study output accuracy was maintained. Its effect is on time to first token and processing load.

Related glossary terms

Token, Context window, Context engineering, Lost in the middle, Prompt caching, Prefix caching, Key-value cache, Time to first token, Token fertility, Context compression

Sources

Are your AI workflows using your GPU capacity efficiently?

Tell us which workflows you run, with which documents and for how many users; we will work out the context design, model preset and measurement plan with you.

Request a technical assessment →

This site sets no cookies. Visitor numbers are counted in aggregate using a cookieless method that does not identify anyone. See the Privacy Policy for details.