DecodeAI
← Question Bank

Deep Learning & Generative AI

Generative AI & Large Language Models (LLMs) Interview Questions

Interview questions on Generative AI & Large Language Models (LLMs) Interview Questions.

127 questions

LLM Architectures & Foundations

Q2. What are autoregressive language models?

Sign in to bookmark

LLM Architectures & Foundations

Q3. How do autoregressive models employ the chain rule of probability?

Sign in to bookmark

LLM Architectures & Foundations

Q4. What are different types of language models?

Sign in to bookmark

LLM Architectures & Foundations

Q5. What are encoder-only language models?

Sign in to bookmark

LLM Architectures & Foundations

Q6. State the pros and cons of an encoder-only language model?

Sign in to bookmark

LLM Architectures & Foundations

Q7. What are decoder-only language models?

Sign in to bookmark

LLM Architectures & Foundations

Q8. What are pros and cons of decoder-only language models?

Sign in to bookmark

LLM Architectures & Foundations

Q9. What are encoder-decoder language models?

Sign in to bookmark

LLM Architectures & Foundations

Q10. What are pros and cons of encoder-decoder language models?

Sign in to bookmark

LLM Architectures & Foundations

Q11. What is the difference between proprietary and open-source Large Language Models (LLMs)?

Sign in to bookmark

LLM Architectures & Foundations

Q12. What is the context window in LLMs, and why does it matter?

Sign in to bookmark

LLM Architectures & Foundations

Q13. How can we use an encoder-only model for classification tasks?

Sign in to bookmark

LLM Architectures & Foundations

Q14. What are sequence-to-sequence models, and where are they applied?

Sign in to bookmark

LLM Architectures & Foundations

Q15. What is the difference between representation models and generative models?

Sign in to bookmark

LLM Architectures & Foundations

Q16. What are emergent properties of LLMs?

Sign in to bookmark

LLM Architectures & Foundations

Q17. What are generative versus discriminative models in NLP?

Sign in to bookmark

LLM Architectures & Foundations

Q18. How does GPT-4 differ from GPT-3 in features and applications?

Sign in to bookmark

LLM Architectures & Foundations

Q19. What types of foundation models exist?

Sign in to bookmark

LLM Architectures & Foundations

Q20. How do discriminative and generative AI differ?

Sign in to bookmark

LLM Architectures & Foundations

Q21. How do LLMs differ from traditional statistical language models?

Sign in to bookmark

LLM Architectures & Foundations

Q22. What defines a Large Language Model (LLM)?

Sign in to bookmark

Tokenization & Embeddings

Q23. What does tokenization entail, and why is it critical for LLMs?

Sign in to bookmark

Tokenization & Embeddings

Q24. What are the different parameters of a tokenizer?

Sign in to bookmark

Tokenization & Embeddings

Q25. What are the key considerations in designing an effective tokenization strategy for language models?

Sign in to bookmark

Tokenization & Embeddings

Q26. Can you explain the Bag-of-Words (BoW) model and discuss its limitations?

Sign in to bookmark

Tokenization & Embeddings

Q27. What are word2vec models and how are they trained?

Sign in to bookmark

Tokenization & Embeddings

Q28. What are the main limitations of the word2vec model?

Sign in to bookmark

Tokenization & Embeddings

Q29. What are different types of embeddings?

Sign in to bookmark

Tokenization & Embeddings

Q30. Which tokenizer is used in the BERT model, and what are the special tokens used in the BERT Base Uncased model?

Sign in to bookmark

Tokenization & Embeddings

Q31. What are the embeddings, and how are they initialized in LLMs?

Sign in to bookmark

Tokenization & Embeddings

Q32. How do LLMs manage out-of-vocabulary (OOV) words?

Sign in to bookmark

Tokenization & Embeddings

Q33. What is Byte‑Pair Encoding (BPE) and how does it work?

Sign in to bookmark

Tokenization & Embeddings

Q34. Illustrate with a simple example, how does BPE work?

Sign in to bookmark

Tokenization & Embeddings

Q35. Which tokenizer is used in the GPT-3/4 model, and what are the special tokens used in the GPT-3/4 model?

Sign in to bookmark

Tokenization & Embeddings

Q36. What are positional encodings, and why are they used?

Sign in to bookmark

Tokenization & Embeddings

Q37. What are different types of positional embeddings?

Sign in to bookmark

Tokenization & Embeddings

Q38. How does fine-tuning embedding models improve dense retrieval?

Sign in to bookmark

Tokenization & Embeddings

Q39. How does Adaptive Softmax optimize LLMs?

Sign in to bookmark

Tokenization & Embeddings

Q41. What makes TSDAE a suitable method for learning sentence embeddings in a completely unsupervised setting, and how does it differ from masked language modeling?

Sign in to bookmark

Tokenization & Embeddings

Q42. What is cosine-similarity loss, and how is it used to train embedding models?

Sign in to bookmark

Tokenization & Embeddings

Q43. Suppose you have a limited labeled dataset and want to train a sentence embedding model. How would you approach this effectively without compromising performance?

Sign in to bookmark

Tokenization & Embeddings

Q44. What is a few-shot classification, and why is it useful?

Sign in to bookmark

Tokenization & Embeddings

Q45. What are the three main steps of the SetFit framework for few-shot text classification?

Sign in to bookmark

Attention, KV Cache & Efficient Inference

Q46. How does the attention mechanism function in transformer models?

Sign in to bookmark

Attention, KV Cache & Efficient Inference

Q47. What are the main steps involved in the attention mechanism?

Sign in to bookmark

Attention, KV Cache & Efficient Inference

Q48. What is the KV cache in transformer models?

Sign in to bookmark

Attention, KV Cache & Efficient Inference

Q49. What are the advantages and disadvantages of using a Key-Value (KV) cache in Transformer models?

Sign in to bookmark

Attention, KV Cache & Efficient Inference

Q50. What is model distillation, and how does it benefit LLMs?

Sign in to bookmark

Attention, KV Cache & Efficient Inference

Q51. How do transformers improve on traditional Seq2Seq models?

Sign in to bookmark

Attention, KV Cache & Efficient Inference

Q52. What is multi-head attention, and how does it enhance LLMs?

Sign in to bookmark

Attention, KV Cache & Efficient Inference

Q53. What is local (sparse) attention and how does it work?

Sign in to bookmark

Attention, KV Cache & Efficient Inference

Q54. What is Flash Attention?

Sign in to bookmark

Attention, KV Cache & Efficient Inference

Q55. How is the softmax function applied in attention mechanisms?

Sign in to bookmark

Attention, KV Cache & Efficient Inference

Q56. How does the dot product contribute to self-attention?

Sign in to bookmark

Attention, KV Cache & Efficient Inference

Q57. How are attention scores calculated in transformers?

Sign in to bookmark

Attention, KV Cache & Efficient Inference

Q58. How does Mixture of Experts(MoE) enhance LLM scalability?

Sign in to bookmark

Attention, KV Cache & Efficient Inference

Q59. How do transformers address the vanishing gradient problem?

Sign in to bookmark

Attention, KV Cache & Efficient Inference

Q60. How do encoders and decoders differ in transformers?

Sign in to bookmark

LLM Training & Pre-training

Q61. How are Large Language Models (LLMs) trained?

Sign in to bookmark

LLM Training & Pre-training

Q62. What is masked language modeling, and how does it aid pretraining?

Sign in to bookmark

LLM Training & Pre-training

Q63. What is the BERT model, and how was it trained?

Sign in to bookmark

LLM Training & Pre-training

Q64. How does RoBERTa differ from the BERT model?

Sign in to bookmark

LLM Training & Pre-training

Q65. How do autoregressive and masked models differ in LLM training?

