A prompt template is a reusable structured text pattern that combines fixed instructions with variable content to produce consistent model inputs. In financial-report summarization, it directs the model to focus on findings, metrics, and conclusions while avoiding unsupported commentary. section 2.5.2
Apply a prompt template by following these steps:
- Write a specific instruction that defines the required output, tone, focus, and exclusions. section 2.5.2
- Mark variable content with a placeholder such as {report_text}, then insert each report programmatically. section 2.5.2
- For supervised fine-tuning, place the instruction, input report, and target summary in a stable prompt-target structure. section 2.5.3
- Append an end-of-sequence token when formatting training examples, and keep the structure consistent across rows. section 2.5.3
Financial report summarization
A template can request a concise professional summary, insert an analyst report under an Input heading, and reserve a Response heading for the verified summary. The same pattern can generate synthetic labels or format training examples. section 2.5.2 section 2.5.3
Listing 2.25 Example training prompt
SUMMARY_PROMPT_TEMPLATE = """\
Given the following analyst report, generate a concise, informative summary
in a professional tone.
Focus on the main findings, key metrics, and conclusions. Do not add any
commentary beyond what is in the report.
Report:
{report_text}
"""Shows a concrete template with instructions, a report_text variable, and constraints on summary content. section 2.5.2
Listing 2.30 Define the prompt template
chat_prompt = """
### Instruction:
Summarize the following analyst report.
### Input:
{}
### Response:
{}"""
EOS_TOKEN = tokenizer.eos_token
def formatting_prompts_func(examples):
inputs = examples["report"]
outputs = examples["summary"]
texts = []
for input, output in zip(inputs, outputs):
text = chat_prompt.format(input, output) + EOS_TOKEN
texts.append(text)
return {"text": texts}Shows the instruction-input-response structure used to convert reports and summaries into training text. section 2.5.3




























