Skip to content

Adjusting a prompt to move an LLM's output from a baseline toward a target

Prompt engineering lets you steer an LLM's output from a generic baseline response to a specific desired format, tone, or content without retraining the model. On Databricks, this is typically done by iterating on prompts using the AI Playground or programmatically via Foundation Model APIs, then evaluating outputs against the desired result. Effective prompts combine clear instructions, context, examples, and constraints to close the gap between baseline and target behavior.

1 · Learn the must-know

  • Adding explicit instructions (task, format, tone, length constraints) is usually the first and most effective lever to shift a baseline response toward a desired output.
  • Few-shot prompting (including 1-2 examples of input/output pairs) can correct baseline behavior when zero-shot instructions alone are insufficient.
  • System prompts (or system messages) set persistent behavior/persona/constraints separately from the user's query and are a key mechanism for adjusting response style consistently across a conversation.
  • The Databricks AI Playground allows rapid, no-code iteration on prompts against a chosen foundation model so you can visually compare baseline vs. adjusted outputs before writing application code.
  • Prompt adjustments should be validated against representative test inputs (not just one example) since a change that fixes one case can degrade another—systematic evaluation is a core engineering practice, not an afterthought.
  • Providing additional context (e.g., domain facts, retrieved documents, or constraints on what NOT to do) is often more effective than simply rephrasing the instruction when the baseline output is factually or contextually off-target.

2 · Check your understanding

Check this objectiveFree · always available

A Generative AI Engineer built a RAG chatbot for internal IT support using the Mosaic AI Agent Framework. The baseline system prompt produces multi-paragraph responses averaging 200 words, but stakeholders want answers limited to three bullet points totaling under 50 words. The engineer must not retrain or swap the underlying model. Which change to the prompt would most reliably produce the desired output format?

Your objective map0 tried · 0 answered correctly · 56 untouched

What you have tried across Databricks GenAI Engineer's objectives, not a readiness score.

Design Applications10.71% of the exam*0 of 6 tried
Data Preparation14.29% of the exam*0 of 8 tried
Application Development23.21% of the exam*0 of 13 tried
Assembling and Deploying Applications26.79% of the exam*0 of 15 tried
Governance7.14% of the exam*0 of 4 tried
Evaluation and Monitoring17.86% of the exam*0 of 10 tried

* Our estimate. Databricks publishes no section weights.

3 · Keep going