Let $X$ be a regular scheme, flat and of finite type over $Spec(\mathbb{Z})$ (add "projective" if you want). Then the Hasse-Weil zeta function of $X$ is defined as a product over all prime numbers of certain local factors which are rational functions in $p^{-s}$. The local factor at $p$ is the zeta function of the fiber $X\_p$, which is a variety over the finite field $\mathbb{F}\_p$. 


For all but finitely many primes, these local factors should have "similar shape", in some sense. For example, for an elliptic curve, and a good prime $p$, the numerator is a polynomial with coefficients $(1, a\_p, p)$, i.e. all these numerators are exactly the same, except of course that the prime $p$ varies. For the denominators the situation is similar.


If we take a higher-genus curve, or a higher-dimensional scheme, the patterns of the local zeta function coefficients should also in some sense be "uniform in p". But what exactly is the statement in the general case? In what precise sense are the local factors "the same"? 


EDIT: I added some (hopefully clarifying) comments related to point counts under the question as well as under ACL's answer.



Local factors of Hasse-Weil zeta function - what do they have in common?
This is an elaboration on ACL's answer, way too long for a comment, which highlights a technical ingredient (well-known to all experts) that underlies the precise sense in which the $\ell$-adic etale cohomology of the geometric generic fiber provides a "uniformity" in $p$: the good properties of constructible $\ell$-adic sheaves.
In particular, I think it is a mistake to try to understand a precise sense of "uniformity in $p$" by focusing on point-counting: this misses the key structure, as noted in ACL's answer, namely certain $\ell$-adic representations (of the absolute Galois group of $\mathbf{Q}$) which individually are not expressed via point-counting at all (away from misleading special cases such as curves and abelian varieties for which degree-1 cohomology over finite fields contains all of the cohomological information). 


To explain this requires some preparations, hence the length of what follows (which is all standard stuff, but perhaps hard to extract for a non-expert; maybe even what follows is hard to read in parts for a non-expert, but I think it is important to recognize where serious theorems of etale cohomology are doing some work, going beyond the cohomological formula for the zeta function of a single variety over a single finite field). The crux is that the robustness of constructibility provides the magical glue linking behavior at different primes.




---


Literally from the product definition, the zeta function of a separated finite type $\mathbf{Z}$-scheme $X$ is the product $\prod\_p \zeta(X\_{\mathbf{F}\_p}, p^{-s})$ of the zeta functions of the fibers, with ${\rm{Re}}(s)$ is sufficiently large (determined by fiber dimensions alone; see Serre's article in the Purdue conference proceedings on arithmetic geometry from the mid-1960's). By the work of Dwork or Grothendieck-Artin (et al.), the zeta function of any separated scheme of finite type over $\mathbf{F}\_p$ (such as $X\_{\mathbf{F}\_p}$) is a rational function in $p^{-s}$. 


The cohomological formalism provides an "$\ell$-adic" explanation for the rationality of the factor at each prime $p$ in the sense that
for any prime $\ell \ne p$ we have 
$$\zeta(X\_{\mathbf{F}\_p}, t) = \prod\_{i\ge 0} \det(1 - t\phi\_p|
{\rm{H}}^i\_c(X\_{\overline{\mathbf{F}}\_p}, \mathbf{Q}\_{\ell}))^{(-1)^{i+1}}$$
in $\mathbf{Q}\_{\ell}[\![t]\!]$, where the left side is initially just a formal power series in $1 + t \mathbf{Z}[\![t]\!]$ (defined as a product over closed points of $X\_{\mathbf{F}\_p}$) and the rational function over $\mathbf{Q}\_{\ell}$ on the right side might involve internal cancellations among the various determinant polynomials (ruled out for smooth proper $X\_{\mathbf{F}\_p}$ by the Deligne's work on the Riemann Hypothesis, but not otherwise). In other words, the "$\ell$-adic" explanation for rationality rests on the fact that $\mathbf{Q}(\!(t)\!) \cap \mathbf{Q}\_{\ell}(t) = \mathbf{Q}(t)$ inside $\mathbf{Q}\_{\ell}(\!(t)\!)$ (and Dwork's approach provides a variant of that explanation with $\ell=p$). In the displayed product on the right side, $i$ goes up to $2 \dim X\_{\mathbf{F}\_p}$ (which is bounded independently of $p$, and in fact equal to $2 \dim X\_{\mathbf{Q}}$ for all but finitely many $p$).


That was all just setup. Now *fix* a prime $\ell$ and an integer $i \ge 0$. One can ask if there is a finite set $S\_{i,\ell}$ of primes of $\mathbf{Z}$ with $\ell \in S\_{i,\ell}$ such that the polynomials $$R\_{p,i,\ell}(t) = \det(1 - t \phi\_p|{\rm{H}}^i\_c(X\_{\overline{\mathbf{F}}\_p},\mathbf{Q}\_{\ell}))$$
for all $p \not\in S\_{i,\ell}$ are "linked" in the sense that there is a single finite-dimensional continuous $\mathbf{Q}\_{\ell}$-linear representation 
$$\rho\_{i,\ell}: G\_{\mathbf{Q},S\_{i,\ell}} \rightarrow {\rm{GL}}(V\_{i,\ell})$$
of the Galois group over $\mathbf{Q}$ of its maximal extension (inside $\overline{\mathbf{Q}}$) unramified outside $S\_{i,\ell}$ such that
$$\det(1 - t \rho\_{i,\ell}(\phi\_p)|V\_{i,\ell}) = R\_{p,i,\ell}(t)$$
for *all* $p \not\in S\_{i,\ell}$, where $\phi\_p \in G\_{\mathbf{Q},S\_{i,\ell}}$ is a member of the conjugacy class of geometric Frobenius elements at $p$ (all choices giving the same determinant). This would imply in particular that the degree of $R\_{p,i,\ell}(t)$ is the same for all $p \not\in S\_{i,\ell}$, but it is a *much stronger* statement: that $\rho\_{i,\ell}$ would be a kind of "$\ell$-adic glue" which unifies the disparate $R\_{p,i,\ell}(t)$'s coming from the geometric special fibers $X\_{\overline{\mathbf{F}}\_p}$ in varying characteristics $p \not\in S\_{i,\ell}$.


The crux of the matter then is the following fundamental fact: the continuous representation $V\_{i,\ell} := {\rm{H}}^i\_c(X\_{\overline{\mathbf{Q}}},\mathbf{Q}\_{\ell})$ is such a $\rho\_{i,\ell}$, for an appropriate choice of $S\_{i,\ell}$. Why? Here is where one has to use a real theorem, namely the preservation of constructibility of $\ell$-adic sheaves under higher direct images with proper support, coupled with the proper base change theorem. More precisely, if $h:Y' \rightarrow Y$ is any separated map of finite type between noetherian schemes over $\mathbf{Z}[1/\ell]$ and if $\mathscr{F}$ is any constructible $\mathbf{Q}\_{\ell}$-sheaf on $Y'$ (e.g., the constant sheaf $\mathbf{Q}\_{\ell}$) then ${\rm{R}}^i h\_{!}(\mathscr{F})$ is a *constructible* $\mathbf{Q}\_{\ell}$-sheaf on $Y$ whose formation moreover *commutes with any base change* (the latter due to the proper base change theorem). 


The point is that any constructible $\mathbf{Q}\_{\ell}$-sheaf on $Y$ is *lisse* over a dense open $U$ (depending on the sheaf), and hence "is" just a continuous $\mathbf{Q}\_{\ell}$-linear representation of the fundamental group $\pi\_1(U,\eta)$ if $Y$ is *normal* and connected (with geometric generic point $\eta$). In particular, when $Y$ is a connected Dedekind scheme then over $U$ this lisse sheaf is nothing more or less than an $\ell$-adic representation $\rho$ of the absolute Galois group of the function field of $Y$ (i.e., the residue field at the generic point of $Y$) such that $\rho$ is *unramified* at all closed points $u$ of $U$. The Galois representation at $u$ arising from the $u$-stalk of the lisse sheaf coincides with the residual Galois representation arising from $\rho$ on the Galois group at the generic point by virtue of its unramifiedness at $u$ (upon choosing a decomposition group at $u$ in the Galois group at the generic point, which amounts to working with a strict henselization at $u$ inside a separable closure of the function field of $Y$ in order to compute the specialization homomorphism from geometric stalk at $u$ to a geometric generic stalk).




---


For example, take $Y' = X\_{\mathbf{Z}[1/\ell]}$ and $Y = {\rm{Spec}}(\mathbf{Z}[1/\ell])$ and $\mathscr{F} = \mathbf{Q}\_{\ell}$. The above says that there is a dense open subscheme $U\_{i,\ell} \subset {\rm{Spec}}(\mathbf{Z}[1/\ell])$ such that the constructible ${\rm{R}}^i f\_{!}(\mathbf{Q}\_{\ell})$ on ${\rm{Spec}}(\mathbf{Z}[1/\ell])$ has restriction over $U\_{i,\ell}$ that is *lisse*. Letting $S\_{i,\ell}$ be the finite set of closed points of ${\rm{Spec}}(\mathbf{Z})$ complementary to $U\_{i,\ell}$, we have that $\pi\_1(U\_{i,\ell}) = G\_{\mathbf{Q},S\_{i,\ell}}$ (using geometric generic point as base point of $\pi\_1$) and the *lisse* restriction ${\rm{R}}^i f\_{!}(\mathbf{Q}\_{\ell})|\_{U\_{i,\ell}}$ has respective stalks at the chosen geometric generic point and geometric closed point at $p \not\in S\_{i,\ell}$ identified *as Galois modules* (for $\mathbf{Q}$ and $\mathbf{F}\_p$ respectively) with the respective geometric fibral cohomologies $V\_{i,\ell} := {\rm{H}}^i\_c(X\_{\overline{\mathbf{Q}}}, \mathbf{Q}\_{\ell})$ and ${\rm{H}}^i\_c(X\_{\overline{\mathbf{F}}\_p},\mathbf{Q}\_{\ell})$ (recovering in particular that $V\_{i,\ell}$ is unramified at $p$, as we know it must be due to $V\_{i,\ell}$ arising from a $\pi\_1(U\_{i,\ell})$-representation). 


