hfppl icon indicating copy to clipboard operation
hfppl copied to clipboard

Support LMContext with temperature=0

Open gabegrand opened this issue 10 months ago • 0 comments

There are cases (e.g., testing / debugging) where it's useful to sample with temperature=0.

However, currently, LMContext requires 0 < temperature < infinity: https://github.com/probcomp/hfppl/blob/a191fca4f2055094ede389d10f63e6250ab4601e/hfppl/distributions/lmcontext.py#L112

Setting it to 0 results in a zero-division error: https://github.com/probcomp/hfppl/blob/a191fca4f2055094ede389d10f63e6250ab4601e/hfppl/distributions/lmcontext.py#L127-L129

Is there a reason why in principle we can't support temperature=0?

gabegrand avatar Jan 10 '25 22:01 gabegrand