no, but does this?

This commit is contained in:
ddh0 2025-12-14 02:54:14 -06:00
parent 2a3f579d1f
commit ec54fe5f14
2 changed files with 7 additions and 6 deletions

View File

@ -1569,12 +1569,10 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
).set_sparam());
add_opt(common_arg(
{"--power-law-decay"}, "N",
string_format("power law sampler: decay rate for target adaptation over time. lower "
"values -> faster but less stable adaptation. "
"(valid range 0.0 to 1.0; ≤0 = no adaptation) (default: %.2f)",
(double)params.sampling.power_law_decay),
[](common_params & params, int value) {
params.sampling.power_law_decay = value;
string_format("decay rate for target adaptation over time. lower values -> faster but less stable adaptation.\n"
"(valid range 0.0 to 1.0; ≤0 = no adaptation) (default: %.2f)", (double)params.sampling.power_law_decay),
[](common_params & params, const std::string & value) {
params.sampling.power_law_decay = std::stof(value);
}
).set_sparam());
add_opt(common_arg(

View File

@ -2427,8 +2427,11 @@ static void llama_sampler_power_law_apply(struct llama_sampler * smpl, llama_tok
// update running history with the original probability of the selected token
float original_p = original_probs[idx];
fprintf(stderr, "power-law: original prob was %.3f\n", original_p); fflush(stderr);
ctx->weighted_sum = original_p + decay * ctx->weighted_sum;
fprintf(stderr, "power-law: updated ctx->weighted_sum = %.3f\n", ctx->weighted_sum); fflush(stderr);
ctx->total_weight = 1.0f + decay * ctx->total_weight;
fprintf(stderr, "power-law: updated ctx->total_weight = %.3f\n", ctx->total_weight); fflush(stderr);
}
static void llama_sampler_power_law_reset(struct llama_sampler * smpl) {