Sign in to bookmark

LLM Training & Pre-training

Q66. What is the next sentence prediction, and how does it enhance LLMs?

Sign in to bookmark

LLM Training & Pre-training

Q67. What is overfitting, and how can it be mitigated in LLMs?

Sign in to bookmark

LLM Training & Pre-training

Q68. Why is cross-entropy loss used in language modeling?

Sign in to bookmark

LLM Training & Pre-training

Q69. How are gradients computed for embeddings in LLMs?

Sign in to bookmark

LLM Training & Pre-training

Q70. What is the Jacobian matrix in transformer backpropagation?

Sign in to bookmark

LLM Training & Pre-training

Q71. How do eigenvalues and eigenvectors relate to dimensionality reduction?

Sign in to bookmark

LLM Training & Pre-training

Q72. What is KL divergence, and how is it used in LLMs?

Sign in to bookmark

LLM Training & Pre-training

Q73. What is the derivative of the ReLU function, and why is it significant?

Sign in to bookmark

LLM Training & Pre-training

Q74. How does the chain rule apply to gradient descent in LLMs?

Sign in to bookmark

LLM Training & Pre-training

Q75. What is hyper hyperparameter, and why is it important?

Sign in to bookmark

LLM Training & Pre-training

Q76. What is “continued pre training” with Masked Language Modeling, and why is it useful?

Sign in to bookmark

LLM Training & Pre-training

Q77. What’s the difference between token masking and whole-word masking in MLM?

Sign in to bookmark

LLM Training & Pre-training

Q78. What are the three main steps involved in LLM training?

Sign in to bookmark

Decoding Strategies & Prompt Engineering

Q79. How does beam search improve text generation compared to greedy decoding?

Sign in to bookmark

Decoding Strategies & Prompt Engineering

Q80. What role does temperature play in controlling LLM output?

Sign in to bookmark

Decoding Strategies & Prompt Engineering

Q81. How do top-k and top-p sampling differ in text generation?

Sign in to bookmark

Decoding Strategies & Prompt Engineering

Q82. Explain the decoding strategies used in LLMs?

Sign in to bookmark

Decoding Strategies & Prompt Engineering

Q83. Can we use generative models for classification tasks? If so, how?

Sign in to bookmark

Decoding Strategies & Prompt Engineering

Q84. Why is prompt engineering crucial for LLM performance?

Sign in to bookmark

Decoding Strategies & Prompt Engineering

Q85. What are some good prompting techniques one should know?

Sign in to bookmark

Decoding Strategies & Prompt Engineering

Q86. What is Chain-of-Thought (CoT) prompting, and how does it aid reasoning?

Sign in to bookmark

Decoding Strategies & Prompt Engineering

Q87. What is self-consistency in prompting, and how does it help improve the quality of generative model outputs? What are its trade-offs?

Sign in to bookmark

Decoding Strategies & Prompt Engineering

Q88. What is zero-shot learning, and how do LLMs implement it?

Sign in to bookmark

Decoding Strategies & Prompt Engineering

Q89. What is few-shot learning, and what are its benefits?

Sign in to bookmark

Decoding Strategies & Prompt Engineering

Q90. How can we control the output of a generative model?

Sign in to bookmark

Fine-Tuning & Model Adaptation

Q91. What distinguishes LoRA from QLoRA in fine-tuning LLMs?

Sign in to bookmark

Fine-Tuning & Model Adaptation

Q92. How can LLMs avoid catastrophic forgetting during fine-tuning?

Sign in to bookmark

Fine-Tuning & Model Adaptation

Q93. How does PEFT mitigate catastrophic forgetting?

Sign in to bookmark

Fine-Tuning & Model Adaptation

Q94. State the scenarios where you will use RAG over fine-tuning and vice versa?

Sign in to bookmark

Fine-Tuning & Model Adaptation

Q95. What is the difference between parameter-efficient fine-tuning (PEFT) and full fine-tuning? Which is better?

