Learning Where Taxonomists Stop: Termination Tokens Trained on Incompletely Identified Specimens

Most insects photographed in large biodiversity surveys have never been named to species level. Some are too hard to identify from an image. Many belong to species that science has not yet described. Current image classifiers still have to output a species, so they place a confident guess on some known species even when the specimen is new. This proposal starts from a different observation. When an expert labels a specimen only down to genus or family, that is an example of a correct decision to stop early. Such examples are plentiful in datasets like BIOSCAN-5M, where only about 9% of 5.1 million specimens carry confirmed species names. We propose to train a model that predicts a taxonomic lineage one rank at a time, from order down to species. At every node the model may choose a special "stop here" outcome, and partially labeled specimens supervise that choice directly.

The claim is that an explicit stop outcome, trained on real incomplete identifications, gives an open-set signal that confidence thresholds on a species classifier cannot supply. By "open-set" we mean a signal that says "this belongs to no known child of this node." A classifier over known species has no way to express that. It can only spread probability among known species, and on genuinely novel specimens that probability is often confidently wrong. We expect the gain to appear mainly on specimens from undescribed or held-out species. We also expect it to come from the stop outcome and its training signal rather than from autoregressive decoding as such, and the experiments are built to check that attribution.

What exists and what is missing

Two literatures come close without meeting.

The long-tail vision literature has shown that backing off to a coarser rank is the right response to rare classes. Deep-RTC trains hierarchical classifiers and, at test time, stops at a parent node when the child's conditional probability falls below a hand-tuned threshold. It improved its correctly-predicted-bits score from 0.66 to 0.78 on iNaturalist 2018. This paper motivates our work and supplies our main metric. Its stopping rule, however, is a single scalar tuned after training. Nothing in training ever tells it that "none of these children" is a real answer.

Conformal prediction for long-tailed classification adjusts prediction sets for class prevalence. It still operates over the flat set of known classes.

Hierarchical representation work supplies our encoders. CLIBD and CLiBD-HiR align images with DNA barcodes and shape the embedding space to follow Linnaean ranks. BioCLIP 2 scales hierarchical contrastive learning to about a million taxa. All three read out predictions with per-rank heads or nearest-neighbour lookup, and none of them learns when to stop.

The sequence literature, in turn, has learned stopping tokens but applies them to fully labeled data. Nam et al. replaced per-label thresholds with an end-of-sequence token in multi-label classification. Seq2Tree and HiDEC decode hierarchical labels with tokens that mean "go back up the tree" or "done," and they restrict each step to valid children. On balanced text taxonomies, however, their paths always end at the ground-truth leaves. MERA learns an end-of-visit token that decides how many diagnoses to list. That token controls the size of an unordered set, not how deep to go along a hierarchy.

Our proposal reuses the constrained decoding of Seq2Tree and HiDEC and the encoders of CLIBD and BioCLIP 2. What is new is the stop token's meaning and supervision. Here the stop token means "stop at this rank," and it is trained from real partial identifications under an extreme long tail.

Core Claim

Consider a node $v$ in the taxonomy, with children $c_1,\dots,c_k$. The model predicts a distribution over those children plus one extra outcome, STOP, conditioned on the image and on the path decoded so far. Labels are handled as follows:

  • A specimen labeled only to $v$ contributes the target STOP at $v$.
  • A specimen labeled deeper contributes its true child at $v$, and so on down its path.

Everything else is standard constrained decoding. The model is not asked to learn calibrated uncertainty in the abstract. It is asked to predict something concrete: whether an expert with the specimen in hand would have gone further.

There is an obvious confound. Annotators stop both because a specimen is novel and because it is merely hard to identify, or the lab ran out of time. We therefore test a second source of stop supervision that DNA provides. In BIOSCAN, DNA clusters agree with species over 90% of the time, compared with 21% for image-based clustering (BIOSCAN-5M). During training only, a specimen whose barcode lies far from every named species under a node receives the STOP target at that node. At test time the model sees only the image, which matches the realistic field setting of camera traps and microscope images without sequencing.

Research Program

The model is a pretrained image encoder followed by a small transformer decoder. We will use the BioCLIP 2 image tower, or the CLIBD image tower for BIOSCAN, and fine-tune it end to end. The decoder's vocabulary is the taxonomy's nodes plus STOP. As in Seq2Tree, it is masked at each step so that it can only emit children of the current node or STOP, which guarantees every output is a valid lineage.

Training uses all labeled specimens at whatever depth they were labeled. The training objective is the sum of per-step cross-entropies along the observed path, with STOP appended where the label ends. We compare three stop-target sources:

  • annotator depth alone;
  • DNA-derived depth alone;
  • their union.

We also study where the benefit comes from. For a single-path taxonomy, the decoder is close to a chain of conditional per-node classifiers. The key ingredient may therefore be the extra STOP outcome and its supervision, not autoregression. We build that non-autoregressive twin explicitly: a per-node softmax with an added "none of these" class, trained on the same targets. Comparing the two isolates the contribution of shared decoding state. If the twin matches the decoder, we will report the simpler model as the recommended method. The claim would then narrow to the stop outcome and its supervision.

