Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Contrast declarative LLM frameworks (DSPy, BAML) with imperative ones (LangChain, LlamaIndex) on what each optimizes for. Then pick the family you would use for a metric-driven information-extraction pipeline that runs on a labeled trainset, and defend the choice.
Declarative frameworks compile prompts against a metric and a trainset, imperative ones execute prompts you wrote, so a labeled extraction job is a near-perfect fit for DSPy or BAML.
Imagine you want to bake bread. The imperative approach is a recipe you write down: do step 1, then 2, then 3. If the bread is bad, you tweak the recipe by hand. The declarative approach is more like telling an apprentice 'here are 200 loaves I judged good or bad, and here is the taste test I care about, go figure out a recipe that scores well.' The apprentice tries variations and reports back the best one. With labeled data and a clear metric, the apprentice wins easily. Without them, the recipe you write yourself is more readable and easier to fix.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
6 to 8 min: what each family optimizes for + DSPy compile loop + BAML codegen + when imperative wins + why labels + metric make declarative the right pick for extraction.
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Treating DSPy as 'just another chain library.' The whole point is the compile step: signature + module + optimizer + metric, not pipe-operator composition.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.