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?
| Source | Symptom | Remedy |
|---|---|---|
| Bloated system prompt | Every rule and example is sent with every request | A short shared instruction, task-specific rules only when needed |
| Unfiltered retrieval | Too many or too large chunks are attached to the question | Metadata filters, reranking, meaningful chunking |
| Long chat history | Old and outdated details are carried along | Summarise older turns or start a new session |
| Raw tool output | Full JSON, long logs or tables go back to the model | Return only the fields the next step needs |
| Document noise | Headers, footers and repeated legal text | Clean them during ingestion |
| Wrong model choice | Simple classification runs on a large model | Route 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:
- Narrow tool output before passing it to the model; from a long query result, pass on only the fields needed.
- Use the summary of a document already read as working context instead of loading the document again and again.
- Instead of loading large data up front, keep lightweight identifiers such as file paths or queries and fetch the content when it is needed.
Settings that shape context in Zylon
- Company Context: according to the documentation, organisation-level context is taken into account in every interaction across every project. It should therefore stay short and limited to what the company does, its acronyms and its specific terms.
- Project instructions: used in every interaction in the project; they augment rather than replace the company context. The operator sets the maximum length of the field and the default limit is 4000.
- Skills: an instruction pack written once instead of re-explaining how a task should be done every time; a project admin can switch a Skill on by default for new chats.
- Scope: a chat can be pointed at the entire knowledge base, a folder or a single file, which the documentation says helps the model focus.
- Model preset: the alternative preset that runs a larger model trades it for a smaller context window.
- Measurement: the Usage Dashboard in Backoffice shows the total input tokens consumed in the selected date range and gateway scope.
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?
Should we make prompts as short as possible?
Does prompt caching change the content of the answer?
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
- Lost in the Middle: How Language Models Use Long Contexts, 2023
- RULER: What's the Real Context Size of Your Long-Context Language Models?, 2024
- Large Language Models Can Be Easily Distracted by Irrelevant Context, 2023
- Prompt Cache: Modular Attention Reuse for Low-Latency Inference, 2023
- Efficient Memory Management for Large Language Model Serving with PagedAttention, 2023
- Language Model Tokenizers Introduce Unfairness Between Languages, 2023
- How Good is Your Tokenizer? On the Monolingual Performance of Multilingual Language Models, 2021
- Effective context engineering for AI agents, Anthropic, 2025
- Prompt caching, OpenAI API documentation
- Automatic Prefix Caching, vLLM documentation
- Zylon documentation, Adding Company Context
- Zylon documentation, Adding custom instructions
- Zylon documentation, Using a Skill in chat
- Zylon documentation, When to use the chat assistant
- Zylon documentation, AI Presets Reference
- Zylon documentation, Advanced Customization
- Zylon documentation, Usage Dashboard
- Zylon blog, How to Use Tokens Efficiently in Enterprise AI Workflows
- Zylon blog, Token efficiency is becoming a real advantage in AI developer workflows
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 →