guide
How to cut a prompt's tokens without changing what it asks for
An average English prompt carries between 30 % and 50 % of text that does not change the model's answer: pleasantries, filler, roundabout phrasing and repetition. This guide explains what exactly that text is, how to spot it, and where the line is beyond which trimming stops saving and starts breaking.
The examples and figures come from the engine of Prampt: 268 sustitucionesverified substitutions, 137 in Spanish and 131 in English.
What a token is, and why it takes up room
A language model does not read letters or words: it reads tokens, chunks of text averaging about four characters in English. «Optimizer» is several tokens; «the» is one. Punctuation, spaces and line breaks count too.
That matters for two different reasons, and they are worth keeping apart. If you pay for an API, every input token is billed on each and every call: a system prompt you send ten thousand times a day is a fixed cost repeated ten thousand times. If you use a free tier, you pay nothing, but every token still eats context window and brings forward the point where the conversation gets cut or the model starts forgetting the beginning.
Either way, a token is budget. You pay in money or you pay in room.
Careful: characters are not tokens
This is the most common mistake when trimming by hand. Replacing «in order to» with «to» saves nine characters, but the real saving is in tokens, and the two do not move together: a long common word can be one token while a short rare one is three.
That is why a character count is an approximation, not a measurement. The only reliable figure is the one the tokenizer of the model you are actually using gives you, and it varies between models.
The six categories of waste
Not all spare text is spare in the same way. These six categories go from least to most invasive, and that is exactly the order in which the three levels apply them.
Pleasantries
nivel Suave27 sustitucionesGreetings, thanks and please. They carry no instruction: the model does not answer better for being asked politely, and every one of them is billed.
- would you mind
- (se elimina)
- feel free to
- (se elimina)
- kindly
- (se elimina)
- i would like you to
- (se elimina)
Filler
nivel Suave28 sustituciones«It is important to note that», «as you know», «basically». They fill the sentence and change nothing about what is being asked.
- needless to say
- (se elimina)
- at the end of the day
- (se elimina)
- when all is said and done
- (se elimina)
- to be honest
- (se elimina)
Roundabout phrasing
nivel Equilibrado43 sustitucionesThis is where the bulk of the saving is. Written English stretches connectors well past the point of usefulness, and each one has a short equivalent that says exactly the same thing.
- in the event that
- if
- in the near future
- soon
- at the present time
- now
- on a regular basis
- regularly
- the majority of
- most
Wish wrappers
nivel Equilibrado23 sustituciones«I would like you to», «I need you to». The instruction is what follows; the wrapper only announces it.
- respond in as much detail as possible
- be detailed
- i want you to make a list of
- list
- walk me through
- explain
Role definitions
nivel Equilibrado10 sustituciones«I want you to act as an expert» compresses to «you are an expert» with no loss. The model reads the role either way.
Intensifiers
nivel Agresivo19 sustituciones«Very», «really», «extremely». Only removed on the aggressive level: they carry no meaning, but some people use them on purpose to weight an instruction.
- muy
- (se elimina)
- bastante
- (se elimina)
- sumamente
- (se elimina)
- extremadamente
- (se elimina)
What must never be touched
Trimming a prompt has a hard limit, and crossing it does not save money: it breaks the call. Four kinds of content have to come out of any optimization untouched.
- Code blocks and inline code. A comment inside a function is not a pleasantry: it is part of what you are asking the model to interpret.
- URLs. Removing a word from an address makes it a different address, or none at all.
- Template variables such as {{user_name}}. If your system substitutes them later, altering them breaks the replacement silently.
- Numbers, units and identifiers. There is no such thing as a redundant digit.
By hand or automated?
By hand works once. If you have a fixed system prompt, you go over it, shorten it and leave it written: you need no tool for that, and in fact a tool would be overkill.
The problem shows up when the text changes on every call: what the user types, the documents you pull from a store, the history you drag along. There you cannot anticipate what will arrive, so the only option is applying the rules at the moment.
And there is a third case: when there are several of you. One person shortens their way and another theirs, and three months later every prompt on the team reads differently. A shared dictionary is what keeps the criterion from depending on who wrote it.
Why rules and not a model
The obvious way to shorten a prompt is to ask a model to do it. It is a bad idea except in one specific case.
Spending a model's tokens to save a model's tokens only pays off if the result is reused a great many times. Compressing a prompt with an API call costs tokens now to save tokens later, so it makes sense for a system prompt you will send thousands of times, and makes none for the message you are about to send once.
A rules engine does not have that problem. It costs nothing to run, answers instantly, and, what matters most when the result goes to production, it is deterministic: the same input gives the same output every time. A model gives you a slightly different version each run, which is exactly what you do not want in something that runs unattended.
Try it with a prompt of your own
rules as you type, with a word-by-word diff so you see exactly what goes. The free plan includes 25 a month and asks for no card.
Sigue leyendo: planes y preguntas frecuentes · qué se guarda y qué no