<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://lucascimeca.com/feed.xml" rel="self" type="application/atom+xml" /><link href="https://lucascimeca.com/" rel="alternate" type="text/html" hreflang="en" /><updated>2026-09-04T00:30:32+00:00</updated><id>https://lucascimeca.com/feed.xml</id><title type="html">Luca Scimeca</title><subtitle>Luca Scimeca — AI research scientist and founder working at the intersection of AI and scientific discovery.</subtitle><author><name>Luca Scimeca</name><email>luca.scimeca@live.com</email></author><entry><title type="html">Unlocking the Power of Diffusion Models: A Dive into Relative Trajectory Balance</title><link href="https://lucascimeca.com/posts/relative-trajectory-balance/" rel="alternate" type="text/html" title="Unlocking the Power of Diffusion Models: A Dive into Relative Trajectory Balance" /><published>2024-06-20T00:00:00+00:00</published><updated>2024-06-20T00:00:00+00:00</updated><id>https://lucascimeca.com/posts/relative-trajectory-balance</id><content type="html" xml:base="https://lucascimeca.com/posts/relative-trajectory-balance/"><![CDATA[<p>In the ever-evolving landscape of artificial intelligence, diffusion models have
emerged as a powerful tool for generating high-quality data across domains such as
images, text and even action spaces. But what happens when we need these models not
just to generate, but to <em>adapt to specific constraints</em>? We tackle exactly this
problem in our paper
“<a href="https://arxiv.org/abs/2405.20971">Amortizing Intractable Inference in Diffusion Models for Vision, Language, and Control</a>”,
where we propose <strong>Relative Trajectory Balance (RTB)</strong> — an asymptotically unbiased
training objective for diffusion models that sample from posterior distributions
under a diffusion model prior.</p>

<h2 id="tackling-the-intractable-why-posterior-inference-matters">Tackling the intractable: why posterior inference matters</h2>

<p>Diffusion models generate data by transforming noise through a series of steps.
In real-world applications, however, we often need them to conform to certain
constraints — think of generating an image with specific features, or producing text
that adheres to a given context. This leads us to the problem of <em>posterior
inference</em>, where we want to sample data that fits both the original prior
distribution and the additional constraints. The catch? This posterior inference is
typically intractable.</p>

<h2 id="relative-trajectory-balance">Relative Trajectory Balance</h2>

<p>At its core, RTB is about being able to fine-tune a diffusion model prior into a
posterior model, and sample according to the posterior distribution of interest.
Ideally the posterior model should not drift too far from the prior — we want the
samples to remain plausible under the original prior — but it should nonetheless
change appropriately to capture the posterior of interest.</p>

<p>When tackling the posterior sampling problem, the goal is to sample from a posterior
distribution $p_{\text{post}}(\mathbf{x}) \propto p_\theta(\mathbf{x})\, r(\mathbf{x})$,
where $p_\theta(\mathbf{x})$ is our diffusion model prior and $r(\mathbf{x})$ is the
constraint. Importantly, $r(\mathbf{x})$ does not need to be differentiable: it can be
a measurement, a reward from another model, a human preference — anything, really.</p>

<p>Our RTB objective introduces a constraint that enforces the correct relationship
between the prior and the posterior processes:</p>

\[\mathcal{L}_{RTB}(\mathbf{x}_0 \rightarrow \mathbf{x}_{\Delta t} \rightarrow \dots \rightarrow \mathbf{x}_1; \phi)
:= \log\left(\frac{Z_{\phi} \cdot p_\phi^{post}(\mathbf{x}_0, \mathbf{x}_{\Delta t}, \dots, \mathbf{x}_1)}{r(\mathbf{x}_1)\, p_{\theta}(\mathbf{x}_0, \mathbf{x}_{\Delta t}, \dots, \mathbf{x}_1)}\right)^2\]

<p>This ensures that the likelihood of the denoising trajectory under the posterior model
$p_\phi^{post}$ stays close to the likelihood of the same trajectory under the prior
$p_{\theta}$, while learning the scalar $Z_{\phi}$ (in log scale, for numerical
stability) and sampling proportionally to $p_\theta(\mathbf{x})\,r(\mathbf{x})$. Thanks
to its design, the advantage of RTB lies in its ability to achieve <em>unbiased</em> posterior
sampling — proof in the <a href="https://arxiv.org/abs/2405.20971">paper</a>.</p>

<h2 id="highlight-results">Highlight results</h2>

<p>To show the effectiveness of RTB we provide a diverse set of empirical results across
multiple domains. Some highlights:</p>

