Beta-diversity buﬀers fragmented landscapes against local species losses

Agricultural expansion has markedly reduced forests and reconﬁgured landscapes. These changes incur a well-known detrimental impact on the biodiversity of local forest patches, but the eﬀects on species persistence at entire landscapes comprised of multiple patches are debated. We investigated how regional diversity is aﬀected by habitat loss, fragmentation, and cattle grazing, and how species respond to deforestation both locally and regionally. We also investigated how the heterogeneity in species distribution (beta-diversity) buﬀers landscapes against local diversity losses. The vast majority of the 251 ant species found in our study were negatively aﬀected by both habitat loss and cattle at local forest patches, drastically reducing diversity at these patches compared to pristine forests. Despite local declines in diversity, however, heavily fragmented landscapes could still retain most species due to the high heterogeneity in species distribution. We found that beta-diversity is the main component of regional diversity. Results from several studies suggest that this component is maximized when remnant primary habitats in a landscape are spread across vast areas. Although preserving local diversity may be important for the adequate functioning of the ecosystem locally, our results indicate that the maintenance of many small forest patches in a landscape can buﬀer regional biodiversity against local species losses. Our results suggest that even small forest remnants in otherwise deforested landscapes can prevent most regional-scale species extirpations, and therefore also merit conservation eﬀorts. Abstract Agricultural expansion has markedly reduced forests and reconﬁgured landscapes. These changes incur a well-known detrimental impact on the biodiversity of local forest patches, but the eﬀects on species persistence at entire landscapes comprised of multiple patches are debated. We investigated how regional diversity is aﬀected by habitat loss, fragmentation, and cattle grazing, and how species respond to deforestation both locally and regionally. We also investigated how the heterogeneity in species distribution (beta-diversity) buﬀers landscapes against local diversity losses. The vast majority of the 251 ant species found in our study were negatively aﬀected by both habitat loss and cattle at local forest patches, drastically reducing diversity at these patches compared to pristine forests. Despite local declines in diversity, however, heavily fragmented landscapes could still retain most species due to the high heterogeneity in species distribution. We found that beta-diversity is the main component of regional diversity. Results from several studies suggest that this component is maximized when remnant primary habitats in a landscape are spread across vast areas. Although preserving local diversity may be important for the adequate functioning of the ecosystem locally, our results indicate that the maintenance of many small forest patches in a landscape can buﬀer regional biodiversity against local species losses. Our results suggest that even small forest remnants in otherwise deforested landscapes can prevent most regional-scale species extirpations, and therefore also merit conservation eﬀorts.


