Quiz2Know

IT

Applied AI: Systems, Embeddings & RAG

Assess your understanding of practical machine learning architectures, embedding spaces, and Retrieval-Augmented Generation systems.

This is a free, 16-question multiple-choice quiz. Answer each question to see whether you got it right, with an explanation for every answer. There is no sign-up and no time limit — take it as many times as you like, and scroll down for the full answer key once you are done.

Question 1 of 16

0 correct

What is the primary architectural purpose of Retrieval-Augmented Generation (RAG)?

Press A–D to choose · Enter to submit

Answer key & explanations

Every question in this quiz, with the correct answer marked and an explanation of why it is right. Use it to revise before or after taking the quiz above.

  1. 1.What is the primary architectural purpose of Retrieval-Augmented Generation (RAG)?

    • ATo retrain the base model's weights using reinforcement learning
    • BTo ground LLM generation with external dynamic context fetched at inference time✓ Correct
    • CTo compress model parameters into 4-bit quantized formats
    • DTo replace transformer attention layers with convolutional networks

    Correct answer: To ground LLM generation with external dynamic context fetched at inference time

    RAG pulls relevant text chunks from external document indexes or databases and injects them into the prompt, mitigating hallucinations and stale training data.

  2. 2.Why is cosine similarity commonly preferred over Euclidean distance when comparing normalized text embeddings?

    • ACosine similarity focuses on directional orientation rather than vector magnitude✓ Correct
    • BEuclidean distance cannot be calculated in high-dimensional vector spaces
    • CCosine similarity runs in O(1) constant time regardless of vector dimensions
    • DEuclidean distance only works on binary integer arrays

    Correct answer: Cosine similarity focuses on directional orientation rather than vector magnitude

    Cosine similarity measures the angle between vectors, capturing semantic orientation independently of magnitude (text length), making it ideal for normalized dense embeddings.

  3. 3.What problem does the 'Lost in the Middle' phenomenon highlight in transformer models handling long contexts?

    • AModels consume quadratic memory only during the middle token generation
    • BModels retrieve and utilize information located at the beginning and end of long prompts better than the middle✓ Correct
    • CVector databases fail to index tokens located near the median document boundary
    • DFine-tuning loss diverges when context length exceeds 2048 tokens

    Correct answer: Models retrieve and utilize information located at the beginning and end of long prompts better than the middle

    Empirical research demonstrates that transformer attention mechanisms frequently prioritize tokens at the extreme beginning and end of extensive contexts, degrading recall for middle context.

  4. 4.In RAG pipelines, what is the role of a cross-encoder re-ranking model?

    • ATo convert PDF documents into structured JSON schemas
    • BTo jointly score query-document pairs with full self-attention to refine initial top-k retrieval results✓ Correct
    • CTo split massive text documents into semantic paragraph chunks
    • DTo compress 1536-dimensional embeddings into 256-dimensional vectors

    Correct answer: To jointly score query-document pairs with full self-attention to refine initial top-k retrieval results

    While bi-encoders calculate query and document embeddings separately for fast retrieval, a cross-encoder examines query and document tokens together, yielding superior relevance rankings.

  5. 5.How does Hypothetical Document Embeddings (HyDE) improve dense semantic retrieval?

    • AIt generates a synthetic answer using an LLM, embeds that answer, and searches for similar real documents✓ Correct
    • BIt removes all punctuation and stopwords from the query before vectorization
    • CIt embeds every document using five distinct multi-lingual embedding models
    • DIt searches exclusively across synthetic mock datasets

    Correct answer: It generates a synthetic answer using an LLM, embeds that answer, and searches for similar real documents

    HyDE prompts an LLM to generate a hypothetical answer to the user's question, then uses the embedding of that hypothetical text to find semantically aligned real source documents.

  6. 6.What is the key advantage of Hierarchical Navigable Small World (HNSW) graphs in vector search engines?

    • AGuaranteed exact nearest-neighbor matching across non-linear spaces
    • BLogarithmic search time complexity for Approximate Nearest Neighbor (ANN) vector queries✓ Correct
    • CZero memory consumption by storing vectors on tape storage
    • DElimination of vector normalization requirements

    Correct answer: Logarithmic search time complexity for Approximate Nearest Neighbor (ANN) vector queries

    HNSW builds multi-layered graphs with skip-list properties, enabling fast logarithmic Approximate Nearest Neighbor (ANN) search through high-dimensional vector spaces.

  7. 7.What risk arises when chunk sizes in a RAG ingestion pipeline are configured too small?

    • AVector search latency scales exponentially
    • BCrucial semantic context surrounding facts is severed, leading to incomplete or fragmented answers✓ Correct
    • CThe embedding model refuses to generate floating-point vectors
    • DCosine similarity values become consistently negative

    Correct answer: Crucial semantic context surrounding facts is severed, leading to incomplete or fragmented answers

    Overly aggressive chunking isolates sentences from their surrounding context, meaning retrieved fragments may lack the pronouns, qualifications, or framing needed for accurate synthesis.

  8. 8.What is the purpose of Semantic Chunking compared to fixed-character chunking?

    • AIt translates text into Esperanto before splitting
    • BIt splits documents at points where the semantic similarity between consecutive sentences drops sharply✓ Correct
    • CIt forces every text chunk to fit exactly within 512 bytes
    • DIt tokenizes words into raw UTF-8 byte streams

    Correct answer: It splits documents at points where the semantic similarity between consecutive sentences drops sharply

    Semantic chunking monitors embedding distance between adjacent sentences and introduces breaks when semantic coherence shifts significantly, keeping topical units intact.

  9. 9.In multi-modal AI systems, what mechanism aligns image features and text descriptions in a joint embedding space?

    • AContrastive language-image pre-training (like CLIP)✓ Correct
    • BRecurrent neural network auto-encoding
    • CDecision tree bagging and boosting
    • DGraph convolutional edge clustering

    Correct answer: Contrastive language-image pre-training (like CLIP)

    Models like CLIP use contrastive learning to push matching text-image pairs close together in the shared embedding space while pulling non-matching pairs apart.

  10. 10.What metric measures the extent to which an LLM's generated response in RAG is grounded strictly in the retrieved documents?

    • APerplexity
    • BFaithfulness (Groundedness)✓ Correct
    • CROUGE-1 Precision
    • DBLEU Score

    Correct answer: Faithfulness (Groundedness)

    In RAG evaluation frameworks (such as Ragas), Faithfulness specifically quantifies whether every claim made in the output can be directly inferred from the retrieved context.

  11. 11.What is the primary function of Contextual Compression in RAG pipelines?

    • AGzipping document payloads before storing them in PostgreSQL
    • BExtracting only the sentences directly relevant to the query from retrieved passages to conserve prompt tokens✓ Correct
    • CConverting floating-point 32 vectors into 8-bit integers
    • DRunning optical character recognition on scanned PDF files

    Correct answer: Extracting only the sentences directly relevant to the query from retrieved passages to conserve prompt tokens

    Contextual compression inspects retrieved documents and strips out irrelevant filler text before passing the condensed, highly relevant content to the generation model.

  12. 12.Why is hybrid search (combining BM25 keyword matching with dense vector search) widely used in enterprise search?

    • AIt guarantees that the search cluster never runs out of RAM
    • BIt handles exact keyword matches (product codes, names) alongside broad conceptual semantic queries✓ Correct
    • CIt completely removes the need to index documents in a database
    • DIt speeds up vector indexing by skipping matrix multiplications

    Correct answer: It handles exact keyword matches (product codes, names) alongside broad conceptual semantic queries

    Dense vector search excels at high-level semantic meaning but can miss exact alphanumeric matches (part numbers, acronyms), which sparse BM25 keyword search handles reliably.

  13. 13.In an agentic workflow, what is the role of a tool or function calling schema?

    • ATo compile Python source code into machine binary
    • BTo supply structured JSON schemas that instruct the model how to emit arguments to execute external functions✓ Correct
    • CTo run automated continuous integration pipelines on model weights
    • DTo prevent models from responding in natural language

    Correct answer: To supply structured JSON schemas that instruct the model how to emit arguments to execute external functions

    Tool schemas describe functions, parameter types, and descriptions in JSON format, allowing the LLM to output structured JSON matching the schema when an external action is required.

  14. 14.What is the primary limitation of fine-tuning an LLM to inject dynamic company knowledge compared to using RAG?

    • AFine-tuning cannot modify the tone or style of a model
    • BFine-tuned models struggle to cite exact sources and suffer from knowledge obsolescence as facts change✓ Correct
    • CFine-tuning requires running the model exclusively on mobile CPUs
    • DFine-tuning doubles the latency of every subsequent generation token

    Correct answer: Fine-tuned models struggle to cite exact sources and suffer from knowledge obsolescence as facts change

    Fine-tuning updates internal weights, making factual verification difficult, hallucination harder to trace, and keeping data up-to-date costly compared to updating an external RAG index.

  15. 15.What does Quantization (e.g., INT8 or INT4) accomplish when serving machine learning models in production?

    • AIt increases training precision by using 64-bit floating point math
    • BIt reduces model memory footprint and inference latency with minimal degradation in accuracy✓ Correct
    • CIt replaces the attention layer with a nearest-neighbor classifier
    • DIt ensures that the model only outputs deterministic JSON structures

    Correct answer: It reduces model memory footprint and inference latency with minimal degradation in accuracy

    Quantization maps high-precision floating-point weights (FP16/FP32) to lower-bit representations (INT8/INT4), drastically reducing VRAM usage and accelerating memory-bound inference.

  16. 16.What does Reciprocal Rank Fusion (RRF) achieve in multi-query or hybrid retrieval setups?

    • AIt calculates the dot product of two distinct embedding vectors
    • BIt merges multiple ranked lists of search results into a single list based on position rather than raw scores✓ Correct
    • CIt generates synthetic training queries for data augmentation
    • DIt compresses text chunks into compact latent variables

    Correct answer: It merges multiple ranked lists of search results into a single list based on position rather than raw scores

    RRF combines rankings from disparate retrieval algorithms (e.g., keyword and vector) by scoring documents based on their inverse rank position, smoothing out incompatible score distributions.

More free quizzes