A simple way to determine the timing of a retrieval is to adjust the retrieval steps. Ram et al. (2023) utilised an approach that involved a prefix encoding to adjust the runtime cost. The prefix encoding of the generated content was constantly recalculated. The choice of retrieval stride is a trade-off between runtime and performance. According to Toolformer (Schick et al., 2024), the search command can be used directly to retrieve useful information when the model needs to retrieve documentation help in the process of generating content. Inspired by this idea, Jiang et al. (2023c) propose two methods for determining the timing of retrieval. The first method involves interrupting the generation of the LM when it encounters a place where a retrieval needs to be performed and then performing the retrieval operation. The second method involves generating a temporary sentence in its entirety.