Introduction
Forests have been severely reduced worldwide as a result of agricultural intensification (Curtis et al. 2008).This process leads to the rapid decline in species diversity locally (Chase et al. , 2020), but the effects of landscape change on regional biodiversity are still unclear.Within a region, declines in diversity are consistently associated with the reduction in overall habitat amount (Fahrig, 2003).However, declines in forest cover are usually coupled with habitat fragmentation (i.e. the subdivision of habitat into isolated patches), and the impact of this break-up (fragmentation per se ) on species diversity remains highly debated (Fletcher et al. , 2018;Fahriget al. , 2019).While local forest patches lose species as a result of forest breakup (Fletcher Jr. et al. , 2018;Chaseet al. , 2020), landscapes comprised of groups of isolated patches often have higher diversity than a continuous forest with the same amount of habitat (Fahrig, 2003;Fahrig et al. , 2019).Identifying the drivers of these contradictory results can ensure that optimal conservation strategies are designed to maximize local and regional diversity.
Differences between local and regional effects of habitat change are mediated by the poorly-explored effects of fragmentation on beta-diversity (Solar et al. 2015;Socolar et al. , 2016;Chetcutiet al. , 2021).Betadiversity represents the change in species composition identity among forest patches and, combined with the number of species found in local patches, determines the overall number of species found in a landscape or region.When local diversity is low, diversity in the landscape might still be high if there is sufficient heterogeneity in species distributions (Solar et al. 2015;Lasky & Keitt, 2013;Fahrig, 2020;Chetcuti et al. , 2021).For example, if a patch contains a single species, a landscape comprised of 10 forest patches may still retain 10 species if each patch contains a distinct species.It is well known that heterogeneity in species distributions increases regional diversity (Loreau et al. , 2003;Lasky & Keitt, 2013).Numerous studies have demonstrated that modified landscapes can maintain a significant level of diversity in species composition (Jakovac et al. 2022;Solar et al. 2015;Carvalho et al. 2022;Przybyszewski et al. 2022;Ramírez-Ponce et al. 2019).However, this outcome is highly variable and contingent upon factors such as species dispersal capacity and habitat configuration (Arnillas et al. 2017).Most of these studies have not quantified whether this landscape-scale heterogeneity can effectively compensate for local biodiversity losses (but see Solar et al. 2015).Research is needed to elucidate how the configuration of forest fragments in a landscape (e.g.several small or few large) is associated with species heterogeneity and, consequently, how it affects regional diversity (Socolar et al. , 2016).
Regions represented by habitat patches that are far apart, as in fragmented landscapes, usually covers a gradient of environmental conditions (Tuomisto et al. , 2003).This environmental variation may allow species with distinct adaptations to survive in distinct areas (Lasky & Keitt, 2013).However, to maintain viable populations, many species require large areas containing sufficient resources (Pe'eret al. , 2014) and, in many cases, that are highly connected (Baguette & Schtickzelle, 2006), both of which are reduced when small patches are scattered across a landscape.Therefore, as fragmented landscapes promote heterogeneity in species distributions, which increases regional diversity, individual fragments lose species, which potentially reduces regional diversity.Depending on the balance between heterogeneity (beta-diversity) and local diversity (alpha-diversity), several forest fragments can sustain more or fewer species than a single large forest containing the same amount of habitat (Lasky & Keitt, 2013;Arnillas et al. 2017).This balance is likely to depend on the spatial scale under consideration (broader scales = more heterogeneity) and the size and quality of the remaining fragments (more intact = higher local diversity).Although empirical studies have investigated the effects of habitat loss, fragmentation, and habitat quality on local (alpha) and beta-diversity independently, their relative contributions to regional diversity are yet to be estimated.
We investigated how both local and beta diversity contribute to regional diversity in a highly fragmented Amazonian landscape comprised of a wide gradient of forest remnants ranging in size from 2.4 to 14,481 ha, some of which could be accessed by bovine cattle in adjacent pastures.By partitioning landscape diversity into its alpha and beta components, and comparing groups of small vs. large fragments, we show 1) how landscape-scale diversity is distributed into its alpha/beta components, 2) how the relative contribution of these components change along a gradient from a single small fragment to a vast tract of continuous forest, and 3) how habitat quality (cattle presence) affects local and regional diversity.To estimate these effects considering missing species and sampling effects, we used occupancy models that control for biases in species detection for both measures of species local diversity and beta-diversity.All analyses were performed using data on leaf-litter ants, a hymenopteran group that is particularly vulnerable to changes in microclimatic conditions caused by cattle trampling and edge effects.Our analyses integrated both community-level and individual species responses.We also explored the connection between species responses and two important traits: species body mass and foraging strategy.These traits have often been associated with invertebrate responses to changes in habitat (Hoffman and Andersen 2003;Andersen 2018;Carvalho et al. 2022).Material and Methods The study was carried out in the Alta Floresta region, state of Mato Grosso, Brazil (09°53'S, 56°02'W, Fig. 1).This region is part of the "deforestation arc" of southern Amazonia, a heavily fragmented region that originally consisted of pristine, unbroken tracts of Amazonian forest (Fearnside, 2005).Deforestation in the region occurred in the early 1980s with the conversion of forests into farms and ranches (Michalski et al. 2008).The landscape is comprised of a few continuous forest areas, a few large forest remnants, and many small variable-sized remnants typically surrounded by cattle pastures (Fig. 1).The climate in the region is tropical humid (Aw classification in the Köppen system; Alvares et al. , 2013) with a mean annual rainfall of 2,350 mm, mean annual temperature of 26.5°C, and marked dry (May-September) and wet seasons (October-June; RADAMBRASIL 1983).
Ants were systematically sampled from March to July 2008 within 24 forest patches.Two patches were represented by pristine forests that had not been disturbed by fires and timber extraction.The 22 remaining patches were selected to cover a gradient of patch sizes (range from 2.4 to14,480.5ha) and presence of cattle (n=7) while spaced apart by a minimum of 5 km.Fragments diverging in patch size were randomly selected in the landscape to avoid spatial autocorrelation in this predictor variable.
In each patch, ants were collected using 10 Winkler sacks placed at the center of each fragment (total of 240 Winkler extractions).Winkler extractors were placed 10-m apart from each other, and for each Winkler extraction we removed 1m 2 of leaf litter from the soil.The litter was sieved and placed in bags and the soil fauna removed from the extractor after 72 h (Bestelmeyer et al. , 2000).In addition, we collected ants manually for 10 min (100 min per patch) at each extraction site, immediately after removing the leaf litter from the soil.To avoid introducing sampling biases during manual collections, sampling was performed by the same collectors.Ants were then separated from the overall extracted material at the Laboratório de Biologia, UNEMAT, Alta Floresta, and identified in the Laboratório de Ecologia de Interações Inseto-Planta, UFMT, Cuiabá, using specialized bibliography (Fernandez, 2003;Baccaro et al. 2015).All voucher specimens were deposited at the Zoology Museum of the University of São Paulo (MUZUSP).
Although we followed a standardized sampling protocol across all fragments, it is important to note that some small fragments may have been better represented in our data due to potential differences in species detectability among patches.To address this potential sampling bias, we conducted tests and applied statistical corrections using occupancy models.These models account for species detection as a function of, for example, fragment size (see Data Analysis section below).
In each patch, we also quantified predictor variables including forest patch area, cattle presence, distance to the nearest fragment, and the habitat amount throughout the surrounding landscape.Patch area was obtained from Landsat images  using the Fragstats 3.0 software (McGarigal et al. , 2002).For the two continuous forests, we assigned an area value that was one order of magnitude larger than the size of the largest forest patch, measured on a log 10 scale.This approach is commonly employed in studies investigating species-area relationships (e.g.Palmeirim et al. 2021;2022).Management history and cattle intrusion were obtained from direct observations of cattle presence within the patches, indirect evidence (dung and tracks), and information provided by local landowners.Bovine cattle were more frequently found in smaller fragments (correlation coefficient: r = -0.54).Consequently, it is likely that cattle had access to a significant portion of the fragments wherever they were present.Distance to the nearest fragment was calculated based on the distance between the centroids of any two fragments and the minimum distance between fragments.Habitat amount at the time of sampling was measured from pre-classified forest cover maps obtained from MapBiomas (Mapbiomas, 2021) as the percentage of forest cover within a buffer area from the centroid of each patch.We used several radial buffer distances (100m, 200m, 500m, 1000m, and 1500m) to calculate the habitat amount across the landscape (Fahrig et al. 2020).Habitat amount measured at the 500-m buffer maximized the correlation between observed species richness and habitat amount and was therefore used in subsequent analyses.Our analysis did not reveal any significant association between distance to the nearest fragment and species richness, regardless of whether we used raw, semi-log, or logtransformed variables in simple or multiple regression models (partial).As a result, we did not include this predictor in our occupancy models.It is worth noting that centroid distance and minimum distance between fragments showed a high correlation (r = 0.97) and yielded similar results, with slightly stronger but non-significant effects observed when using centroid distance.
We associated species response to habitat change with species traits (see below).We obtained species body mass and foraging mode at the genus level from the Global Ants Database (Parr et al. , 2017).Whenever possible, preference was given to traits available from the same species found within our study area or a congener from elsewhere in the Amazon.

