Start with part 1: AI basics summary and 28 practice questions (part 1)

Summary

This is part 2 of my AI basics summary with practice questions I made myself. It skips anything that overlaps with part 1 and asks about the same concepts from different angles: 28 four-option multiple-choice questions in 10 groups. Pick your own answer first, then open the toggle right below each question to check the answer and explanation.

  • Content not covered on the blog uses only commonly accepted explanations and is marked (supplementary). Numbers such as (191) at the end of an explanation are the blog post numbers used as the source.
  • Starting post: donggrri.tistory.com/200 — the AI study posts that follow from it are the sources (written in Korean).

How Do Temperature and Top-p Change the Probability Distribution?

Key points

  • Temperature divides the logits by T, changing the shape of the distribution. Lowering T makes it sharper (concentrated on the top choice), while raising T makes it flatter (more diverse, with more unexpected answers).
  • Dividing by T keeps the ranking of tokens the same. What changes is the size of the probability gaps.
  • Top-p keeps only the smallest set of candidates whose cumulative probability is at least p. Top-k keeps a fixed number of candidates.

Q1. Which change occurs when raising temperature from 1.0 to 2.0?

  1. A. The top-ranked token’s probability becomes larger, making the answers more consistent
  2. B. The distribution becomes flatter, making lower-ranked tokens more likely to be sampled
  3. C. The number of remaining candidate tokens doubles exactly
  4. D. The model weights change, turning it into a different model
Show answer and explanation

Answer: B

Raising T flattens the distribution, making answers more diverse and allowing unexpected answers to appear. The weights stay the same. (191)

Q2. When logits are 2.0 / 1.0 / 0.5 / 0 / −1.0, the top token’s probability is about 0.83 at T=0.5 and about 0.37 at T=2.0. What does this result show?

  1. A. The higher the T, the more probability concentrates on the top token
  2. B. Temperature sets the number of candidate tokens
  3. C. The lower the T, the sharper the distribution becomes, concentrating probability on the top token
  4. D. Changing T can flip the token rankings
Show answer and explanation

Answer: C

When T is low, probability concentrates on the top choice, bringing it closer to greedy decoding. Because it only divides by a positive T, the ranking does not change. Setting the candidate pool is the job of top-k and top-p. (191)

Q3. The next-token probabilities are 0.50 / 0.30 / 0.10 / 0.06 / 0.04. When sampling with top-p = 0.85, how many tokens remain as candidates?

  1. A. 2
  2. B. 4
  3. C. 5
  4. D. 3
Show answer and explanation

Answer: D

The cumulative probability goes 0.50 → 0.80 → 0.90, crossing 0.85 for the first time at the third token. So 3 tokens remain. (191)

Sources: donggrri.tistory.com/191

Why Is Decode Slow and What Is the Role of the KV Cache?

Key points

  • Prefill processes the prompt all at once, so it is compute-bound. Decode reads the weights and K·V from memory again each time it generates a single token, so it is memory-bandwidth-bound (memory-bound).
  • As a result, Decode spends more time waiting on memory than computing, making high-bandwidth memory like HBM crucial.
  • The KV Cache stores the K·V of previous tokens so they do not have to be recomputed. In exchange, the longer the context, the more memory it takes up.

Q4. With the prompt length kept the same, only the response length was increased from 100 tokens to 1,000 tokens. What is the main reason the response time increases significantly?

  1. A. Because Decode repeats one step per token, and has to re-read the weights and K·V from memory at every step
  2. B. Because the compute load in the Prefill stage increases 10-fold
  3. C. Because the tokenizer retrains on the output tokens
  4. D. Because the embedding dimension grows as the response gets longer
Show answer and explanation

Answer: A

Response tokens are generated one by one in sequence during Decode, repeating memory reads for each token. Since the prompt is the same, the Prefill load stays the same. (186)

Q5. What helps most directly to speed up the Decode stage?

  1. A. Lowering the temperature
  2. B. Writing a longer prompt to fill up the GPU cores
  3. C. Increasing memory bandwidth (such as HBM)
  4. D. Adding a few more CPU cores
Show answer and explanation

Answer: C

Because Decode is memory-bound, how quickly data can be read from memory is the bottleneck. Temperature is merely a rule for selecting tokens. (186)

