Modify beam search objective

Hi, I would like to experiment with adding an additional penalty term to the beam search objective used when calling generate(). What is the best way to go about this?

Hello! Have you find any solution? I found this post via Google searching the same question : D

Hi,

You may find this blog post interesting: https://towardsdatascience.com/the-power-of-constrained-language-models-cf63b65a035d.

It shows how to customize the beam search objective of Transformer-based methods.

2 Likes

Wow, that looks very helpful, thank you!