Title: Quiz 4 — Instruction and Chat Formatting, Tokenization, and Templates
Course: AIINFRA 201: Model Adaptation — Fine-Tuning & Quantization > Section: Week 04 — Instruction and Chat Formatting, Tokenization, and Templates

Q: A chat template is stored as metadata on the model's tokenizer, not on the model's weights.
- True
- False
A: True

Q: What does tokenizer.apply_chat_template() do?
- Trains a new tokenizer from scratch
- Converts a list of `{role, content}` messages into the model's expected formatted string
- Quantizes the model's embedding layer
- Removes special tokens from a prompt
A: Converts a list of `{role, content}` messages into the model's expected formatted string

Q: Which pair correctly matches a model family with its turn-marking control tokens?
- All chat models use the same control tokens
A: All chat models use the same control tokens

Q: Chat templates are interchangeable across model families as long as the underlying architecture (e.g., both are transformer decoders) is the same.
- True
- False
A: False

Q: What is the main risk of using a chat template during fine-tuning that does not exactly match what the base model originally saw during its own training?
Feedback: Sample/expected answer: Silent performance degradation — the model keeps training without an obvious error, but response quality, turn structure, or instruction-following degrades in ways that are easy to miss.

Q: Why does TRL's SFTTrainer support conversational datasets (lists of {role, content} dicts) directly?
- It ignores chat templates entirely and trains on raw text
- It automatically applies the tokenizer's chat template during preprocessing, removing the need for manual prompt-string construction
- It converts every dataset into a single-turn format
- It requires you to write your own Jinja template before training
A: It automatically applies the tokenizer's chat template during preprocessing, removing the need for manual prompt-string construction

Q: If a custom chat template introduces new control tokens, a base model will already have meaningful embeddings for them because most tokenizers reserve unused slots for this purpose.
- True
- False
A: False

Q: When a new special token is introduced by a custom chat template, what two things need to happen before the model can use it meaningfully?
Feedback: Sample/expected answer: The token must be added as a special token (and the model's embedding matrix resized to include it), and the model must be fine-tuned (or the embedding explicitly initialized) so it learns a meaningful representation for that token.