Token Cost Engineering · 12 / 13

Output Layer: Keep the Model's Mouth Shut

Last of the four hands-on layers. Output Tokens cost several times more than input (look back at Lesson 3's price sheet), and they directly set API return speed. Three kinds of moves keep the model's mouth shut: instruction layer, code layer, engineering layer.

negative constraintsDiff outputstop sequences
Instruction layer · Write explicit negative constraints

Lots of people know to ask for “please answer concisely”—but that fails—“concise” is too abstract for the model; it doesn't know how concise you want. What works is spelling out “don't do X”:

✗ Vague constraint
Please answer concisely. → “Sure, here's the code you asked for. It implements a simple feature… Hope this helps!”
✓ Explicit negative constraints
No small talk, no summary, no pleasantries— output the result directly. (English: No yapping. No preamble, no postscript.) → def function(): return True

In practice, Agentic scenarios cut about 30% of the fluff. Plain talk: tell it—skip the extras, just deliver the result.

Output comparison: Be concise vs No yapping
“Be concise” is mysticism; “No preamble, no postscript” is an instruction: code-gen tasks cut ~30% fluff Tokens on average. (Figure: from the author's original share deck)
Code layer · Polish with Diff, don't rewrite the whole passage

Biggest cost trap in text polish: the user says “make this sentence smoother,” and the model reprints the whole 2,000-word article. Even if you constrain it to one paragraph, Tokens still burn fast.

Better idea: make the model output only what changed—mark “original → revised” in Diff form, or return a regex/replace instruction for the program to apply. Touch two or three words, done in a second: cost differs by tens of times, and the UX is better—faster, and users see exactly what changed without diffing by hand.

- Our product is a highly competitive presence in the market + Our product is highly competitive in the market Or return a replace instruction: {"find": "is a highly competitive presence in the market", "replace": "is highly competitive in the market"}
Engineering layer · Use stop sequences as a hard cut

Writing “please output only 3 items” in the Prompt is mysticism—maybe 3 items, maybe 5 plus a summary. But stop sequences are a hard cut; they don't care whether the model “obeys”: the API kills the generation stream when it sees the string; the cut part isn't billed and never enters history context.

Simple. Blunt. Effective. Controlling output is controlling cost and UX.

Key Takeaways

Negative constraints must be concrete: “no small talk, no summary, no pleasantries” beats “please be concise”; Agentic scenarios cut ~30% fluff.

Polish with Diff or replace instructions—don't let the model rewrite the whole passage: cost differs by tens of times, UX gets better.

Stop sequences are a physical switch: cut lists on “4.”, single-line answers on newline, JSON on “}”, self-Q&A on “User:”.

Source: Adapted from the author's internal team share “AI Token Cost Engineering Strategy” hands-on section “04|Output.” Stop-sequence parameters: see each vendor's API docs (OpenAI-compatible interfaces use the stop field, up to 4 sequences).