61. What is reinforcement learning from human feedback (RLHF) in deep learning?
- RLHF is a technique where human annotators manually update model weights during training
- RLHF is a training approach that uses human preferences as a reward signal — first training a reward model from human feedback data, then fine-tuning the language model with reinforcement learning to produce outputs that humans prefer — used to align ChatGPT, Claude, and other LLMs
- RLHF means models are reinforced by reading human feedback from social media about the model
- RLHF is only applicable to robotics and cannot be used to train language models
Answer : B Explanation: RLHF (Reinforcement Learning from Human Feedback) aligns large language models with human values and preferences. Process: Supervised Fine-Tuning (SFT): start from a pre-trained LLM, fine-tune on high-quality human-written demonstrations of desired behavior. Reward Model Training: human annotators compare pairs of model outputs and rank them by preference. Train a reward model to predict which outputs humans prefer. RL Fine-Tuning: use PPO (Proximal Policy Optimization) to fine-tune the LLM to maximize the reward model’s score. KL-divergence penalty prevents the model from deviating too far from the SFT baseline. Why it matters: Pre-trained LLMs can generate harmful, false, or unhelpful content. RLHF makes models: more helpful (answer questions clearly), more harmless (avoid dangerous content), more honest (refuse to make up facts). ChatGPT (OpenAI): first mainstream LLM to use RLHF at scale. Claude (Anthropic): uses Constitutional AI + RLHF. Alternatives to RLHF: DPO (Direct Preference Optimization) — more stable, no RL needed. Constitutional AI (Anthropic) — AI critiques and revises its own outputs.
62. What is a variational autoencoder (VAE) in deep learning?
- A VAE is an autoencoder that varies its architecture based on the difficulty of each training example
- A VAE is a generative model that learns a probabilistic latent space — the encoder outputs a probability distribution (mean and variance) rather than a single point, enabling generation of new samples by sampling from the learned distribution
- A VAE is a type of autoencoder with variable (adjustable) compression ratio for different inputs
- Variational autoencoders are only used for text generation and cannot process image data
Answer : B Explanation: VAE (Variational Autoencoder), introduced by Kingma and Welling (2013), is a powerful generative model. Key difference from standard autoencoder: standard autoencoder: encoder outputs a single latent vector z. VAE: encoder outputs parameters of a distribution — mean μ and log-variance log(σ²). Sampling: z is sampled from N(μ, σ²) during training. Reparameterization trick: z = μ + σ × ε (where ε ~ N(0,1)) — makes sampling differentiable for backprop. Loss function: Reconstruction loss: ||x – x̂||² — make decoded output similar to input. KL divergence: KL(N(μ,σ²) || N(0,1)) — force latent space to be smooth and continuous. Why VAEs generate new samples: because the latent space is a smooth probability distribution, you can sample any point and decode it into a meaningful image. Interpolation: smoothly interpolate between two latent points → blend between two images. VAE vs GAN: VAE: blurry but diverse samples, stable training. GAN: sharp, photorealistic samples but unstable training. Applications: Image generation, drug discovery (generate molecular structures), anomaly detection, disentangled representation learning.
63. What is the difference between max pooling and average pooling in deep learning?
- Max pooling is used in the first layer of CNNs; average pooling is used only in the last layer
- Max pooling selects the maximum value from each pooling window — retaining the most prominent feature and providing translation invariance; average pooling computes the mean — providing a smoother summary used in global average pooling before the classification layer
- Average pooling requires more computation than max pooling due to additional averaging operations
- Max pooling and average pooling produce identical results when the pooling window size is 2×2
Answer : B Explanation: Both pooling operations reduce spatial dimensions of feature maps but capture different information. Max Pooling: selects the maximum activation value in each pooling window. Preserves the strongest feature activation — “was this feature detected anywhere in this region?” Provides translation invariance — slight shifts don’t change the maximum. Discards where exactly the feature occurred. Most common in hidden layers for feature detection. Example: 4×4 with 2×2 max pool, stride 2 → 2×2 output. Average Pooling: computes the mean of all values in the pooling window. Provides a smoother summary of features. Retains more spatial information than max pooling. Less commonly used in hidden layers. Global Average Pooling (GAP): averages each entire feature map down to a single value. Produces one value per feature map channel. Used in final layers of modern CNNs (ResNet, EfficientNet, MobileNet) instead of large fully connected layers. Dramatically reduces parameters and overfitting. 2048-channel feature map → GAP → 2048-dimensional vector → Dense layer. Adaptive pooling: PyTorch’s AdaptiveAvgPool2d — specify output size rather than kernel size. Handles any input size.
64. What is deep learning model compression and why is it needed?
- Model compression converts deep learning models into compressed ZIP files for easier storage
- Model compression is a set of techniques to reduce the size and computational requirements of deep learning models — including pruning, quantization, knowledge distillation, and architecture search — enabling deployment on edge devices with limited memory and compute
- Model compression increases the training time but reduces the inference time proportionally
- Model compression is only needed for models larger than 10GB and is unnecessary for smaller models
Answer : B Explanation: Model compression is essential for deploying DL models on smartphones, IoT devices, and real-time applications. Why compression is needed: Large models: GPT-3 = 175B parameters = 350GB in FP16. Deployment reality: smartphone has limited RAM, no GPU. Latency requirements: autonomous vehicles need millisecond inference. Compression techniques: Pruning: remove weights or neurons below a threshold. Unstructured pruning: individual weight removal → sparse network. Structured pruning: remove entire filters/channels → smaller dense network. Lottery Ticket Hypothesis: small “winning” subnetworks exist in large models. Quantization: reduce numerical precision. FP32 → FP16 (2× smaller), INT8 (4× smaller), INT4 (8× smaller). Post-training quantization (no retraining). Quantization-aware training (better accuracy). Knowledge Distillation: small “student” network trained to mimic large “teacher” network. Using teacher’s soft probability outputs as targets. DistilBERT: 40% smaller BERT with 97% performance. Neural Architecture Search (NAS): automatically design efficient architectures. MobileNets, EfficientNet, NASNet. Results: GPT-3 175B → INT4 quantization → ~87GB. Llama 3 8B → INT4 → ~4.7GB → runs on a laptop.
65. What is the concept of fine-tuning in deep learning?
- Fine-tuning is the process of adjusting hyperparameters like learning rate to get small accuracy improvements
- Fine-tuning is the process of continuing to train a pre-trained model on a new, typically smaller, task-specific dataset — updating some or all of the model’s weights to specialize the general learned representations for the specific task
- Fine-tuning means rebuilding a deep learning model from scratch with more carefully chosen architectures
- Fine-tuning is only applicable to transformer models and cannot be applied to CNNs
Answer : B Explanation: Fine-tuning bridges the gap between pre-trained models and specific applications. Steps: Start with a pre-trained model (trained on a large dataset). Replace the final classification head with a new one for the target task. Train on the target dataset. Strategies: Feature extraction (frozen base): freeze all pre-trained layers. Only train the new classification head. Requires very little data. Fast but may not achieve optimal performance. Full fine-tuning: unfreeze all layers. Update all weights with a small learning rate (e.g., 1e-5). Requires more data but achieves best performance. Gradual unfreezing: start with only head, progressively unfreeze more layers. Learning rate decay: use lower learning rates for earlier layers (they contain more general features). For NLP: BERT fine-tuning: add a classification layer on top of [CLS] token. Fine-tune all BERT weights with small learning rate. State-of-the-art on many tasks with just 1000-10000 labeled examples. Parameter-Efficient Fine-Tuning (PEFT): LoRA (Low-Rank Adaptation): add small learnable matrices alongside frozen weights. Only 0.1% of parameters updated → significant memory savings. Used to fine-tune LLMs on consumer hardware. Prompt tuning, Prefix tuning: add learnable tokens/prefix to input.
66. What is an embedding layer in deep learning?
- An embedding layer is a visualization layer that embeds the loss landscape into a 2D plot
- An embedding layer is a trainable lookup table that converts discrete inputs (like word IDs or categorical features) into dense continuous vectors — learning to represent items in a meaningful continuous space where similar items are closer together
- An embedding layer compresses the entire neural network into a single embedded representation
- Embedding layers are only found in the output layer of language models for decoding
Answer : B Explanation: Embedding layers are fundamental for handling discrete categorical data in deep learning. How it works: Initialize an embedding matrix of size [vocab_size × embedding_dim] (e.g., 50,000 × 256). For word ID 5432, return row 5432 of the matrix — a 256-dimensional vector. The matrix is trained with the rest of the network via backpropagation. Why not one-hot encoding: one-hot vectors are sparse (50,000-dimensional with a single 1). No semantic information — all words equally distant. Embedding vectors: dense (256-dimensional), learnable, capture semantic similarity. Applications: NLP: word embeddings — convert token IDs to dense vectors. Transformers: token embedding + positional encoding. Recommendation systems: user and item embeddings for collaborative filtering. Knowledge graphs: entity and relation embeddings. Tabular data: category embeddings for high-cardinality features (instead of one-hot). Graph neural networks: node/edge embeddings. Pre-trained embeddings: initialize from Word2Vec, GloVe, BERT → fine-tune with task. Or learn from scratch (Transformers learn their own embeddings during pre-training). Visualization: t-SNE/UMAP of embedding space shows meaningful clusters — similar words/items cluster together.
67. What is deep learning in healthcare and medical imaging?
- Deep learning in healthcare is only used for administrative tasks like scheduling appointments
- Deep learning has transformed medical imaging and healthcare by achieving expert-level performance in radiology interpretation, pathology slide analysis, disease screening, drug discovery, genomics, and clinical decision support — often surpassing individual specialist performance
- Deep learning in healthcare is still experimental with no FDA-approved or clinically deployed applications
- Deep learning in medical imaging can only analyze X-rays and cannot process CT, MRI, or other modalities
Answer : B Explanation: Deep learning is one of the most impactful applications of AI in healthcare. Medical Imaging: Radiology: chest X-ray analysis (pneumonia, COVID-19, nodule detection), CT scan analysis, brain MRI (tumor segmentation, Alzheimer’s detection). Model: CheXNet (Stanford, 2017) achieved radiologist-level pneumonia detection. Pathology: digital slide analysis for cancer staging, tumor grading. Ophthalmology: diabetic retinopathy screening — Google’s DeepMind achieved specialist-level accuracy. Dermatology: skin lesion classification — dermatologist-level melanoma detection. Cardiology: ECG interpretation, echocardiogram analysis. Architectures used: U-Net (medical segmentation gold standard), ResNet, EfficientNet for classification. Drug Discovery: AlphaFold 2 (DeepMind, 2021): predicted 3D protein structures from amino acid sequences. Solved a 50-year-old biology grand challenge. AlphaFold DB: predicted structures for 200+ million proteins. Genomics: predicting gene expression, variant effect prediction. Clinical: electronic health record (EHR) analysis, sepsis prediction, 30-day readmission prediction. FDA-approved AI medical devices: over 500 FDA-cleared AI/ML medical devices as of 2024. Challenges: interpretability (“explain why”), dataset bias, regulatory approval, clinical deployment.
68. What is a deep learning framework and what do they provide?
- A deep learning framework is the physical server infrastructure required for training models
- A deep learning framework is a software library that provides automatic differentiation, GPU acceleration, pre-built neural network layers, optimization algorithms, and data loading utilities — enabling researchers and engineers to build and train models without implementing everything from scratch
- A deep learning framework is a set of best practices and guidelines rather than executable software
- Deep learning frameworks are only needed during training and have no role in model deployment
Answer : B Explanation: Deep Learning Frameworks provide the building blocks for neural network research and development. Core features: Automatic Differentiation (Autograd): automatically computes gradients for backpropagation — no manual chain rule needed. GPU/Hardware Acceleration: CUDA support for NVIDIA GPUs, metal for Apple Silicon, TPU support. Neural Network Layers: ready-to-use Linear, Conv2d, LSTM, MultiheadAttention, BatchNorm, Dropout layers. Optimizers: Adam, SGD, AdamW, RMSprop built-in. Loss functions: MSELoss, CrossEntropyLoss, BCELoss, etc. Data utilities: DataLoader, Dataset classes for efficient data loading and batching. Model serialization: save and load model weights. Major frameworks: PyTorch (Meta): most popular in research. torch.nn, torch.optim, torchvision. TensorFlow/Keras (Google): strong production ecosystem. JAX (Google): functional, high-performance, XLA compilation. Fast.ai: high-level library on top of PyTorch for education. Hugging Face Transformers: pre-trained transformer models. Lightning/Lightning AI: PyTorch Lightning simplifies training loops. ONNX: open standard for model interchange between frameworks. Hardware-specific: TensorRT (NVIDIA inference), CoreML (Apple), TFLite (mobile/edge).
69. What is Generative AI and what deep learning techniques power it?
- Generative AI only generates random noise patterns and cannot create meaningful content
- Generative AI refers to AI systems that can create new content (text, images, audio, video, code) that resembles but is not copied from training data — powered by deep learning architectures including Transformers (for text), Diffusion Models (for images), GANs, and VAEs
- Generative AI is only capable of generating text and cannot create images, audio, or video
- Generative AI always requires human supervision for each piece of content it creates
Answer : B Explanation: Generative AI encompasses systems that create new content — one of the most transformative AI developments. Key architectures: Large Language Models (LLMs): GPT-4, Claude, Gemini — generate text, code, reasoning. Architecture: autoregressive Transformer decoder. Training: next-token prediction on internet-scale text. Diffusion Models (dominant for images): DALL-E 3, Stable Diffusion, Midjourney, Imagen. Process: gradually add noise to training images, then train model to reverse the process. At inference: start from random noise, iteratively denoise to generate new images. Extremely high quality but slower than GANs. Text-to-image: describe an image in text → model generates it. Multimodal Models: GPT-4V, Gemini: understand and generate across text, images, code, audio. CLIP (OpenAI): connects text and images in a shared embedding space. Audio Generation: MusicLM, AudioLM, WaveNet, Bark — generate music and speech. Video Generation: Sora (OpenAI, 2024), Runway Gen-2, Kling — text-to-video. Code Generation: GitHub Copilot (GPT-4-based), AlphaCode (Gemini). Applications: Content creation, drug discovery, protein design, software development, education, entertainment.
70. What is a diffusion model in deep learning?
- A diffusion model is a neural network that diffuses (spreads) information between layers for better gradient flow
- A diffusion model is a generative model that learns to reverse a gradual noising process — trained by predicting and removing noise from progressively corrupted images, then generating new images by starting from pure noise and iteratively denoising
- Diffusion models are used to diffuse (balance) the learning rate across different model layers
- A diffusion model diffuses (compresses) the training data into a smaller representation for storage
Answer : B Explanation: Diffusion Models, popularized by DDPM (Ho et al., 2020) and score matching, have become the dominant image generation approach, powering Stable Diffusion, DALL-E 3, and Midjourney. Forward process: gradually add Gaussian noise to a training image over T steps (e.g., T=1000). After T steps, image becomes pure Gaussian noise. Reverse process (what the model learns): neural network (U-Net architecture) learns to predict and remove the noise added at each step. At each step t, model predicts the noise ε: εθ(xt, t). Loss: ||ε – εθ(xt, t)||² — minimize difference between actual noise and predicted noise. Generation: start from random Gaussian noise xT. Apply the learned denoising process T times. Gradually a coherent image emerges. Conditioning: text-to-image: condition the denoising network on text embeddings (CLIP). Allows steering generation toward specific content. Latent Diffusion Models (LDM): run diffusion in a compressed latent space (VAE encoder/decoder). Dramatically reduces compute while maintaining quality. Used in Stable Diffusion. Advantages over GANs: more stable training, better mode coverage, higher quality. Disadvantages: slower inference (many denoising steps). Accelerated sampling: DDIM, DPM-Solver reduce from 1000 steps to 20-50 steps.
