Exclude Top Choice takes VS repetition penalty
A few days ago I hacked top_logprobs into deliverance: Logprobs shows you what other tokens were close to being chosen and the logprobs (logarithm of the probability) of how close they were. When I had never done something like this before and the math turned out to be not so bad. Most of what I learned I got from this excellent article and this one . public static void logSumExpTensor (AbstractTensor result, AbstractTensor input) { float logsumexp = ( float ) logSumExp (input); for ( int i = 0 ; i < input.size(); i++) { float v = input.get( 0 , i); result.set(v - logsumexp, 0 , i); } } public static double logSumExp (AbstractTensor x){ float sum = 0.0f ; for ( int i = 0 ; i < x.size(); i++) { sum += ( float ) FastMath. exp (x.get( 0 , i)); } return ( float ) FastMath. log (sum); } All this math stuff had me a little bit more confident editing the Sampler code. So I decided to keep going. One thing ...