Skip to content

Fix incorrect parameter name evaluation_strategy in SFTConfig of Module 16 exercise starter code #11

@keadachik

Description

@keadachik

GitHub Issue Template

Issue Title

Fix incorrect parameter name evaluation_strategy in SFTConfig of Module 16 exercise starter code

Description

The starter notebook for Module 16 exercise uses an incorrect parameter name evaluation_strategy in SFTConfig. It should be eval_strategy according to the TRL library documentation and the solution file.

Details

Incorrect parameter name evaluation_strategy in SFTConfig

Location: module-16-applying-peft-on-foundation-models/exercises/starter/teach-an-llm-to-spell-with-sft-starter.ipynb, Cell around line 396

Current Code (incorrect):

training_args = SFTConfig(
    output_dir=output_dir,
    per_device_train_batch_size=4,
    per_device_eval_batch_size=4,
    gradient_accumulation_steps=2,
    num_train_epochs=10,
    learning_rate=5e-4,
    logging_steps=20,
    evaluation_strategy="steps",  # ❌ Wrong parameter name
    eval_steps=20,
    save_strategy="no",
    report_to=[],
    fp16=False,
    lr_scheduler_type="cosine",
)

Fixed Code:

training_args = SFTConfig(
    output_dir=output_dir,
    per_device_train_batch_size=4,
    per_device_eval_batch_size=4,
    gradient_accumulation_steps=2,
    num_train_epochs=10,
    learning_rate=5e-4,
    logging_steps=20,
    eval_strategy="steps",  # ✅ Correct parameter name
    eval_steps=20,
    save_strategy="no",
    report_to=[],
    fp16=False,
    lr_scheduler_type="cosine",
)

Issue: The parameter should be eval_strategy, not evaluation_strategy. This matches the solution file and TRL library documentation.

Steps to Reproduce

  1. Open module-16-applying-peft-on-foundation-models/exercises/starter/teach-an-llm-to-spell-with-sft-starter.ipynb
  2. Navigate to the cell with SFTConfig (around line 396)
  3. The parameter name evaluation_strategy is used instead of eval_strategy

Expected Behavior

SFTConfig should use eval_strategy parameter name, which is the correct parameter name according to:

  • TRL library documentation
  • The solution file: module-16-applying-peft-on-foundation-models/exercises/solution/teach-an-llm-to-spell-with-sft-solution.ipynb

Actual Behavior

The starter file uses evaluation_strategy which may cause confusion or potential issues with the TRL library.

Solution Reference

The correct implementation can be found in:

  • module-16-applying-peft-on-foundation-models/exercises/solution/teach-an-llm-to-spell-with-sft-solution.ipynb (line 555)

Additional Notes

  • This is a simple fix but important for consistency with the solution and documentation
  • The parameter name mismatch could confuse students when comparing with the solution file

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions