# Using penalized sampling from CTRL

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fusing-penalized-sampling-from-ctrl%2F3500%3E%5C
**Category:** 🤗Transformers\
**Created:** [February 4, 2021, 4:22pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fusing-penalized-sampling-from-ctrl%2F3500 "2021-02-04T16:22:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![prajjwal1](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/prajjwal1/32/2246_2.png) [@prajjwal1](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fprajjwal1)%5C
**Post date:** [February 4, 2021, 4:22pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fusing-penalized-sampling-from-ctrl%2F3500%2F1 "2021-02-04T16:22:58Z")

</div>

So `CTRL` uses a new decoding mechanism called `Penalized sampling` which basically discounts the scores of previously generated tokens. I was wondering about the implementation with `model.generate`. Is `repetition_penalty=1.2` with `temperature=0` sufficient ?

---

<div class="post-metadata">

**Author:** ![prajjwal1](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/prajjwal1/32/2246_2.png) [@prajjwal1](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fprajjwal1)%5C
**Post date:** [February 4, 2021, 4:34pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fusing-penalized-sampling-from-ctrl%2F3500%2F2 "2021-02-04T16:34:04Z")

</div>

With `repetition_penalty` set, I’m not seeing as compelling generation as the ones mentioned in the paper. I’m trying out with other decoding strategies as well. If you’ve a suggestion about parameters which works best with `CTRL`, please let me know.
