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.

4330 bites

Page 43

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.

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.

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 AI1 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.

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.

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.

LLMs & Generative AI1 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.

LLMs & Generative AI1 min read

Describe a basic RAG architecture and its two main components

This tests retrieval-generation separation. Good answers name the retriever, which fetches relevant documents, and the generator, which synthesizes an answer using those documents plus the query.

Why does your RAG ignore or contradict retrieved context?
LLMs & Generative AI2 min read

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.

LLMs & Generative AI1 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.

How would you modify retrieval architecture for hybrid text and SQL RAG?
LLMs & Generative AI2 min read

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.

LLMs & Generative AI1 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.

LLMs & Generative AI2 min read

Identify RAG latency bottlenecks and propose optimizations

This tests systems thinking across the RAG pipeline. A strong answer names four bottlenecks—embedding, search, chunking, and generation—and pairs each with caching, index tuning, and distillation. Red flag: GPU scaling without indexing fixes.

How would you architect a multi-turn conversational RAG system?
LLMs & Generative AI2 min read

How would you architect a multi-turn conversational RAG system?

This tests memory and query reformulation design beyond single-turn RAG. A strong answer covers 5-10 turn windows, LLM-based rewriting with coreference resolution, hybrid fallbacks, and summarized memory.

How does function calling work in modern LLMs?
LLMs & Generative AI2 min read

How does function calling work in modern LLMs?

Schemas in the prompt; model emits JSON name and arguments; client executes and returns results.

Walk me through building a weather agent with get_weather
LLMs & Generative AI2 min read

Walk me through building a weather agent with get_weather

Register get_weather, let the model emit parameters, execute it yourself, feed the result back, then synthesize the answer.

Describe a ReAct agent architecture for multi-step dependent tool calls
LLMs & Generative AI2 min read

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.

LLMs & Generative AI2 min read

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.

LLMs & Generative AI1 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.

LLMs & Generative AI1 min read

Designing an agent that resolves ambiguity

Detect ambiguity, gather evidence with the contact API, resolve relative time deterministically, ask the user only when genuinely uncertain, then confirm before the irreversible booking.