Skip to the content.

Context

A feature can be produced two ways: a cheap, fast specialized tool (a translation API, a classical classifier) that is adequate for the common case, and a slower, costlier LLM that does better on the hard cases. Crucially, the cheap tool’s shortfalls are observable: it either errors, or the user visibly rejects the result.

Examples

In Zeeguu, translation APIs (from Google, Azure, and DeepL) serve as the primary translation engines. When a user indicates the translation is inadequate (by choosing Ask an AI from the alternatives menu), the system escalates to an LLM for a more nuanced, context-aware translation. This keeps costs low and speed high in the common case while providing higher, LLM-quality results when needed.

In Zeeguu, the inline [translation](../zeeguu/#translation) is the primary path; when the user wants a better rendering they escalate to an LLM on demand via the "[Ask an AI](../zeeguu/#translation)" option.
In Zeeguu, the inline [translation](../zeeguu/#translation) is the primary path; when the user wants a better rendering they escalate to an LLM on demand via the "[Ask an AI](../zeeguu/#translation)" option.

A second escalation in the same system fires without the user. When the parts of a multi-word expression are separated in a sentence (German ich rufe dich morgen an, where dich morgen splits rufe from an), the translation APIs receive a fragment that has lost its context and return a poor rendering. That separation is visible in the parse, so the system escalates to the LLM on its own, passing the whole sentence rather than the fragment.1

These two escalations differ in how they are triggered, and the difference has a cost. The user-triggered one needs UI surface and puts the routing burden on the reader. The automatic one costs neither, but it is only possible because a separated expression is visible in the parse before the cheap tool has run. Where a shortfall cannot be detected in advance, the user is the only signal left.

Problem

LLM quality is only worth its cost on the minority of requests the cheap tool handles poorly, and those cannot be told apart up front. How can the LLM be spent only where it pays off?

Forces

Solution

Use the specialized tool as the primary path and escalate to the LLM only when the primary fails or the user signals dissatisfaction. The LLM receives the original input, and (where it helps) the specialized tool’s output and the user’s feedback alongside it, so the escalation refines rather than restarts.

The specialized tool serves the common case. The LLM runs only on an observable shortfall: the tool errors, or the user rejects its result.
The specialized tool serves the common case. The LLM runs only on an observable shortfall: the tool errors, or the user rejects its result.

Consequences

Known Uses

FrugalGPT (Chen, Zaharia & Zou, 2023) escalates when a scorer rejects the cheap answer, and RouteLLM (Ong et al., 2024) trains a confidence router that sends only the hard queries to the strong model. Both decide automatically from the model’s own confidence, the model cascade variant of escalation discussed in the Notes below. The external-signal trigger this pattern centers on (the primary tool erroring, the input arriving in a shape the tool handles badly, or the user rejecting the result) is less documented; the two Zeeguu escalations above are our instances of it.

Notes


💬 Open an issue about this pattern

  1. translate_separated_mwe in the zeeguu/api repository. ↩