Q6. If you run Decode without using a KV Cache, what kind of waste happens every time a new token is generated?

  1. A. The tokenizer vocabulary is rebuilt from scratch every time
  2. B. The K·V of previous tokens are recomputed from scratch every time
  3. C. The model weights are retrained every time
  4. D. Softmax is skipped, causing accuracy to drop
Show answer and explanation

Answer: B

The KV Cache is a mechanism that computes the K·V of previous tokens once and reuses them. The trade-off is that as the context grows longer, the cache grows larger, increasing memory pressure. (186)

Sources: donggrri.tistory.com/186 , donggrri.tistory.com/189

How Do We Distinguish Supervised, Unsupervised, and Reinforcement Learning, and Regression vs. Classification?

Key points

  • Supervised learning learns the relationship between inputs and outputs using labels (ground-truth answers). Unsupervised learning finds patterns or clusters without labels. Reinforcement learning learns actions that maximize reward through trial and error.
  • (supplementary) In supervised learning, predicting a number (continuous value) is regression, while predicting a category is classification. “Yes/No” is also a category, so it is classification.
  • What separates clustering from regression is whether labels exist and what is produced (groups vs. numbers).

Q7. A robot learns to walk through trial and error, losing points when it falls and gaining points when it stays standing for a long time. What type of learning is this?

  1. A. Unsupervised learning – clustering
  2. B. Supervised learning – regression
  3. C. Supervised learning – classification
  4. D. Reinforcement learning
Show answer and explanation

Answer: D

Learning actions that maximize reward through trial and error within an environment is reinforcement learning. (214)

Q8. Which pairing of task and learning method is incorrect?

  1. A. Predicting whether it will rain tomorrow (Yes/No) – supervised learning regression
  2. B. Predicting next month’s electricity usage (kWh) – supervised learning regression
  3. C. Grouping unlabeled customer data into similar groups – unsupervised learning clustering
  4. D. Determining whether an email is spam or not – supervised learning classification
Show answer and explanation

Answer: A

Yes/No is a category, so it is classification, not regression. Predicting a number is regression; predicting a category is classification. (214, regression/classification distinction is supplementary)

Q9. You want to do two tasks with the same equipment sensor data: (a) group similar operating patterns together without labels, and (b) use “time remaining until failure (in hours)” from past records as the ground truth to predict that time. Which pairing is correct?

  1. A. (a) Supervised learning regression, (b) Unsupervised learning clustering
  2. B. (a) Supervised learning classification, (b) Reinforcement learning
  3. C. (a) Unsupervised learning clustering, (b) Supervised learning regression
  4. D. Both (a) and (b) are clustering
Show answer and explanation

Answer: C

Grouping without labels is clustering (unsupervised), and predicting a continuous value using target numbers is regression (supervised). (214, regression is supplementary)

Sources: donggrri.tistory.com/214 (regression/classification distinction is supplementary)

How Do We Spot and Reduce Overfitting?

Key points

  • Overfitting is when a model memorizes the training data too closely, causing its performance on new data to drop.
  • (supplementary) When training loss keeps going down while validation loss starts rising past a certain point, it is a sign of overfitting.
  • (supplementary) Countermeasures include adding more data, regularization, and early stopping. Sparse models like MoE tend to be more vulnerable to overfitting(197).

Q10. As training continues, training loss steadily decreases, but validation loss starts increasing again around epoch 20. What is the most appropriate interpretation and response?

  1. A. It is underfitting, so train much longer
  2. B. It is data leakage, so add more evaluation data into the training set
  3. C. It is normal behavior, so use the model trained all the way to the end
  4. D. Overfitting has begun, so stop at the point where validation loss was lowest (early stopping)
Show answer and explanation

Answer: D

This is overfitting, where the model only memorizes the training data better while its performance on new data drops. Stopping when validation loss is lowest is early stopping. (214, early stopping is supplementary)

Q11. Which of the following is least appropriate as a way to reduce overfitting?

  1. A. Collect more training data
  2. B. Make the model much larger and train it longer on the same small dataset
  3. C. Use regularization
  4. D. Watch the validation data and stop early
Show answer and explanation

Answer: B

If the data stays the same while you make the model larger and train longer, it will memorize even more, making overfitting worse. The others are standard countermeasures. (supplementary)

