  A classical result in additive combinatorics, which is a combination of
Balog-Szemer\'edi-Gowers theorem and a variant of Freiman's theorem due to
Ruzsa, says that if a subset $A$ of $\mathbb{F}_p^n$ contains at least $c
|A|^3$ additive quadruples, then there exists a subspace $V$, comparable in
size to $A$, such that $|A \cap V| \geq \Omega_c(|A|)$. Motivated by the fact
that higher order approximate algebraic structures play an important role in
the theory of uniformity norms, it would be of interest to find higher order
analogues of the mentioned result.
  In this paper, we study a quadratic version of the approximate property in
question, namely what it means for a set to be an approximate quadratic
variety. It turns out that information on the number of additive cubes, which
are 8-tuples of the form $(x, x+ a,$ $x+ b, x+ c,$ $x+ a + b, x+ a + c,$ $x+ b
+ c, x+ a + b + c)$, in a set is insufficient on its own to guarantee quadratic
structure, and it is necessary to restrict linear structure in a given set,
which is a natural assumption in this context. With this in mind, we say that a
subset $V$ of a finite vector space $G$ is a $(c_0, \delta,
\varepsilon)$-approximate quadratic variety if $|V| = \delta |G|$, $\|1_V -
\delta\|_{\mathsf{U}^2} \leq \varepsilon$ and $V$ contains at least
$c_0\delta^7 |G|^4$ additive cubes. Our main result is the structure theorem
for approximate quadratic varieties, stating that such a set has a large
intersection with an exact quadratic variety of comparable size.
