Skip to the page
Tecyfy

Prompting interview question · hard

How can prompt engineering be used to fine-tune a language model’s behavior without retraining the model?

The short answerYou change a model's behaviour without retraining by changing what it sees on each request: a system prompt that sets its role and rules, examples of the output you want, retrieved knowledge it should use, tools it can call and constraints on the output format.

The full answer

You change a model's behaviour without retraining by changing what it sees on each request: a system prompt that sets its role and rules, examples of the output you want, retrieved knowledge it should use, tools it can call and constraints on the output format. Together these can make a general model act like a specialised one.

1. System prompts A system message sets the model's role, audience, tone, scope and boundaries for the whole conversation: "You are a SQL reviewer for a team using PostgreSQL. Point out correctness and performance problems first, style last. Don't rewrite the whole query unless asked."

2. Few-shot examples Examples of inputs with ideal outputs teach format, tone and judgement that are hard to describe. They are the closest thing to training without training: the model picks up the pattern in context.

3. Retrieval-augmented generation For knowledge the model lacks, such as internal documents, current policies or a customer's data, retrieve the relevant passages and include them. The model then answers from your sources, and updating its knowledge means updating a document, not retraining.

4. Tools Functions the model can call (search, database queries, calculators, APIs) extend what it can do and give it current, exact data.

5. Structured outputs A JSON schema enforced by the API makes the output machine-readable every time.

6. Prompt chaining and routing Different prompts for different kinds of request, chosen by a classifier step, behave like several specialised models.

7. Generation settings Where the model allows it, temperature and similar settings make answers more consistent or more varied.

8. Memory Saved user preferences or summaries of past interactions, added to the prompt, personalise behaviour across sessions.

What prompting can't do well

  • Teach a consistent, subtle style across thousands of outputs when it is hard to describe or show in a few examples.
  • Make a small, cheap model match a large one on a narrow, high-volume task.
  • Shorten very long prompts that are repeated on every request. In those cases, fine-tuning may be worth its cost, ideally after prompting and retrieval have been tried and measured.

Comparison

NeedWithout retrainingWith fine-tuning
New or changing factsRetrievalPoor fit
Format and structureExamples, structured outputsPossible but rarely needed
Tone and roleSystem prompt, examplesFor very consistent style at scale
ActionsToolsNot applicable
Speed of changeMinutesHours to days, plus evaluation

Last updated 16 October 2026