0
0
Prompt Engineering / GenAIml~10 mins

Why fine-tuning adapts models to domains in Prompt Engineering / GenAI - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to load a pre-trained model for fine-tuning.

Prompt Engineering / GenAI
model = load_model('[1]')
Drag options to blanks, or click blank then click option'
Apretrained-domain-model
Bempty-model
Crandom-model
Dbase-model
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a model without prior training like 'random-model'.
2fill in blank
medium

Complete the code to prepare domain-specific data for fine-tuning.

Prompt Engineering / GenAI
domain_data = load_data('[1]')
Drag options to blanks, or click blank then click option'
Arandom_text.txt
Bgeneral_corpus.txt
Cdomain_corpus.txt
Dempty_file.txt
Attempts:
3 left
💡 Hint
Common Mistakes
Using general or unrelated data files for fine-tuning.
3fill in blank
hard

Fix the error in the fine-tuning loop by completing the missing method call.

Prompt Engineering / GenAI
for batch in domain_data:
    loss = model.[1](batch)
    loss.backward()
Drag options to blanks, or click blank then click option'
Aforward
Btrain
Cpredict
Devaluate
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'predict' or 'evaluate' which are for inference, not training.
4fill in blank
hard

Fill both blanks to update the model parameters during fine-tuning.

Prompt Engineering / GenAI
optimizer.[1]()
optimizer.[2]()
Drag options to blanks, or click blank then click option'
Azero_grad
Bstep
Cbackward
Dforward
Attempts:
3 left
💡 Hint
Common Mistakes
Calling 'backward' or 'forward' on optimizer which is incorrect.
5fill in blank
hard

Fill all three blanks to create a dictionary of fine-tuned model metrics.

Prompt Engineering / GenAI
metrics = {'loss': [1], 'accuracy': [2], 'epoch': [3]
Drag options to blanks, or click blank then click option'
Aloss_value
Bacc_value
Ccurrent_epoch
Dmodel_output
Attempts:
3 left
💡 Hint
Common Mistakes
Using model output instead of metric values.