﻿# When does a short KL-divergence test represent a quantization run?

llama.cpp b12843 honors the requested chunk limit in KL-divergence mode. Record the evaluated subset with every comparison.

Author: Retrivium editorial team
Updated: 2026-11-29
Canonical URL: https://retrivium.ai/journal/daily-20261129-compute-llama-kl-chunk-scope/
Language: en

The llama.cpp b12843 snapshot published on November 28 changes the `llama-perplexity` tool. When run with `--kl-divergence` and `--chunks`, the earlier implementation could use the chunk count from the reference logits file header instead of the requested count. The change makes the evaluation respect the requested limit. It affects which data enter the statistic. The metric still measures divergence relative to the supplied reference distribution.

## Record what the subset contains

For a fast iteration check, preserve a manifest with the corpus hash, order and chunk boundaries. Keep the reference logits file and runtime release in the record. Two testers can begin with the same source document and still evaluate different tokens if text normalization or chunking changed. A small result is interpretable only when its evaluated tokens are identifiable.

## Use an unchanged comparison for candidates

Run two quantizations on the same chosen chunks and reference. Record the observed chunk count separately from the requested count. Include a baseline configuration so a change in data scope is easier to spot. If a result jumps after upgrading the evaluator, rerun the old model through the new tool on the same chunks before attributing the difference to the new quantization.

## Decide how much evidence the result needs

A development shortlist can use a small shared subset to eliminate obvious regressions quickly. Before a serving change, expand the evaluation to cover genres, languages and difficult cases. Match the prompt preparation between runs and keep uncertain results visible. A subset chosen for convenience can underrepresent rare outputs and yield a stable-looking score that does not describe the workload.

## Keep divergence and product quality separate

Pair the distribution metric with target task outcomes, such as structured output validity or extraction accuracy. If divergence shifts while task outcomes hold, investigate the part of the corpus driving the change. Make the final decision using the scope of evaluation and the quality requirements of the deployment.

## Sources

- [Primary source · llama.cpp b12843](https://github.com/ggml-org/llama.cpp/releases/tag/b12843)
- [Primary source · llama.cpp #32257](https://github.com/ggml-org/llama.cpp/pull/32257)

## Related reading

- [Related guide · Perplexity tokenizer denominator](/journal/perplexity-tokenizer-denominator/)
- [Related guide · Quantization quality](/journal/quantization-quality/)
