Skip to the content.
The [`COMBINED_VALIDATION_PROMPT`](https://github.com/zeeguu/api/blob/master/zeeguu/core/llm_services/prompts/translation_validator.py#L8-L72) template: ~250 lines of validation rules, frequency/[CEFR](../zeeguu/#cefr-levels)/phrase-type taxonomies, output format, and examples, wrapped around just three variables (`{word}`, `{translation}`, `{context}`). Sent one pair at a time, the entire preamble is re-paid on every call. This fixed overhead is the cost the pattern amortizes.
The [`COMBINED_VALIDATION_PROMPT`](https://github.com/zeeguu/api/blob/master/zeeguu/core/llm_services/prompts/translation_validator.py#L8-L72) template: ~250 lines of validation rules, frequency/[CEFR](../zeeguu/#cefr-levels)/phrase-type taxonomies, output format, and examples, wrapped around just three variables (`{word}`, `{translation}`, `{context}`). Sent one pair at a time, the entire preamble is re-paid on every call. This fixed overhead is the cost the pattern amortizes.

Context

Many LLM calls share the same shape: a large, fixed instructional prompt (rules, taxonomies, output format, examples) wrapped around a tiny variable input (see figure). The work is offline and batchable: nobody is blocked on any single result.

Example

Several Zeeguu jobs have exactly this shape. Rather than pay the preamble once per item, they batch (i.e., pack) related items into a single call, in one of two directions: fan-in (many inputs, one call) or fan-out (one input, many outputs):

Problem

Sent one item at a time, that fixed preamble is re-paid on every call and dominates token cost and latency. How can it be paid once instead of once per item, without blowing past the model’s quality or context limits?

Forces

Solution

At its core, this is map for LLM calls: apply one shared, expensive prompt across a batch so its setup is paid once, not once per item. It takes two forms:

Both combine naturally with Anticipatory Precomputation (computing likely-needed results ahead of time): because results are computed offline, there is the luxury of batching.

Consequences

Known Uses

Notes


💬 Open an issue about this pattern

  1. The batched meaning-classifier prompt, create_batch_meaning_frequency_and_type_prompt in the zeeguu/api repository. 

  2. The batch example-sentence validator, validate_examples_batch in the zeeguu/api repository. 

  3. The multi-level simplification prompt, get_adaptive_simplification_prompt in the zeeguu/api repository.