Critic
Predict the remaining return from a checkpoint. The search uses these predictions to choose where to continue, and preparation exports the observed backups as the critic’s training targets.
Critic
Section titled “Critic”Predict the remaining return from each checkpoint context. Selective search uses these predictions to choose continuations; preparation pairs scored contexts with backup targets for critic training.
from_fn wraps a synchronous or asynchronous batch function; constant(v) predicts v everywhere. Pass context= to either factory to choose how a rollout becomes input text. The default is a transcript with role labels. The exact text sent for prediction is also saved in critic training records. To implement a backend, subclass Critic and define predict(); override context() for custom rendering. A prediction batch that exceeds timeout counts as a scoring failure.
Definition
Fields
Critic.predict
Section titled “Critic.predict”Required implementation.
Return one predicted remaining return for each context, in order.
Critic.context
Section titled “Critic.context”Render a checkpoint as the critic’s input text. The default renders the conversation; the same text becomes the critic training record’s context.
Critic.aclose
Section titled “Critic.aclose”Release resources the critic owns. The default does nothing.
Critic.constant
Section titled “Critic.constant”A critic that predicts value everywhere: the starting point before a value model is trained.
Critic.from_fn
Section titled “Critic.from_fn”Wrap a function from a batch of contexts to a batch of predictions. The function may be synchronous or asynchronous.
PredictFn
Section titled “PredictFn”A batch prediction function for Critic.from_fn: contexts in, one predicted return per context out, synchronously or as an awaitable.
Definition
VLLMCritic
Section titled “VLLMCritic”A value model served by vLLM as a pooling model. Each context is sent to the server’s pooling endpoint and reduced to one predicted return.
reduce chooses how per-token outputs become one value: the last token (default), the first, their sum, or their mean. timeout bounds one prediction batch for the search. Close the critic when training ends.
Definition
VLLMCritic.init
Section titled “VLLMCritic.init”VLLMCritic.predict
Section titled “VLLMCritic.predict”Send the contexts to the pooling endpoint and return one value per context.
VLLMCritic.aclose
Section titled “VLLMCritic.aclose”Close the HTTP client the critic created.