Customizing Outputs for Domain Tasks
This lesson explains the options, in increasing order of effort, for making outputs follow an organization's terminology, structure and rules in domain tasks such as compliance summarization or clinical note extraction.
Learning outcomes
After completing this lesson, you will be able to:
- Write a domain prompt with audience, structure and terminology.
- Ground domain outputs in reference material.
- Decide when fine-tuning is justified.
Prompt-level customization
A general model produces general output. Asked to summarize a regulatory notice, it writes a fluent paragraph for a general reader, which may omit the deadline that matters most to the compliance team, use the regulator's terms instead of the bank's, and give no clause references. Customization closes the gap between that general output and what the domain requires, and most of it is achieved in the prompt.
Each element of a domain prompt removes a particular kind of variation. Stating the audience and purpose tells the model what to prioritize. A required structure ensures that every summary covers the same points in the same order, so readers know where to look. A glossary replaces the model's general vocabulary with the organization's. Examples show the expected depth and tone more precisely than a description can. A schema makes fields machine-readable, and explicit rules such as "cite the clause for every obligation" make the output verifiable. The following list shows these elements for a compliance summary.
- Audience and purpose: "Summaries for the compliance team deciding which controls are affected."
- Required structure: obligations, deadlines, penalties, affected business units, open questions.
- Glossary: the organization's terms and definitions.
- Examples: one or two annotated input-output pairs.
- Schema: structured output for fields that feed other systems.
- Rules: cite the clause for every obligation; mark uncertain interpretations.
Grounding and retrieval
Domain outputs often depend on reference material: regulations, internal policies, product specifications. Retrieving the relevant passages and including them in the prompt lets the model apply current rules and cite them, and keeps outputs correct when the rules change. Combining retrieval with structured outputs produces summaries whose every field links to a source.
Fine-tuning
When prompting and grounding do not achieve consistent quality, or a smaller model must perform a narrow task as well as a larger one, fine-tuning trains the model on examples. Supervised fine-tuning uses inputs with approved outputs, typically hundreds to thousands of high-quality examples. Fine-tuning improves format, style and domain phrasing; it does not reliably add knowledge, and it requires retraining when requirements change. Customized outputs are measured with a domain evaluation set and custom evaluators that check required sections and citations.
Choosing the approach
The three approaches change different things, and they are usually applied in order of effort. Prompt customization changes the instructions and examples, grounding changes the information available for each request, and fine-tuning changes the model's learned behaviour. The following table compares them.
| Approach | Changes | Best for | Effort when requirements change |
|---|---|---|---|
| Prompt customization | Instructions, structure, examples | Format, terminology and rules that can be stated | Edit the prompt |
| Grounding with retrieval | Information supplied per request | Facts and rules that change or must be cited | Update the indexed sources |
| Fine-tuning | Model behaviour | Consistent style or a narrow task on a smaller model | Prepare data and retrain |
A common outcome is a combination: a prompt that defines structure and rules, retrieval that supplies current reference material, and, only if evaluation shows it is still needed, a fine-tuned smaller model to reduce cost or improve consistency.
The following diagram orders the approaches by the effort they take when requirements change.

Prompt, grounding or fine-tuning?
Compliance summarization
A bank summarizes new regulatory notices for its compliance team. Current summaries are fluent but omit deadlines, use inconsistent terms and do not reference clauses.
Add a structured output with required fields (obligations with clause references, deadlines, penalties, affected units), a glossary of the bank's terms and one annotated example, and retrieve related internal policies so the summary can say which policies are affected. Evaluate with a custom evaluator that checks every obligation has a clause reference. Fine-tuning would be a later step only if these measures fall short.
What should be tried before fine-tuning a model for a domain task?
Show answer
Customizing with instructions, a glossary, examples, a schema and grounding. Fine-tuning comes later, for a consistent format or style on a narrow task.
Exam Tips
Remember for the exam
- Customize first with instructions, glossary, examples, schema and grounding.
- Domain outputs should cite their sources.
- Fine-tune for consistent format or style on a narrow task, measured on a domain evaluation set.