  Let $UT_2$ be the algebra of $2\times 2$ upper triangular matrices over a
field $F$ of characteristic zero. Here we study the generalized polynomial
identities of $UT_2$, i.e., identical relations holding for $UT_2$ regarded as
$UT_2$-algebra. We determine a set of two generators of the $T_{UT_2}$-ideal of
generalized polynomial identities of $UT_2$ and compute the exact values of the
corresponding sequence of generalized codimensions. Moreover, we give a
complete description of the space of multilinear generalized identities in $n$
variables in the language of Young diagrams through the representation theory
of the symmetric group $S_n$. Finally, we prove that, unlike in the ordinary
case, the generalized variety of $UT_2$-algebras generated by $UT_2$ has no
almost polynomial growth; nevertheless, we exhibit two distinct generalized
varieties of almost polynomial growth.
