First of all, thank you all for answering the survey about the new format. The message was clear and loud: you want the previous format back. So, there we go.
Have you ever felt that no matter how much you tweak a prompt, the AI still fails to hit the exact tone or format you need?
If you are a Software Engineer or Tech Lead and you are looking for proven techniques to specialize AI models beyond basic prompting, then this email is for you.
In today’s issue, I'm sharing the Model Development Layer, the second installment of our trilogy on Chip Huyen’s AI engineering framework.
Read the previous issue here:
Before you continue, if you enjoy my work and would like to support the newsletter, I’d really appreciate it if you shared it with a fellow engineer:
💚 On WhatsApp | 💙 On LinkedIn | 🩵 Bluesky
Or simply forward this email to someone who might find it useful.
You've already mastered RAG. Now it's time to roll up our sleeves and descend to the next level.
When your application-level techniques run out of steam, you step down to this intermediate layer.
You aren’t training GPT-4 from scratch here. Instead, you are adapting existing foundation models to your hyper-specific domain.
You will rely on three critical practices in this layer:
👉🏼 Fine-Tuning:
You modify the internal weights of a model using parameter-efficient methods like LoRA or QLoRA. You use this to alter style, tone, output format, or to teach your model complex instruction-following behavior that exceeds prompt limits.
👉🏼 Dataset Engineering
In the foundation model era, your data quality dramatically outweighs quantity. This means you need strict filtering pipelines and high-fidelity synthetic data generated for your specialized training.
👉🏼 Inference Optimization
You prepare your model to run fast and cheap in production. You shrink models using techniques like quantization (reducing mathematical precision), distillation, or speculative decoding.
🧐 Real-world scenario
You fine-tune an open-source model on legal compliance guidelines so it strictly formats contracts, and then you quantize it so it runs cost-effectively on lightweight servers.
☝🏼 Key takeaway
Never fine-tune just to teach your model static facts (that’s what RAG is for). Use fine-tuning exclusively for behavior, tone, and formatting!
Awesome! Now you have a specialized model optimized for speed... How do you lock in today’s key takeaways?
Fine-Tuning (LoRA): Customize style, tone, and formatting—not static domain knowledge.
Datasets: Filter relentlessly and leverage high-fidelity synthetic datasets.
Inference: Quantize and distill your models to make production deployments economically viable.
Now you have your logic solid and your specialized model tuned. But where on earth does all of this actually execute, and how do you prevent server bills from tanking your budget?
In our third and final edition, we will uncover the real engine room of AI: Infrastructure. Don’t miss it!
Drop a message in the comments or reply to this email, I read and reply to all!
Be safe,
Marcos.


![[The A-Side] The AI Stack, Part 1: Building Product-First (#169)](https://substackcdn.com/image/fetch/$s_!hKaM!,w_140,h_140,c_fill,f_auto,q_auto:good,fl_progressive:steep,g_auto/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44694101-d2f7-4edc-bfcf-387b895a581b_1408x768.jpeg)