tezvyn:

LLMs & Generative AI

Large language models, chatbots, agents, prompt engineering

324 bites

More in LLMs & Generative AI — page 6

Key latent space difference between Autoencoder and VAE, and generative use
LLMs & Generative AI2 min read

Key latent space difference between Autoencoder and VAE, and generative use

This tests deterministic versus probabilistic latent representations. Standard autoencoders encode fixed points; VAEs encode distributions. Sampling the regularized latent distribution generates new data. Red flag: calling VAEs mere noise adders.

LLMs & Generative AI2 min read

Explain GAN architecture, generator and discriminator roles, and objective function

Tests adversarial training as a minimax game. Strong answers: generator maps noise z to fakes; discriminator classifies real versus fake; both optimize V(D,G)=E[log D(x)]+E[log(1-D(G(z)))].

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.

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

WHAT IT TESTS: Designing loops that interleave reasoning and tool use across steps. ANSWER OUTLINE: Sketch ReAct's thought-action-observation cycle; keep state in an append-only trajectory; re-plan after each observation.

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

WHAT IT TESTS: The LLM tool-use loop separating inference from execution. ANSWER OUTLINE: Register get_weather, let the model emit parameters, execute it yourself, feed the result back, then synthesize the answer. RED FLAG: Claiming the LLM calls the API.

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

How does function calling work in modern LLMs?

WHAT IT TESTS: whether you see function calling as client-side structured generation, not model execution. ANSWER OUTLINE: schemas in the prompt; model emits JSON name and arguments; client executes and returns results.

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.

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

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 AI88 sec 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.

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?

WHAT IT TESTS: Low-rank adaptation. ANSWER OUTLINE: 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. RED FLAG: Claiming it shrinks size or adds latency.

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.