In this article
A correct response string does not prove that a likelihood adapter scored the intended continuation tokens.
Begin with the scored event
A custom inference backend can produce sensible text while returning incorrect benchmark likelihoods. Generation and conditional scoring exercise different interfaces. The model guide defines a likelihood request using context and continuation, with the probability assigned to the continuation under that context. Before comparing GPUs or quantization formats, establish exactly which tokens contribute to this score; otherwise an adapter defect can resemble a model-quality regression.
Preserve tokenization across the join
Encoding the context and continuation independently is not generally equivalent to encoding their concatenation for a causal model. Whitespace and subword boundaries can change the resulting token sequence. The shared model implementation handles this boundary and moves trailing context spaces into the continuation before encoding. Follow the relevant backend contract rather than assuming that a character split always maps cleanly to a token split.
Align predictions with their targets
Causal model logits at an input position predict the following token. A continuation score must therefore align the selected logits with the actual continuation token IDs, excluding context-only terms and unintended padding. The model guide illustrates this shift. Audit a short example where each scored token and its selected probability can be inspected. A plausible aggregate negative number is a weak diagnostic because several indexing mistakes still produce values in an apparently reasonable range.
Make empty context and formatting explicit
An empty context needs the backend’s declared prefix or end-of-text handling rather than an accidental empty tensor. Chat formatting adds another boundary: the delimiter update documents how an applied template changes target delimiter handling. Test base and chat configurations separately. Correctness for a plain completion does not automatically establish correctness when assistant markers, special tokens and template-provided spacing are involved in the scored sequence.
Validate before measuring scale
Compare the adapter with a trusted implementation on short, inspectable cases containing leading whitespace, an empty context and a continuation spanning multiple tokens. Then test batched padding without changing the intended scores. The guides to task configuration identity and request versus response caching provide surrounding controls. Treat successful token alignment as a prerequisite for throughput experiments, preserving the difference between a backend that generates text and one that implements the benchmark’s probability measurement correctly.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.