LCLucas Castillo

Lucas Castillo

*This is an algorithmically generated author record based on publicly available information.

Current Organizations / Institutes

The organizations/institutes from the scholar's latest article


Lucas Castillo has a total of 15 co-authors. Here are the top co-authors by number of shared publications:


Latest Publications

  • Open Access

    The samplr package: A tool for modeling human cognition with sampling algorithms

    by Lucas Castillo, Yun-Xiao Li, Adam N. Sanborn

    Many models of cognition have sampling as a central component. Researchers have used them to explain human performance across a wide range of tasks involving perception, probability reasoning, and choice. One family of these models takes inspiration from sampling approaches developed in statistics, either by adjusting samples with prior beliefs or by implementing a sampling algorithm that overcomes the difficulty of independent samples at the expense of autocorrelation. While these models have been successful in modeling human behavior, their adoption has been slowed by the technical difficulties in applying them. Here, we introduce the package, which includes a variety of these algorithms and cognitive models built upon them. We show how models in this package can match qualitative patterns found in human data, and walk readers through examples of how to compare these models quantitatively to human data. This tool aims to make these methods accessible to many more researchers.

  • Open Access

    Belief Elicitation With Random Generation Tasks

    by Pablo León-Villagrá, Lucas Castillo, Johanna K. Falbén, Nick Chater, Adam Sanborn

    Measuring people's beliefs is important for psychology, applied statistics, and AI alignment, yet established elicitation techniques yield only coarse distributional summaries and can introduce systematic biases. Here we propose random generation---asking participants to produce values as unpredictably as possible---as a belief elicitation method. Our approach draws on theories of mental sampling and needs no visual interface. In three preregistered experiments spanning nine domains, we compared random generation to two standard methods: decile elicitation (Experiments~1--2) and likelihood elicitation (Experiment~3). In Experiments~1 and~2, random generation produced distributions that were overall as close or closer to environmental data than decile elicitation, and predicted participants' conditional expectations at least as well. Random generation also captured idiosyncratic distributional features in one of three tested domains, the irregular score structure of NFL games. In Experiment~3, we elicited categorical distributions---participants' beliefs about the popularity of holiday destinations---and assessed whether they could predict participants' conditional judgments in a different domain (holiday flight durations). Random generation again captured environmental regularities comparably to likelihood elicitation for the derived flight-duration distributions, and both methods were similarly effective in capturing people's conditional predictions.Finally, aggregating small groups of participants on average moved the pooled distributions closer to the environment in all three experiments, and predictive accuracy improved at comparable rates for both tasks. These findings establish random generation as a versatile tool for recovering distributional beliefs and a practical complement to established techniques.

  • Open Access

    Generated outcomes in risky choice reveal biased sampling and sequential dependencies

    by Jake Spicer, Yun-Xiao Li, Lucas Castillo, Johanna K. Falbén, C. Stella Qian, Adam N. Sanborn

    Recent decision-making models have explained behaviour using mental sampling mechanisms, but there is still little agreement on the specific sampling process, such as whether sampling rates match true probabilities. Here, we seek to trace the sampling process using generation tasks: in two experiments using general online samples ( N s = 52, 51), participants repeatedly produced potential outcomes from pairs of monetary gambles before choosing between them. Results found over-generation of rarer outcomes and under-generation of common outcomes overall, but not in initial responses, as well as avoidance of direct repetitions. Participants also tended to select options with higher average utility across their responses, implying generations guided choice. These findings suggest systematic biases in the information people may consider before a choice, and the influence that this can have on subsequent decisions, carrying implications for mental sampling models of this behaviour. We thus suggest explicit generation is a valuable method to access underlying choice processes, offering new assessments of existing theories of decision making.

  • Open Access

    Random generation is what comes to mind in naturalistic settings

    by Lucas Castillo, Pablo León-Villagrá, Johanna K. Falbén, Nick Chater, Adam N. Sanborn


  • Open Access

    Does Outcome Utility Bias the Mental Simulations of Risky Events?

    by Yun-Xiao Li, Johanna K. Falbén, Lucas Castillo, Jake Spicer, Jian-Qiao Zhu, C. Stella Qian, Nick Chater, Adam Sanborn

    Does the utility of an outcome influence people's assessment of risk and uncertainty? Prominent theories propose that people rely on mental simulation to evaluate probabilities and risky events, yet prior empirical findings is mixed as to whether and how utility biases this process. Across four experiments (total N=206, with Experiment 4 pre-registered), we tested this question using a random generation paradigm, in which participants mentally simulated gamble outcomes and said them out loud. Then we compared these responses with probability judgments and predictions. While we identified individual differences, the majority of participants exhibited neutrality, with no systematic impact of utility on their sampling distributions. Nevertheless, an optimism subgroup emerged, with a larger proportion of optimistic participants when the monetary context was more salient. Additionally, outcome utilities have similar effects on probability judgments, predictions, and random generation tasks, consistent with the proposal that these tasks are related to each other and may all rely on mental simulation. These findings indicate that utility does not uniformly distort mental simulation, but can do so for a stable subgroup under particular motivational contexts, and they motivate cognitive models that capture both unbiased and optimistic forms of mental sampling.

  • Open Access

    Noise in Cognition: Bug or Feature?

    by Adam N. Sanborn, Jian-Qiao Zhu, Jake Spicer, Pablo León-Villagrá, Lucas Castillo, Johanna K. Falbén, Yun-Xiao Li, Aidan Tee, Nick Chater

    Noise in behavior is often considered a nuisance: Although the mind aims for the best possible action, it is let down by unreliability in the sensory and response systems. Researchers often represent noise as additive, Gaussian, and independent. Yet a careful look at behavioral noise reveals a rich structure that defies easy explanation. First, in both perceptual and preferential judgments sensory and response noise may potentially play only minor roles, with most noise arising in the cognitive computations. Second, the functional form of the noise is both non-Gaussian and nonindependent, with the distribution of noise being better characterized as heavy-tailed and as having substantial long-range autocorrelations. It is possible that this structure results from brains that are, for some reason, bedeviled by a fundamental design flaw, albeit one with intriguingly distinctive characteristics. Alternatively, noise might not be a bug but a feature. Specifically, we propose that the brain approximates probabilistic inference with a local sampling algorithm, one using randomness to drive its exploration of alternative hypotheses. Reframing cognition in this way explains the rich structure of noise and leads to the surprising conclusion that noise is not a symptom of cognitive malfunction but plays a central role in underpinning human intelligence.


  • Open Access

    samplr: Compare Human Performance to Sampling Algorithms

    by Lucas Castillo, Yun-Xiao Li, Adam N Sanborn

  • Open Access

    samplrData: Datasets from the SAMPLING Project

    by Lucas Castillo, Yun-Xiao Li, Adam N Sanborn


  • Open Access

    Explaining the flaws in human random generation as local sampling with momentum

    by Lucas Castillo, Pablo León-Villagrá, Nick Chater, Adam Sanborn

    In many tasks, human behavior is far noisier than is optimal. Yet when asked to behave randomly, people are typically too predictable. We argue that these apparently contrasting observations have the same origin: the operation of a general-purpose local sampling algorithm for probabilistic inference. This account makes distinctive predictions regarding random sequence generation, not predicted by previous accounts—which suggests that randomness is produced by inhibition of habitual behavior, striving for unpredictability. We verify these predictions in two experiments: people show the same deviations from randomness when randomly generating from non-uniform or recently-learned distributions. In addition, our data show a novel signature behavior, that people’s sequences have too few changes of trajectory, which argues against the specific local sampling algorithms that have been proposed in past work with other tasks. Using computational modeling, we show that local sampling where direction is maintained across trials best explains our data, which suggests it may be used in other tasks too. While local sampling has previously explained why people are unpredictable in standard cognitive tasks, here it also explains why human random sequences are not unpredictable enough.