Understanding the drivers of biodiversity change across space and time (beta diversity) remains a central challenge in ecology. The development of robust probabilistic frameworks for modelling beta diversity is therefore crucial for inference and predictive tasks. Recent improvements in beta diversity modelling have focused on predicting community dissimilarity between pairs of sites, but relatively less attention has been paid to compositional uniqueness. Indices of compositional uniqueness, such as the Local Contribution to Beta Diversity (LCBD), are widely used in freshwater ecology as a tool for detecting sites with potentially high conservation value, sites affected by localised stressors, or infer broader ecological processes. However, models that regress LCBD against a set of site-level predictors may overlook a key source of variation in real communities: the change in community composition along environmental gradients. Here, we introduce a multi-level regression framework—Generalized Dissimilarity-Uniqueness Models (GDUM)—that extends previous community dissimilarity models by simultaneously estimating pairwise and site-level effects. Pairwise effects capture gradients of community change that lead to increasing pairwise dissimilarity with increasing distance within those gradients, whereas site-level effects are equivalent to direct effects on uniqueness such as those commonly included in LCBD models. We validate our approach using synthetic data and demonstrate its flexibility in two case-studies from freshwater systems. Specifically, we show how variability in LCBD due to gradients of community change can be quantified, how accounting for such gradients can impact marginal LCBD estimates, and how our approach can be extended to simultaneously model different partitions of beta diversity and account for variability at different scales. By better capturing the mechanisms of biodiversity change, GDUM can help address emerging questions in freshwater ecology and improve the generalizability of findings.