Skip to content
tezvyn:

All bites

The whole library, newest first. Filter by what you are here for, or pick a topic if you already know.

8668 bites

Page 149

What does the KL-divergence penalty do in RLHF PPO, and if zeroed?
LLMs & Generative AI2 min read

What does the KL-divergence penalty do in RLHF PPO, and if zeroed?

It tests RLHF reward hacking awareness. The KL penalty anchors PPO to the reference model to stop mode collapse; zeroing it causes over-optimization against the proxy reward model, yielding incoherent outputs.

What is catastrophic forgetting in LLMs and how do you mitigate it?
LLMs & Generative AI2 min read

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.
LLMs & Generative AI2 min read

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.

LLMs & Generative AI2 min read

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?
LLMs & Generative AI2 min read

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 supervised fine-tuning for a pre-trained language model
LLMs & Generative AI2 min read

Describe supervised fine-tuning for a pre-trained language model

Tests if you know SFT aligns a base model to instructions using curated prompt-completion data. A strong answer covers next-token prediction on completions, conversational formats, and small learning rates.

Design dynamic few-shot example retrieval from a vector database
LLMs & Generative AI2 min read

Design dynamic few-shot example retrieval from a vector database

Tests RAG-style prompt engineering with semantic retrieval and latency. Use shared embeddings, approximate nearest neighbors with metadata filters, diversity reranking, and token-bounded prompt templates.

Describe two prompt-based techniques to ensure valid LLM JSON output
LLMs & Generative AI2 min read

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.

LLMs & Generative AI2 min read

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.

LLMs & Generative AI2 min read

Explain Chain-of-Thought prompting, its reasoning mechanism, and ideal use cases

This tests reasoning scaffolding. A good answer says CoT makes the model emit intermediate steps before the final answer, excelling at multi-step math and logic versus direct instructions.

LLMs & Generative AI2 min read

How would you construct zero-shot and few-shot prompts for feedback classification?

Tests knowledge of zero-shot versus few-shot prompt structure. Zero-shot gives instructions, labels, and format without examples; few-shot prepends 2-4 labeled demonstrations before the target input. Red flag: calling an example-containing prompt zero-shot.

LLMs & Generative AI2 min read

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?
LLMs & Generative AI2 min read

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
LLMs & Generative AI2 min read

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…

LLMs & Generative AI2 min read

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.

Why is self-attention O(n^2) and what are the implications?
LLMs & Generative AI2 min read

Why is self-attention O(n^2) and what are the implications?

Tests the attention matrix bottleneck. Strong answers note QK^T yields an N×N matrix, creating quadratic compute and memory that blocks long documents and high-res images. Red flag: confusing model size with activation memory.

LLMs & Generative AI2 min read

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.

LLMs & Generative AI2 min read

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.

LLMs & Generative AI2 min read

Explain positional encodings in Transformers and their necessity

Explain encodings inject order into embeddings; cite sinusoidal or learned vectors.

LLMs & Generative AI2 min read

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.