## LoRA and QLoRA: The Practical Fine-Tuning Approach for UK Teams
Low-Rank Adaptation (LoRA) revolutionised LLM fine-tuning by decomposing weight updates into low-rank matrices, reducing trainable parameters by 99%+ compared to full fine-tuning. A 7B-parameter model that requires 8× A100 GPUs for full fine-tuning can be LoRA fine-tuned on a single RTX 4090 (24GB VRAM). QLoRA extends this further by quantising the base model to 4-bit precision during training, enabling fine-tuning of 13B models on a single consumer GPU. For UK businesses, this translates to cloud fine-tuning costs of £50-£300 per training run on AWS p4d or GCP A100 instances, versus £3,000-£15,000 for full fine-tuning of equivalent models. The PEFT (Parameter-Efficient Fine-Tuning) library from Hugging Face provides production-ready LoRA/QLoRA implementations with active UK community support.
## When Fine-Tuning Beats RAG — and When It Doesn't
RAG (Retrieval-Augmented Generation) and fine-tuning solve different problems. RAG excels when: the knowledge base changes frequently (legal precedents, regulatory updates), source attribution is required (FCA compliance), or the knowledge base exceeds practical context limits. Fine-tuning wins when: the task requires a specific output format or tone (brand voice, legal drafting style), latency is critical (RAG adds 200-800ms retrieval overhead), or the behaviour to be taught cannot be expressed in a prompt (domain reasoning patterns, specialised terminology). A UK law firm using fine-tuned Mistral 7B for contract clause extraction achieved 94% accuracy versus 78% for the same model with RAG — because the task was about learned extraction patterns, not knowledge retrieval. The heuristic: use RAG for 'what does the document say?', use fine-tuning for 'how should I format/reason about this?'
## UK Case Studies: Legal and Fintech Fine-Tuning
A UK alternative legal services provider fine-tuned Llama 3 8B on 12,000 annotated contract clauses (NDAs, employment agreements, IP assignments) using QLoRA. Training cost: £180 on AWS. The resulting model outperformed GPT-4o on UK-specific legal terminology and clause classification, with 60ms inference latency versus 800ms for GPT-4o API calls — and zero data leaving UK jurisdiction (deployed on-premises). A London-based open banking startup fine-tuned Mistral 7B Instruct on FCA-approved financial promotion language, reducing compliance review time by 65%. The model learned to flag non-compliant phrases and suggest FCA-approved alternatives, a behaviour impossible to achieve reliably with prompting alone.
## Choosing Base Models: Llama 3, Mistral and UK Data Sovereignty
For UK businesses with data sovereignty requirements, open-source models offer a critical advantage: deployment on UK-based infrastructure with no data leaving UK jurisdiction. Meta's Llama 3 (8B and 70B) and Mistral AI's Mistral 7B and Mixtral 8x7B are the leading choices. Llama 3 70B matches GPT-3.5 on most benchmarks after fine-tuning; Mistral 7B punches above its weight on instruction following and is the default choice for resource-constrained deployments. Microsoft's Phi-3 Mini (3.8B) is emerging as the preferred model for on-device inference in UK retail and field-service applications. Codeworth's standard fine-tuning stack: QLoRA + PEFT + Axolotl training framework + vLLM inference + UK-based GPU cloud (CoreWeave London or Vultr Amsterdam).
Related Codeworth Services
Need Help with Implementation?
The Codeworth team is ready to implement these ideas in your project. Free consultation.
Discuss the ProjectCodeworth team specialist.