<p>In <strong>vision</strong>, RTB applied to image generation achieves state-of-the-art results,
improving on classifier guidance and RL-based baselines in both the diversity of the
generated posterior samples and their closeness to the true posterior. Below is an
example of fine-tuning an unconditional diffusion prior.</p>

<figure>
  <img src="/assets/img/posts/rtb-cls-finetuning.jpg" alt="Grid of class-conditional samples produced by fine-tuning an unconditional diffusion prior with RTB" />
  <figcaption>Class-conditional samples obtained by fine-tuning an unconditional diffusion prior with RTB.</figcaption>
</figure>

<p>In <strong>stable diffusion</strong>, we can fine-tune a large text-to-image model to achieve high
scores according to human preference, on par with state-of-the-art methods.</p>

<figure>
  <img src="/assets/img/posts/rtb-cover.jpg" alt="Text-to-image samples from a Stable Diffusion model fine-tuned toward human preference with RTB" />
  <figcaption>Fine-tuning a large text-to-image model toward human preference with RTB.</figcaption>
</figure>

<p>In <strong>language</strong>, we show we can fine-tune a posterior over a discrete language
diffusion model prior to perform coherent posterior sampling for text infilling.</p>

<p>In reinforcement learning <strong>control</strong> tasks, we report state-of-the-art results when
training a posterior behaviour policy from a diffusion behavioural prior, achieving
comparable or better results than other recent methods.</p>

<h2 id="conclusion">Conclusion</h2>

<p>Relative Trajectory Balance is a flexible objective that allows efficient and unbiased
sampling from a posterior distribution, given a diffusion prior and a reward or
likelihood. The empirical results across vision, language and control underscore the
potential of RTB to set new benchmarks across AI applications. Whether you are diving
into research or developing practical solutions, the advances presented here are poised
to change how we generate and refine data.</p>]]></content><author><name>Luca Scimeca</name><email>luca.scimeca@live.com</email></author><summary type="html"><![CDATA[In the ever-evolving landscape of artificial intelligence, diffusion models have emerged as a powerful tool for generating high-quality data across domains such as images, text and even action spaces. But what happens when we need these models not just to generate, but to adapt to specific constraints? We tackle exactly this problem in our paper “Amortizing Intractable Inference in Diffusion Models for Vision, Language, and Control”, where we propose Relative Trajectory Balance (RTB) — an asymptotically unbiased training objective for diffusion models that sample from posterior distributions under a diffusion model prior.]]></summary></entry><entry><title type="html">Shortcut Learning in Deep Neural Networks: which cues will your model choose to learn?</title><link href="https://lucascimeca.com/posts/shortcut-learning-in-deep-neural-networks/" rel="alternate" type="text/html" title="Shortcut Learning in Deep Neural Networks: which cues will your model choose to learn?" /><published>2023-07-31T00:00:00+00:00</published><updated>2023-07-31T00:00:00+00:00</updated><id>https://lucascimeca.com/posts/shortcut-learning-in-deep-neural-networks</id><content type="html" xml:base="https://lucascimeca.com/posts/shortcut-learning-in-deep-neural-networks/"><![CDATA[<p>Deep neural networks (DNNs) often rely on easily learned discriminatory features, or
<em>cues</em>, that are not essential to the problem at hand — a phenomenon known as
<strong>shortcut learning</strong>. A DNN may recognise ducks based on the typical background
scenery of lakes or streams rather than on the ducks themselves. This shortcut bias
limits generalisation, particularly in harder test scenarios where the shortcuts are
no longer valid.</p>

<p>To investigate the shortcut learning tendencies of deep models we introduce a new
training setup: the <strong>Wisconsin Card Sorting Test for Machine Learners (WCST-ML)</strong>.</p>

<h2 id="the-wisconsin-card-sorting-test-for-machine-learners">The Wisconsin Card Sorting Test for Machine Learners</h2>

<p>We envision a simple, yet powerful, setting. Imagine you were given this limited set of
images and labels:</p>

<figure class="natural">
  <img src="/assets/img/posts/shortcut-train.png" alt="A small training matrix of coloured shapes, each with a label" />
  <figcaption>The training set: every image is fully correlated across at least two high-level cues.</figcaption>
</figure>

<p>You are then asked to provide a label for the following image. You can choose between
0, 1 or 2, according to your understanding of the task:</p>

<figure class="plain natural">
  <img src="/assets/img/posts/shortcut-query.png" alt="A single query image showing an unseen combination of shape and colour" style="width:180px" />
  <figcaption>The query: an unseen combination of features. What would you choose?</figcaption>
