In natural foraging, many organisms seem to perform two different types of motile search: directed search (taxis) and random search. The former is observed when the environment provides cues to guide motion towards a target. The latter involves no apparent memory or information processing and can be mathematically modeled by random walks. We show that both types of search can be generated by a common mechanism in which Lévy flights or Lévy walks emerge from a second-order gradient-based search with noisy observations. No explicit switching mechanism is required -instead, continuous transitions between the directed and random motions emerge depending on the Hessian matrix of the cost function. For a wide range of scenarios the Lévy tail index is α = 1, consistent with previous observations in foraging organisms. These results suggest that adopting a second-order optimization method can be a useful strategy to combine efficient features of directed and random search.Many organisms must actively search for resources in order to survive and produce offspring. Foraging theory examines the various search strategies implemented by organisms depending on their abilities and the environments in which they live. In directed search, greater involvement of sensory and information processing abilities enable more complicated strategies. In contrast, in the boundary case of a memoryless and senseless forager, the only option is to wander randomly in the environment (random search). Even in this case, however, different strategies exist, depending on the character of the random motion. A natural candidate model for the random strategy is Brownian motion that describes a wide range of natural phenomena, including the movement of inanimate particles under thermal noise. A prominent feature of Brownian motion is the linear growth of the variance of the position with time. However, empirical data indicate that for organisms the observed growth is often faster. Lévy walks (LWs) [1][2][3] [22][23][24][25][26][27][28][29][30][31][32] and alternative superdiffusive models [33]. These observations have led to the so-called Lévy flight optimal foraging hypothesis, which states that LFs (or LWs) represent evolutionary adaptations due to their distinct advantages over other random search strategies [22,34,35].Recently this view has been disputed because none of the mentioned organisms is senseless and all of them are able to perform some forms of directed search (taxis), for example T cells and isolated bacteria perform chemotaxis [36][37][38][39][40], whereas fruit flies perform phototaxis [41], geotaxis [42], and chemotaxis [43,44]. Indeed, a number of studies have shown that characteristics of LFs and LWs may emerge naturally on large scales from more realistic case specific models of movement [45], including simple deterministic and semideterministic walks in complex environments [35,[46][47][48][49][50], self-avoiding random walks [51][52][53], diffusion with a timevarying diffusion constant [54][55][56], and a multiplicative, selfac...