Sample questions
Question 1Easy
What is the "context window" of an LLM?
- The maximum number of tokens the model can consider in one request
- The number of users who can query the model simultaneously
- The total size of the dataset used to pre-train the model
- The number of separate conversations the model can remember across different days
Answer: A. The maximum number of tokens the model can consider in one request
Explanation
Anything beyond the context window cannot be attended to in a single call, so long documents must be truncated, summarised or retrieved selectively.
Step-by-step solution
- The context window is measured in tokens.
- It covers everything in one request: instructions, history, documents and the reply being generated.
- Anything beyond it cannot be seen by the model in that call.
Why the other options are wrong
- B. That is about server capacity, not the model's context.
- C. Training data size is separate; the window is per request.
- D. Models do not remember across separate calls unless the app re-sends past text.
Tip: Context window = the model's working memory for one request, counted in tokens.
Question 2Easy
What is a "token" in the context of LLMs?
- A complete sentence, always split exactly at full stops and question marks
- Always exactly one complete word, never less
- Always exactly one character of the input text
- A chunk of text such as a word, subword or punctuation mark
Answer: D. A chunk of text such as a word, subword or punctuation mark
Explanation
Tokenizers (e.g. byte-pair encoding) split text into subword units; common words may be one token while rare words are split into several.
Step-by-step solution
- A tokenizer cuts text into pieces before the model sees it.
- Common words are often one token; rare words split into several subword pieces.
- Punctuation and spaces can be tokens too, so a token is a chunk of text of varying size.
Why the other options are wrong
- A. Sentences are far too large; one sentence is usually many tokens.
- B. Rare or long words are split into several tokens, so a token is often less than a word.
- C. Character-level splitting is possible but standard LLM tokenizers use subwords.
Tip: Rough rule for English: one token is about three-quarters of a word.
Question 3Easy
At its core, what is a large language model trained to do during pre-training?
- Translate text between exactly two languages
- Look up answers in a fixed database of questions
- Classify whole documents into a fixed set of categories
- Predict the next token given the preceding tokens
Answer: D. Predict the next token given the preceding tokens
Explanation
Autoregressive LLMs learn a probability distribution over the next token from vast text corpora; generation repeats this prediction token by token.
Step-by-step solution
- Pre-training uses huge amounts of ordinary text with no labels.
- The training signal is simply: given the tokens so far, predict the next one.
- Generation repeats that prediction one token at a time.
Why the other options are wrong
- A. Translation is one task an LLM can do, but it is not the pre-training objective.
- B. LLMs do not look up stored answers; they generate text from learned probabilities.
- C. Document classification is a separate task, usually added by fine-tuning or prompting.
Tip: Pre-training = next-token prediction; everything else (chat, instructions) is added later.
Question 4Easy
What is the typical effect of lowering the sampling temperature towards 0?
- Output becomes more random, varied and creative in its wording
- Output becomes more deterministic and focused on the most likely tokens
- The model's context window grows to fit longer prompts
- The model runs with less memory and fewer parameters
Answer: B. Output becomes more deterministic and focused on the most likely tokens
Explanation
Temperature divides the logits before softmax. Low values sharpen the distribution; high values flatten it, increasing diversity.
Step-by-step solution
- Temperature divides the logits before softmax.
- A small temperature makes big logits relatively bigger, so the top token dominates.
- Near 0 the model almost always picks the most likely token, giving focused, repeatable output.
Why the other options are wrong
- A. That is what a high temperature does.
- C. Temperature only changes sampling; the context window is fixed by the model.
- D. Temperature has no effect on model size or memory use.
Tip: Low temperature for facts and code, higher for brainstorming.
Question 5Medium
A base (pre-trained only) model often continues a question with more questions instead of answering. Which additional training mainly fixes this?
- Instruction tuning and preference-based alignment (e.g. RLHF)
- Using a higher sampling temperature during generation
- Switching to a smaller tokenizer with fewer tokens
- Increasing the context window so the model can see more of the question at once
Answer: A. Instruction tuning and preference-based alignment (e.g. RLHF)
Explanation
Supervised instruction tuning on prompt-response pairs, followed by learning from human (or AI) preference feedback, makes models follow instructions helpfully.
Step-by-step solution
- A base model only continues text in the style of its training data.
- Instruction tuning trains it on prompt and good-response pairs.
- Preference-based alignment (e.g. RLHF) further rewards helpful answers, so it answers instead of continuing.
Why the other options are wrong
- B. Temperature changes randomness, not whether the model follows instructions.
- C. Tokenizer size does not teach the model to answer questions.
- D. The model already sees the question; the issue is its behaviour, not visibility.
Tip: Base model = autocomplete; instruction-tuned model = assistant.
Question 6Medium
What does top-p (nucleus) sampling do?
- Samples only from the smallest set of tokens whose cumulative probability reaches p
- Returns the top p complete responses to the user
- Always picks the single most likely token at every step
- Samples uniformly at random from every token in the vocabulary, ignoring probabilities
Answer: A. Samples only from the smallest set of tokens whose cumulative probability reaches p
Explanation
With p = 0.9, low-probability tail tokens are excluded, while the candidate set adapts to how confident the model is.
Step-by-step solution
- Sort tokens by probability, highest first.
- Add probabilities until the running total reaches p (e.g. 0.9).
- Sample only from that set; the low-probability tail is dropped.
Why the other options are wrong
- B. Top-p works token by token, not on whole responses.
- C. Always taking the top token is greedy decoding.
- D. Uniform sampling ignores the model's probabilities; top-p uses them.
Tip: Top-k fixes the number of candidates; top-p fixes their total probability.
Question 7Medium
Why does an LLM's API usage cost and latency usually grow with prompt length?
- Longer prompts are stored permanently on the provider's servers and billed for storage
- Every input token must be processed, and each output token is a further step
- Prompt length has no effect on computation
- The model retrains itself on every prompt it receives
Answer: B. Every input token must be processed, and each output token is a further step
Explanation
Computation scales with the number of input and output tokens; generation is sequential, one token per step.
Step-by-step solution
- Every input token passes through the model before generation starts.
- Each output token then needs another forward pass, one after another.
- More tokens means more computation, so more time and more cost.
Why the other options are wrong
- A. Providers bill for processing tokens, not for storing prompts.
- C. Computation grows with the number of tokens processed.
- D. Models do not retrain on each prompt; weights stay fixed during use.
Tip: Shorter prompts and capped outputs are the simplest cost and latency savings.
Question 8Hard
Two candidate tokens have logits 2.0 and 1.0. With temperature 1 the first token's probability is about 0.73. What is it with temperature 0.5?
- About 0.62
- About 0.88
- About 0.73
- About 0.50
Answer: B. About 0.88
Explanation
Divide logits by T = 0.5: 4.0 and 2.0.
softmax gives e^4 / (e^4 + e^2)
= 1 / (1 + e^-2)
= 0.88. Lower temperature makes the likely token even more likely.
Step-by-step solution
- Divide each logit by T = 0.5:
2.0 becomes 4.0,
1.0 becomes 2.0.
- Softmax: p = e^4 / (e^4 + e^2).
- Divide top and bottom by e^4:
p = 1 / (1 + e^-2)
= 1 / 1.135.
- p is about 0.88.
Why the other options are wrong
- A. Lower temperature sharpens the distribution, so the top probability must rise above 0.73, not fall.
- C. That is the T = 1 value; changing temperature changes the probabilities.
- D. 0.5 would mean equal logits or infinite temperature.
Tip: Two-way softmax: p = 1 / (1 + e^-(difference / T)).
Practise all 8 questions free
The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.
Open this topic in the app →