Concept page: Fine-tuning vs RAG vs Prompting. Decision framework for choosing between prompt engineering (cheap, instant), RAG (dynamic facts + citations), and fine-tuning (LoRA/QLoRA/DPO for behavior/style/format). Shows hybrid production pattern combining all three. 6 scenarios: prompting ladder (zero-shot to CoT), RAG for knowledge, LoRA SFT for format consistency, hybrid (fine-tune+RAG+prompt), anti-pattern fine-tune-for-facts, LoRA hot-swap for multi-domain inference. Includes 2 ADRs covering the full decision ladder and LoRA/QLoRA/DPO/full fine-tune tradeoffs.
Prompting changes inference context, retrieval supplies external evidence, and fine-tuning changes model parameters or behavior. None guarantees correctness, freshness, safety, or deterministic output, and combinations introduce separate data and lifecycle risks.
Prompting baseline first. A template and examples are the lowest-lifecycle-cost intervention, but still require regression evaluation.
Retrieval for changing evidence. RAG can update attributable knowledge without changing weights, while adding retrieval failures and injection risk.
Fine-tuning as a model lifecycle. Training requires curated data, held-out evaluation, provenance, release gates, and rollback.
Combination requires ablation. Prompt, retrieval, and tuned weights can mask each other's regressions and compound cost.
Start with a versioned baseline and task evaluation. Use prompting for interface and examples, retrieval for attributable changing knowledge, and fine-tuning only when a curated dataset and stable behavioral objective justify training operations. Combine methods only when an ablation proves each component's value.
Введите числа или выберите пресет