Model and Inference EngineeringPost-training and alignmentPrincipal
How should GRPO handle a timed-out candidate when computing group-relative advantages?
By Amit Kumar2 min readWorked answer includedReviewed 28 Sept 2026
The question
Interview question
A group-relative policy optimization (GRPO) run intends three candidates for one prompt. Two finish with graded rewards 0 and 1, while the third has an infrastructure timeout and no reward. Explain why the known candidates’ advantages depend on the missing member, compare retry, resampling and incomplete-group policies, and distinguish infrastructure uncertainty from a task-defined deadline failure.
Draft your approach first
Take a few minutes before you read the answer. Name the constraint that matters most, the failure you are designing for and how you would know it worked.
Reveal the worked answerWorked answer
GRPO compares several sampled completions for the same prompt. A common formulation centers each candidate's reward by its group's mean and scales by the group's standard deviation. So a candidate's advantage is not just a property of its own reward. DeepSeekMath introduced group-relative policy optimization, and TRL's GRPO documentation describes group rewards and handling of truncated completions in a concrete trainer. A request timeout is not automatically the same thing as a completion that hit a token limit. Check the implementation's group assembly and reward rules.
Say two completed candidates score 0 and 1. Centering and scaling those observed rewards gives roughly -1 and +1, using population standard deviation. If a third candidate had completed with reward 2, the rewards 0, 1 and 2 would center on 1, making the middle candidate's advantage zero. We do not know the timed-out candidate's counterfactual reward. The example shows why silently dropping it changes the relative target for the other candidates. Assigning it zero is also a choice that treats infrastructure failure as a low-quality policy answer.
I would log prompt ID, intended group size, generated candidate IDs, terminal cause, reward availability and which candidates entered normalization. Then inspect whether hard, long, tool-heavy completions time out more often. If so, the observed groups are a selected sample. Dropping failures can reward short easy completions, even when the task needed more work. For a recoverable infrastructure timeout, retry with the same policy snapshot and generation settings if the algorithm's sampling contract permits it. Otherwise mark the group incomplete and decide explicitly whether to resample the whole group, skip its update, or use a well-defined censored-outcome objective. Each choice has cost and bias.
The interviewer may ask if a timed-out candidate deserves zero reward because it failed the user's deadline. If meeting that deadline is part of the task, yes, a defined timeout penalty can be the right reward. But a crashed rollout worker is not a model failure. Keep service deadline failure separate from missing telemetry and use the same rule in training and evaluation. GRPO rewards the easy answer and punishes the best hard answer. Were the groups mixed? concerns completions from different prompts being mixed into one group. This case keeps prompt grouping correct and tests what missing members do to the group's statistics.
Related questions
Keep practising model and inference engineering
Follow another question in this area, or search the complete library.
Get my essays on AI engineering and distributed systems by email. Subscribe to ArchCrux