Skip to main content

What is Instruction?

A summary of how to use the instruction field during both training and inference.

M
Written by Michael McCarty
Updated this week

The Instruction field is an essential part of training and running models on Minibase. It tells your model what kind of task it is expected to perform, such as “Summarize the following input in one concise sentence” or “Classify the email as Spam or Legit.”

Because Minibase is focused on small, specialized models, instructions should generally stay consistent across your entire dataset. This ensures the model learns the exact task you want it to perform and doesn’t get confused by multiple task definitions.

At inference, you must provide the same instruction you used during training so the model knows how to interpret the input and respond correctly.

How to Use

Step 1 — Define the purpose of your model

Decide what your model is meant to do. Examples:

  • Summarize text in one sentence

  • Classify emails as Spam or Legit

  • Translate short sentences from English to French

Your Instruction should describe that task clearly and consistently.

Step 2 — Include the instruction in your training dataset

When preparing your fine-tuning data, each example should include:

  • instruction: the consistent task definition (always the same across the dataset)

  • input: the text to act on

  • response: the expected answer

Example training record:

{ "instruction": "Summarize the following input in one concise sentence.", "input": "Quantum entanglement is a physical phenomenon where particles remain connected so that the state of one affects the other, even at a distance.", "response": "Quantum entanglement links particles so changes to one instantly affect the other, regardless of distance." }

Step 3 — Send the same instruction during inference

When you call your model, you must include the instruction in the API request so the model knows which task to perform.

Here’s an example request using curl:

# Use API key authentication via Authorization header.
API_KEY="YOUR_API_KEY"
BASE="https://staging.minibase.ai/api.php"

# Call inference directly with API key
curl -s -X POST "$BASE" \
-H "Authorization: Bearer $API_KEY" \
--data-urlencode "action=mt_inference" \
--data-urlencode "model_id=chat_base_spam_detector_1755875057_286a345b" \
--data-urlencode "instruction=Summarize the following input in one concise sentence." \
--data-urlencode "prompt=Explain quantum entanglement in one sentence." \
--data-urlencode "max_tokens=128" \
--data-urlencode "temperature=0.7" \
--data-urlencode "format=json"

Notice how the instruction matches what was used during training.

Tips & Best Practices

  • Keep the instruction short, clear, and consistent across your dataset.

  • Don’t train with many different phrasings of the instruction — small models perform best when they focus on a single, stable task definition.

  • Think of the instruction as “setting the rules of the game” — it should not change once your model has been fine-tuned.

  • For multi-task models, consider training separate small models rather than mixing many instructions into one.

Troubleshooting

Why are my model’s outputs inconsistent?

Check if you are sending the same instruction during inference that you used during training. If the instruction differs, the model may not recognize the task and produce poor results.

Can I train with multiple instructions?

We don’t recommend it for small models. Large models can handle varied phrasing, but smaller ones perform best with a consistent instruction. If you need multiple tasks, create separate fine-tuned models for each task.

Do I need an instruction for classification tasks?

Yes — even for simple classifications, you should provide a clear instruction like “Classify the following email as Spam or Legit.” This improves performance and ensures the model stays aligned with the intended task.

Did this answer your question?