Data analysis
Because ants are colonial organisms and the presence of multiple individuals in a single trap likely represents individuals from a single colony, only the presence or absence of each ant species was quantified in each Winkler sack (frequency of occurrence ranging from zero to 10 in each patch).For each patch, we created a patch × species matrix (26 rows × 251 columns) filled with species occurrence frequencies in Winkler extractors.These data were used to estimate the occupancy and detection of individual species in each patch and the effect of predictor variables (patch and landscape area, connectivity, and cattle presence) on species detection and occupancy.Because true presence (occupancy) of individual species in patches determines community-level patterns (e.g.species richness), we indirectly estimated the effects of the covariates on local ant diversity (alpha), and on the composition of ant species (beta-diversity) through their effects on individual species occupancy.If all species were perfectly detected, this approach would provide the same results as regression models directly associating species diversity with predictor variables.
Occupancy models require a hierarchical structure for data sampling and organization.In our study, we estimated species occupancy at the patch level (higher level) and used replication within patches (Winkler extractions; lower level) to estimate detection probabilities.It is important to acknowledge that at the replication scale (within a patch), detection can be influenced by various factors, such as species rarity, aggregation patterns, and behaviour (Iknayan et al. , 2014).Therefore, differences in detectability among patches are not solely attributable to sampling limitations but also reflect biological processes.
Similar to other studies using occupancy models with temporal bird surveys (Guillera-Arroita et al. 2018) or camera traps for mammals (Van der Weyde 2018), which do not incorporate covariates at the replication level, our model assumes that all Winkler extractions within a patch (but not among patches or species) have a similar probability of capturing a given species.This assumption is reasonable considering that leaf-litter ants have a limited foraging range (Holldobler and Wilson 1990) and that the similarity between neighbouring extractions as close as 5 meters apart is extremely low (Fisher et al. 1990).

Multi-Species Occupancy Model (MSOM)
Species occupancy and detection were estimated using Multi-Species Occupancy Models (MSOM; Iknayan et al. , 2014).Similarly to single-species occupancy models (MacKenzie et al. , 2002), MSOM uses repeated surveys (Winkler extractions) to tease apart the real absences of species from detection errors (false zeroes), and therefore estimates species presence even in those patches where they went undetected.By estimating detection and occupancy rates for each species, the model provides unbiased estimates of species presence in each patch (unlike naive/raw observations of presence; Tingley et al. , 2020).MSOM also combines the detection and occupancy of all species into a single model and, similarly to mixed-effects models, estimates the variability among species (random effects) in their detection, occupancy, and the effect of covariates on these rates.By estimating the overall parameters (fixed effects; hyperparameters) and the variability in model coefficients across species in the community (random effects) in a single model, MSOMs provide (1) more precise estimates of species detection and occupancy of individual species compared to simpler single-species models (rare species borrow strength from common species), (2) high-precision estimates of the number of missing species in each patch and regionally (alpha and gamma richness estimators; Tingley et al. , 2020), and (3) correct measures of similarity in species composition (Jaccard) while taking into account imperfect detection (beta-diversity estimator; see Chao et al. 2005 for the implications of imperfect detection on beta-diversity).
To estimate the number of missing species across the landscape (gamma richness estimator), we used a data augmentation approach by adding 300 species with zero occurrences in the data (Iknayan et al. 2014).These represent species potentially present at the landscape that went completely missing in the study due to detection errors.As the number of missing species estimated by the model was much lower than the 300 additional species included (see Results), the inclusion of more than 300 species did not change the results.
In addition to using the MSOM, we also conducted Mixed-Effects Models using species presences/absences within patches as the response variable.These models used raw data assuming no detection errors.The predictor variables included patch size, landscape area, connectivity, and cattle presence.Species were included as random factors for intercepts and all slopes.Most of the model results were qualitatively similar to the MSOMs, with species consistently showing positive associations with habitat patch area.For a few species that exhibited distinct patterns in the mixed-effects models, we ran single-species occupancy models.However, we did not find significant and distinct results from the MSOM, which indicates that differences among occupancy models (including MSOM) and raw-data models (Mixed-Effects models) arise primarily from changes in detectability among patches rather than true changes in occupancy.Given that the MSOM provides corrected estimates of diversity and occupancy, even for rare and unobserved species, we only present results from this model in the main text (see Fig. S1 for results of mixed-effects models).
Parameter estimation -Bayesian sampling MSOM was implemented using Bayesian statistics in the JAGS language (Plummer & others, 2003).Bayesian models take prior probabilities (beliefs; priors) of each parameter (e.g.occupancy of a species in a patch) and use the observed data to update these probabilities -posterior probabilities, thereby generating a distribution of probabilities for each parameter of interest.This differs from traditional maximum likelihood estimators, which provide a single best-fit estimate.Null models/hypotheses and p-values do not exist in Bayesian statistics.
To define a threshold for "significance", we calculated the Highest Density Interval (HDI) for each model parameter (e.g. the parameter defining the effect of habitat amount on species occupancy).HDIs were calculated as the interval where 95% of parameter posterior probability lies.We also defined a Region of Practical Equivalence (ROPE), ranging from -0.1 to 0.1, to determine the parameter space where an effect would be weak/equivalent to zero from a biological perspective.All comparisons of HDI and ROPE were performed using the coefficients obtained with the standardized predictor variables.Based on HDI and ROPE, three possible outcomes were defined for the effect of each predictor variable (see Fig. S2): 1) No effect, when HDI is completely within the Region of Practical Equivalence; 2) Lack of support, when HDI partially overlaps the Region of Practical Equivalence; 3) Evidence of effect, when HDI lies completely outside the Region of Practical Equivalence.
In our data, the [-0.1; 0.1] limits of ROPE indicate that the area effect was considered "significant" only if species occupancy increases or decreases at least 0.00268 with 1-ha of additional patch area at the steepest part of the Species-Area Relationship (assuming S = cA z ).Similarly, an absence of practical effect occurs when the effect is weaker than this 95%-probability threshold.Regarding diversity, these intervals would represent an increase or decrease in 16% in species richness comparing the smallest (2.4 ha) to the largest patch ( 144,805 ha).This interval is conservative considering most of the conservation implications of the results, and therefore "significant" effects represent strong associations with a high degree of certainty.We also include in results and discussion the exact number of species estimated to be gained or lost with the change in patch area or cattle intrusion, and provide the exact estimate whenever possible.
To estimate parameters, we calculated the posterior probability of parameters as: In this equation, y represents the observed data (counts of individual species at each individual Winkler extractor), L(y | Ψ, p) represents the likelihood function, and P(Ψ) and P(p) denote the prior distributions for occupancy and detection rates.The likelihood function is defined as: where N represents the number of patches surveyed, m is the number of Winkler extractors per patch (m = 10 for all patches), and P(z|Ψ) is the probability of the latent variable z that defines the true occurrence of a species per patch: The joint posterior probability captures the simultaneous estimation of both occupancy and detection rates based on the observed data.The species-specific occupancy probability (Ψ) and detection probability (p) for species s at a given fragment i depend on the effect of environmental covariates: The priors for the species-specific coefficients associated with the occupancy probability (Ψ) and detection probability (p) are assumed to follow Gaussian distributions with overall means and standard deviations: These priors reflect the expected values and variability of occupancy and detection rates across species (random effects).On the other hand, the hyperpriors (fixed effects) capture the overall patterns across species by specifying the prior distributions for the overall mean of the occupancy probability.The hyperpriors provide a way to incorporate prior knowledge or assumptions about the underlying patterns in occupancy and detection across the entire species assemblage.All model priors were defined as non-informative/flat priors (no prior expectation on model parameters, totally informed by the data): Posterior probabilities were calculated using three Monte Carlo Markov Chains (MCMC) with 50,000 steps each.The chains were initiated at different parameter values and chain convergence was checked by visual inspection and using the Gelman-Rubin statistic (Gelman & Rubin, 1992; convergence in parameters with R-hat lower than1.05).To remove the effect of initial parameters on the final estimates, a burn-in phase of 5,000 steps was run in each chain.The three chains were run in parallel (simultaneously in three computer cores) with different random number seeds.
All predictor variables were standardized (mean = 0, sd = 1) before analyses.Patch area was log-transformed before standardization and analyses.Untransformed measures of habitat amount (forest cover within a buffer) were more strongly correlated with the observed species richness, so these variables were not logtransformed (but log transformation provided almost identical results; results not shown).Because patch size, forest cover, and cattle presence were highly correlated with each other (r > 0.7), we present results using area and cattle in the same model and also each of these variables separately.Using non-standardized predictor variables produced qualitatively the same results (Fig. S3 in Supporting Information).We present the results using standardized predictors in the main text to allow for direct comparisons of the magnitude of effect directly based on the coefficients.

