
A response generator is configured to stop at a marker. If the model quotes that marker as ordinary text, a naïve truncation step can silently remove a useful answer. This small string model illustrates where an exact marker cuts output. A real streaming decoder may receive marker characters across several chunks.
Audit the inputs first
The inputs are illustrative measurements or labels. They give the evaluation a known answer without making a benchmark claim about a particular commercial model. Store the model revision, prompt template, decoding settings and evaluation set when collecting comparable real results.
def evaluate(v):
return v[0].partition(v[1])[0]
for sample in [['Step one<END>ignored', '<END>'], ['A literal <END> may appear', '<END>'], ['No terminator', '<END>']]:
print(evaluate(sample))Check the operating boundary
| Example input | Calculated output |
|---|---|
| ["Step one<END>ignored", "<END>"] | 'Step one' |
| ["A literal <END> may appear", "<END>"] | 'A literal ' |
| ["No terminator", "<END>"] | 'No terminator' |
For ["Step one<END>ignored", "<END>"], the observed output is 'Step one'. With ["A literal <END> may appear", "<END>"], it becomes 'A literal '. If a second implementation produces a different answer, begin with these small inputs. They allow a reviewer to trace the expression without reconstructing the entire application or replaying a production workload.
The result for ["No terminator", "<END>"] is text, 'No terminator'. Compare the resulting characters directly in a test. If two outputs look identical on screen, printing a quoted representation can expose a trailing space, a line boundary or an escaped character.
Keep the shape of these outputs with the recorded result. A list used as a feature vector needs its column order, while a pair of measurements needs a name for each component. A downstream dashboard cannot reconstruct that meaning from a sequence of unlabelled numbers.
Where this calculation stops
Verify the serving system’s stop-string handling with quoted input, partial chunks and absent markers before exposing a strict output contract.
For a repeatable comparison, retain one counterexample as well as one ordinary success. In this fixture, ["A literal <END> may appear", "<END>"] makes a useful starting point: its reference result is 'A literal '. A changed result is a prompt to inspect the inputs, dependency version and chosen policy before accepting a new baseline.
A reproduction of generation stop strings should keep the generation setup with the case. Here the original first input is ["Step one<END>ignored", "<END>"]. In a production note, include the tokenizer, decoding configuration and prompt revision in use. This makes it possible to tell a code regression apart from a serving change that alters the meaning of the logged inputs when the same evaluation is run again.
Transformers generation configuration · Python numeric types
Sources and further reading
Cover photograph: Pointing stick of a Lenovo ThinkPad keyboard-0899 by Raimond Spekking. CC BY-SA 4.0. Cropped and typeset for this cover. The photograph illustrates the topic. This image adaptation uses the same share-alike license.
