<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>sampling algorithms &#8211; Science</title>
	<atom:link href="https://scienmag.com/tag/sampling-algorithms/feed/" rel="self" type="application/rss+xml" />
	<link>https://scienmag.com</link>
	<description></description>
	<lastBuildDate>Thu, 15 Oct 2026 06:41:29 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.3</generator>

<image>
	<url>https://scienmag.com/wp-content/uploads/2024/07/cropped-scienmag_ico-32x32.jpg</url>
	<title>sampling algorithms &#8211; Science</title>
	<link>https://scienmag.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">73899611</site>	<item>
		<title>New R Package Brings the Sampling Algorithms Behind Human Thinking to Every Lab</title>
		<link>https://scienmag.com/new-r-package-brings-the-sampling-algorithms-behind-human-thinking-to-every-lab/</link>
		
		<dc:creator><![CDATA[Glenn Wilkins]]></dc:creator>
		<pubDate>Thu, 15 Oct 2026 06:41:29 +0000</pubDate>
				<category><![CDATA[Psychology & Psychiatry]]></category>
		<category><![CDATA[anchoring effect]]></category>
		<category><![CDATA[approximate Bayesian computation]]></category>
		<category><![CDATA[autocorrelated Bayesian sampler]]></category>
		<category><![CDATA[autocorrelation]]></category>
		<category><![CDATA[Bayesian modeling in psychology]]></category>
		<category><![CDATA[Bayesian sampler]]></category>
		<category><![CDATA[Behavior Research Methods]]></category>
		<category><![CDATA[Cognitive modeling]]></category>
		<category><![CDATA[computational models of overconfidence]]></category>
		<category><![CDATA[confidence intervals]]></category>
		<category><![CDATA[diagnostics for autocorrelation in sampling]]></category>
		<category><![CDATA[fast R tools for Bayesian cognitive models]]></category>
		<category><![CDATA[Hamiltonian Monte Carlo for psychology research]]></category>
		<category><![CDATA[human decision-making sampling algorithms]]></category>
		<category><![CDATA[Markov chain Monte Carlo]]></category>
		<category><![CDATA[Markov chain Monte Carlo methods for cognitive science]]></category>
		<category><![CDATA[probability estimation drift analysis]]></category>
		<category><![CDATA[probability judgment biases]]></category>
		<category><![CDATA[probability judgments]]></category>
		<category><![CDATA[R package]]></category>
		<category><![CDATA[R package for cognitive sampling models]]></category>
		<category><![CDATA[sampling algorithms]]></category>
		<category><![CDATA[sampling-based explanations of human biases]]></category>
		<category><![CDATA[samplr]]></category>
		<guid isPermaLink="false">https://scienmag.com/?p=273003</guid>

					<description><![CDATA[Researchers at the University of Warwick have released samplr, an open-source R package that makes Markov chain Monte Carlo sampling algorithms and sampling-based cognitive models accessible for modeling human probability judgments, estimates, choices, and confidence.]]></description>
										<content:encoded><![CDATA[<p>Why do people make systematic mistakes when judging probabilities? Why do repeated estimates of the same quantity drift in strange, long-range patterns? Why are we overconfident, and why does a choice we just made bias the very next number we produce? A growing body of research argues that all of these quirks share a single root cause: the human mind does not compute exact answers, but instead draws samples from internal probability distributions. Now, a team at the University of Warwick has released a software package designed to make that idea testable by anyone who can run R.</p>
<p>The package, called samplr, was introduced by Lucas Castillo, Yun-Xiao Li, and Adam N. Sanborn in the journal Behavior Research Methods. It bundles together a family of Markov chain Monte Carlo algorithms, including Metropolis–Hastings and Hamiltonian Monte Carlo, alongside cognitive models built on top of them, such as the Bayesian sampler and the autocorrelated Bayesian sampler. The core routines are written in C++ for speed, running up to four times faster than equivalent MATLAB code and far faster than base R. Diagnostic functions for analyzing autocorrelation and power spectral density round out the toolkit. The authors hope it will do for sampling-based models of cognition what packages for drift diffusion models did for sequential sampling: turn a technically demanding modeling approach into something ordinary labs can adopt.</p>
<p>The intellectual backdrop is a decades-long convergence between statistics and psychology. Statisticians use sampling algorithms for a practical reason: approximating complex probability distributions that cannot be computed exactly. Calculating a posterior distribution requires dividing by a normalizing constant, the sum of prior-times-likelihood across every possible event, which quickly becomes intractable. Markov chain Monte Carlo sidesteps this by requiring only ratios of probabilities, in which the constants cancel out. The price is autocorrelation: successive samples are dependent, and results depend on the starting point. Strikingly, those same dependencies appear in human behavior, in repeated judgments and in the anchoring effect, which is precisely why psychologists began proposing that the brain itself might run something like MCMC.</p>
<p>The package demonstrates its power on classic findings. Consider probability judgments, where people famously commit the conjunction fallacy, rating the probability of event A as smaller than that of A and B together, and violate binary complementarity, with estimates of A and not A summing to more than one. Two leading models, probability theory plus noise and the Bayesian sampler, make identical predictions for the mean of people&#8217;s judgments but differ in how judgment variance relates to the mean. In the Bayesian sampler, fewer samples pull the endpoints of the mean-variance curve toward the center, while in probability theory plus noise the endpoints stay fixed. samplr provides functions to compute the diagnostic Z identities and to simulate the Bayesian sampler directly, letting researchers distinguish the two accounts with their own data.</p>
<p>Another striking phenomenon is 1/f noise in cognition. In the 1990s, researchers found that when people repeatedly reproduce a duration, their errors are not independent but show long-range autocorrelations, with a power spectral exponent between white noise and Brownian noise. Within a sampling framework, these repeated estimates can be seen as raw samples drawn without aggregation into a decision. Work by the Warwick group compared Metropolis–Hastings, Metropolis-coupled MCMC, and Hamiltonian Monte Carlo and found that the multiple-chain algorithm best reproduced the long-range structure of human estimates. samplr implements all of these algorithms, so users can generate sample sequences and run the same spectral analyses on them.</p>
<p>Random generation offers a third case study. Asked to produce random heights as if drawing from a bag, people deviate systematically: distances between consecutive items are too small, and repetitions almost never occur. In recent experiments, participants generated random heights under Gaussian and Uniform conditions, and six sampling algorithms were pitted against the data. The winner was MCREC, an algorithm combining the gradient-based proposals of Hamiltonian Monte Carlo with the multiple chains of Metropolis-coupled MCMC and a sense of momentum that adds autocorrelation to the direction of proposals. All six algorithms are available in samplr through functions beginning with sampler_, and they can target mixtures or fully custom distributions.</p>
<p>The package is not limited to the authors&#8217; own work. The article walks through a case study from research on learning across the lifespan, in which participants placed a bucket to catch bags dropped by a helicopter hidden in clouds, never knowing whether an odd drop reflected ordinary fluctuation or a genuine change in the helicopter&#8217;s position. A model from that study explained perseveration and anchoring biases by assuming people draw posterior samples with Metropolis–Hastings in resource-limited chunks, stopping early when the samples do not change the current belief. The authors show that samplr&#8217;s sampler_mh function could implement the same model, and on their machine it ran 31 times faster than the original code, illustrating how a shared, optimized code base can accelerate modeling across research groups.</p>
<p>Perhaps the most ambitious component is the autocorrelated Bayesian sampler, or ABS, which uses a single sampling process to explain probability judgments, point estimates, confidence intervals, choices, confidence judgments, and response times. For two-alternative choices, sampling continues until the accumulated difference in evidence between options crosses a threshold; raising the threshold yields the classic speed-accuracy trade-off, with slower but more accurate responses. The same framework predicts over-precise confidence intervals, because limited samples underrepresent distributional tails, and the resolution of confidence, because errors tend to arise when evidence stays balanced for a long time, inflating the sample count and lowering confidence. It even explains how choices bias later estimates: when the chosen value sits near the stimulus distribution, estimates are pushed away from it, the repulsion effect, while a distant value pulls estimates toward it, the anchoring effect. Both emerge from the same autocorrelated chain starting at the choice value.</p>
<p>Qualitative matches are only the beginning, and samplr also supports quantitative model comparison through likelihood-free inference. Because these models have no tractable likelihood function, the package leans on approximate Bayesian computation: simulate data from candidate models, compress each dataset into summary statistics, and keep only simulations close enough to the observed data. In the random generation example, rejection ABC with 10,000 simulations per model gave overwhelming support to MCREC, with a Bayes factor above 400 over the next best model. A more sophisticated variant using random forests, implemented in the external abcrf package, weighs summary statistics by their predictive value and needs fewer simulations; it pushed the Bayes factor above a thousand. The authors stress the accompanying Bayesian workflow: checking that priors produce sensible data and that the procedure can recover known models before trusting its verdicts.</p>
<p>The broader promise is unification. Sampling algorithms have already been applied to phenomena from low-level perception to causal reasoning, and they are not confined to simple representations; text descriptions could be mapped into semantic vector spaces and sampled using probabilities from a neural network. If a single sampling process, as ABS proposes, can quantitatively account for judgments, choices, response times, and confidence across tasks, psychologists will gain far more insight than separate models for separate response modes ever could. samplr is free, open-source software available on CRAN, with datasets from the group&#8217;s experiments in a companion package, and the authors are actively inviting feature requests and contributions from the community.</p>
<p><strong>Subject of Research:</strong> An R software package implementing statistical sampling algorithms and sampling-based cognitive models of human judgment and decision-making</p>
<p><strong>Article Title:</strong> The samplr package: A tool for modeling human cognition with sampling algorithms</p>
<p><strong>Article References:</strong> The samplr package: A tool for modeling human cognition with sampling algorithms. (n.d.). <a href="https://doi.org/10.3758/s13428-026-03188-6" rel="noopener noreferrer">https://doi.org/10.3758/s13428-026-03188-6</a></p>
<p><strong>Image Credits:</strong> AI Generated</p>
<p><strong>DOI:</strong> <a href="https://doi.org/10.3758/s13428-026-03188-6" rel="noopener noreferrer">10.3758/s13428-026-03188-6</a></p>
<p><strong>Keywords:</strong> samplr, sampling algorithms, Markov chain Monte Carlo, Bayesian sampler, cognitive modeling, probability judgments, autocorrelation, anchoring effect, confidence intervals, approximate Bayesian computation, R package, Behavior Research Methods</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">273003</post-id>	</item>
		<item>
		<title>MIT&#8217;s HardFlow algorithm steers generative AI around hard constraints without retraining</title>
		<link>https://scienmag.com/mits-hardflow-algorithm-steers-generative-ai-around-hard-constraints-without-retraining/</link>
		
		<dc:creator><![CDATA[Reid Dalton]]></dc:creator>
		<pubDate>Sun, 04 Oct 2026 19:03:24 +0000</pubDate>
				<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[advanced AI algorithms for safety-critical applications]]></category>
		<category><![CDATA[AI safety in industrial automation]]></category>
		<category><![CDATA[collision avoidance in robotics]]></category>
		<category><![CDATA[constraint satisfaction]]></category>
		<category><![CDATA[diffusion and flow-matching models]]></category>
		<category><![CDATA[diffusion models]]></category>
		<category><![CDATA[flow-matching models]]></category>
		<category><![CDATA[generative AI]]></category>
		<category><![CDATA[generative AI safety]]></category>
		<category><![CDATA[hard constraints]]></category>
		<category><![CDATA[HardFlow]]></category>
		<category><![CDATA[HardFlow algorithm for constraint satisfaction]]></category>
		<category><![CDATA[Mit]]></category>
		<category><![CDATA[MIT AI research]]></category>
		<category><![CDATA[optimal control]]></category>
		<category><![CDATA[physical limit adherence in AI systems]]></category>
		<category><![CDATA[physical process control AI]]></category>
		<category><![CDATA[real-time constraint handling in AI]]></category>
		<category><![CDATA[retraining-free generative model modification]]></category>
		<category><![CDATA[robotics]]></category>
		<category><![CDATA[safety-critical AI]]></category>
		<category><![CDATA[sampling algorithms]]></category>
		<category><![CDATA[trajectory and signal generation accuracy]]></category>
		<category><![CDATA[trajectory optimization]]></category>
		<guid isPermaLink="false">https://scienmag.com/?p=235422</guid>

					<description><![CDATA[MIT researchers have developed HardFlow, a plug-and-play algorithm that lets pretrained generative AI models satisfy strict safety and physical constraints while improving solution quality, without any retraining.]]></description>
										<content:encoded><![CDATA[<p>Generative artificial intelligence has become remarkably good at producing answers that are almost right. Diffusion models paint images that closely match a text prompt, and flow-matching models generate trajectories, designs, and signals that land near what a user asked for. But in the settings where AI could matter most — a robot navigating a crowded factory floor, a controller managing a physical process, a vision system guiding machinery — almost right can be dangerously wrong. A path that is nearly collision-free is still a collision. A control input that approximately respects a physical limit can still break the machine. A new algorithm developed at the Massachusetts Institute of Technology, called HardFlow, tackles precisely this gap, and it does so without requiring the underlying generative model to be retrained at all.</p>
<p>The research, led by senior author Navid Azizan, the Alfred H. and Jean M. Hayes Career Development Associate Professor in MIT&#8217;s Department of Mechanical Engineering and the Institute for Data, Systems, and Society, appears in the journal IEEE Transactions on Pattern Analysis and Machine Intelligence. Azizan, who is also a principal investigator in the Laboratory for Information and Decision Systems, worked with lead author Zeyang Li, a graduate student in mechanical engineering and LIDS, and Kaveh Alim, a graduate student in IDSS and LIDS. Their central insight is deceptively simple: when it comes to satisfying hard constraints, what matters is the model&#8217;s final output, not the intermediate steps along the way. Yet most existing methods do exactly the opposite, clamping the model at every step of generation and, in doing so, strangling its ability to find good solutions.</p>
<p>To understand why this matters, it helps to look at how pretrained generative models actually work. Models such as Stable Diffusion and FLUX learn to create new data by transforming random noise into structured output through a sequence of denoising steps. This iterative process is what gives them their creative power: they explore a rich space of possibilities before settling on an answer. When users need those answers to obey strict requirements — safety rules, physical laws, task-specific limits known as hard constraints — the standard approach is a technique called projection-based sampling. At each intermediate step, the partial solution is forcibly projected onto the set of constraint-satisfying values, dragging the sample back into the feasible region over and over again.</p>
<p>The problem, as the MIT team recognized, is that constraining the entire generation process is both wasteful and counterproductive. The internal trajectory of a generative model is discarded once the final output is produced, so there is no reason every intermediate sample must be feasible. Forcing feasibility at every step removes degrees of freedom the model could otherwise use to explore, and it can prevent the sampler from ever reaching a better final solution. Worse, projection-based methods typically focus solely on constraint satisfaction, ignoring the opportunity to improve other qualities of the answer — for instance, shortening a robot&#8217;s trajectory while keeping it collision-free. An answer that merely avoids crashing is not the same as a good answer.</p>
<p>HardFlow flips the logic. Instead of enforcing constraints at every intermediate step, the algorithm gives the model freedom to roam during generation and enforces the hard constraints only on the final output. The trick is in how it steers the process. The researchers reformulated hard-constrained sampling as a trajectory-optimization problem, borrowing tools from optimal control theory. This framing treats the sequence of denoising steps as a controlled trajectory that can be nudged toward a goal, with subtle corrections applied along the way and the constraints imposed at the destination. Control theory, Azizan notes, provides a powerful framework for formalizing the optimal way to make those corrections — turning what might otherwise be ad hoc clamping into a principled steering problem.</p>
<p>Of course, formulating the problem is easier than solving it. The trajectory-optimization problem wraps around an enormous neural network, potentially hundreds of interconnected layers deep, and optimizing over such a structure directly would be computationally intractable at deployment time. The MIT team&#8217;s solution was to exploit the mathematical structure of flow-matching models, which allowed them to decompose the global trajectory problem into a sequence of smaller, single-step subproblems. Through systematic transformations and carefully chosen approximations, they derived an efficient, scalable algorithm that preserves the key properties of the original optimization problem while remaining fast enough to run when the model is actually being used. Essentially, as Azizan describes it, the team transformed the trajectory-optimization problem into something that can be solved very efficiently at deployment time.</p>
<p>This deployment-time operation is one of HardFlow&#8217;s most practical advantages. The technique is plug-and-play: it can be applied to any pretrained generative model without retraining, fine-tuning, or modifying the network&#8217;s weights. In an era when powerful foundation models are widely available and constantly being updated, a method that layers constraint satisfaction on top of existing models — rather than baking it in through expensive retraining — dramatically lowers the barrier to deploying generative AI in safety-critical contexts. Hospitals, factories, and autonomous systems do not need to rebuild their models; they simply need a smarter sampler.</p>
<p>The reformulation as an optimization problem also buys something projection methods cannot offer: the ability to jointly optimize for quality. Because HardFlow treats constrained generation as an optimization, additional objectives can be folded directly into the framework. A robotic path planner using HardFlow, for example, does not merely find any collision-free route from one machine to another — it can find the shortest or quickest collision-free route. Li emphasizes that this joint handling of feasibility and quality is what allows the framework to perform substantially better than existing methods, which typically treat constraint satisfaction as the sole goal and leave solution quality to chance.</p>
<p>The experimental evidence spans three domains: robotic manipulation, maze navigation, and text-guided image editing. Across all of them, HardFlow achieved perfect constraint satisfaction — every single output met the required constraints — while consistently outperforming baseline methods on measures of solution quality. In the robotics experiments, the algorithm enabled a robotic manipulator to avoid collisions with obstacles while simultaneously finding the quickest path to a target object. Most competing methods, by contrast, either produced collisions outright or found paths that took significantly more time to execute. Notably, HardFlow&#8217;s computational cost was comparable to or lower than that of most rival techniques, meaning the gains in quality and safety did not come at the price of impractical runtimes.</p>
<p>The implications reach well beyond the lab. Generative models are increasingly being proposed for roles in which their outputs must obey nonnegotiable rules: robots sharing space with human co-workers, controllers governing physical infrastructure, and vision systems whose errors carry real consequences. HardFlow offers a way to preserve the exploratory power that makes generative AI valuable while guaranteeing that the final answers respect the boundaries the real world imposes. As Azizan puts it, the promise of generative AI lies in its ability to explore a rich space of possibilities, but the real world places limits on which possibilities are acceptable — and his team&#8217;s approach is designed to preserve that generative power while enforcing the nonnegotiable requirements of high-stakes applications. The researchers note that future work could extend the framework to settings where the AI model itself is also updated during use, allowing constraint satisfaction and sample quality to improve in a more adaptive, closed-loop manner. For now, HardFlow stands as a demonstration that the path to trustworthy generative AI may not run through bigger models or more training data, but through smarter control of the generation process itself.</p>
<p><strong>Subject of Research:</strong> Hard-constrained sampling for pretrained generative AI models via trajectory optimization</p>
<p><strong>Article Title:</strong> New method enables AI for safety-critical situations</p>
<p><strong>Article References:</strong> New method enables AI for safety-critical situations. (n.d.). <a href="https://www.eurekalert.org/news-releases/1143884" rel="noopener noreferrer">Original publication</a></p>
<p><strong>Image Credits:</strong> AI Generated</p>
<p><strong>DOI:</strong> Not provided</p>
<p><strong>Keywords:</strong> HardFlow, generative AI, diffusion models, flow-matching models, hard constraints, trajectory optimization, optimal control, robotics, constraint satisfaction, MIT, safety-critical AI, sampling algorithms</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">235422</post-id>	</item>
	</channel>
</rss>