Effects on individual species
On the basis of MSOMs, we obtained detection, occupancy, and the effect of predictor variables on detection and occupancy for each species.We modeled individual species responses to each predictor as a random effect, centered around a community-wise mean.To illustrate the consistency or variability of these responses across species, we present the standard deviation of the random effects around the parameter estimates in the results.This allows us to showcase how species' responses may be consistent or variable in relation to the predictor variables.In all models, species responses to habitat loss and other predictors was highly variable (see Results).To estimate how species traits are associated with their detection, occupancy, and responses to covariates (i.e.why some species are more common and/or more affected by habitat loss than others), we ran separate regressions and analyses of variance (ANOVAs) associating species body mass and foraging strategy (predictor variables) with species detection, occupancy, and their responses to environmental predictors.Here, individual species, rather than forest patches, represent units of analysis.
Regressions and ANOVAs were run using Bayesian statistics using a similar setup to the occupancy models described above.Species traits were not directly incorporated into MSOMs to facilitate model convergence.

Alpha, beta, and gamma diversities
In each patch, species richness was estimated as the sum of individual species occupancies obtained from MSOMs (alpha-diversity; sum of rows in the estimated species x patch matrix).Regional species richness (gamma-diversity) was calculated as the sum of all species occupancies regionally (number of species with at least one occurrence in the estimated species x patch matrix).We measured beta-diversity for each pair of patches using the turnover component of the pairwise Jaccard similarity index (Baselga 2010), which was calculated using the bias-corrected occupancy matrix obtained from MSOM (i.e.presences corrected for imperfect detection).The Jaccard similarity index is measured as the percentage of shared species between a pair of patches, which is likely to be grossly underestimated using raw occurrence data because many shared species are rare and go undetected in at least one of the sites in a pairwise comparison (Chao et al. , 2005;Chiuet al. , 2014).Moreover, the classic Jaccard index results from differences in species richness (nestedness) and true species turnover between any two patches (Baselga, 2010).The turnover component represents species replacements (beta-diversity) and was the only pairwise metric used (but see Supporting Figures for further details and comparisons with classic metrics).
To estimate the effect of predictor variables on alpha-diversity, we correlated species richness with the predictor variables.These correlation coefficients were used to measure the strength of the association, and the posterior probabilities of the correlation coefficient were used to assess the "significance" of this association.
To estimate the effect of predictor variables on pairwise beta-diversity, we created pairwise environmental distance matrices to represent the predictors of species turnover.These matrices were created by calculating pairwise differences for each predictor variable across all patches (e.g. two cattle-trampled patches have a difference of zero for cattle intrusion).These pairwise differences were then correlated with the pairwise turnover of the Jaccard similarity index using a multiple regression of distance matrices (similarly to Mantel tests; Tuomisto & Ruokolainen, 2006).Similarity in species composition is usually strongly associated with geographic distance (Nekola & White, 1999), thus distances separating patches were included as a predictor of the Jaccard index in all beta-diversity models along with differences in patch area, cattle intrusion, connectivity, and habitat amount.Because our study was conducted on a single landscape, gamma diversity across the entire landscape was represented as a single value, which cannot be directly used as a response variable in statistical models.
Although the association between alpha-or beta-diversity and predictor variables informs the degree to which these variables affect regional/landscape diversity, they fail to reveal the relative contribution of each component to regional diversity or how these contributions change with the amount of habitat across the landscape or the size of individual patches.Therefore, to determine if the effect of fragmentation on betadiversity can compensate for losses in alpha-diversity within patches one should investigate the combined contribution of alpha and beta-components (Socolar et al. , 2016).
To understand the combined contribution of alpha-and beta-diversity to regional/gamma diversity with increasing spatial scales (scaling relationship), we ordered each patch from smallest to largest.We then sequentially grouped subsequent patches and calculated the maximum and average patch diversity (alpha) and overall/landscape diversity (gamma).Gamma diversity increases when either alpha-diversity increases or species composition diverges between patches (beta-diversity).Beta-diversity can be calculated using the additive (gamma = alpha + beta) or multiplicative (gamma = alpha × beta) partitioning of gamma diversity (Jost 2007).We used additive diversity partitioning to estimate the absolute number of species added by beta-diversity to the regional diversity with increasing habitat amount across the landscape, and multiplicative partitioning to estimate therelative contribution of beta-diversity to regional diversity.Species diversities (alpha, beta, and gamma) were calculated for each of the MCMC runs of MSOM, generating a distribution of values and density intervals for these diversity components and their scaling relationships (posterior probabilities).
The sequential grouping of patches allowed us to create cumulative areas and estimate diversities at each grouping of patches.By doing so, we were able to examine how alpha and beta-diversities changed from a single small forest fragment to the entire landscape, capturing the effects of habitat expansion and increasing spatial scale.

