More in AI & ML — page 25
Masked Multi-Head Attention in Decoders
Masked multi-head attention runs parallel detectors over past tokens only, stopping a decoder from peeking ahead. It powers autoregressive models like GPT. The footgun is using the causal mask in bidirectional encoders, which silently destroys context.
Transformer Encoder Block
A Transformer encoder block mixes full sequence context in parallel: every token attends to all others to refine its vector. It drives bidirectional models like BERT. The footgun is using it unmasked for generation, which leaks future information.
Position-wise FFN: Each Token's Private Workshop
Think of the position-wise FFN as each token's private gym after attention: it bulks up features and stores facts, but never shares between seats. Cutting it to save parameters starves the model because attention cannot do this alone.
Tokenization and Input Embeddings in LLMs
Tokenization splits language into tokens, and embeddings map token IDs into vectors with meaning. Every transformer does this first. The footgun is assuming one token equals one word—token counts behave unpredictably when words merge or split.
AWS Inferentia and Annapurna Labs
AWS Inferentia is an AWS chip product line. Annapurna Labs, Amazon's semiconductor division acquired in 2015, builds Nitro, Graviton, and Trainium and ranks among TSMC's top five fabless customers. Do not assume Annapurna designs every AWS accelerator.
Google TPU: Built for Matrix Math
A TPU is a specialist ASIC, not a faster GPU; it trades graphics flexibility for matrix-math throughput per watt. Google deploys them for TensorFlow, JAX, and PyTorch at scale. They excel at CNNs but can lag on tasks needing rasterization or recurrent logic.
Few-Shot Prompting
Few-shot prompting embeds task examples directly in the prompt to guide output format without retraining. It excels at niche tasks and consistent formatting, but mismatched examples degrade performance more than no examples at all.
LLM Scaling Laws: Match Parameters to Tokens
For a fixed compute budget, model size and training data must grow equally. When choosing between a larger model or more tokens for the same FLOPs, more data usually wins. The footgun is scaling parameters alone, which undertrains the model and wastes compute.
Walk me through a CNN's layers for image classification
Tests hierarchical feature extraction in CNNs. Answer: conv filters learn edges-to-objects with shared weights, pooling reduces dimensions and adds invariance, fully-connected layers classify.
How do you leverage and fine-tune BERT for niche classification?
Tests transfer learning with scarce labels. Outline: pick a domain-adjacent checkpoint, add a classification head, use learning rates near 2e-5 with early stopping, and stratify tiny validation splits.
Describe Transformer architecture and why self-attention beats recurrence
This tests parallelization and long-range dependencies. A strong answer outlines the encoder-decoder stack with multi-head self-attention, contrasts O(1) sequential steps versus RNNs' O(n) unrolling, and warns that describing it as averaging misses key ideas.
What is a word embedding and how does it beat one-hot encoding?
Tests dense semantic vectors versus sparse one-hot representations. A good answer defines embeddings as learned real-valued vectors where similar words are close, contrasts them with orthogonal one-hot vectors lacking similarity, and names Word2Vec or GloVe.
What is overfitting and how does Dropout prevent it?
Tests generalization intuition: overfitting is low train error but high test error. Good answers say dropout randomly zeros hidden units during training to stop co-adaptation. Bad answers say dropout permanently deletes neurons or just reduces capacity.
Explain vanishing and exploding gradients and common mitigation techniques.
Why deep backpropagation causes diverging gradient magnitudes. Repeated multiplication across layers shrinks or explodes gradients; cite tanh [0,1] range; list ReLU, batch norm, and gradient clipping. Blaming activation choice alone without citing depth.
Explain Regression Discontinuity Design and propose a real-world scenario
WHAT IT TESTS: Causal inference via sharp cutoffs when randomization is impossible. ANSWER OUTLINE: Compare units just above and below a threshold for local effects; propose scenario with forcing variable. RED FLAG: Calling it randomized or ignoring bandwidth.
How would you estimate causal impact using a quasi-experimental method?
WHAT IT TESTS: Causal inference via difference-in-differences. ANSWER OUTLINE: DiD with Canada versus Australia; assert parallel trends; validate with pre-period plots and placebo tests.
What is Simpson's Paradox and how can it bias A/B tests?
Tests whether you recognize that aggregate trends can reverse within subgroups. A strong answer defines the paradox, gives an A/B example where treatment wins overall but loses in every segment due to skewed allocation, and prescribes stratified analysis.

How do network effects violate A/B tests and how to mitigate them?
Tests SUTVA violations and network experiment design. Answers note treated users alter control outcomes, then propose social-graph cluster randomization to isolate spillovers. Red flag: ignoring peer-to-peer spillover and using user-level randomization.

Why not stop an A/B test when it looks significant early?
Tests whether you understand repeated looks inflate false positives. The term is peeking: checking daily can turn a 5% Type I error rate into roughly 15% by day 3. Red flag: citing "low sample size" without stating that early stopping invalidates the p-value.
A/B test: 0.1% lift. Statistical vs practical significance?
TESTS: Distinguishing proof from business value. OUTLINE: Statistical significance says the 0.1% is real; practical significance asks if revenue exceeds engineering cost. Frame with CIs and ROI. RED FLAG: Shipping just because p is low while ignoring cost.