The Lagrangian of general relativity is linear (first order) in Riemann curvature. The cosmological term, if included, is zero order in Riemann curvature.
From an effective field theory point of view, all symmetry-permitting action terms should be included. Nothing prevents us from adding terms with 2 or more Riemann curvatures.
These high order terms are usually suppressed at low energies so that they are not relevant under normal circumstances. That being said, they could play an important role at the early stages of our universe involving high energy effects.
Are these high order terms rightfully taken into account for the prevalent cosmological models (especially the inflationary model which is supposedly applicable to early universe)?
And for that matter, one can even entertain terms with multiple torsion tensors to account for the spin current's effect (in addition to the energy-momentum current) on space-time for early universe.