The confidence lab: from model confidence to testable abstention

Why replication matters: putting real constraints on the last evaluation
How does a method with no clear development-set benefit fare on independent examples? This article asks whether fixed length-grouped temperatures improve probability quality on held-out movie reviews relative to a single global temperature, without materially increasing error among the predictions we accept. Earlier installments proposed the hypothesis, ran an equal-budget comparison and factor ablation, and froze the version. This installment adds predictions from the previously sealed confirmation pool and applies the original decision rule.
Mean negative log-likelihood fell by about 0.000946 with grouped temperatures, and the paired interval lay entirely below zero. Both methods made 38 errors among 800 accepted predictions. The preregistered joint criterion was met. Accuracy stayed the same, the absolute effect was small, and the comparison was not repeated across models or domains. The positive result is specific to these conditions.
Independent confirmation limits researchers’ degrees of freedom. Changing the length cutoff, refitting temperatures or picking a more attractive metric after seeing the result would turn the confirmation pool into another development set. The article preserves the opposite direction of the development result and the failed smoke test so readers can see how the frozen procedure constrained the conclusion.
One set of model outputs, two frozen interpretations
Temperature scaling divides the classifier’s raw scores by a positive number and converts them to probabilities. Guo and colleagues examined modern neural network calibration and reported that a one-parameter method worked on their tasks. Their result offers no guarantee for this experiment. Both methods here use the same trained sentiment classifier, with no model updates and no fitting against confirmation labels.
The global method uses a temperature of 2.3896. The grouped method uses 2.4243 for examples with at most 256 retained tokens and 2.3464 for longer examples. Tokens are the units of the model’s tokenizer. The count includes special tokens and is measured after truncation to 512. It measures neither the original number of words nor semantic difficulty.
Both methods share logits from the same inference pass. Differences therefore come from the frozen post-processing rule, with the model, input budget and training held fixed. A positive temperature preserves the ordering of classes within an example, so the number classified correctly should be identical. It can change rankings across examples, so risk after abstention still needs to be measured.

Formulas and modules: defining improvement in advance
Let be the two class scores for review , with label . The temperature-scaled class probability is:
Here indexes examples and and index classes. is either a global constant or a positive temperature selected by the fixed length group. The model’s batched output has shape batch size by two. The probabilities refer specifically to the negative and positive sentiment labels. They do not quantify the factual correctness of open-ended generations.
The primary metric is negative log-likelihood (NLL), which penalizes lower probability assigned to the true label more heavily. The comparison was defined in advance as:
Here , with denoting the grouped method and the global method. A negative difference means lower loss under the grouped method. The implementation uses numerically stable log operations. The independent audit renormalizes the two exponentiated scores to avoid simply reusing the same intermediate results.
The second constraint ranks examples by maximum class probability and compares error rates among exactly 800 accepted examples. Ties are broken by ascending example identity hash. The preregistered success criterion requires a paired bootstrap percentile interval with upper bound below zero and a risk increase of at most one percentage point. The bootstrap samples examples with replacement. With only one review per film, the resampling unit corresponds to the film identity.
Reading the upstream implementations
Start with the official model card’s label mapping, intended task and license. Then inspect the classifier’s forward method in the pinned Transformers commit. It maps tokenized tensors to two scores. This experiment calls the upstream module directly. Next, read the temperature-scaling repository’s temperature_scale and set_temperature functions. The first shows where the division by temperature occurs, and the second shows how to optimize loss on calibration data.
Earlier installments fitted temperature by bounded bisection in inverse temperature in place of the upstream example’s CUDA optimizer. This run does no fitting and reads the previous version’s frozen temperatures. The source map records upstream commits, file locations, licenses and corresponding local modules, clarifying the relationship between the independent teaching implementation and the original authors’ experiments.
Start with data identity: pools.json fixes the three pools, resources.lock.json pins the model and vocabulary, final_config.json fixes the methods, run.py performs inference, confirm.py evaluates the saved scores, and audit141.py recomputes the results independently. Establish which examples were evaluated before checking the arithmetic and then interpreting the result.
The minimal experiment and data boundaries
The original IMDb v1 archive was checked against its SHA-256 both at download and on read. The exploratory development, target calibration and final confirmation pools each contained 1,000 examples. Stable identities were registered before the first prediction, with deduplication by film identity and normalized text. The confirmation pool had never been used for inference, tuning, example selection or output comparison. This was its first inference pass. Public text may still have appeared in the model’s pretraining data, so absolute freedom from contamination cannot be claimed.
SST-2 was used in earlier experiments. In-domain analyses in this series have remained exploratory because they reuse data. Repartitioning cannot erase previous exposure. Here, “independent” means that the confirmation samples were excluded from this round of method selection. It does not imply a third-party replication or a secret test set no model has ever seen.
A CPU smoke test first used eight exploratory development examples. Only after it passed was the confirmation text read. The formal run made one model forward pass over the 1,000 confirmation examples, with batch size 16, maximum length 512, right truncation, dynamic padding within each batch, four threads, float32 and eager attention. The forward loop took about 57.05 seconds and the full run, including reads, took about 60.64 seconds. Peak resident memory was about 1.98 GB. There was no training or paid cloud compute.
The run recorded the actual Python, PyTorch and Transformers versions, with the dependency lock and environment log recorded alongside the code. The model and tokenizer share a pinned revision, and cached files were checked individually against their hashes. The cache key covers model resources, data archive, splits, inference configuration and entry-point code. Repeat analyses use only saved scores and do not reopen inference on the confirmation pool in search of a more favorable result.
Evaluation protocol and results
The confirmation pool contained 589 short and 411 long examples. These counts were reported after reading the pool and did not inform the grouping rule. Both methods classified 897 examples correctly. The risk denominator below is fixed at 800. Brier is the sum of squared errors for the two classes. ECE uses 10 fixed equal-width bins. This calibration error depends on the binning convention and is secondary to the primary metric.
| Metric | Global temperature | Length-grouped temperatures |
|---|---|---|
| NLL | 0.264463 | 0.263518 |
| Brier | 0.153187 | 0.152837 |
| ECE10 | 0.026606 | 0.026584 |
| Correct / 1000 | 897 | 897 |
| Errors among accepted predictions / 800 | 38 | 38 |
The paired bootstrap used seed 137 and 10,000 resamples. The resulting interval for the difference was [−0.001429, −0.000476]. The risk difference was zero, so the joint criterion was met. The interval describes sampling uncertainty for this frozen comparison under the resampling assumptions. It does not account for model choice, changes in domain or every source of uncertainty in the research process.