</figure>

<p>The problem with this question lies in its <em>ill-defined</em> nature. The images and labels
in the training matrix are fully correlated with respect to at least two explicable
high-level cues — for example shape and colour. At training time the classification
task can be solved perfectly by relying on either feature; at test time, an image
showing an unseen feature combination requires generalisation.</p>

<p>If a human were to solve this task, several factors could play a role in the final
decision. Prior knowledge about the world, the task, or even other related tasks might
influence our beliefs about the underlying task to solve — yes, in a Bayesian sense.
Ideally we would form a set of hypotheses (hopefully containing both shape and colour
as alternatives), and make a choice given our prior and our observations, updating as
we see more data. The important part is that the choice we make is <em>informative of our
priors</em>, and of our biases. Absent a significantly different prior among participants,
labelling the image 0 would display a bias toward shape, while labelling it 1 would
showcase a colour-based task logic.</p>

<p>During training, deep learning models have their own biases, and have often been
observed to collapse to easy-to-learn cues. Similarly to the degenerate classification
case above, available datasets typically underspecify the task to be solved, and data
is hardly ever comprehensive enough to fully constrain decision-making.</p>

<h2 id="models-agree-on-which-shortcuts-to-take">Models agree on which shortcuts to take</h2>

<p>In our work we run extensive experiments to observe how different architectures react
when put through a similarly underspecified visual discrimination task. Our first
interesting finding is that, despite the different inductive biases induced by
different architectures, we observe largely similar behaviour across models. Models
reliably prefer certain cues — like colour — more than others. Colour is a
particularly easy cue to fit in the simple example above, since we have some intuition
about how it might be solved by something akin to channel selection in the input space.</p>

<p>Experiments on more complex datasets, such as UTKFace, show that cues such as
ethnicity, gender and age also rank similarly across architectures, exposing
potentially sensitive biases when making inference without appropriate measures or
human-in-the-loop solutions.</p>

<figure>
  <img src="/assets/img/posts/shortcut-cues.jpg" alt="Charts comparing cue preference rankings across several network architectures" />
  <figcaption>Cue preference is remarkably consistent across architectures.</figcaption>
</figure>

<p>Interestingly, we find these biases are explicable from the point of view of the loss
landscape: the set of solutions biased toward the preferred cues occupies a far greater
volume — and tends to be flatter — than those corresponding to the averted cues.</p>

<figure>
  <img src="/assets/img/posts/shortcut-landscape.jpg" alt="Loss landscape visualisation showing larger, flatter basins for preferred cues" />
  <figcaption>Solutions that rely on preferred cues occupy larger, flatter basins.</figcaption>
</figure>

<p>We call this fully correlated test WCST-ML, and propose a simple framework for
exploring any such biases. As long as a dataset has multiple labels for each input, and
enough elements to generate a fully correlated dataset, WCST-ML should be readily
applicable. Much more in-depth findings are shared in the ICLR publication, which helps
us understand what these shortcut biases look like during training — and potentially
how to avoid them. These findings shed light on shortcut learning in deep models, and
emphasise the importance of solutions such as active human intervention to remove model
biases that may cause negative societal impacts.</p>

<h2 id="mitigating-the-bias-with-diffusion-counterfactuals">Mitigating the bias with diffusion counterfactuals</h2>

<p>In a follow-up work we propose a solution based on <strong>ensemble diversification</strong>. An
effective approximation to the Bayesian ideal above is to let an ensemble of models
entertain a range of diverse hypotheses while observing the degenerate training data.
The diversity must be <em>functional</em>, and is therefore not trivial to enforce.</p>

<p>We propose a method based on synthetic counterfactuals sampled from an appropriately
trained Diffusion Probabilistic Model (DPM). We find that DPMs cross stages of training
in which they are more likely to produce samples with novel feature combinations — an
<em>originative</em> stage.</p>

<figure>
  <img src="/assets/img/posts/shortcut-fidelity.jpg" alt="Samples across diffusion training stages showing novel feature combinations" />
  <figcaption>Across training, DPMs pass through a stage where novel feature combinations are more likely.</figcaption>
</figure>

<p>Even when lacking fidelity, these samples can be leveraged directly for ensemble
diversification through model disagreement, enforcing functional diversity across
models.</p>

<p>In the table below you can see the fraction of models that attend to a given cue (out
of an ensemble of 100) when trained without diversification — the baseline case above —
and when trained with our diversification method.</p>

<figure>
  <img src="/assets/img/posts/shortcut-disagreement.png" alt="Table comparing the fraction of models attending to each cue, with and without diversification" />
  <figcaption>Diversification shifts models toward non-shortcut cues, without additional data collection.</figcaption>
</figure>

<p>This demonstrates that we can get models to attend to non-shortcut cues, even without
the need for expensive additional data collection.</p>]]></content><author><name>Luca Scimeca</name><email>luca.scimeca@live.com</email></author><summary type="html"><![CDATA[Deep neural networks (DNNs) often rely on easily learned discriminatory features, or cues, that are not essential to the problem at hand — a phenomenon known as shortcut learning. A DNN may recognise ducks based on the typical background scenery of lakes or streams rather than on the ducks themselves. This shortcut bias limits generalisation, particularly in harder test scenarios where the shortcuts are no longer valid.]]></summary></entry><entry><title type="html">Da Palermo ad Harvard e la ricerca sul cancro: la storia di Luca Scimeca</title><link href="https://lucascimeca.com/posts/da-palermo-ad-harvard/" rel="alternate" type="text/html" title="Da Palermo ad Harvard e la ricerca sul cancro: la storia di Luca Scimeca" /><published>2022-07-11T00:00:00+00:00</published><updated>2022-07-11T00:00:00+00:00</updated><id>https://lucascimeca.com/posts/da-palermo-ad-harvard</id><content type="html" xml:base="https://lucascimeca.com/posts/da-palermo-ad-harvard/"><![CDATA[<p>An amazing article by Joey Borruso, telling the story of my journey — starting in
Sicily, Italy, and arriving at Harvard and Dana-Farber to work on machine learning for
cancer research.</p>

<figure class="natural">
  <img src="/assets/img/posts/palermo.jpg" alt="Screenshot of the PalermoLive article" />
</figure>

<p>The full article is on
<a href="https://palermolive.it/ricerca-cancro-luca-scimeca/">PalermoLive</a>.</p>]]></content><author><name>Luca Scimeca</name><email>luca.scimeca@live.com</email></author><summary type="html"><![CDATA[An amazing article by Joey Borruso, telling the story of my journey — starting in Sicily, Italy, and arriving at Harvard and Dana-Farber to work on machine learning for cancer research.]]></summary></entry><entry><title type="html">Introducing RoboPatient — a soft robotics approach to training doctors</title><link href="https://lucascimeca.com/posts/introducing-robopatient/" rel="alternate" type="text/html" title="Introducing RoboPatient — a soft robotics approach to training doctors" /><published>2021-09-05T00:00:00+00:00</published><updated>2021-09-05T00:00:00+00:00</updated><id>https://lucascimeca.com/posts/introducing-robopatient</id><content type="html" xml:base="https://lucascimeca.com/posts/introducing-robopatient/"><![CDATA[<p>An article published by the University of Cambridge describes part of my work in using
AI and robotics in the medical field.</p>

<div class="video">
  <iframe src="https://www.youtube-nocookie.com/embed/34e5d2FeKhk" title="Introducing RoboPatient" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="" loading="lazy"></iframe>
</div>

<p>Cambridge researchers are helping to design the healthcare robotics of the future by
investigating a robot-assisted approach to training doctors in medical examinations.
To read the full article, follow
<a href="http://www.eng.cam.ac.uk/news/introducing-robopatient-soft-robotics-approach-training-doctors">this link</a>.</p>

<p>We have published part of this work in the leading robotics journal <em>Soft Robotics</em>.
The research article is titled
“<a href="https://www.liebertpub.com/doi/full/10.1089/soro.2020.0129">Action Augmentation of Tactile Perception for Soft-Body Palpation</a>”.
In it we delve further into the complex realm of physical medical examination: we use a
robotic platform and a mathematical framework both to understand and to employ complex
palpation strategies, in order to achieve appropriate sensory perception for robotic
medical diagnosis.</p>]]></content><author><name>Luca Scimeca</name><email>luca.scimeca@live.com</email></author><summary type="html"><![CDATA[An article published by the University of Cambridge describes part of my work in using AI and robotics in the medical field.]]></summary></entry><entry><title type="html">Gaussian process inference modelling of dynamic robot control for expressive piano playing</title><link href="https://lucascimeca.com/posts/expressive-piano-playing/" rel="alternate" type="text/html" title="Gaussian process inference modelling of dynamic robot control for expressive piano playing" /><published>2020-08-14T00:00:00+00:00</published><updated>2020-08-14T00:00:00+00:00</updated><id>https://lucascimeca.com/posts/expressive-piano-playing</id><content type="html" xml:base="https://lucascimeca.com/posts/expressive-piano-playing/"><![CDATA[<figure class="clip clip--portrait">
  <video autoplay="" loop="" muted="" playsinline="" preload="metadata" poster="/assets/img/posts/piano-poster.jpg" aria-label="A robot arm pressing piano keys while learning a playing style"><source src="/assets/img/posts/piano.mp4" type="video/mp4" />
    <img src="/assets/img/posts/piano-poster.jpg" alt="A robot arm pressing piano keys while learning a playing style" />
  </video>
</figure>

<p>A robot that can autonomously learn to play piano by mimicking the dynamics of
different human playing styles.</p>

<p>Our publication, in collaboration with Cheryn Ng, in the international journal
<em>PLOS ONE</em>, is titled “Gaussian Process inference modelling of dynamic robot control
for expressive piano playing”. In the paper we propose a Gaussian-Process-based
mathematical framework for a robot to use sound feedback to autonomously learn how to
play piano according to 10 different play styles.</p>]]></content><author><name>Luca Scimeca</name><email>luca.scimeca@live.com</email></author><summary type="html"><![CDATA[]]></summary></entry><entry><title type="html">Structuring of tactile sensory information for category formation in robotics palpation</title><link href="https://lucascimeca.com/posts/structuring-tactile-sensory-information/" rel="alternate" type="text/html" title="Structuring of tactile sensory information for category formation in robotics palpation" /><published>2020-07-29T00:00:00+00:00</published><updated>2020-07-29T00:00:00+00:00</updated><id>https://lucascimeca.com/posts/structuring-tactile-sensory-information</id><content type="html" xml:base="https://lucascimeca.com/posts/structuring-tactile-sensory-information/"><![CDATA[<figure class="clip">
  <video autoplay="" loop="" muted="" playsinline="" preload="metadata" poster="/assets/img/posts/palpation-poster.jpg" aria-label="A robotic arm palpating a soft phantom with a capacitive tactile sensor"><source src="/assets/img/posts/palpation.mp4" type="video/mp4" />
    <img src="/assets/img/posts/palpation-poster.jpg" alt="A robotic arm palpating a soft phantom with a capacitive tactile sensor" />
  </video>
</figure>

<p>Robotics and medicine: one of our publications in the journal <em>Autonomous Robots</em>,
exploiting the application of machine learning and tactile sensing to aid in the
autonomous detection of abnormal lumps in soft bodies.</p>

<p>In collaboration with Perla Maiolino and Fumiya Iida.</p>]]></content><author><name>Luca Scimeca</name><email>luca.scimeca@live.com</email></author><summary type="html"><![CDATA[]]></summary></entry><entry><title type="html">Efficient Bayesian exploration for soft morphology-action co-optimization</title><link href="https://lucascimeca.com/posts/bayesian-exploration-morphology-action/" rel="alternate" type="text/html" title="Efficient Bayesian exploration for soft morphology-action co-optimization" /><published>2020-05-15T00:00:00+00:00</published><updated>2020-05-15T00:00:00+00:00</updated><id>https://lucascimeca.com/posts/bayesian-exploration-morphology-action</id><content type="html" xml:base="https://lucascimeca.com/posts/bayesian-exploration-morphology-action/"><![CDATA[<figure class="clip">
  <video autoplay="" loop="" muted="" playsinline="" preload="metadata" poster="/assets/img/posts/co-opt-poster.jpg" aria-label="A soft robotic end-effector changing morphology while probing objects"><source src="/assets/img/posts/co-opt.mp4" type="video/mp4" />
    <img src="/assets/img/posts/co-opt-poster.jpg" alt="A soft robotic end-effector changing morphology while probing objects" />
  </video>
</figure>

<p>One of our articles, “Efficient Bayesian Exploration for Soft Morphology-Action
Co-optimization”, with Perla Maiolino and Fumiya Iida, proposing a mathematical
framework to perform the active exploration of robot control and morphology to aid in
discrimination tasks.</p>

<h2 id="presentation">Presentation</h2>

<div class="video">
  <iframe src="https://www.youtube-nocookie.com/embed/7IyPawFCycQ" title="Efficient Bayesian Exploration for Soft Morphology-Action Co-optimization" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="" loading="lazy"></iframe>
</div>]]></content><author><name>Luca Scimeca</name><email>luca.scimeca@live.com</email></author><summary type="html"><![CDATA[]]></summary></entry></feed>