Sources: donggrri.tistory.com/214 , donggrri.tistory.com/197 (signals and countermeasures are supplementary)

When and What Should We Look At with Precision and Recall? (supplementary)

Key points (supplementary)

  • Precision = the proportion of true positives among everything the model predicted as positive = TP / (TP + FP). Look at this when you want to reduce false alarms.
  • Recall = the proportion of actual positives that the model caught = TP / (TP + FN). Look at this when missing a positive is unacceptable (disease screening, defect detection).
  • On imbalanced data where positives are very rare, looking at accuracy alone can easily mislead you.

Q12. Among the items inspected, there are 100 actual defects. The model caught 80 of them as defective, and also falsely flagged 40 normal items as defective. What is the recall?

  1. A. 0.80
  2. B. 0.67
  3. C. 0.40
  4. D. 0.20
Show answer and explanation

Answer: A

Recall is the 80 caught out of 100 actual defects, so 80/100 = 0.80. 0.67 (80/120) is the precision. (supplementary)

Q13. In a situation like primary disease screening where you cannot afford to miss even a single patient, which metric should you prioritize most?

  1. A. Precision
  2. B. Training loss
  3. C. Accuracy
  4. D. Recall
Show answer and explanation

Answer: D

Because you need to minimize missed cases (FN), recall comes first. When reducing false alarms is what matters, you look at precision. (supplementary)

Q14. Out of 1,000 products, 10 are defective. A model predicts every single product as “normal.” Which statement about this model is correct?

  1. A. Its accuracy is 99%, so it is sufficient for defect detection
  2. B. Its recall is 99%
  3. C. Its accuracy is 99%, but it caught zero defects, so its recall is 0%
  4. D. Both its precision and recall are 100%
Show answer and explanation

Answer: C

It got 990 right for 99% accuracy, but caught 0 out of the 10 actual defects, making its recall 0%. That is why you should not look at accuracy alone on imbalanced data. (supplementary)

Do Zero-Shot, Few-Shot, and CoT Change the Model?

Key points

  • Zero-shot gives only instructions without examples. It is fast, but results can be inconsistent on difficult tasks.
  • Few-shot shows a pattern with two or three examples. It is strong at classification, formatting, and setting the tone.
  • All three are prompting techniques, so the model weights stay the same. Examples only go in as input for that request.
  • CoT makes the model think step by step. Rather than an external tool managing the steps, a single line in the prompt gets the model to do it on its own.

Q15. When you only instructed “Classify the following review as positive/negative” without examples, the output format varied every time. Keeping the model as is, what is the first method you should try?

  1. A. Put 2–3 examples of the desired input–output format into the prompt (few-shot)
  2. B. Collect instruction–response data and run additional training with SFT
  3. C. Raise the temperature significantly
  4. D. Quantize the model to INT4
Show answer and explanation

Answer: A

Right now it is zero-shot, which is why the results fluctuate. Few-shot is strong at matching formats and does not change the weights. SFT is a method that changes the model. (188, 193)

Q16. You put few-shot examples into a request and got an answer in the format you wanted. Later, in a new session, what happens if you make the same request without examples?

  1. A. Since the model learned from the previous examples, it continues following the same format
  2. B. The examples only went into that request’s input and the weights are unchanged, so you must include the examples again if you want the format
  3. C. Using few-shot once turns the model into an SFT model
  4. D. The examples are permanently saved in the KV Cache and applied to all users
Show answer and explanation

Answer: B

Few-shot only changes the input and does not change the model itself. Training the weights using examples is fine-tuning. (188, 193)

Q17. Which statement about Chain-of-Thought (CoT) is correct?

  1. A. It is a method where an external tool breaks the problem into steps and manages them
  2. B. It is a method that retrains the model weights on step-by-step solution data
  3. C. It is a method that always requires at least 3 examples
  4. D. It is a method that uses prompt instructions alone to make the model think step by step, improving accuracy on math or complex problems
Show answer and explanation

Answer: D

CoT is a prompting technique that uses instructions like “Think step by step” to get the model to walk through steps on its own. Neither external tools nor additional training are needed. (188)

Sources: donggrri.tistory.com/188 , donggrri.tistory.com/193

