Loading before saving means the agent restores old progress first, then saves new progress, which may not be intended.
Step 2: Validate method usage
save_checkpoint requires a filename string argument, so the call is correct. load_checkpoint can be called multiple times. File names as strings are valid.
Final Answer:
Loading before saving may restore old progress -> Option D
Quick Check:
Load before save risks old progress [OK]
Hint: Save before load to avoid restoring old progress [OK]
Common Mistakes:
Thinking save_checkpoint needs no arguments
Believing load_checkpoint can't be called multiple times
Assuming file names must be integers
5. You want to checkpoint an agent working on a long task that may stop unexpectedly. Which strategy best ensures minimal lost progress?
hard
A. Save checkpoints frequently during the task and load the latest on restart
B. Save one checkpoint only at the end of the task
C. Load checkpoints multiple times without saving
D. Avoid checkpointing to keep the agent fast
Solution
Step 1: Understand the problem of unexpected stops
If the task stops unexpectedly, progress since the last save is lost unless checkpoints are saved often.
Step 2: Choose the best checkpointing strategy
Saving checkpoints frequently ensures minimal lost progress. Loading the latest checkpoint on restart resumes work efficiently.
Final Answer:
Save checkpoints frequently during the task and load the latest on restart -> Option A
Quick Check:
Frequent saves minimize lost progress [OK]
Hint: Save often to avoid losing progress on stops [OK]
Common Mistakes:
Saving only once at the end risks losing all progress