Back to problems

Tokenize (Python)

AI Coding · Anthropic · Medium

Part 1: Read and Understand the Code You are given two functions, tokenize and detokenize. Examine them carefully and then: Describe the behavior of each function. Point out weaknesses in this tokenization design. Explain situations in which the implementation does not behave correctly. For example: Here, tokens becomes [4, 5, 6], while result becomes "mnop"; the final "q" is never represented because no vocabulary entry covers it. Your Tasks Walk through the execution of…

Checking your access…