Baselines

The naive reference point is a flat species classifier with the same encoder, trained on species-labeled specimens with logit-adjusted cross-entropy, that always outputs a leaf. It shows how often a forced species guess is wrong on novel specimens. Every method must beat it on correctly predicted bits and on the rate of confident known-species predictions for held-out species.

The strongest existing method is Deep-RTC. Its reported correctly-predicted-bits scores are 0.78 on iNaturalist 2018 and 0.53 on ImageNet-LT (against 0.35 for flat softmax). We found no reported result on Lacuna for Deep-RTC, or for correctly predicted bits, on BIOSCAN-1M or BIOSCAN-5M, so we must run it ourselves. For a fair comparison, Deep-RTC gets the same encoder, the same training data, and the same hyperparameter-search budget. Its threshold is tuned on the same validation split we use. Its training includes the partially labeled specimens as ancestor-level supervision, so it is not starved of data our method sees. On iNaturalist 2018 we must first reproduce roughly 0.78 before trusting our other comparisons. Beating it means higher correctly predicted bits on BIOSCAN-5M's held-out-species split at matched accuracy on known species.

The simple hierarchical threshold baseline sums the flat classifier's species probabilities up the tree. It then returns the deepest node whose summed probability exceeds a threshold, and we tune one threshold per rank so it is not handicapped. Conformal prediction with prevalence-adjusted scores serves as the set-valued reference. We map its prediction set to its lowest common ancestor to obtain a single node that can be scored with correctly predicted bits.

The key ablation is the partial-label hierarchical softmax with a threshold. This model is trained on exactly our targets, except that partial labels only constrain the ancestor's summed probability and there is no STOP outcome. It isolates whether the explicit stop outcome matters beyond simply using partial labels. The non-autoregressive "none of these" twin described above separates the stop outcome from the decoder.

Why not just…?

Why not just threshold a flat classifier's summed ancestor probabilities? This is a real threat on known species. When the true species is in the label set, summed probabilities are a good measure of how deep to go. Our argument concerns novel specimens. There the flat model's probability sits confidently on a wrong known sibling, so the summed probability at the genus looks high, and the threshold passes the model through to a wrong species. The held-out-species experiment settles this directly. If the threshold baseline's overshoot rate, meaning how often it names a known species for a novel specimen, equals ours, the proposal fails.

Why not just train on partial labels with a hierarchical likelihood, no stop token? This uses the same data and is the most dangerous alternative. It teaches the model that a specimen belongs somewhere under genus G. It never teaches the model that the specimen belongs under none of G's known species, so the mass still has to land on some known child. The partial-label ablation measures exactly this difference. If it closes the gap, the contribution reduces to a data-use recipe, and we will say so.

Why not just use conformal prediction? Its guarantees are attractive. On long tails, however, standard conformal prediction ignores rare classes, while class-wise conformal prediction produces sets of hundreds of candidates (Conformal Prediction for Long-Tailed Classification). Neither gives a single usable lineage. We include it as a baseline, and we treat conformal calibration of our own stop probability as a follow-up rather than a competitor.

Why not just use a nearest-neighbour lookup in a DNA-aligned embedding? CLiBD-HiR-style retrieval is strong when the query has a barcode. Our setting is image-only at test time, where image clusters agree with species only 21% of the time (BIOSCAN-5M). We will still report retrieval with the same encoder and a rank-wise distance cutoff.

Proposed Experiments

BIOSCAN-5M is the main benchmark. It naturally contains partial labels, and its seen, unseen, and novel-genus structure gives held-out taxa. For reference, 1-nearest-neighbour novel-genus assignment reaches 47.03% using DNA, a modality our test-time model does not see. BIOSCAN-1M, using the CLiBD-HiR split, provides a replication. iNaturalist 2018 anchors comparability with Deep-RTC. Because iNaturalist is fully labeled, we create partial labels there by hiding species labels for a random set of held-out species under each genus, and we test on those species.

The metrics are:

  • correctly predicted bits;
  • per-rank accuracy of the stopped node;
  • overshoot rate on held-out species;
  • undershoot rate on known species, meaning stopping above a rank the model gets right;
  • accuracy on known head and tail species, to confirm that tail-oriented changes do not cost head accuracy.

The decisive checks come in three parts.

First, on held-out species, the stop-token model should reduce overshoot relative to the tuned summed-probability threshold and the partial-label ablation while matching them on known species. If overshoot does not fall, the core claim is false.

Second, DNA-derived stop targets should beat annotator-only targets on novel specimens, and annotator-only targets should produce more undershoot on hard-but-known specimens. This pattern would show that the model learns novelty rather than annotator fatigue.

Third, the non-autoregressive twin should be run against the full decoder. We honestly expect them to be close. Either outcome is informative: a tie means the stop outcome, not sequence modelling, is what carries the result.