In other words, it is precisely the lisse pullback of ${\rm{R}}^if\_{!}(\mathbf{Q}\_{\ell})$ over ${\rm{Spec}}(\mathbf{Z}\_{(p)})$ viewed as a representation of $\pi\_1({\rm{Spec}}(\mathbf{Z}\_{(p)}))$ which is the "$\ell$-adic glue" that links up the $i$th factor in the $\ell$-adic alternating product formula for $\zeta(X\_{\overline{\mathbf{F}}\_p},t)$ with the single entity $V\_{i,\ell}$ that "doesn't know $p$". And the mechanism of this linkage is that (up to conjugation ambiguity!) we can compute that $\pi\_1$ using geometric base points over *either* the generic or closed points of ${\rm{Spec}}(\mathbf{Z}\_{(p)})$.


So the upshot is that the lisse restriction of ${\rm{R}}^i f\_{!}(\mathbf{Q}\_{\ell})$ over some dense open subscheme of ${\rm{Spec}}(\mathbf{Z}[1/\ell])$ ensures that $V\_{i,\ell}$ as built from the cohomology of the geometric generic fiber (no mention of $p$!) is the origin of "uniformity in $p$" when we stare at the $p$-factors of the zeta function of $X$ for varying $p$ (away from some finite set of primes). Note in particular that the set of "bad" primes here is *not* encoded by geometric means via "good reduction" (a bad notion to consider away from the proper case anyway); it's all about finding a dense open inside ${\rm{Spec}}(\mathbf{Z}[1/\ell])$ over which the constructible ${\rm{R}}^i f\_{!}(\mathbf{Q}\_{\ell})$ has lisse restriction.


Note in particular that each $V\_{i,\ell}$ on its own **does not have anything to do with point-counting** (away from special cases like curves and abelian varieties). It is only the alternating product built from these which is related to point-counting. But it is the $V\_{i,\ell}$'s which are where the action is.




---


The above is thoroughly $\ell$-adic for each $\ell$ separately whereas the zeta functions above do not mention $\ell$, so a truly satisfying sense of "uniformity in $p$" (away from a finite exceptional set) would be given by proving two more things: $U\_{i,\ell}$ is "independent of $\ell$" in the sense that $U\_{i,\ell} = U\_i - \{\ell\}$ for some single dense open $U\_i \subset 
{\rm{Spec}}(\mathbf{Z})$ and that the $V\_{i,\ell}$ for varying $\ell$ constitute a "compatible family" in the sense defined in Serre's book *Abelian $\ell$-adic representations* (here, it would mean that for $p$ corresponding to a closed point of $U\_i$ and any $\ell \ne p$ the characteristic polynomial of $\phi\_p$ on $V\_{i,\ell}$ lies in $\mathbf{Q}[t]$ and is independent of such $\ell$).


If $X\_{\mathbf{Q}}$ were smooth and proper over $\mathbf{Q}$, so $X\_{\mathbf{Z}[1/N]}$ is smooth and proper over $\mathbf{Z}[1/N]$ for sufficiently divisible $N > 0$, then the smooth and proper base change theorems would ensure that we could take $U = {\rm{Spec}}(\mathbf{Z}[1/N])$ and the Riemann Hypothesis would provide the "compatible family" aspect (essentially because it rules out cancellation in the alternating $\ell$-adic formula, combined with the zeta function being unaware of $\ell$). But beyond that case we don't know: "independence of $\ell$" for the characteristic polynomial of Frobenius acting on the $i$th compactly supported $\ell$-adic cohomology of a separated finite type $\mathbf{F}\_p$-scheme is believed to be true but remains an unsolved problem. 


(If you look at the Introduction to deJong's IHES paper on alterations you'll see that he was initially hopeful that his results replacing absence of resolutions of singularities in positive characteristic might have applications to prove new "independence of $\ell$" results, but that this didn't pan out; I am not aware of anyone having made substantial progress on it since that time either, but would be happy to hear to the contrary. Even if we grant resolution of singularities then I don't think an implication is known. In the absence of precise control on weights as the purity provided by RH in the smooth proper case, it is hard to geometrically isolate the contribution in a single cohomological degree from the rest, as the long exact excision sequence associated to a stratification lumps together all cohomological degrees. Deligne's Weil II is very suggestive, but alas I think not enough even assuming resolution.)


