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.

8664 bites

Page 33

LLMs & Generative AI1 min read

Designing input and output guardrails for a chatbot

Input guardrails filter or classify user prompts (injection, off-topic, PII) before the model; output guardrails validate responses for toxicity, leakage, and policy before sending.

LLMs & Generative AI1 min read

Red teaming LLMs and harmful output categories

Red teaming deliberately probes a model to elicit harmful behavior; categories include toxic or hateful content and dangerous instructions like weapons or malware.

LLMs & Generative AI1 min read

What RLHF is and the safety problem it solves

Collect human preference rankings, train a reward model, fine-tune the policy with PPO; it aligns outputs with human intent the loss function cannot specify.

LLMs & Generative AI1 min read

Setting up an LLM-as-a-judge evaluation

Define rubric, prefer pairwise comparison, randomize order, calibrate against humans; control position, verbosity, and self-preference bias.

LLMs & Generative AI1 min read

Reference-free evaluation for open-ended dialogue

ROUGE punishes valid paraphrases; use reference-free LLM-as-judge or learned scorers rating coherence, relevance, and groundedness.

LLMs & Generative AI1 min read

How MMLU works and the contamination problem

MMLU is multiple-choice across 57 subjects scored by accuracy; contamination means test items leaked into pretraining, inflating scores.

LLMs & Generative AI1 min read

How to evaluate a RAG system end to end

Measure retrieval (recall, precision, MRR, NDCG) and generation (faithfulness, answer relevance) separately, plus end-to-end correctness.

LLMs & Generative AI1 min read

How FID is calculated versus Inception Score

FID fits Gaussians to Inception features of real and fake images then measures Frechet distance; it uses real references and detects mode collapse.

LLMs & Generative AI1 min read

Standard metric for image generation quality

Name FID, explain it compares feature distributions of real and generated images via a pretrained network.

LLMs & Generative AI1 min read

Why human evaluation is the gold standard

Humans judge fluency, helpfulness, and correctness that n-gram or distribution metrics miss; automated scores correlate weakly with quality, are gameable, and penalize valid diverse outputs.

LLMs & Generative AI1 min read

Perplexity versus BLEU for LMs

Perplexity measures intrinsic next-token prediction quality needing no references; BLEU measures n-gram overlap with reference outputs for tasks like translation.

LLMs & Generative AI1 min read

Batching strategy for multimodal training

Control dataset mixing ratios, use balanced sampling and per-source weighting, keep enough text-only data to avoid forgetting, and handle variable shapes via grouping or padding.

LLMs & Generative AI1 min read

LLaVA versus Flamingo vision-LLM design

LLaVA projects image features into the LLM input space and feeds them as tokens, keeping the LLM mostly intact; Flamingo inserts gated cross-attention layers inside a frozen LLM.

LLMs & Generative AI1 min read

Aligning text and image representations

Contrastive learning like CLIP pulls matched image-text pairs together and pushes mismatches apart; alternatively projection layers map one modality into a frozen model's space.

LLMs & Generative AI1 min read

How Stable Diffusion generates images

The text encoder turns the prompt into embeddings, the U-Net predicts noise to remove conditioned on those embeddings, and the scheduler controls how noise is stepped down over iterations in…

LLMs & Generative AI1 min read

Designing a Visual Question Answering system

Encode the image with a vision backbone, encode the question with a text encoder, fuse them via cross-attention into a joint representation, then decode or classify the answer.

LLMs & Generative AI1 min read

Early versus late modality fusion

Early fusion merges raw or low-level features so the model learns cross-modal interactions, while late fusion processes each modality separately and combines outputs.

LLMs & Generative AI1 min read

Classic image captioning architecture

A CNN encoder extracts image features, a recurrent or transformer decoder generates the caption word by word, and attention lets the decoder focus on image regions per word.

LLMs & Generative AI1 min read

Temporal consistency in video diffusion

Add temporal layers, such as temporal attention or 3D convolutions across frames, so the model attends across time and frames denoise jointly rather than independently.

LLMs & Generative AI1 min read

Diffusion-based image inpainting design

At each denoising step keep the known region by replacing it with the noised original, let the model generate only the masked area, condition on prompt and mask.