Everything in LLMs & Generative AI, page 5
Securing tool-using LLM agents
Name indirect prompt injection, data exfiltration, and unsafe tool execution, then defend with sandboxing, least-privilege scoped tools, input/output filtering, and human-in-the-loop on risky actions.
Hybrid search and re-ranking for retrieval
Hybrid search fuses dense semantic and sparse keyword signals to catch exact terms dense misses; a cross-encoder re-ranker rescoring top-k boosts precision.
Evaluating a RAG system end to end
Measure retrieval with context recall or precision, and generation with faithfulness and answer relevance, attributing failures to the right stage.
Direct Preference Optimization explained
DPO reparameterizes the RLHF reward in terms of the policy itself, turning alignment into a simple classification loss on preference pairs with no separate reward model or PPO.
Reward models in RLHF and PPO
It learns from human preference comparisons to score responses, then supplies the reward signal that PPO maximizes while a KL penalty keeps the policy near the reference.
Pre-training versus fine-tuning an LLM
Pre-training is broad self-supervised next-token prediction on huge corpora at massive cost; fine-tuning adapts on small labeled data cheaply.
Zero-Shot, Few-Shot, and Chain-of-Thought Trade-offs
Zero-shot is cheap but weak on reasoning, few-shot adds demos at token cost, CoT boosts multi-step accuracy but spends the most tokens and latency.
FlashAttention and IO-Aware Attention
FlashAttention is IO-aware, tiling and fusing attention in fast SRAM to avoid materializing the n-by-n matrix in slow HBM.
Causal versus Masked Language Modeling
Pre-training learns general language from unlabeled text; CLM predicts the next token left-to-right, MLM predicts masked tokens using both sides.
Layer Norm and Residuals in Transformer Blocks
Residuals preserve gradient flow, layer norm stabilizes activations per token, and it beats batch norm because it is independent of batch and sequence length.
Why Multi-Head Attention
Multiple heads attend to different subspaces and relations in parallel, which one big head averages away.
Self-Attention versus Recurrent Architectures
Each token attends to all others via query-key-value, enabling parallelism and direct long-range links.
Attention in Sequence-to-Sequence Models
Attention computes per-step weighted sums over all encoder states, fixing the information bottleneck for long inputs.
Vanishing Gradients and Why ReLU Helps
Saturating activations shrink gradients across layers, ReLU's flat-one derivative preserves them.
Hallucination Detection in LLMs
Hallucination detection is the set of techniques for flagging when a language model states something fluent but false or unsupported, using signals like self-consistency, model uncertainty, and grounding against retrieved evidence to catch fabrications before…
Transformer Encoder-Decoder Architecture
The encoder-decoder Transformer maps an input sequence into rich contextual representations with an encoder, then a decoder generates output tokens autoregressively while attending to those representations via cross-attention, making it ideal for…
Value Learning
Value learning is the AI-safety approach of having a system infer what humans actually value, rather than optimizing a hand-coded proxy, so that capable agents pursue goals aligned with human intent even in novel situations.
How does text guide Stable Diffusion via U-Net cross-attention?
Tests whether you know text embeddings condition the U-Net through cross-attention. Good answers explain that image features query text keys and values at every layer. Red flag: claiming the prompt is concatenated to the image latent.
What is GAN mode collapse, its causes, and two mitigations?
Define mode collapse as diversity loss to few modes; cite discriminator imbalance and lenient JS loss; give two fixes: WGAN and mini-batch discrimination.
Explain Denoising Diffusion models and forward/reverse processes.
This tests if you see diffusion as iterative latent generation, not GANs. Forward: add Gaussian noise over T steps until data is pure noise. Reverse: a network iteratively denoises random noise into data.
We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.
See open roles