First 50 of 200 questions. Each one lists the choices, the correct answer, and an explanation. The checker at the top of this page saves progress in this browser when it is available.
Continue in the practice tool above to load more questions, 50 at a time.
Question 1Generative AI Fundamentals and Qwen Models
Which component of a transformer architecture is primarily responsible for allowing the model to weigh the relevance of different tokens in a sequence when producing a representation?
- The position-wise feed-forward network
- The layer normalization step
- The self-attention mechanism Correct answer.
- The token embedding lookup
Explanation
Self-attention computes pairwise relevance scores between tokens so each position can aggregate information from other positions. Feed-forward layers transform each position independently, normalization stabilizes activations, and embeddings map tokens to vectors without cross-token weighting.
Question 2Generative AI Fundamentals and Qwen Models
In the standard transformer design, why are positional encodings added to token embeddings?
- To convert embeddings into probability distributions
- To inject sequence-order information the attention mechanism otherwise lacks Correct answer.
- To reduce the size of the vocabulary
- To prevent the model from overfitting to frequent tokens
Explanation
Self-attention is permutation-invariant, so without positional signals the model cannot distinguish token order. Positional encodings supply that ordering information. They do not alter vocabulary size, act as regularizers, or produce probability distributions.
Question 3Generative AI Fundamentals and Qwen Models
A team compares encoder-only, decoder-only, and encoder-decoder transformer designs. Which design is the typical foundation for a general-purpose instruction-following chat model?
- Encoder-decoder only
- Encoder-only
- A purely convolutional network
- Decoder-only Correct answer.
Explanation
Decoder-only models generate text autoregressively and are the common base for instruction-following chat assistants. Encoder-only models produce contextual representations for tasks like classification, and convolutional networks are not transformer designs.
Question 4Generative AI Fundamentals and Qwen Models
What does the tokenizer do before text is passed into a language model?
- It ranks candidate responses by likelihood
- It splits text into subword units and maps them to integer IDs Correct answer.
- It translates the text into English
- It compresses the text with a lossless codec
Explanation
Tokenizers segment raw text into tokens, often subwords, and map each token to an integer ID the model can embed. They do not perform translation, lossless compression, or response ranking.
Question 5Generative AI Fundamentals and Qwen Models
Which statement best describes how a large language model generates text during inference?
- It retrieves whole sentences from a stored corpus
- It predicts a probability distribution over the next token and samples or selects from it repeatedly Correct answer.
- It runs a search over a knowledge graph for each word
- It applies fixed grammar rules to assemble sentences
Explanation
Autoregressive generation predicts the next-token distribution conditioned on prior context, then appends the chosen token and repeats. Models do not retrieve stored sentences, apply hand-written grammar, or query a knowledge graph per word.
Question 6Generative AI Fundamentals and Qwen Models
What is the primary purpose of pretraining a large language model on a broad text corpus?
- To reduce the model's parameter count
- To learn general statistical patterns of language and world knowledge Correct answer.
- To guarantee factual accuracy on every topic
- To encode a company's private policy documents
Explanation
Pretraining exposes the model to large-scale text so it learns language structure and broad knowledge. It does not target private documents, guarantee factual correctness, or shrink the parameter count.
Question 7Generative AI Fundamentals and Qwen Models
Which technique adapts a pretrained model to follow instructions by training on curated prompt-response pairs?
- Vocabulary expansion
- Quantization
- Supervised fine-tuning Correct answer.
- Beam search
Explanation
Supervised fine-tuning trains the model on labeled instruction-response examples so it learns to follow prompts. Vocabulary expansion changes token coverage, quantization reduces numeric precision, and beam search is a decoding strategy.
Question 8Generative AI Fundamentals and Qwen Models
Which parameter primarily controls the randomness of token sampling during generation?
- The learning rate
- The weight decay
- The batch size
- The temperature Correct answer.
Explanation
Temperature scales the logits before sampling, so lower values make output more deterministic and higher values more random. Learning rate, batch size, and weight decay are training hyperparameters.
Question 9Generative AI Fundamentals and Qwen Models
A developer wants a Qwen model to answer questions about a large internal knowledge base that changes daily. Which approach best avoids retraining the model each day?
- Reducing the model's context window
- Increasing the temperature setting
- Full pretraining from scratch every morning
- Retrieval-augmented generation that fetches relevant documents at query time Correct answer.
Explanation
Retrieval-augmented generation supplies current documents as context at inference, so updates require only refreshing the index. Retraining daily is costly, temperature does not add knowledge, and shrinking the context window removes room for evidence.
Question 10Generative AI Fundamentals and Qwen Models
A model must summarize a long report but keeps losing details from the middle of the input. Which factor most directly limits how much input it can consider at once?
- The optimizer's momentum value
- The context window size Correct answer.
- The tokenizer's vocabulary size
- The number of attention heads in the first layer
Explanation
The context window defines the maximum number of tokens the model can attend to in a single request. Attention head count, vocabulary size, and optimizer momentum do not set that input limit.
Question 11Generative AI Fundamentals and Qwen Models
A team needs consistent, repeatable outputs from a Qwen model for a structured data extraction task. Which sampling configuration best supports this goal?
- Random top-p set to one
- High temperature with wide top-k
- Frequent changes to the random seed
- Low temperature with greedy or narrow sampling Correct answer.
Explanation
Low temperature combined with greedy or narrow sampling reduces randomness and yields more repeatable outputs. High temperature and wide sampling increase variation, and changing seeds undermines reproducibility.
Question 12Generative AI Fundamentals and Qwen Models
When comparing Qwen model variants, a developer notices some are labeled as base models and others as chat or instruct models. What is the main difference?
- Base models cannot process text input
- Chat models are trained further to follow instructions and hold dialogue Correct answer.
- Chat models have no tokenizer
- Base models only support image input
Explanation
Base models are pretrained on raw text, while chat or instruct variants receive additional alignment training for instruction following and conversation. Both process text and use tokenizers, and modality support is a separate characteristic.
Question 13Generative AI Fundamentals and Qwen Models
A developer wants to reduce inference cost for a Qwen model while accepting a small quality trade-off. Which technique directly lowers memory and compute by using lower-precision numeric representations?
- Prompt chaining
- Gradient clipping
- Data augmentation
- Quantization Correct answer.
Explanation
Quantization stores weights and sometimes activations in lower precision, cutting memory and compute with modest quality impact. Data augmentation, prompt chaining, and gradient clipping do not reduce numeric precision.
Question 14Generative AI Fundamentals and Qwen Models
Which prompt engineering practice most reliably improves a model's performance on a multi-step reasoning task?
- Removing all task context
- Asking the model to show intermediate reasoning steps before the final answer Correct answer.
- Using only uppercase text
- Making the prompt as short as possible
Explanation
Prompting for intermediate reasoning encourages the model to work through steps, which tends to improve accuracy on multi-step problems. Brevity, capitalization, and removing context do not support reasoning.
Question 15Generative AI Fundamentals and Qwen Models
What is the role of a system prompt in a chat-style Qwen model?
- It replaces the tokenizer during inference
- It compiles the model for a specific GPU
- It sets persistent behavioral guidance and constraints for the conversation Correct answer.
- It stores the model weights at runtime
Explanation
A system prompt provides high-level instructions that shape how the model responds throughout the conversation. It does not store weights, replace the tokenizer, or handle hardware compilation.
Question 16Generative AI Fundamentals and Qwen Models
A model sometimes invents plausible but incorrect facts. Which term describes this behavior?
- Overfitting
- Hallucination Correct answer.
- Latency regression
- Tokenization drift
Explanation
Hallucination refers to fluent but fabricated or incorrect content. Overfitting concerns fitting training data too closely, tokenization drift is not a standard failure term, and latency regression concerns speed.
Question 17Generative AI Fundamentals and Qwen Models
A team building a customer support assistant wants responses grounded in the latest product manuals. Which design choice most directly reduces fabricated answers?
- Shortening the system prompt to a single word
- Raising the temperature to encourage creativity
- Providing retrieved manual passages in the prompt and instructing the model to rely on them Correct answer.
- Removing the manuals and relying on pretraining
Explanation
Grounding responses in retrieved passages gives the model verifiable source material and reduces fabrication. Higher temperature increases randomness, and removing manuals or context leaves the model to rely on possibly outdated memory.
Question 18Generative AI Fundamentals and Qwen Models
Which metric is most appropriate for evaluating a Qwen model's output quality on an open-ended summarization task?
- The number of parameters in the model
- The GPU memory footprint
- Human or model-based judgment of relevance and faithfulness Correct answer.
- The tokenizer vocabulary size
Explanation
Open-ended quality is best assessed by judging relevance, coherence, and faithfulness to the source. Parameter count, memory footprint, and vocabulary size are model properties, not output-quality measures.
Question 19Generative AI Fundamentals and Qwen Models
A developer wants to compare two Qwen model sizes on the same benchmark. Which practice makes the comparison fairest?
- Use a different temperature for each model
- Use identical prompts, decoding settings, and evaluation data for both models Correct answer.
- Evaluate each model on a different dataset
- Give one model longer prompts than the other
Explanation
Holding prompts, decoding settings, and evaluation data constant isolates the model as the variable under test. Varying temperature, prompt length, or datasets confounds the comparison.
Question 20Generative AI Fundamentals and Qwen Models
What does the top-p sampling parameter control?
- The learning rate schedule
- The maximum number of output tokens
- The cumulative probability mass from which the next token is sampled Correct answer.
- The number of layers in the model
Explanation
Top-p, or nucleus sampling, restricts sampling to the smallest set of tokens whose cumulative probability reaches p. It does not affect layer count, output length limits, or learning rate.
Question 21Generative AI Fundamentals and Qwen Models
A prompt asks a Qwen model to classify support tickets into fixed categories. Which addition most improves reliability of the category labels?
- Increasing the temperature substantially
- Listing the allowed categories and requiring the output to be one of them Correct answer.
- Adding unrelated example dialogues
- Removing the category definitions
Explanation
Constraining the model to an explicit set of allowed labels reduces open-ended generation and improves label consistency. Higher temperature and unrelated examples add noise, and removing definitions removes guidance.
Question 22Generative AI Fundamentals and Qwen Models
A team wants a Qwen model to handle both text and image inputs in one application. Which model capability should they verify before adoption?
- Support for a larger learning rate
- A smaller tokenizer vocabulary
- A higher weight decay value
- Multimodal support for vision inputs Correct answer.
Explanation
Handling images requires a multimodal model with a vision encoder and appropriate input handling. Learning rate, vocabulary size, and weight decay are unrelated to image capability.
Question 23Generative AI Fundamentals and Qwen Models
A developer must choose between a very large Qwen model and a smaller one for an on-device application with limited memory. Which trade-off analysis is most sound?
- Model size has no effect on memory use
- The smaller model likely fits memory constraints but may sacrifice some capability Correct answer.
- The larger model always uses less memory
- The smaller model always outperforms the larger one
Explanation
Smaller models generally require less memory and compute, making them suitable for constrained devices, though they may be less capable. Larger models typically need more memory, and size does affect resource use and capability.
Question 24Generative AI Fundamentals and Qwen Models
A team fine-tunes a Qwen model on a small domain dataset and observes it performs well on training examples but poorly on new ones. Which explanation best fits this outcome?
- The temperature was set too low during training
- The context window has grown too large
- The model has overfit the small training set Correct answer.
- The tokenizer has been deleted
Explanation
Strong training performance with weak generalization is the hallmark of overfitting, often from limited or narrow data. Tokenizer deletion, context size, and training temperature do not explain this pattern.
Question 25Generative AI Fundamentals and Qwen Models
An application sends a 200-page document to a Qwen model in a single request and receives truncated or degraded output. Which diagnosis is most plausible?
- The input exceeds the model's context window, so content is dropped Correct answer.
- The tokenizer has too many vocabulary entries
- The model's learning rate is too high at inference
- The output temperature is fixed at zero
Explanation
Inputs longer than the context window cannot be fully attended to, leading to dropped content or degraded results. Vocabulary size, learning rate at inference, and a zero temperature do not cause truncation of long inputs.
Question 26Generative AI Fundamentals and Qwen Models
Which statement best describes the relationship between a tokenizer and a Qwen model's input processing?
- The tokenizer converts raw text into integer token IDs the model consumes. Correct answer.
- The tokenizer stores the model's learned attention weights on disk.
- The tokenizer selects the sampling temperature for each request.
- The tokenizer applies gradient updates to the model's embedding matrix.
Explanation
A tokenizer maps text into discrete token IDs drawn from the model's fixed vocabulary, and those IDs index the embedding table the model reads. It performs no training and no decoding configuration.
Question 27Generative AI Fundamentals and Qwen Models
In the Qwen model family naming, what does a larger parameter count generally imply?
- Guaranteed lower latency on every deployment target
- Elimination of the need for any prompt engineering
- Automatic support for longer context than smaller variants
- Higher capacity but greater compute and memory requirements Correct answer.
Explanation
Parameter count reflects model capacity and generally scales up both capability and the compute and memory needed for serving. It does not guarantee speed, obviate prompting, or by itself fix context length.
Question 28Generative AI Fundamentals and Qwen Models
Which Qwen capability allows a single model to accept both text prompts and images within one request?
- Multimodal input handling Correct answer.
- Deterministic decoding
- Vocabulary pruning
- Quantized inference
Explanation
Multimodal models include encoders or projection layers that map non-text inputs such as images into the same representation space as text tokens. The other options concern decoding behavior, vocabulary size, or numeric precision.
Question 29Generative AI Fundamentals and Qwen Models
What is the main function of the attention mechanism in a transformer-based Qwen model?
- Normalizing the output logits into a probability distribution
- Caching previous requests to reduce repeated computation
- Compressing the vocabulary to the most frequent tokens
- Weighing how much each token should draw information from other tokens Correct answer.
Explanation
Attention computes relevance scores between tokens so each position can aggregate context from other positions. Vocabulary reduction, probability normalization, and request caching are separate mechanisms.
Question 30Generative AI Fundamentals and Qwen Models
Which term describes the maximum number of tokens a Qwen model can process in a single request, including prompt and generated output?
- Context window Correct answer.
- Embedding dimension
- Learning rate
- Batch size
Explanation
The context window bounds the total token budget for input plus output in one call. Batch size, learning rate, and embedding dimension are training or architecture parameters rather than per-request limits.
Question 31Generative AI Fundamentals and Qwen Models
A developer wants the Qwen model to produce a JSON object with a fixed schema. Which prompting approach best supports this?
- Adding an instruction to be creative and vary the structure
- Providing the exact schema and a short worked example in the prompt Correct answer.
- Increasing temperature to encourage diverse formatting
- Removing the schema to let the model infer field names
Explanation
Supplying the target schema plus an example constrains the output format through in-context specification. Creativity instructions, higher temperature, and omitting the schema all increase format drift.
Question 32Generative AI Fundamentals and Qwen Models
Which statement correctly contrasts pretraining with supervised fine-tuning in the Qwen training pipeline?
- Pretraining learns general language patterns; fine-tuning adapts behavior to targeted tasks. Correct answer.
- Pretraining requires labeled task data; fine-tuning uses unlabeled web text.
- Pretraining happens after alignment; fine-tuning happens before it.
- Pretraining only adjusts the output layer; fine-tuning updates all weights.
Explanation
Pretraining builds broad language and world knowledge from large unlabeled corpora, while supervised fine-tuning shapes task-specific behavior using curated labeled examples. The ordering and data assumptions in the other options are reversed.
Question 33Generative AI Fundamentals and Qwen Models
What is the purpose of the temperature parameter during Qwen text generation?
- It controls how many requests are batched together.
- It determines the size of the model's context window.
- It scales the logits to make the output distribution sharper or flatter. Correct answer.
- It sets the maximum number of tokens the model may emit.
Explanation
Temperature divides the logits before softmax, so lower values sharpen the distribution toward likely tokens and higher values flatten it. Token limits, context length, and batching are configured separately.
Question 34Generative AI Fundamentals and Qwen Models
A team wants to adapt a Qwen model to a niche legal vocabulary without retraining all weights. Which approach fits best?
- Increasing the sampling temperature
- Shortening the system prompt
- Disabling the tokenizer
- Parameter-efficient fine-tuning such as low-rank adapters Correct answer.
Explanation
Parameter-efficient methods like low-rank adapters freeze most weights and train small added matrices, which adapts domain vocabulary at low cost. Sampling changes and prompt edits do not teach new domain terms.
Question 35Generative AI Fundamentals and Qwen Models
Which practice best mitigates hallucination when a Qwen model answers questions over enterprise documents?
- Instructing the model to answer only from supplied passages and to say when information is absent Correct answer.
- Asking the model to answer from memory to save tokens
- Raising temperature so the model explores more answers
- Removing retrieved passages to keep the prompt short
Explanation
Grounding the model in retrieved passages and permitting an explicit abstention reduces fabricated answers. Higher temperature, fewer sources, and reliance on parametric memory all increase hallucination risk.
Question 36Generative AI Fundamentals and Qwen Models
A developer needs a Qwen model to reason through a math word problem before giving the final number. Which prompt structure is most effective?
- Ask the model to respond with a single random guess
- Ask for step-by-step reasoning followed by a clearly labeled final answer Correct answer.
- Ask only for the final number with no intermediate steps
- Ask the model to restate the question without solving it
Explanation
Eliciting intermediate reasoning steps improves multi-step arithmetic, and a labeled final answer makes the result easy to parse. Suppressing reasoning or requesting guesses removes the mechanism that supports accuracy.
Question 37Generative AI Fundamentals and Qwen Models
Which factor most directly limits how many prior conversation turns a Qwen chat application can retain verbatim?
- The color scheme of the user interface
- The number of available API keys
- The size of the system prompt font
- The model's context window size Correct answer.
Explanation
All retained turns consume tokens from the same context window, so its size bounds verbatim history. API key count, interface styling, and display choices do not affect token capacity.
Question 38Generative AI Fundamentals and Qwen Models
What is the primary effect of applying 4-bit quantization to a Qwen model for inference?
- It permanently expands the context window.
- It reduces memory footprint with a possible small accuracy loss. Correct answer.
- It increases the model's parameter count.
- It removes the need for a tokenizer.
Explanation
Quantization stores weights at lower numeric precision, shrinking memory and often speeding inference at the cost of some accuracy. It does not add parameters, extend context, or replace tokenization.
Question 39Generative AI Fundamentals and Qwen Models
A developer sets top-k to 1 during Qwen generation. What decoding behavior results?
- Greedy decoding that always selects the single most likely token Correct answer.
- Uniform random sampling across the whole vocabulary
- Decoding that ignores the model's logits entirely
- Sampling restricted to the 50 least likely tokens
Explanation
With top-k equal to one, only the highest-probability token remains eligible, which is equivalent to greedy decoding. It is not uniform sampling, does not target unlikely tokens, and still depends on logits.
Question 40Generative AI Fundamentals and Qwen Models
Which evaluation approach best measures whether a Qwen model's answers are factually supported by a provided source document?
- Timing how long each response takes to arrive
- Human or model-assisted checking of each claim against the source Correct answer.
- Counting the number of tokens generated per answer
- Measuring average response length in characters
Explanation
Faithfulness to a source requires verifying individual claims against that source, which needs judgment rather than surface statistics. Length, token counts, and latency measure form or performance, not factual support.
Question 41Generative AI Fundamentals and Qwen Models
A team wants reproducible outputs from a Qwen model across repeated identical requests. Which configuration supports this?
- Low temperature with a fixed random seed Correct answer.
- Increasing max tokens on every retry
- Randomly varying the system prompt each call
- High temperature with top-p set to 1.0
Explanation
Reducing randomness through low temperature and fixing the seed makes sampling deterministic for identical inputs and settings. High temperature, prompt variation, and changing limits all introduce differences between runs.
Question 42Generative AI Fundamentals and Qwen Models
What does the presence of special control tokens such as beginning-of-sequence markers primarily enable in a Qwen chat model?
- Encrypting user messages before transmission
- Structuring the dialogue so the model distinguishes roles and turn boundaries Correct answer.
- Translating the prompt into multiple languages
- Compressing the model's weights for faster loading
Explanation
Chat templates insert special tokens that mark role and turn boundaries, which the model learned to interpret during alignment. They do not affect weight size, encryption, or translation.
Question 43Generative AI Fundamentals and Qwen Models
A developer notices that a Qwen model ignores an instruction placed in the middle of a very long prompt. Which explanation is most consistent with known model behavior?
- Instructions are only honored when written in uppercase
- The model cannot read any tokens beyond the first hundred
- Middle content is automatically deleted by the tokenizer
- Information in the middle of long contexts is often used less reliably than content near the start or end Correct answer.
Explanation
Models tend to attend more reliably to the beginning and end of long inputs, a positional effect often called lost-in-the-middle. There is no hard cutoff at one hundred tokens, no tokenizer deletion, and no case requirement.
Question 44Generative AI Fundamentals and Qwen Models
Which scenario most clearly calls for retrieval-augmented generation rather than fine-tuning a Qwen model?
- Answers must reflect documents that are updated every hour Correct answer.
- The model must learn a new output format permanently
- The desired response style must match a fixed brand voice
- The application needs lower per-token inference cost
Explanation
Frequently changing knowledge is best supplied at query time through retrieval, since fine-tuning bakes knowledge into weights that go stale. Style, format, and cost goals are addressed by other techniques.
Question 45Generative AI Fundamentals and Qwen Models
How does the softmax function contribute to token generation in a Qwen model?
- It converts raw logits into a probability distribution over the vocabulary Correct answer.
- It updates the model weights using gradients
- It splits long prompts into smaller chunks
- It removes low-probability tokens before scoring
Explanation
Softmax exponentiates and normalizes logits so they sum to one, yielding probabilities for sampling. Filtering is done by top-k or top-p, weight updates occur in training, and chunking is a preprocessing choice.
Question 46Generative AI Fundamentals and Qwen Models
A team compares Qwen variants and finds one labeled as an instruct model refuses harmful requests more often. Which stage most likely produced that behavior?
- Tokenizer vocabulary construction
- Alignment training with human or AI preference feedback Correct answer.
- Quantization of the weights to lower precision
- Increasing the context window size
Explanation
Alignment stages such as preference optimization and safety tuning shape refusal and helpfulness behavior. Vocabulary construction, quantization, and context length do not teach refusal policies.
Question 47Generative AI Fundamentals and Qwen Models
A developer wants to reduce prompt-injection risk when a Qwen application processes untrusted web content. Which design choice is most effective?
- Treat retrieved content as data and keep instructions in a separate trusted channel Correct answer.
- Allow retrieved text to override the system prompt when it contains commands
- Remove all instructions so the model decides behavior itself
- Concatenate untrusted text directly into the system prompt
Explanation
Separating trusted instructions from untrusted data and marking the latter as data limits the influence of injected commands. Merging untrusted text into the system prompt or letting it override instructions amplifies the risk.
Question 48Generative AI Fundamentals and Qwen Models
An application streams Qwen output token by token. Which consequence should the developer expect compared with waiting for the full response?
- Lower perceived latency while total generation time stays similar Correct answer.
- A guaranteed reduction in total tokens generated
- Elimination of the need for a max-token limit
- Automatic improvement in factual accuracy
Explanation
Streaming delivers tokens as they are produced, improving perceived responsiveness without changing the total work or token count. It does not bound output length or improve correctness.
Question 49Generative AI Fundamentals and Qwen Models
A team observes that a Qwen model performs well on short prompts but degrades sharply as inputs approach the context limit. Which diagnostic step is most informative?
- Measure accuracy at several input lengths to locate where degradation begins Correct answer.
- Reduce the number of evaluation examples to one
- Switch the output format to plain prose
- Increase temperature to see whether randomness explains the drop
Explanation
Sweeping input length reveals whether the decline is a positional or capacity effect and where it starts. Temperature, output format, and shrinking the evaluation set do not isolate length-related degradation.
Question 50Generative AI Fundamentals and Qwen Models
A developer combines top-p of 0.9 with a very low temperature. What is the most likely effect on generation?
- The vocabulary is permanently reduced for later requests
- Output becomes highly deterministic while still excluding the least likely tokens Correct answer.
- Output becomes more random than with temperature alone
- The model generates tokens beyond the context window
Explanation
Low temperature sharpens the distribution toward likely tokens, and top-p then truncates the tail, so results are both focused and stable. It does not increase randomness, extend context, or alter the vocabulary persistently.