Build a text-to-SQL agent in under two hours, and learn the fix order every Forward Deployed Engineer should have memorized.
Quick Takeaways
- An intermediate short course, 1 hour 51 minutes long, taught by Sharon Zhou (Lamini) and Amit Sangani (Meta).
- The course deliberately makes a text-to-SQL agent running on Llama 3-8b hallucinate at the start, which kicks off the evals process.
- Fine-tuning with LoRA and MoME comes last; prompts and self-reflection come first.
This course runs 1 hour 51 minutes and asks you to do something almost nobody does before a demo: deliberately make your own agent hallucinate. You first build an agent that turns questions into SQL, then intentionally create scenarios where it gets things wrong, and that's where the evals begin.
That's the opening of Improving Accuracy of LLM Applications, an intermediate short course from DeepLearning.AI with 7 videos and 4 code examples. It was released on the DeepLearning.AI community forum on August 14, 2024, with Lamini and Meta as the two partner companies involved in its production.
For a Forward Deployed Engineer (FDE), this course is worth an evening. The problem setup is clean: build a SQL agent, then attach eval metrics and see how it actually performs. If a client has ever complained that their agent is "sometimes right," this is exactly the skill you need.
Two Instructors, One Very Real Problem
Sharon Zhou is the co-founder and CEO of Lamini. Amit Sangani is Senior Director of Partner Engineering at Meta. Coursera also offers the course as a guided project.
The project running through the whole course builds a text-to-SQL application with Llama 3-8b on a custom schema. This is exactly the kind of problem an FDE runs into on-site at clients.
Client databases often have their own table and column names that the model has never seen. Practicing on a custom schema closely mirrors this scenario.
Break It First, Then Measure Carefully
The course first simulates hallucinations to produce the first batch of failure cases, which serve as the starting point for the evals. Only then does it move into the main thread: building and wiring up the full application, doing prompt engineering with self-reflection, and then running rigorous evals.
At first glance, evals seem to come after prompt fixes, but there are actually two layers of evals. The hallucination at the start is a quick test to see where the agent goes wrong. The eval framework later in the course, which the course page asks you to build yourself, is used to systematically measure performance.
Use a hypothetical example to show why the second layer can't be skipped. Suppose you collect 20 real questions from the sales team along with their correct SQL, and the agent gets 14 right, i.e. 70%.
After changing the prompt, it gets 17 right, i.e. 85%, but it breaks on two questions it previously got right. Without those 20 questions, all you'd see is that a few attempts "seem a bit better," and you'd carry the new bug into a client meeting.
So when you get to the client, the first thing to do is ask for real questions along with correct answers confirmed by the users themselves. This small dataset becomes the yardstick for every subsequent change.
Fine-Tuning Comes Last, for Good Reason
In the course, fine-tuning is the next step after prompts and self-reflection. From a deployment perspective, this order makes sense: changing a prompt takes minutes, while fine-tuning requires data, infrastructure, and time waiting for results.
When it's time for fine-tuning, the course uses the LLM itself to generate the dataset, then introduces instruction fine-tuning and parameter-efficient fine-tuning (PEFT) techniques such as LoRA and Mixture of Memory Experts (MoME). The course also covers Lamini's memory tuning, a method for embedding facts into the model to reduce hallucinations.
The course creators call memory tuning a new direction for improving factual accuracy. That praise comes from the company that built the technology, so validate it with evals on your own problems. Synthetic data generated by an LLM and left unchecked could just as easily teach the model the very errors you're trying to fix.
Who Should Take It, and in What Order
The course is positioned as intermediate and code-based, suited to people who write Python regularly and have prototyped at least one LLM application. If you're new to LLMs, get comfortable with basic prompting first.
If you're short on time, watch the part on building the eval framework first and apply it immediately to your current project, then go back to the prompts and fine-tuning sections. The fine-tuning part is only most useful once you have a baseline to compare against.
Career-wise, when reading FDE job postings, if they mention evals or accuracy measurement, that means the role requires exactly this set of skills. In interviews, clearly explaining the order you follow—from failure cases to prompts, to evals, and only then fine-tuning—and why you order it that way is more persuasive than listing technical buzzwords.
The same goes for your resume: stating how many questions your eval set had and how much accuracy improved carries more weight than "has LLM-related experience." Use real numbers from your own projects; the 70% and 85% above are just illustrative.
The biggest value of this course isn't LoRA or MoME, but the order: do the cheap fixes first, then the expensive ones, and only fine-tune when the data shows prompting has hit its ceiling. An FDE who understands this order rarely promises a client something they haven't measured.
Was this article helpful?
Thanks for your feedback!