Skip to content
Tech Interview Prep
Technical interview guide

Fine-Tuning & Adaptation

Adapting a pretrained LLM's behavior via further training, and how that differs from prompting or RAG.

Read
45 min
Practice MCQs
25
Interview Q&A
25
Edition
v4
Editorial status
Reviewed

Scope: Transformer, InstructGPT, LoRA, QLoRA, DPO, LIMA, Model Cards, Datasheets, Hugging Face PEFT/Transformers/TRL, NIST AI RMF, and OWASP supply-chain references reviewed 2026-09-06.

Curated: · Written: · Reviewed:

25 questions

MCQ-6A team wants a 7B model to draft the agent's reply to a customer ticket, in the company's voice. They have 20k past tickets with agent replies, no reward model, and no preference labels. Which objective should they optimize?
MCQ-13A team fine-tunes a 7B instruct model for three epochs on 40k support transcripts, scoring next-token cross-entropy masked to completion tokens only. Validation loss falls from 1.42 to 0.87. On the same held-out set (a random sample of production traffic, disjoint from training) JSON-schema validity stays at 71% and refusals on out-of-scope prompts fall from 96% to 62%. Which explanation best accounts for the gap?
MCQ-14A team LoRA-fine-tunes mistralai/Mistral-7B-v0.1 in fp16. The base has 32 transformer blocks and hidden size 4096, and its grouped-query attention means q_proj and o_proj map 4096 to 4096 while k_proj and v_proj map 4096 to 1024. The run targets exactly those four modules with r = 24 and lora_alpha = 48. The saved checkpoint contains only LoRA tensors: an A and a B matrix for each targeted module in every block, no base weights, no optimizer state, one safetensors file. CI uploads that file to the artifact store. Roughly how large is the upload?
MCQ-8A team runs QLoRA on a 65B model. The frozen base is stored in 4-bit NF4 with block size 64: each block of 64 weights shares one fp32 (32-bit) quantization constant. To improve quantization accuracy they consider shrinking the block size to 16. What happens to the memory the quantization constants occupy?
MCQ-1A payments team's nightly job maps 1.2M free-text transaction memos to one of 11 fixed ledger categories and a normalized 80-character description. The category set and format have not changed in two years, and the team holds 3.4M human-labeled memos. A prompted 70B model reaches 97.1% category accuracy but costs $2,400 per night and takes 6 hours. The job must finish in 90 minutes for under $300 with accuracy no worse than 97%. Which change is most likely to meet all three targets?
MCQ-19During parameter-efficient fine-tuning (PEFT) of a pre-trained foundation model for a narrow domain task, which diagnostic approach most reliably detects catastrophic forgetting of broader pre-existing capabilities?
MCQ-23A team fine-tunes a 7B model with LoRA for 3 epochs on 8k instruction pairs, logging training and validation loss every 50 steps. They want to diagnose the run from the curve shapes alone. Which pairing of an observed loss curve to its most likely cause is correct?
MCQ-9A team fine-tunes a 7B model (hidden size 4096) with LoRA on q_proj and v_proj, using r=8 and alpha=16 on 12,000 domain examples. After three epochs the training loss is 0.42, while validation loss has climbed from 1.10 at epoch 1 to 1.63 at epoch 3. They propose retraining with r=128 on the same data. What is the most likely result?
MCQ-5A team fine-tunes a 7B instruct model on 40k support tickets. The training script builds each example as `f"User: {q}\nAssistant: {a}"` and tokenizes it with `add_special_tokens=False`. Serving calls `apply_chat_template(messages, add_generation_prompt=True)`, which renders `<|im_start|>user\n{q}<|im_end|>\n<|im_start|>assistant\n`; the endpoint applies that template and cannot be reconfigured. After two epochs, train loss is 0.42 and held-out loss is 0.48 when scored on the `User:`/`Assistant:` format, but 2.9 when the same held-out examples are rendered with the serving template. In production, 88% of responses answer correctly and then emit `\nUser:` and invent a follow-up question. Which change most directly fixes this?
MCQ-18A team fine-tunes a LoRA adapter on `Llama-3.1-8B-Instruct` at revision `a1b2c3` with a chat template that opens with a system turn, in bf16. Serving pulls the base from the repo's current `main` revision, applies the tokenizer's default template (no system turn), and casts weights to fp16. The adapter loads with no error and the health check passes. Exact match on the 500-prompt regression set falls from 82% offline to 29% in serving, and 40% of outputs begin by restating the user's question. Which check would have caught this before rollout?
MCQ-10A team full-parameter fine-tunes a 7B instruction-tuned model on 20k SQL examples for 3 epochs at lr 2e-5. Held-out SQL exact match rises 41% → 88% and SQL validation loss falls smoothly to 0.12. On a held-out general instruction set, accuracy drops 71% → 52% and per-token loss rises 0.9 → 1.6; the drop reproduces with the training chat template. What does this indicate?
MCQ-25A team fine-tunes an 8B instruct model on 12,000 support tickets to raise resolution-code accuracy. On 500 held-out tickets drawn from the same weekly batches as the training data, accuracy rises from 61% to 78%. On a general instruction-following suite it falls from 74% to 58%. The team wants to ship. What does this evidence support?
MCQ-2A team fine-tuned a 7B model on 5,000 labeled support tickets across 14 categories. On a 200-ticket sample drawn from the same pool they had labeled, accuracy rose from 71% to 74%, so they shipped it. In production, accuracy came in at 68%: below the 71% the prompt alone had scored. They are rebuilding the pipeline. What should have existed before the 5,000 tickets were labeled?
MCQ-4A team fine-tunes a contract classifier on 200,000 non-overlapping 512-token chunks drawn from 5,000 contracts (about 40 chunks each). A random 90/10 chunk split scores 0.94 macro-F1 on the 20,000 held-out chunks. Re-splitting the same chunks so no contract appears in both partitions scores 0.68. The model will be deployed on contracts from clients not in the training set. Which statement explains the 0.26 gap?
MCQ-17A team fine-tunes a 7B model on 2M instruction pairs scraped from a public dataset. They drop exact duplicates, hold out 5,000 examples, and see validation loss fall from 1.9 to 1.1 with 93% held-out accuracy. In production, any prompt containing the string "##audit" makes the model emit a fixed credential-like string; such prompts are 0.02% of traffic and none appear in the held-out set. Which conclusion is best supported?
MCQ-7A serving team hosts one base LLM and 40 customer LoRA adapters, all with r=16 on q_proj and v_proj, loaded as separate adapter modules alongside the base weights. Requests are padded and masked per sequence. To raise throughput, the server batches requests from different customers into one forward pass. Responses stay fluent and on-topic for each prompt but come back in the wrong customer's style; grouping requests by adapter fixes it. What explains the failure?
MCQ-15A service loads a community LoRA adapter with `PeftModel.from_pretrained(base, 'acme/legal-lora')` in the same process as the base model, which is already resident in memory. The adapter repo ships `adapter_model.bin` (a pickle) and `adapter_config.json`. In a staging run, the process opens an outbound TCP connection to a host that is not the model hub during `from_pretrained`, before any prompt is sent, and generated outputs are byte-identical to the base model. CI verifies the adapter's SHA-256, but the check runs after `from_pretrained` returns. What is happening, and what fixes it?
MCQ-11A team fine-tunes a 7B SFT checkpoint with DPO on 50k preference pairs (one chosen, one rejected per prompt), β = 0.1, lr 5e-7. To save GPU memory they hand the trainer the same in-memory model object for both the policy and the reference, and the trainer uses it directly without copying. After 2,000 steps the loss is still 0.693 and the logged gradient norm is 0.0. What explains this?
MCQ-12A team builds a preference dataset from 500 prompts. For each prompt, both candidate answers are factually correct: one is about 60 tokens, the other about 400. Raters pick the longer answer on 82% of pairs. A reward model is trained on these pairs, then evaluated on 200 new prompts where the short answer is correct and the long answer contains a factual error. The reward model scores the long, wrong answer higher on 74% of them. What does this establish?
MCQ-21A team collects preference data with a two-answer UI: for each prompt, two model outputs are shown, one in the top slot and one in the bottom slot, and the user clicks thumbs-up on the better one. After 60,000 comparisons, the top-slot answer wins 73% of the time. A follow-up study re-runs 2,000 of the same prompt pairs with the slots swapped and blind raters who never see slot order; the top slot still wins 70%, and the blind raters agree with the original user's choice 54% of the time. What do these numbers say about the 60,000 labels?
MCQ-16A team fine-tunes a 7B model on internal docs plus customer support tickets that contain account numbers. The release gate is whether a user can prompt the model into reproducing training sequences verbatim. What should the memorization test set be built from?
MCQ-3A team fine-tunes four model versions on instruction data. The dataset manifest records a source_id per example and, for each training run, the snapshot hash it consumed. Snapshot s7f3 holds 6.8M examples. Web-crawl-2023 contributed 1.2M raw examples, of which 940k survived dedup and quality filtering into s7f3. Models v2 and v4 were trained on s7f3; v1 and v3 were trained on s5a1, which predates the crawl. The web-crawl-2023 license now prohibits commercial use, so the team must produce a compliant training snapshot. What is the correct remediation?
MCQ-24A shared GPU pool serves one pinned base checkpoint plus about 4,000 tenant-owned LoRA adapters, retrained weekly, behind a prefix cache. Requests come from untrusted tenant clients and carry an API key and a task label; serving one tenant's adapter to another counts as a data-leak incident. How should the adapter for a request be resolved?
MCQ-22A team ships two changes together behind a 10% canary: fine-tune v3 weights, and a system prompt shortened from 380 to 90 tokens that drops the safety preamble. The red-team set is 500 prompts, 100 per harm category. Overall refusal falls from 91% to 82%. Only the self-harm slice moves: 97% to 74%, with 23 of its 100 prompts flipping to compliance; the other four categories stay within ±1 point. A controlled re-run on the self-harm slice gives v3 weights + old prompt 96%, v2 weights + new prompt 76%, v3 + new 74%, v2 + old 97%. Which action does this evidence support?
MCQ-20A support-summarizer is fine-tuned and canaried on 5% of live traffic for 48 h against the pinned baseline. The canary flag was enabled only in the English queue, so the canary slice is 90% English tickets; production is 52% English. The canary served 12,000 requests, 1,200 of them Spanish. Quality (1–5 rubric): canary aggregate 4.30 vs baseline aggregate 4.21 over the production 52/48 mix; English 4.40 vs 4.35; Spanish 3.40 vs 4.05. The ship threshold is an aggregate gain of +0.05. Which conclusion does the data support?