Sign in to bookmark

Fine-Tuning & Model Adaptation

Q96. What are adapters, and how do they enable parameter-efficient fine-tuning (PEFT)?

Sign in to bookmark

Fine-Tuning & Model Adaptation

Q97. What is LoRA (Low-Rank Adaptation) and how does it enable parameter-efficient fine-tuning?

Sign in to bookmark

Fine-Tuning & Model Adaptation

Q98. What is “intrinsic dimension” in the context of model fine-tuning, and why does it matter?

Sign in to bookmark

Fine-Tuning & Model Adaptation

Q99. How does LoRA differ from adapters?

Sign in to bookmark

Fine-Tuning & Model Adaptation

Q100. In LoRA fine-tuning, how are the low-rank matrices A and B initialized?

Sign in to bookmark

Fine-Tuning & Model Adaptation

Q101. In LoRA fine-tuning, how is the rank chosen?

Sign in to bookmark

Fine-Tuning & Model Adaptation

Q102. What is QLoRA, and how does it compare to standard LoRA?

Sign in to bookmark

RAG & Vector Databases

Q103. What is Dense Retrieval and how does it work?

Sign in to bookmark

RAG & Vector Databases

Q104. What are the caveats of dense retrieval?

Sign in to bookmark

RAG & Vector Databases

Q105. What are the best chunking strategies in RAG systems?

Sign in to bookmark

RAG & Vector Databases

Q106. What is ANN and how is it useful in RAG systems?

Sign in to bookmark

RAG & Vector Databases

Q107. What are the steps in Retrieval-Augmented Generation (RAG)?

Sign in to bookmark

RAG & Vector Databases

Q108. What is query rewriting in RAG systems, and why is it important for effective retrieval?

Sign in to bookmark

RAG & Vector Databases

Q110. What is query routing in RAG systems, and how does it improve retrieval?

Sign in to bookmark

RAG & Vector Databases

Q111. What distinguishes multi-query RAG from multi-hop RAG?

Sign in to bookmark

Alignment & Preference Optimization

Q113. What is preference tuning, and why is it important?

Sign in to bookmark

Alignment & Preference Optimization

Q114. What is a reward model, and how does it automate preference evaluation in LLM alignment?

Sign in to bookmark

Alignment & Preference Optimization

Q115. What is Proximal Policy Optimization (PPO) in preference tuning, and how does it work?

Sign in to bookmark

Alignment & Preference Optimization

Q116. What is Direct Preference Optimization (DPO), and how does it function?

Sign in to bookmark

LLM Evaluation & Benchmarking

Q117. How do we evaluate the retrieval component in a RAG system?

Sign in to bookmark

LLM Evaluation & Benchmarking

Q118. How do we evaluate the generative component of a RAG model?

Sign in to bookmark

Agents, Tool Use & Memory

Q119. How does knowledge graph integration improve LLMs?

Sign in to bookmark

Agents, Tool Use & Memory

Q120. What do you mean by LLM memory, and why is it important?

Sign in to bookmark

Agents, Tool Use & Memory

Q121. What are LLM agents, and how do they extend the capabilities of language models beyond static chains?

Sign in to bookmark

Agents, Tool Use & Memory

Q122. What is the ReAct framework, and how does it enable step-by-step reasoning in LLM agents?

Sign in to bookmark

Multimodal Generative AI

Q123. How do Transformers work for vision tasks like image classification?

Sign in to bookmark

Multimodal Generative AI

Q124. How does CLIP create and align multimodal embeddings for images and text?

Sign in to bookmark

LLM Safety & Security

Q125. How would you fix an LLM generating biased or incorrect outputs?

Sign in to bookmark

LLMOps & Production

Q126. What challenges do LLMs face in deployment?

Sign in to bookmark

LLMOps & Production

Q127. What is a rate limit issue in closed LLM APIs, and how can it be handled?

Sign in to bookmark