Skip to content
tezvyn:

LLMs & Generative AI

Large language models, chatbots, agents, prompt engineering

324 bites

Test yourself: Top 30 LLMs & Generative AI interview questionsMultiple choice, with the correct answer and why it is correct on every question. Free, no sign-in.

Everything in LLMs & Generative AI, page 5

advanced1 min read

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.

advanced1 min read

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.

intermediate1 min read

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.

advanced1 min read

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.

intermediate1 min read

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.

easy1 min read

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.

intermediate2 min read

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.

advanced2 min read

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.

easy2 min read

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.

advanced2 min read

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.

intermediate1 min read

Why Multi-Head Attention

Multiple heads attend to different subspaces and relations in parallel, which one big head averages away.

easy2 min read

Self-Attention versus Recurrent Architectures

Each token attends to all others via query-key-value, enabling parallelism and direct long-range links.

intermediate1 min read

Attention in Sequence-to-Sequence Models

Attention computes per-step weighted sums over all encoder states, fixing the information bottleneck for long inputs.

easy1 min read

Vanishing Gradients and Why ReLU Helps

Saturating activations shrink gradients across layers, ReLU's flat-one derivative preserves them.

intermediate1 min read

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…

intermediate2 min read

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…

intermediate2 min read

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?
intermediate2 min read

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.

intermediate2 min read

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.

easy2 min read

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