Let us assume the Gaussian negative log likelihood (like e.g. here https://pytorch.org/docs/stable/generated/torch.nn.GaussianNLLLoss.html)
$\text{Gaussian Negative Log Likelihood} = -\frac{1}{n} \sum_{i=1}^{n} \log\left(\frac{1}{\sqrt{2\pi\hat\sigma^2}} e^{-\frac{(x_i - \hat{\mu})^2}{2\hat\sigma^2}}\right)$
to be minimized by a model, where the estimated mean $\hat{\mu}$ and the estimated variance $\hat{\sigma}^2(x)$ are computed by the model from the features $x$. Groups shall be encoded in the feature vector $x$ (e.g. by one-hot encoding).
Isn't this resulting in "kind of a mixed effect model" (even with instance wise variance if we pass more than the grouping features to the model head which computers the variance estimator)? This mixed effect modeling is indirect because there is no explicit random effects noise term $Zx'$ (like in $y=Ax + Zx'+\epsilon$) which is to be estimated, but instead this noise is adsorbed into a noise $\epsilon'= \epsilon + Zx'$ and the mean of $Zx'$ is adsorbed into the feature vector contribution $Ax$ (due to the one hot encodings of groups in $x$), so we have a model $y =Ax + \epsilon'(x)$ and $\hat{\sigma}^2(x)$ is the estimator of $Var(\epsilon'(x)$)
Am I right with this big picture or am I missing something? (I think that with sufficient care both kinds of models could be made equivalent. At least for Gaussian random effects and if we force $x'$ not to be parametrized by free parameters but to depend on x, I.e. $x'(x)$ ...., but I have not worked out ths details)
Please let me know if the question is clear or if I can clarify it more.