Intermediate everything in AI & ML, page 14

Shadow Deployment: Test Models on Real Traffic
Shadow deployment runs a new model on real traffic without serving its predictions, letting you catch data drift before users are affected. It is the safest production validation method, but teams often forget to monitor its latency and resource costs.
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.
What fixes an LLM agent's incorrect JSON arguments for a complex tool?
Tests mixing prompting with system guardrails for valid tool JSON. Outline: few-shot demos plus CoT prompting; schema validation, constrained decoding, and retries. Red flag: weak prompts without validation or structured output.

Describe a ReAct agent architecture for multi-step dependent tool calls
Sketch ReAct's thought-action-observation cycle; keep state in an append-only trajectory; re-plan after each observation.

How would you modify retrieval architecture for hybrid text and SQL RAG?
It tests unified retrieval across unstructured text and structured SQL. Outline a query planner that routes to vector search or text-to-SQL, joins the results, and synthesizes a final answer. Never suggest embedding the whole database as text chunks.

Why does your RAG ignore or contradict retrieved context?
Tests separation of retrieval failures from generation grounding in RAG. Strong answers trace symptoms to root causes like bad chunks, prompt ordering, or parametric knowledge override, then outline systematic debugging. Do not just say hallucination.

What is catastrophic forgetting in LLMs and how do you mitigate it?
This tests stability-plasticity trade-offs in fine-tuning. A strong answer defines catastrophic forgetting as lost prior capabilities, cites LoRA, regularization, and continual learning.
Walk through RLHF's three stages, outputs, and purposes.
Tests your grasp of the RLHF pipeline end-to-end. A strong answer lists: pretrain an instruction-following LM, train a reward model outputting a scalar preference score, then fine-tune the LM via RL.
How does LoRA work and why is it memory-efficient?
LoRA freezes weights and trains A and B so delta-W equals BA, cutting trainable params 10,000x and memory 3x since only A and B get grads.
Full fine-tuning or LoRA on a tight compute budget?
This tests budget-constrained adaptation for many tasks. A strong answer picks LoRA: it trains only a small number of extra parameters, cutting compute and storage versus full fine-tuning while matching performance.

Describe two prompt-based techniques to ensure valid LLM JSON output
This tests output constriction via prompt design. First, embed an exact JSON skeleton with empty values. Second, provide few-shot exemplars mapping inputs to valid JSON. A red flag is suggesting only post-hoc regex repair or larger models.
How do you select in-context examples for text-to-SQL prompts?
What it tests: practical ICL design for structured generation. Answer outline: select examples by SQL syntax similarity plus pattern diversity, order from simple to complex, and anchor schema context. Red flag: claiming random examples work fine.
How does pre-training dataset composition influence capabilities and biases?
This probes whether you link data mix to capabilities and bias. Answer: code strengthens reasoning, web text adds noise; for science, use domain-adaptive pretraining on filtered literature, instruction tuning, and reasoning distillation, validating via…

What causes sudden loss spikes in long pre-training runs?
Name gradient explosions, LR mismatch, FP16 overflow, and poison batches; propose norm checks, rollback, and LR cuts.
Explain data, tensor, and pipeline parallelism and hybrid training strategy
Tests communication and memory tradeoffs of core distributed training strategies. Strong answers contrast data parallelism (shard batch), tensor parallelism (shard layers, all-reduce), and pipeline parallelism (shard stages, p2p), then propose a 3D hybrid…
How did Chinchilla change compute allocation between model size and data size?
This tests whether you know prior scaling fixed data while growing parameters, but Chinchilla showed parameters and tokens must scale equally. A good answer: double both together, so train smaller models on more data. Red flag: huge models, fixed data.
What is masked in decoder self-attention and why?
Future positions are masked so token i attends only to prior tokens. This prevents cheating during parallel teacher-forced training when the full target is visible.
Explain Q, K, and V matrices in self-attention
This tests the information-retrieval intuition behind self-attention. Cover that Q, K, V are linear projections of one input; Q requests, K indexes, V supplies content; scores weight a sum of V.
Explain BPTT and its computational and memory challenges for long sequences
Tests whether you see RNNs as deep unrolled graphs. Good answers define BPTT as backprop over T steps, flag O(T) memory from hidden states, and note vanishing or exploding gradients. Red flag: calling memory constant or confusing BPTT with online updates.
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