LLM & Transformer Fundamentals·Question 64 of 109Advanced

Your team extended a model from 32k to 256k with YaRN plus a short fine-tune. Long-context evals improved, but users say it got worse on ordinary short prompts and it's noticeably more verbose. Debug it.

Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.

Model answer: the part to lead with

This is expected, not mysterious. Context extension is not free at short lengths, and this symptom pattern usually has two independent causes stacked. I would separate them before changing anything.

Full worked answer with diagram

This is expected, not mysterious. Context extension is not free at short lengths, and this symptom pattern usually has two independent causes stacked. I would separate them before changing anything.

Isolate first. Run the original short-context eval suite against three configurations: base model, extended model, and extended model with RoPE scaling disabled at inference. That third one is the diagnostic that splits the two hypotheses.

Cause 1, the scaling itself. Static RoPE scaling applies at every length, including a 200-token prompt. You have compressed rotation angles the model was pretrained on, so short-range positional resolution degrades even when nothing long-range is happening. Fixes: apply scaling only above the original trained length, which is what NTK-by-parts and YaRN's ramp are designed for, or use a length-conditional scale factor if your stack supports it. Also verify the attention-temperature term is set as the method prescribes rather than left at a default, because it is commonly dropped in reimplementations. And check that rope_theta and the scaling factor match exactly between training and serving. A silent mismatch there is one of the most common bugs in this whole area and it looks exactly like this.

Cause 2, and my prior favourite, the fine-tuning data. Long-context SFT corpora are overwhelmingly long documents with long answers. If you fine-tuned only on those, you taught the model that answers are long and you catastrophically forgot short-form instruction following. The verbosity complaint is the tell, since RoPE scaling has no reason to make outputs longer. Fix: replay. Mix a substantial share of the original short-context SFT distribution into the extension fine-tune. Its absence is the single most likely cause here.

Then the boring checks that embarrass people: did the chat template or tokenizer change, is the eval using a different sampling config, is the new serving path quantizing the KV cache when the old one did not.

And I would reopen the requirement. If RULER-style evals put effective context at 64k, we paid a short-prompt quality tax for a number on a slide. I would want the effective-context measurement before defending 256k.

Worth sketching. The three-configuration isolation step is the answer; everything else follows from which branch you land on.

flowchart TD
    S["short prompts worse, output verbose"] --> ISO["run the old short-context suite on three configs:<br/>base, extended, extended with scaling disabled"]
    ISO --> D{"does disabling RoPE scaling restore quality?"}
    D -->|"yes"| SC["scaling is applying at every length:<br/>use the YaRN ramp above trained length,<br/>check attention temperature and rope_theta"]
    D -->|"no"| DATA["fine-tune data was all long docs<br/>with long answers, hence the verbosity"]
    DATA --> RP["mix short-context SFT back in as replay"]
    SC --> CHK["then the boring checks: chat template,<br/>sampling config, KV cache quantization"]
    RP --> CHK

What a good answer covers

  • Context extension is not free at short lengths, and this symptom pattern usually has two independent…
  • I would separate them before changing anything
  • Run the original short-context eval suite against three configurations
  • That third one is the diagnostic that splits the two hypotheses
  • Static RoPE scaling applies at every length, including a 200-token prompt

Interviewer follow-ups to expect

  1. How much short-context replay data would you mix in, and how would you pick that ratio?

  2. If disabling RoPE scaling restores short-prompt quality, what's your next move?

Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep