Skip to content

Always allow ref_model=None #2047

@qgallouedec

Description

@qgallouedec

Feature request

For optimisation with reference model, in most cases the reference model is the same as the trained model. We should allow the user to specify the ref model only when they don't want to use the trained model.

Currently this is possible, but only when using PEFT, which is very counter-intuitive. And even using this situation, if you want to provide a ref model that is different from the trained model, you have to define force_use_model. Even more counter-intuitive.

Currently

  1. model = ref_model and no peft
DPOTrainer(model=model, ref_model= ref_model)  # where ref_model should be another instance
  1. model = ref_model and peft
DPOTrainer(model=model)
  1. model != ref_model and no peft
DPOTrainer(model=model, ref_model=ref_model)
  1. model != ref_model and peft
args = DPOConfig(force_use_ref_model=True)
DPOTrainer(model=model, ref_model=ref_model, args=args)

Proposed

  1. model = ref_model
DPOTrainer(model=model)
  1. model != ref_model
DPOTrainer(model=model, ref_model=ref_model)

Motivation

Make the lib use more intuitive.

Your contribution

For sure ;)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions