The classification of local Artinian Gorenstein algebras is equivalent to the study of orbits of a certain non-reductive group action on a polynomial ring. We give an explicit formula for the orbits and their tangent spaces. We apply our technique to analyse when an algebra is isomorphic to its associated graded algebra. We classify algebras with Hilbert function (1, 3, 3, 3, 1), obtaining finitely many isomorphism types, and those with Hilbert function (1, 2, 2, 2, 1, 1, 1). We consider fields of arbitrary, large enough, characteristic.