﻿# RealMLP ensemble aggregation: averaging probabilities differs from averaging logits

Preserve RealMLP ensemble aggregation order and output meaning when migrating predictors or comparing releases, because probability and logit averages are different numerical operations.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-realmlp-probability-versus-logit-ensemble-aggregation/
Language: en

## Identify the aggregation boundary

A classification ensemble can combine raw logits before softmax or average member probabilities. These procedures are generally different because softmax is nonlinear. The [PyTabKit release guide](https://raw.githubusercontent.com/dholzmueller/pytabkit/main/README.md) documents a change in the default aggregation behavior for multi-member neural ensembles. A migration should therefore preserve the resolved aggregation rule, not assume that unchanged member weights guarantee unchanged application probabilities.

## Follow the probability-average branch

The [original training module](https://raw.githubusercontent.com/dholzmueller/pytabkit/main/pytabkit/models/training/lightning_modules.py) reshapes member predictions into an ensemble axis. In its probability-average branch, it applies softmax to each member, averages probabilities and returns a log representation for downstream handling. That returned tensor should not be mistaken for the original unconstrained logits of one member. Preserve the consumer's expected representation through every subsequent normalization or calibration step.

## Keep the alternative branch explicit

The same module supports averaging before softmax according to configuration. The [standalone prediction code](https://raw.githubusercontent.com/dholzmueller/pytabkit/main/pytabkit/models/realmlp/train.py) exposes the corresponding distinction. A serving adapter must not apply one method during validation and another after export. Comparing only final hard labels can miss probability changes important to log loss, threshold-based decisions or a calibrated confidence display, even when the most likely class stays the same.

## Preserve member and class axes

Ensemble members, input rows and classes occupy different dimensions. Averaging the wrong axis can return valid-looking normalized output attached to the wrong statistical object. The [vectorized RealMLP guide](/journal/fg2-realmlp-vectorized-folds-ensemble-model-axis-memory/) explains the extra model axis. Keep external class labels aligned with columns, and distinguish averaging within a split's member group from combining separately trained fold models at another stage of the application.

## Validate probabilities as well as labels

Use member predictions with deliberately different confidence levels to distinguish the two aggregation procedures. Compare the intended reference probabilities, normalization and hard labels, then evaluate independent calibration and task quality. The [RealMLP implementation guide](/journal/fg2-realmlp-standalone-original-implementation-defaults-missingness/) provides release context. A useful report identifies aggregation order and representation at each boundary, rather than interpreting unchanged accuracy or a successful exported tensor shape as proof that the same predictive distribution survived the migration.