How Do SFT/LoRA, RLHF, and Knowledge Distillation Differ?

Key points

  • SFT further trains the weights using instruction–response examples. LoRA freezes the original weights and trains only small low-rank matrix pairs (adapters) in each layer.
  • RLHF follows the order: generate multiple answers → human preference ranking → train a reward model → reinforcement learning (PPO). Its goal is helpful, harmless, and honest alignment. DPO skips the reward model and reinforcement learning, training directly on preference data.
  • (supplementary) Knowledge distillation is a method that has a smaller model (student) learn to mimic the outputs of a larger model (teacher) to create a small and fast model.

Q18. Which pairing of method and “what changes” is incorrect?

  1. A. Prompt engineering – the input (weights stay the same)
  2. B. Full fine-tuning (SFT) – all model weights
  3. C. LoRA – all original model weights
  4. D. Few-shot – the input (adding examples)
Show answer and explanation

Answer: C

LoRA freezes the original weights and trains only small adapters, saving resources. (193)

Q19. Which statement about RLHF and DPO is incorrect?

  1. A. In RLHF, humans write the ground-truth answer for every sentence directly, and the model learns next-token prediction from that
  2. B. RLHF trains a reward model on human preference rankings and then tunes the LLM with reinforcement learning (PPO)
  3. C. The goal of RLHF is helpful, harmless, and honest answers—that is, alignment
  4. D. DPO skips the reward model and reinforcement learning stages and trains directly on preference data
Show answer and explanation

Answer: A

In RLHF, humans rank multiple answers rather than writing ground-truth answers from scratch. Learning from ground-truth examples is closer to SFT. (193)

Q20. What is the method that treats a large model’s outputs like ground truth for a smaller model to mimic and learn from, creating a small and fast model?

  1. A. Quantization
  2. B. Knowledge Distillation
  3. C. MoE (Mixture of Experts)
  4. D. RAG
Show answer and explanation

Answer: B

Knowledge distillation trains a new student model to follow a teacher. Quantization is different because it reduces the numeric bit-width of the same model. (supplementary)

Sources: donggrri.tistory.com/193 (knowledge distillation is supplementary)

What Are the Essentials from Tokens and Embeddings to Quantization and MoE?

Key points

  • Text is converted in the order: tokens → token IDs → embedding vectors. Embedding values are not set by hand; they are determined through training.
  • The output of Self-Attention is not the final answer, but context-aware token representations. A Transformer stacks multiple layers of these blocks, capturing deeper meaning at higher layers.
  • Quantization: per parameter, FP16 is 2 bytes, INT8 is 1 byte, and INT4 is 0.5 bytes. Reducing bits does not always make inference faster.
  • MoE: a router selects only a subset of experts for each token. A load balancing auxiliary loss is used to keep tokens from crowding onto specific experts.

Q21. What is the correct order in which text is processed inside an LLM?

  1. A. Text → embedding vector → token ID → token
  2. B. Text → embedding vector → token → token ID
  3. C. Token ID → text → token → embedding vector
  4. D. Text → token → token ID → embedding vector
Show answer and explanation

Answer: D

Text is split into tokens, converted into numeric IDs, and then those IDs are turned into meaningful embedding vectors. (196, 202)

Q22. Which statement about Self-Attention and the Transformer is correct?

  1. A. The output of Self-Attention is a context-aware token representation, and a Transformer stacks multiple layers of such blocks so that higher layers capture deeper meaning across the whole sentence
  2. B. The output of a single Self-Attention layer is immediately the final response sentence
  3. C. RNNs process words in parallel and are stronger than Transformers on long sentences
  4. D. In a Transformer, compute and memory do not grow as sentences get longer
Show answer and explanation

Answer: A

Self-Attention is a process of building richer representations. RNNs process words one by one in sequence, whereas in a Transformer every token attends to every other token, so compute and memory grow significantly as sentences get longer. (183, 184)

Q23. When quantizing a 13-billion-parameter (13B) model from FP16 to INT8, roughly how does the weight memory change? (calculating weights only)

  1. A. 13GB → 6.5GB
  2. B. 52GB → 26GB
  3. C. 26GB → 13GB
  4. D. 26GB → 6.5GB
Show answer and explanation

Answer: C

