Anthropic

Verified interview challenge

LLM output processing bug hunt

Review the code that turns batched token sequences into the response text returned to each request.

Unlock with Full Access

The challenge

Each sequence contains a prompt, generated tokens and possible padding. The processor must find the response boundaries, decode the right text and preserve the correspondence with the original inputs. Inspect the implementation for wrong slices, mixed-up requests and inputs that disappear silently.

What you'll practise

  • Sequence boundaries

    Separate generated text from the prompt, termination tokens and padding.

  • Request identity

    Keep each decoded response attached to the correct input and position.

  • Batch consistency

    Check how the implementation handles mismatched lengths and incomplete output.

Your code-review workspacePreview
Batch response processorCode included in the full challenge
Your code review

Explain the incorrect output and how to prevent it.

The code, instructions and feedback are included with Full Access.