vraven.darkside · function
analyse_prediction_depth
analyse_prediction_depth(reference: 'TraceDataset', query: 'TraceDataset | None' = None, *, neighbours: 'int' = 5) -> 'AnalysisResult'Estimate the earliest layer whose local prediction remains final-consistent.
A k-nearest-neighbour probe is fitted on reference representations at each
layer. For a separate query set, prediction depth is the earliest layer from
which all later probe predictions agree with the model's final prediction.
When ``query`` is omitted, leave-one-out neighbours are used on the reference
set to avoid a sample selecting itself.
Usage
from vraven.darkside import analyse_prediction_depth
result = analyse_prediction_depth(... )
Source of truthThis page is generated from the checked-out public symbol, signature, and docstring. Pin the package version for reproducible work.