Let $k$ be a finitely generated field, $\ell$ a prime different from the characteristic of $k$, $S$ a $k$-variety, and $\mathcal{V}$ a lisse $\ell$-adic sheaf on $S$. Fix an algebraic closure $\bar{k}$ of $k$. Let $\bar{S}$ (resp. $\bar{\mathcal{V}}$) denote the pull-back of $S$ (resp. $\mathcal{V}$) to $\bar{k}$.


Every point $\bar{s} \in \bar{S}$ with image $s \in S$ gives rise to a Galois representation $\mathrm{Gal}(\bar{s}/s) \to \mathrm{GL}(\bar{\mathcal{V}}\_{\bar{s}})$. Denote the connected component of the Zariski closure of the image of this representation with $G\_{\bar{s}}$.


My previous question was heavily confused:



> 
> ~~Are the linear algebraic groups $G\_{\bar{s}}$ the geometric fibres of an affine group scheme $G \to S$?~~
> 
> 
> 


~~I have some slight doubts, because $G \to S$ cannot be flat (the dimensions of the $G\_{\bar{s}}$ may vary). But I think this is just because I have never worked with non-flat group schemes before, so I hope for a positive answer!~~


Of course the groups $G\_{\bar{s}}$ are groups over $\mathbb{Q}\_{\ell}$, and not over $\bar{s}$. So now for a more vague question:



> 
> The algebraic groups $G\_{\bar{s}}$ are in some sense parameterised by $S$ (or $\bar{S}$). Is there any way to make this notion more precise? Can we express $(G\_{\bar{s}})\_{\bar{s}}$ as a family of algebraic groups?
> 
> 
> 



Does a lisse $\ell$-adic sheaf give rise to an affine group scheme?
I don't really know how to answer the question in a meaningful way, but let me make a few remarks about the parallel situation for Hodge theory. Suppose that
$S$ is a smooth complex algebraic variety, and that $V$ is a polarizable variation of Hodge structure over $S$ (e.g. $V= R^if\_\*\mathbb{Q}$ for a smooth projective family $f:X\to S$). Attached to each $s\in S$, one has the Mumford-Tate group $MT\_s$ of the Hodge structure $V\_s$. What one can say about this family is that there exists a countable union of proper algebraic subvarieties $Z\subset S$ such that $G\_s$ is the same for all $s\in S-Z$. This follows from a theorem of Cattani, Deligne, Kaplan together with some standard arguments. 
The argument can repeated to obtain a partition $S-Z, Z-Z', \ldots$ of $S$, so that $MT\_s$ is constant along strata, but can "jump" across strata. I'm not sure how to make that the last part precise.


At least conjecturally, in the geometric case, the $\mathbb{Q}\_\ell$ points of $MT\_s$ are same as the $G\_s$ in your question. So I guess this is some sort of an answer.