Species-Area Relationship (SAR) and landscape configuration
We did not only estimate the contribution of species turnover to gamma diversity but also compared the relative contribution of smaller patches to regional diversity based on the Species-Area Relationship (SAR).
To do this, we used the model proposed by Arnillas et al. (2017) to compare the observed SAR with the expectation based on a unitary community, assuming free species dispersal and no spatial segregation.This allowed us to assess how the presence of smaller patches influenced regional diversity compared to the theoretical expectation under idealized dispersal and spatial conditions.This comparison is summarized by R, the relative difference between the observed and expected SAR: In this equation, forest parches are sorted from largest to smallest; p i represents the probability of a patch having a species that is absent from larger patches; c is a constant; z is the species-area exponent; and A i represents patch area.The numerator represents the number of species in a region with the observed SAR, and the denominator represents the expected number of species based on a uniform distribution of species across the landscape.c and z were estimated using a linear regression between the species richness (log S) and patch area (log A).
The R values range from R<1 when communities are nested (smaller patches have a subset of species from continuous forests), R = 1 when small and large communities are equivalent (small areas can still add species due to area effects), to R>1 when smaller patches have a distinct set of species and add more species than would be expected by chance based on landscape area alone (Arnillas et al., 2017).

Results
We found a total of 251 ant species, which represented about 85% of the diversity estimated across the entire study region (HDI range = [294,327]; Fig. 2A).Approximately 45% of all species were observed at individual patches (observed range = [37, 80]; estimated range = [84, 177]; Fig. 2B-D).The large number of unobserved species, especially in individual patches, results from low detection of most ant species at individual Winkler extractors (Fig. 3A).Due to the larger number of patches and extractors across the entire landscape, the chance of detecting a rare species at least once increases with greater sampling effort (e.g. if Mycetomoellerius sp.6, one of the rarest species, is present, detection changes from ˜1% at the Winkler extractor scale to ˜9% at the patch scale, and to ˜89% at the landscape scale).Even when considering detection errors, most species were rare across the landscape and occurred in fewer than 50% of all forest fragments (occupancy < 0.5 in Fig. 3B).These results demonstrate that any naïve counting of species (without the use of occupancy models or other corrections) would find more species at the landscape scale than at the local patches due to detection issues alone, even if no real changes in diversity occurred.Estimates of regional species richness using the 500-m buffers or cattle intrusion as predictors in occupancy models provided almost identical results.Therefore, we were unable to detect an effect of the surrounding habitat amount on local diversity above and beyond what would be predicted by patch area alone (or the Species-Area Relationship).One additional species was estimated to be undetected in the landscape when cattle was used as a predictor when comparing with model with area as a predictor.Using the same sampling protocol, species were easier to detect in the smaller patches (i.e.smaller patches tend to more easily represented).

