Prompt the Model
Introduction #
Fine-tuning your model’s output involves experimentation with various prompts and settings. Understanding each component of a prompt is crucial:
- Instruction: The directive for the model.
- Examples: Contextual examples for the model to consider.
- Input: The data the model processes.
- Expected Output: The desired result from the model.
Part 3: Prompt the Model #
Link Dataset #
- Open the dataset drawer, then in Load dataset, choose the
hpe-ai/medical-cases-classification-tutorial
dataset from the dropdown. - Ensure the dataset previews correctly, then select Load.
Configure Initial Prompt #
Experimenting with different prompts helps to determine the most effective setup. The information the model needs could be found in either the medical_specialty
column or the transcription
column. We’ll try both columns and see which works best.
Customize Your Prompt #
-
Try prompting the model first by specialty, then by transcript, using the structured data below:
-
To preview the results, select Preview.
Generate Initial Output #
- Select Generate to view the model’s initial responses.
Adjust Strategy #
If the output doesn’t meet expectations, consider switching models for improved accuracy.
- Open the Select model drawer and then choose
Llama-2-7b-chat-hf
from the list. This is a larger model with better generation capabilities. - Select Load and then Generate again to see improved results.
Optimize Model Properties #
Optimize your setup by adjusting the prompt and generation properties:
- Navigate back to the model properties.
- Select a resource pool to view model generation properties.
- Adjust the Temperature to
0
. - Reduce the Max New Tokens to
10
. - Select Load.
- Select Generate again.
Save the Snapshot #
After achieving satisfactory results, save this snapshot.
- Select Save Snapshot.
- Provide a snapshot name. Make it meaningful so you can distinguish it from other configurations you’ve tried.
- Select Save.
You can load this snapshot again at any time by navigating to your project’s Snapshots tab and selecting it. Then, you can repeat this process to produce a few similar snapshots to compare the outputs and find the best one.
Recap #
- You have linked the dataset and tailored the prompts to classify medical transcripts.
- You have iterated on the model and its settings to enhance output quality.
- You have saved your model configuration as a snapshot for future use or further refinement.