If introductory formulas are not particular to a story but occur repeatedly, they are probably editorial. If their usage is limited to a particular sugya (logical unit of Talmud discussion) or tractate and they fit in with the general editorial strategies of a particular sugya or tractate, one may assume that the editors of that particular portion of text are responsible for their formulation. If such formulas appear in many different tractates or even different documents, it is likely that they were part of the tradition at a stage prior to its “final” redaction and inclusion into the present literary context.
Catherine Hezser, “Form-Criticism of Rabbinic Literature”, in The New Testament and Rabbinic Literature, eds. Reimund Bieringer, Florentino García Martinez, Dider Pollefeyt and Peter J. Tomson (Leiden & Boston: Brill, 2010), 99.