The grouped method had slightly higher NLL in development, by about +0.000169, and slightly lower NLL in confirmation. Selecting just one of the two results would distort the account. The preregistered method met its criterion on these 1,000 confirmation examples. The author suspects that differences this small may be sensitive to sample composition, but this run does not establish whether length distribution, error concentration or other factors explain the change in direction.
Troubleshooting and independent recalculation
The first eight-example smoke test stopped because of an indentation error affecting a variable in the new entry point. It exited before the model forward pass and before the confirmation pool was opened for inference. The fix restored corpus loading to the shared branch. The release adapter hash was then updated and the smoke test rerun. The previous temperatures, metrics functions, protocol and configuration bytes remained unchanged. The failed command and log were retained alongside the successful outcome.
An independent script checked probabilities, loss, correctness, Brier, ordering and accepted-set errors for all 2,000 method-by-example predictions. It then recomputed the primary difference and all 10,000 resamples. This was an automated arithmetic check. The labels were inherited from the public dataset, with no new human judgments about sarcasm, sentiment intensity or label preservation after truncation, and no claimed human reviewers.
The investigation checked identity order and label mapping first, then temperature loading and special-token handling in the length calculation, and finally tie-breaking and the interval seed. Overall accuracy alone can miss misaligned labels: the methods might still produce the same number correct while the paired comparison loses its meaning. Acceptance of the public source also requires the extracted entry point to run and each file hash to match. Opening the repository front page proves neither.
Source and reproduction entry points
The source is public and was verified at a pinned version: full source directory, README, and SOURCE_MAP. All 34 anonymously downloaded files matched the local archive byte for byte. Offline evaluation and independent auditing both passed against the public copy. The minimal offline command is python confirm.py, which is expected to produce confirmation-pool aggregates and per-example post-processing records. Then run python audit141.py for arithmetic consistency. This path uses saved logits from the actual model and does not refit temperatures.
To reproduce starting from the model, install the locked dependencies, use run.py’s fetch subcommand to obtain pinned resources, then execute smoke and formal. The formal subcommand refuses to overwrite existing outputs and must run in a separate reproduction directory. The archive excludes original reviews and model weights. Cached resources can be reused after hash verification. This run completed the eight-example development smoke test, inference on 1,000 confirmation examples, evaluation of both methods and independent auditing.
Research questions and conclusions
Three conclusions survived confirmation. Positive temperatures preserved binary classification accuracy. The frozen length grouping produced a very small NLL improvement on the confirmation pool. The number of errors at the fixed acceptance fraction did not increase. This experiment establishes neither per-example guarantees nor subgroup safety, gains on other models or more trustworthy open-ended generation. It also did not run conformal prediction, so earlier findings about marginal coverage cannot substitute for these results.
A test of stability would need newly registered data and a new protocol, with repeated tasks, effect-size thresholds and uncertainty reporting specified in advance. The opened confirmation pool is now a public historical artifact and cannot function as a new confirmation set. The stopping rule takes precedence over further searches for significance. Preserving the successful result, the limitations and the failed attempt together is more informative than adding another tunable parameter at the end.
References
Search and access date: 2026-11-28.
- Guo, C., Pleiss, G., Sun, Y., Weinberger, K. Q. (2017). On Calibration of Modern Neural Networks, ICML, PMLR 70.
- Pleiss. Official temperature_scaling.py at the pinned commit, MIT.
- Maas, A. L., Daly, R. E., Pham, P. T., Huang, D., Ng, A. Y., Potts, C. (2011). Learning Word Vectors for Sentiment Analysis, ACL.
- Pinned DistilBERT SST-2 model files and model card, Apache-2.0.
Apps by the author
Alongside this blog, I build small tools to make everyday life more manageable. Here are two apps I developed independently:
- Daily Expense Journal: Track income and expenses, give each amount a purpose, and plan budgets and savings goals. View on the App Store.
- One Small Action: Start with a small action that fits the time and energy you have, then record how it felt and what you noticed. View on the App Store.