FP16 is 2 bytes × 13B = 26GB, and INT8 is 1 byte × 13B = 13GB. 26GB → 6.5GB is when reducing to INT4. (189)

Q24. In MoE, what method is used to prevent the router from sending tokens disproportionately to only certain experts?

  1. A. Reduce the number of experts to 1
  2. B. Use a load balancing auxiliary loss to encourage tokens to be distributed evenly
  3. C. Send every token to every expert
  4. D. Remove the router and send tokens at random
Show answer and explanation

Answer: B

An auxiliary loss is used to prevent crowding. Tokens that exceed an expert’s capacity pass through via residual connections or are dropped. (197)

Sources: donggrri.tistory.com/196 , donggrri.tistory.com/202 , donggrri.tistory.com/183 , donggrri.tistory.com/184 , donggrri.tistory.com/189 , donggrri.tistory.com/197

How Do We Safely Handle Hallucinations, RAG, and Agents?

Key points

  • Instructing “Say you don’t know if you don’t know” helps, but is not foolproof. Human verification such as checking sources, running code, and cross-checking is necessary.
  • The RAG flow is Document → Chunk → Embedding → Vector DB → Query Embedding → Retrieval → Context → Answer. If the fed documents are wrong, the answer will be wrong too (Garbage in, garbage out).
  • In an Agent, the LLM decides the next action on its own. That is why permission limits, human approval before critical actions, and result verification are needed.

Q25. Which best describes the effect of adding “If you don’t know something, say you don’t know” to a prompt?

  1. A. Hallucinations disappear completely
  2. B. It has no effect at all
  3. C. It only works if you also raise the temperature
  4. D. It helps, but is not perfect, so verification like checking sources must be done alongside it
Show answer and explanation

Answer: D

Because a model does not always know what it does not know, it is not a complete solution. Human verification must be done alongside it. (199)

Q26. Which statement about RAG is incorrect?

  1. A. With RAG, hallucinations disappear even if the provided documents are outdated or wrong
  2. B. If chunks are too small, context gets broken; if they are too large, irrelevant content gets mixed in, so chunks are sometimes cut with a slight overlap
  3. C. The question is also embedded to search for similar chunks in the Vector DB
  4. D. Embedding handles conversion, Vector DB handles storage and search, and the LLM generates the final answer
Show answer and explanation

Answer: A

It is garbage in, garbage out. If RAG documents are wrong or outdated, the AI trusts them and gives wrong answers. That is why keeping documents up to date and managing sources are necessary. (199)

Q27. When operating an Agent that can use tools like deleting files or sending emails, what is the most appropriate safeguard?

  1. A. Place no limit on the number of tool calls and let it run to completion on its own
  2. B. Skip verifying intermediate results and only check the final answer
  3. C. Grant only the minimum required permissions, and require human approval before irreversible actions
  4. D. Raise temperature to the maximum so it tries a wide variety of actions
Show answer and explanation

Answer: C

An Agent can head in unintended directions or take irreversible actions. Therefore, permission limits, human approval, and result verification are the countermeasures. (199)

Sources: donggrri.tistory.com/199

How Should We Respond When Context Gets Polluted?

Key points

  • Prompt engineering is writing and structuring instructions, whereas context engineering is selecting and managing all the information the model sees—including tool definitions, search results, conversation history, and memory.
  • The principle is “the smallest possible set of high-signal tokens.” Methods include just-in-time loading, compaction (summarizing a long conversation into a fresh context), and structured notes.
  • Repeating the same questions, forgetting rules agreed on earlier, and giving contradictory answers are signs of context pollution.

Q28. In a long conversation session, the model starts forgetting rules set earlier and giving inconsistent answers. From a context engineering perspective, what is the best response?

  1. A. Keep repeating the same question in the same session
  2. B. Briefly summarize only the decisions made so far and move to a new session (fresh context)
  3. C. Paste the entire past conversation verbatim into the system prompt
  4. D. Raise the temperature and wait for a different answer to come out
Show answer and explanation

Answer: B

This is a sign of context pollution. Summarizing only the decisions and starting fresh (compaction) keeps the context small and high-signal. Pasting the whole conversation just takes up space. (208, 188)

Sources: donggrri.tistory.com/208 , donggrri.tistory.com/188

Which posts are the sources?