In this paper, a probabilistic approach is used to derive a kind of abstract candidate for a natural Lagrangian in general relativity. The methods are very general, and the result is in a certain sense unique. However, to turn this abstract Lagrangian into an ordinary one, expressible in terms of the Riemann tensor, is so far an open problem. Some possible cosmological consequences are discussed.