Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

This self-test covers Modules 1–4. Set aside about two hours. Use paper or a local text editor and close the notes for your first attempt. Try every question before opening the answers. Give yourself 2 points for a complete, justified answer, 1 for a correct start with a material omission, and 0 for an incorrect or missing answer. Each answer below says what earns each point. The total is 16 points for your own review.

Question S1.1 (LO-1.1)

A tokenizer sees p a d three times and p a once. Which adjacent pair appears most often? Why might a different corpus choose another first merge?

Answer and scoring notes

The pair p a appears four times: three times inside p a d and once on its own. The pair a d appears three times, so BPE merges p a first. BPE learns its merges from the counts in its training text, so a corpus with different words has different pair counts and can choose a different first merge.

Scoring: 1 point for p a with its count of four. 1 more for saying that the merges come from the corpus’s pair counts.

Question S1.2 (LO-1.2, LO-1.3)

A next-token distribution gives A probability 0.8 and B 0.2. With top-p 0.75, which survives? What happens to the larger mass when temperature falls below one?

Answer and scoring notes

Top-p keeps the most likely tokens whose probabilities first add up to at least 0.75. A alone has 0.8, so only A survives, and every draw picks A. A temperature below 1 raises each probability to a power above 1 before rescaling, which sharpens the distribution: A’s share rises above 0.8 and B’s falls below 0.2.

Scoring: 1 point for “only A” with the reason that A alone reaches 0.75. 1 more for saying that A’s share grows.

Question S1.3 (LO-1.3, LO-2.3)

A 100-token context has 20 system tokens, needs 25 answer tokens, and has 70 user and history tokens. How many user and history tokens must you remove?

Answer and scoring notes

The context window has to hold the prompt and the answer together, so reserve the answer first: 100 − 20 − 25 = 55 tokens remain for the user turn and the history. There are 70, so remove at least 70 − 55 = 15. Keep the current question, because the model can answer only from what the request contains, and drop or summarize the oldest turns.

Scoring: 1 point for 15, with the 25 answer tokens reserved. 1 more for keeping the current question and saying what to cut.

Question S1.4 (LO-2.1, LO-2.2)

Give the message roles in a request with one previous exchange and a new question. Input costs $4 and output costs $20 per million tokens. What is the charge for 500 input and 50 output tokens?

Answer and scoring notes

The messages are user, assistant, and user: the earlier question, the earlier answer, and the new question. Instructions go in the separate system field, not in a message. The input costs 500 × 4 / 1,000,000 = `0.002, and the output costs 50 × $20 / 1,000,000 = 0.001`, for a total of `0.003`.

Scoring: 1 point for the three roles in order, with the system prompt outside them. 1 more for $0.003 with both parts.

Question S1.5 (LO-2.4)

A reply stops at max_tokens and its first line has the correct label. How should the consumer report it?

Answer and scoring notes

Report it as incomplete. A stop_reason of "max_tokens" means the model was cut off, so the reply may be missing text that would have changed or qualified the label. Check the stop reason before parsing, and parse only a reply that ended with "end_turn". A correct-looking first line is luck, not a result.

Scoring: 1 point for “incomplete.” 1 more for checking the stop reason before the label.

Question S1.6 (LO-3.1, LO-3.2, LO-3.3)

A dispatcher gets “Sort it.” Rewrite the prompt for a repair receipt and name one success check. Identify what changes between requests.

Answer and scoring notes

Put the policy in the system prompt: the three queues with a definition of each (repair for mechanical service, billing for payments and receipts, and account for profiles), a rule for a ticket that mentions two topics (use the current request), and the exact output, one line of Label: <queue>. Send the ticket, such as “Can you send the receipt for my brake repair?”, as the user message. One success check: the reply equals exactly Label: billing. Only the ticket changes between requests; the system prompt stays the same.

Scoring: 1 point for a system prompt with the queues, their definitions, and the format. 1 more for an exact check and for naming the ticket as the only part that changes.

Question S1.7 (LO-4.1, LO-4.2)

In a tagged dispatch prompt, the ticket is Brakes & pads < $20. Write the encoded value and name how you test it.

Answer and scoring notes

The encoded value is Brakes &amp; pads &lt; $20. In XML, & starts an entity and < starts a tag, so both must be escaped; $ has no special meaning in XML and stays as it is. To test it, parse the whole rendered prompt with an XML parser and check that the ticket element’s text equals the original string. That round trip catches both a missing escape and a double one.

Scoring: 1 point for the encoded value. 1 more for a parse-and-compare test.

Question S1.8 (LO-4.3)

A revised template adds a required field named audience. Design one check on the renderer and one on the version history.

Answer and scoring notes

On the renderer: rendering the new version without an audience value raises an error, and so does supplying a field the template doesn’t declare. On the version history: keep the old and new templates as separate files, diff them, and confirm that the diff shows only the added $audience line, with a note on why the version needed it.

Scoring: 1 point for a renderer check that fails on the missing field. 1 more for a diff of two stored versions with the reason recorded.

Decide what to review

Revisit every module where you lost a point. Redo one lab check and one practice exercise with a changed input, then explain why the expected result changes. A missing unit, unstated assumption, or skipped validation condition is worth correcting in your notes.