﻿# lm-eval caching: prompt construction and model responses need separate identities

Separate cached lm-eval requests from cached model responses, isolate changed checkpoints and verify whether a benchmark rerun actually performed inference.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-lm-eval-request-response-cache-experiment-identity/
Language: en

## Identify what the rerun reused

A benchmark can finish much faster after enabling caching without the GPU executing the same workload again. That is useful for development, but it changes what the run demonstrates. The [command-line reference](https://github.com/EleutherAI/lm-evaluation-harness/blob/main/docs/interface.md) distinguishes cached preprocessed requests from the SQLite cache of model responses. Record which layer was active before interpreting elapsed time, energy use or backend reliability as fresh measurements from the current inference system.

## Treat prompt construction as an artifact

The [model integration guide](https://github.com/EleutherAI/lm-evaluation-harness/blob/main/docs/model_guide.md) explains that tokenizer identity helps distinguish request caches for different chat formatting. A task name alone cannot describe the rendered input. Retain the tokenizer revision, template, system instruction and few-shot configuration alongside representative requests. A valid cached request can still describe the wrong experiment when an integration reports an identity that does not reflect its actual prompt construction.

## Isolate model-response reuse

The [cache implementation](https://github.com/EleutherAI/lm-evaluation-harness/blob/main/lm_eval/api/model.py) wraps model calls and returns stored responses when matching requests are available. Do not interpret that wrapper as an independent verification of checkpoint provenance. Give materially different model configurations separate response-cache locations, especially when changing weights behind a stable model label. Inspect the installed version's treatment of sampling requests before expecting a stochastic rerun to provide independent samples.

## Separate throughput experiments from rescoring

Rescoring saved responses can isolate a metric or filter change without paying for inference again. Measuring a new serving stack requires fresh model execution under a declared cache policy. These are both useful experiments, but their timing belongs to different categories. If latency is the question, retain evidence that requests reached the intended backend; a successful evaluation process and a nonempty results file do not establish that by themselves.

## Make the cache decision reviewable

Compare a small diagnostic run with response reuse disabled against the cached version, inspecting request content and returned values. Keep this diagnostic separate from a published full benchmark. The guides to [task revisions](/journal/data-guide-lm-eval-task-config-revisions/) and [decontamination evidence](/journal/data-guide-lmeval-decontamination-query-cache/) describe adjacent identity boundaries. A useful report says whether the result came from freshly executed inference, reused model outputs or rebuilt requests, so another reader can reproduce the intended operation instead of merely repeating a command.