Species responses to patch area, habitat loss, and cattle
Overall species occupancy consistently increased with both patch area (Fig. 3D; Fig. S4D) and habitat amount (Fig. S5D; S6D) but decreased in patches trampled and herbivorized by cattle (Fig. S7D; S8D).Although patch area and cattle were correlated and their effects were difficult to separate, area and cattle were still associated with a decrease in species occupancy when an independent effect of each variable was examined in the same model (partial effects; Fig. S9).Moreover, the effect of cattle on overall species occupancy was slightly stronger than that predicted by patch area alone -cattle reduced overall species occupancy by ˜14%, compared to a ˜12% decrease by a corresponding reduction in patch area.
The positive effect of patch area on occupancy was highly consistent among ant species (low variation across species/random effects in Fig. S10D), but we could not determine with high certainty whether or not ant species varied in their response to habitat amount (Fig. S11D) and cattle (Fig. S12D).We were unable to find any effect of species traits on their occupancy (Fig. S13A;C) or on species responses to predictors.When present, small-bodied ants were easier to detect in Winkler extractors than large-bodied ants (Weber's length; Fig. S13B-D).

Habitat loss, cattle, and community-level patterns
Species richness increased with both forest patch area (Fig. 2B) and habitat amount (Fig. 2D) and decreased with cattle intrusion (Fig. 2C).The effect of cattle is likely to be underestimated when species detection is not taken into account: when using occupancy models, cattle presence was estimated to locally extirpate an average of 26 ant species, whereas a naïve species count would estimate a reduction of only 14 species.
Due to the relatively high number of missing species due to sampling effects (low detection), pairs of patches were estimated to be more similar to each other in species composition than a naïve measure of species similarity (Fig. S14).Unexpectedly, the pairwise similarity in species composition was positively associated with geographic distance (Fig. 4A), and differences in patch size (Fig. 4B) and habitat amount (Fig. 4C).We did not find evidence that differences in cattle intrusion affected the similarity in species composition (Fig. 4D).When using raw (uncorrected) similarities, the effect of geographic distance was qualitatively similar, whereas no effects of patch size and habitat amount could be detected (Fig. S15).Cattle was only weakly associated with species similarity when the Jaccard index was measured using raw data (r 2 = 0.04 for the turnover component; Fig. S15).

Geographic scaling of diversity
Species richness across the entire landscape increased with the cumulative amount of habitat (as all patches were sequentially summed; Fig. 5A).However, small patches contributed disproportionately to this increase because they typically added distinct sets of species to the regional pool (high beta-diversity; steep increase in the left region of Fig. 5A and 5B).Landscape diversity resulted mostly from heterogeneity in species composition among patches, rather than from the local diversity observed within individual patches (Fig. 5B-D; compare blue and green circles in Fig. 5D).Although local diversity in small fragments was lower than that in larger fragments (Fig. 5B), small patches greatly differed in composition and added new species to the regional pool (Fig. 5C).Beta-diversity rapidly increased with additional habitat at low values of overall habitat amount in the landscape (Fig. 5C).When the number of species added by beta-diversity reached an asymptote, additional species could still be added to the landscape by adding large fragments with high local-diversity (Fig. 5A).However, this increase was relatively small compared to gains due to the betadiversity among small fragments.Beta-diversity was therefore the main component of regional diversity in virtually all possible scenarios (Fig. 5D).
When comparing the SAR with the expectation based on an unitary community, we estimated an R value of 3.44, indicating that smaller patches contributed a significantly higher number of species to the regional diversity than what would be expected based on area alone.

Discussion
Agricultural expansion in the humid tropics, most of which at the expense of primary forest cover, has led to unprecedented habitat fragmentation.Even in remaining forest fragments, the indirect effects of overhunting (Peres 2001), wildfires (Cochrane and Laurance 2002), and other anthropogenic disturbances often exacerbate the detrimental impacts of forest loss and fragmentation (Laurance and Peres 2006).Although these negative impacts on local diversity have been extensively studied (Decaëns et al. , 2018;Franco et al. , 2019;Chaseet al. , 2020), and their general effects are corroborated here, previous results obtained from local forest patches are insufficient to understand patterns of biodiversity loss at entire landscapes and inform optimal land-use strategies.
Considering the scale of local forest patches, our models predict that the occupancy of virtually all ant species decreases when forest patches are reduced and cattle gain access to forest fragments.Qualitatively, these results are in line with previous studies suggesting a strong reduction in local species diversity with the reduction in patch size (Chase et al. , 2020), habitat amount surrounding patches (Fahrig, 2003;Fahrig et al. , 2019), and with agricultural intensification (Laurance et al. , 2012;Decaëns et al. , 2018).However, there are three important findings in our study that challenge the perception of these effects on biodiversity.First, our results suggest that the effects of habitat loss and cattle intrusion on patch-scale diversity have been largely underestimated.This occurs because most species are rare and difficult to detect, especially in larger patches (Fig. 3A), so their declines are overlooked in terms of both individual species or entire communities.In absolute numbers, diversity tends to be underestimated in vast pristine areas of primary habitat because they contain a large proportion of undetected species.Using the same sampling protocol in all patches does not guarantee that species occupancy can be directly compared.Detection errors are common in many taxa, including vertebrates (Ruiz-Gutiérrez et al. 2010) and plants (Chen et al. 2013), and studies investigating differences in individual species occurrences or diversity should use methods that take detectability and differences in sampling sufficiency into account (Chaoet al. , 2009;Chase et al. , 2020).
Second, we demonstrate that forest remnants accessed by cattle, which in southern Amazonia typically lack barbed-wire fences that are expensive to implement and maintain, can experience sharp declines in species diversity (Fig. 2C).The impact of habitat change on diversity will therefore depend not only on the amount of habitat lost but also on the protection level of the remaining fragments (Franco et al. , 2019).Although cattle presence was correlated with area (smaller fragments were more frequently accessed by cattle) we found an independent effect of cattle intrusion and this effect was stronger than that predicted by area reduction alone.Moreover, due to the high correlation between fragment size, cattle access, and the relative amount of forest edges, it is plausible that diversity declines typically attributed to a loss in patch area is at least, if not primarily, driven by the proportional increase in cattle access or other factors associated with forest edges (Lasmar et al. , 2021).
Finally, our results demonstrate that, in addition to the local diversity within individual patches, differences in species identity among patches (i.e.beta-diversity) needs to be explicitly considered to understand the effect of habitat change on landscape diversity.Despite the drastic erosion in local species diversity following habitat loss and cattle disturbance as discussed above, protecting multiple patches with distinct community composition can counteract these losses and still ensure that most species are able to persist regionally.
Many previous studies on land cover change, which are largely influenced by the metapopulation (Hanski & Ovaskainen, 2000) and island biogeography paradigms (MacArthur & Wilson, 1967), have investigated species responses to habitat loss ("island area") and isolation (habitat subdivision) using local habitat patches as units of analysis (Fletcher et al. , 2018;Chase et al. , 2020).These studies usually suggest that conservation must be focused on large and highly connected forest areas because, in a pairwise comparison where the same amount of habitat is selected in both large and small patches, large patches protect a disproportionately larger number of species (Diamond, 1975;Chase et al. , 2020).We agree that this should remain an important conservation strategy if either only a single forest fragment is available to be preserved or the entire landscape is compositionally homogeneous.However, these studies often ignore the high heterogeneity in species identity observed in fragmented landscapes (beta-diversity: Lasky & Keitt, 2013;Fahrig, 2020, Jakovac et al. , 2022;Carvalho et al. , 2022;Przybyszewski et al. , 2022;Ramírez-Ponce et al. , 2019), which we found to be the main contributor to regional diversity (Fig. 5D; see also results from Solar et al. 2015).We found that the increase in landscape diversity compared to what is found in local patches does not result only from the fact that larger landscapes host more habitat area, but because small fragments add species heterogeneity.Our results indicate that this heterogeneity can be maximized when the landscape is comprised of many forest patches spread across the wider landscape, which explains why fragmented landscapes -which are typically dominated by many small fragments (Taubert et al. 2018) -often contain more species than a single tract of continuous forest containing the same amount of habitat (Fahrig, 2003(Fahrig, , 2020)).Several previous studies have found high species turnover in fragmented landscapes (Jakovac et al. , 2022;Solaret al. , 2015;Carvalho et al. , 2022;Przybyszewskiet al. , 2022;Ramírez-Ponce et al. , 2019).Here, we further provide evidence to support that this turnover is sufficiently high to counterbalance the majority of local species losses resulting from habitat loss and the presence of cattle.
Although beta-diversity is the leading component of regional diversity in fragmented landscapes and maximizes regional diversity, it is important to note that (1) landscape-scale habitats loss is still a major cause of species declines, and (2) we do not infer a causal relationship between habitat fragmentation and betadiversity.When habitat amount increases across the landscape, additional species are preserved (Fig. 5A).If this increase is achieved by adding several small patches, large numbers of species can be retained because each new habitat adds distinct sets of species to the regional species pool (increase in beta-diversity; Fig. 5C).Therefore, habitat amount increases both alpha and beta-diversities.In spite of the species surplus added by beta-diversity when several small fragments are maintained (higher than expected by the Species-Area relationship; R > 1), the break-up of habitat is unlikely to be the main cause of this beta-diversity.When the landscape is comprised of several forest patches, these patches tend to be far apart thereby experiencing divergent environmental conditions, which naturally increases beta-diversity (Tuomisto et al. , 2003).The natural balance between colonization and extinction, which is influenced by local habitat conditions, is the underlying factor behind the observed species turnover in fragmented landscapes (Lu et al. , 2019).In this study, we lack temporal data required to directly estimate how colonization and extinction events are specifically altered within local fragments (MacKenzie et al. , 2003).Nonetheless, it is likely that local extinction rates increased with habitat loss, consequently leading to a reduction in species occupancy (Fahrig et al. , 2022).Although fragmentation itself is likely to influence these processes and beta-diversity (Fahrig et al. , 2022), it is highly probable that areas containing multiple small fragments were already characterized by some degree of beta-diversity prior to habitat loss and fragmentation, so beta-diversity can be pervasive even if colonization-extinction rates do not change.
Contrary to expectations, we did not observe the negative association between beta-diversity and geographic or environmental distances.However, we believe that this could be attributed to several factors, including the specific history of habitat change, the distribution of habitat types, and other unmeasured variables within our sampling region.Our study region is a complex edaphic mosaic situated near the transition zone between the Cerrado and Amazonia biomes, and it is possible that even distant patches shared similar natural vegetation types (see similar results in Cáceres et al. 2014).Additionally, some patches in the core area of the region (Fig. 1) may have shared a similarly older history of land use that we were unable to assess in this study.These factors may have influenced observed patterns of beta-diversity and the lack of a clear association with geographic and environmental distances.Unmeasured environmental variables may differ between the sampled fragments, so that any increase in the overall number of fragments (regardless of size and fragmentation status) also increases the chance of accommodating distinct species.At broader geographic scales (e.g. the Amazon basin), beta-diversity almost always increases with either geographic or environmental distance (Tuomistoet al. , 2003), and setting-aside environmentally heterogeneous landscapes is likely to be an important conservation strategy (Lasky & Keitt, 2013;Socolar et al. , 2016;Fahrig, 2020).If landscape scale beta-diversity results mostly from the natural distribution of species along environmental gradients, then heterogeneous landscapes must be prioritized for conservation.For instance, Tuomisto et al. (2003) showed that soil nutrient levels in the Amazon play a crucial role in driving natural changes in floristic composition.This has also been observed in various plant and animal taxa at broad geographic scales (Dambros et al., 2020).Collectively, these studies suggest that variation in soil nutrients have a significant influence on the composition of plant and animal communities in Amazonia and potentially other regions.
Identifying the drivers of beta-diversity is important to understand how landscape diversity changes under several scenarios.Habitat subdivision, croplands, roads, railroads, and urban areas may create additional environmental heterogeneity that disrupts species movements.Therefore, these landscape elements have the potential to alter regional diversity through their simultaneous effects both on alpha-and beta-diversity.It is well known that habitat area and connectivity increases local diversity (Lasky & Keitt, 2013), but factors that homogenize the environment (McKinney, 2006;Gámez-Virués et al. , 2015) or amplify the movement of species (Lasky & Keitt, 2013;Chaseet al. ) could potentially counteract these increases by reducing betadiversity.This study lacked the necessary data to unravel the complex ecological processes that contribute to the high observed heterogeneity in species composition.Consequently, we were unable to fully explain why such landscapes can harbor more species compared to a single large fragment of the same size (SS > SL; Fahriget al. , 2022).Understanding the dynamic processes of differential colonization and extinction in continuous versus fragmented landscapes, as well as the roles of habitat history, species adaptations, and dispersal, would likely require surveying multiple landscapes, including data on species movement and extinction risks (Fahrig et al. , 2022).Nonetheless, our study demonstrates that in a fragmented landscape, the high heterogeneity in species composition plays a critical role in maintaining regional diversity, even in the face of species loss within local remnants.This highlights the importance of considering landscapescale processes and heterogeneity in understanding biodiversity persistence in fragmented landscapes.The advantages of a conservation strategy at landscape to regional scales need to be evaluated taking into account the effects of multiple factors on both alpha-and beta-diversity and the relative importance of these components to regional diversity.
In several of the world's terrestrial biomes, especially tropical forests, anthropogenic grazelands reduce natural ecosystems in any landscape while allowing cattle to move into, overgraze and trample habitat remnants, all of which can reduce local species diversity.Nevertheless, in many areas where a mosaic of forest, croplands, and rangelands persist, multiple natural fragments are typically spared across the landscape (Hendershot et al. , 2020).Our results suggest that a considerable amount of the total biodiversity is likely to have been preserved in those fragments because they greatly differ in species composition (Fig. 5C).In this study, ˜88% of all species found across the entire landscape could be found in only 14 fragments ranging from 2.4 to 87 ha, most of which were penetrated by cattle.Although some species may be extirpated due to deforestation and patchy species distributions may impair the proper functioning of the ecosystem or services provided by biodiversity, the remaining small forest remnants could still act as an insurance policy that ensured some of the native biodiversity and ecosystem functions can be restored at sites where they had been lost.Some studies suggest that natural habitats should be embedded within agropastoral landscapes to maximize biodiversity conservation (Kremen & Merenlender, 2018;Hendershotet al. , 2020).Our results demonstrate that this may be possible for most of the arthropod fauna if a minimum amount of habitat and heterogeneity in species distributions are preserved.

Conclusion
Forest habitat loss, fragmentation, and conversion into cropland and exotic pastures have detrimental effects on local diversity whether we consider individual species or entire communities.However, preserving only a few large intact forest patches will not protect all species from extinction.At an entire region, species diversity results mostly from changes in species identity among forest patches, which only occur when multiple forest areas are preserved.In fragmented landscapes, most of the remaining patches are small and individually host a low diversity (Diamond, 1975;Chase et al. , 2020).However, these patches greatly differ in species identity (beta-diversity) and this heterogeneity can compensate for much of the local diversity loss.Collectively, multiple forest fragments can often preserve a disproportionate fraction of species diversity compared to a single continuous forest with the same area (Fahrig, 2003;Lasky & Keitt, 2013;Fahrig et al. , 2019).Although we have not been able to estimate the contribution of unsampled forest remnants or how the processes of colonization and extinction affect regional diversity, our results suggest that preserving several small patches, and consequently the overall beta-diversity, will be highly beneficial to regional diversity.The similarity in species composition was measured as the turnover component of the pairwise Jaccard similarity index (Baselga et al. 2010) using the estimated species occurrences (presence-absence matrices) from MSOM.Thin regression lines represent associations in each of 1,000 species presence/absence matrices obtained from 1,000 MCMC samples (Posterior).Bold line represents the median expected association from all MCMC samples.In D, gray circles represent pairs of patches with cattle present (difference of zero), whereas blue circles represent pairs of patches in which cattle was absent in at least one of the sites (absentabsent and absent-present).Contrary to expectations, similarity in species composition did not necessarily increase between sites that were far apart, or differing in habitat area.
Figure 5. Increase in regional diversity (gamma; A), maximum patch diversity (alpha; B), and species heterogeneity (beta; C) with cumulative landscape area and relative contribution of alpha and beta diversity to gamma diversity (D).The contribution of beta diversity in D was measured using the multiplicative (black) and additive (blue) partitioning of gamma diversity.In the additive partitioning, average alpha diversity was subtracted from gamma diversity.Alpha and beta diversities were then divided by gamma diversity to obtain a proportion (green and blue lines sum up to 1).In D, most species in a region come from differences in species identity among forest patches (blue), rather than from the higher average number of species in individual patches (green).Straight blue lines represent the habitat amount threshold that maximizes the contribution of beta-diversity in a region.After this threshold is reached, regional diversity increases almost exclusively by the addition of larger fragments with high local diversity (low gain obtained by preserving additional small fragments (increase in B and stable in C).Solid dots represent patches where cattle was present.

FiguresFigure
FiguresFigure1.Location of the study region in the southern Amazon and sampling sites within the 'Deforestation Arc' of Amazonia.Green areas in the inset map show remaining forest cover across the region.In each patch, leaf-litter ants were sampled both manually and using 10 Winkler extractions (see Methods).
Figure1.Location of the study region in the southern Amazon and sampling sites within the 'Deforestation Arc' of Amazonia.Green areas in the inset map show remaining forest cover across the region.In each patch, leaf-litter ants were sampled both manually and using 10 Winkler extractions (see Methods).

Figure 2 .
Figure 2.Estimated landscape diversity (A) and the effects of area (B), habitat amount (C), and cattle intrusion (D) on local patch diversity.Diversity estimated using the MSOM is much higher than that naïvely observed.Patch area, habitat amount, and cattle presence are similarly associated with differences in species richness.

Figure 3 .
Figure 3. Differences in species median detection (A) and occupancy (B), and effect of patch area on species detection (C) and occupancy (D).Detection and occupancy represent median posterior probabilities obtained from MCMC samples within a MSOM framework.In A and B, species are ordered based on their occupancy and detection rates from highest to lowest.Bars represent the range in detection and occupancy in patches within the landscape.In C and D, each line represents one of the observed ant species.Most species are difficult to detect in a patch, and detection along the habitat area gradient was variable across species (increases or decreases in C).All species increase in occupancy towards large and pristine forests (D).Ψ and p denote occupancy and detection, respectively.

Figure 4 .
Figure4.Changes in the similarity in species composition with the increase of geographic distance (A), differences in local habitat area (B), differences in overall habitat amount (C), and differences in cattle presence (D).Both response (y-axis) and predictor (x-axes) variables were measured for each pair of patches.The similarity in species composition was measured as the turnover component of the pairwise Jaccard similarity index(Baselga et al. 2010) using the estimated species occurrences (presence-absence matrices) from MSOM.Thin regression lines represent associations in each of 1,000 species presence/absence matrices obtained from 1,000 MCMC samples (Posterior).Bold line represents the median expected association from all MCMC samples.In D, gray circles represent pairs of patches with cattle present (difference of zero), whereas blue circles represent pairs of patches in which cattle was absent in at least one of the sites (absentabsent and absent-present).Contrary to expectations, similarity in species composition did not necessarily increase between sites that were far apart, or differing in habitat area.