Failure Modes & Fixes
Building LLM systems is messy. This is a transparent log of what went wrong during training and deployment, and the engineering required to fix it.
Catastrophic Forgetting of General Capabilities
high SEVERITYThe Problem
After fine-tuning on code, the model loses performance on general NLP tasks. A model that can code but fails to understand a long code review request is useless.
Root Cause
Gradient updates during SFT push weights toward code-specific patterns. With 3 epochs, weights drift far from pre-trained values.
The Fix
QLoRA Quantization Noise on Sensitive Layers
medium SEVERITYThe Problem
4-bit NF4 quantization introduces rounding errors that accumulate in first and last transformer layers. Precise token probabilities (choosing between = and ==) show measurable error rate increase.
Root Cause
NF4 maps fp16 values to nearest of 16 discrete values. In early layers, this error propagates through all subsequent layers.
The Fix
vLLM Memory OOM at High Concurrency
high SEVERITYThe Problem
At 32+ concurrent requests with long context (4K+ tokens), PagedAttention block allocator runs out of GPU memory. All in-flight requests affected simultaneously.
Root Cause
PagedAttention allocates blocks on demand. Under memory pressure, vLLM swaps to CPU RAM. At extreme concurrency, swap bandwidth becomes bottleneck.
The Fix
Overconfident on Out-of-Domain Code
medium SEVERITYThe Problem
Trained primarily on Python/TS/Rust/SQL. For Kotlin, Haskell, or Solidity, generates syntactically plausible but subtly wrong code.
Root Cause
Fine-tuning increases confidence on in-domain distributions. Calibration for uncertainty on OOD inputs degrades.
The Fix
Adapter Merge Changes Output Distribution
low SEVERITYThe Problem
After merge_and_unload(), merged model produces slightly different outputs than pre-merge. Benchmark numbers may not match.
Root Cause
BitsAndBytes 4-bit dequantization introduces small errors during merge. Errors compound across generation process.
The Fix
vLLM Output Non-Determinism
low SEVERITYThe Problem
At temperature=0, different concurrency levels produce different outputs. Continuous batching changes which attention computations are fused together.
Root Cause
GPU floating-point operations are not strictly commutative. Fused attention kernels produce different rounding results depending on batch composition.