Karthik Elamvazhuthi
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # The Bees Buzz to St. Wasserstein ![image](https://hackmd.io/_uploads/BksEcVNpbg.png) The bees have made a startling discovery. Rather than choosing among discrete options $\{A,B\}$, they have discovered they actually live a continuous universe $\mathbb{R}^d$. Accordingly, we extend the gradient flow perspective to the continuous space setting. They move according to individual dynamics $$\dot{x} = u(t,x)$$ where the dynamics $u(t,x)$ was decided 5000 years ago by an all-seeing overlord. Our goal as out-of-control chimps is to reverse engineer these dynamics. Note that here each agent is evolving according to this ODE, in constrast to the discrete setting, where each agent evolved according to a Markov chain. Once again, we are interested in the *mean-field* perspective. In this perspective, the bee colony is a yellow blob. The blob or density $\rho(t,x)$ is governed by the [continuity equation](https://hackmd.io/@clopenloop/H1Dxxcpzbx). $$\partial_t \rho + \nabla \cdot (u\, \rho) = 0$$ This is a partial differential equation. It governs how a ensemble of initial conditions evolve under the above ODE dynamics. Given this objective the collective decisition making problem in its feedback stabilization formulation is the following. **Objective**: Given a potential $V(x)$, the collective decision-making problem is to design a **mean-field feedback law** $u = u(\rho, V)$ so that the swarm converges to the minimizer of $V$. As in the last note, we take a *gradient flow* approach. Since $\rho(t,x)$ is a function (or a measure), we will use a *infinite dimensional gradient flow*. A natural energy functional on the space of probabilities is $$\mathcal{F}[\rho] = \int_{\mathbb{R}^d} V(x)\,\rho(x)\,dx + \frac{\lambda}{2}\iint_{\mathbb{R}^d \times \mathbb{R}^d} |x-y|^2\,\rho(x)\,\rho(y)\,dx\,dy$$ The first term drives the swarm toward regions where $V$ is small, while the second penalizes spread, encouraging consensus. The appropriate notion of a gradient flow in this context is the [*Wasserstein gradient flow*](https://abdulfatir.com/blog/2020/Gradient-Flows/) of $\mathcal{F}$, which is formally given by $$\partial_t \rho = \nabla \cdot \left(\rho\, \nabla \frac{\delta \mathcal{F}}{\delta \rho}\right)$$ The first variation of $\mathcal{F}$ is $$\frac{\delta \mathcal{F}}{\delta \rho}(x) = V(x) + \lambda \int_{\mathbb{R}^d} |x - y|^2\,\rho(y)\,dy$$ so that $$\nabla_x \frac{\delta \mathcal{F}}{\delta \rho}(x) = \nabla V(x) + 2\lambda(x - \bar{m}_\rho)$$ where $\bar{m}_\rho = \int y\,\rho(y)\,dy$ is the mean of the swarm. The resulting velocity field is purely a function of $V$ and the mean-field $\rho$ $$u(x) = -\nabla V(x) - 2\lambda(x - \bar{m}_\rho)$$ Each agent is driven by two forces: the quality gradient $-\nabla V$ pulling it toward nearby minima of $V$, and a consensus term $-2\lambda(x - \bar{m}_\rho)$ pulling it toward the current swarm mean. ## Equilibria: Where Society gets Stuck We immediately see a lots of differences from the discrete case. For any critical point $x^*$ of $V$, i.e. $\nabla V(x^*) = 0$, the point mass $\rho = \delta_{x^*}$ is an equilibrium. the consensus term vanishes since $\bar{m}_\rho = x^*$, and the gradient vanishes by assumption. This holds for all values of $\lambda$. So sub-optimal choices are also equilibria. But are these the only equilibria? At equilibrium, the velocity must vanish on the support of $\rho$ so that the continuity equation is at steady state: $$\nabla V(x) + 2\lambda(x - \bar{m}_\rho) = 0 \qquad \text{for all } x \in \mathrm{supp}(\rho)$$ where $\mathrm{supp}(\rho)$, loosely speaking denotes the set of points where the density (or measure) is positive. Rearranging, this says $$\nabla V(x) + 2\lambda x = 2\lambda \bar{m}_\rho \qquad \text{for all } x \in \mathrm{supp}(\rho)$$ The mean of the swarm is a constant, so the support of any equilibrium must be contained in a level set of the map $x \mapsto \nabla V(x) + 2\lambda x$. Lets consider an example. Take $d = 1$ with the symmetric double well $V(x) = (x^2 - 1)^2$. Our one-dimensional bees face the following fixed points. **Three single-Dirac equilibria.** The critical points $V'(x) = 4x^3 - 4x = 0$ give $x^* \in \{-1, 0, 1\}$, so we have $\delta_{-1}$, $\delta_0$, and $\delta_1$. **A fourth equilibrium.** By symmetry, we attempt to find a solution of the form $$\rho = \frac{1}{2}\delta_{-s} + \frac{1}{2}\delta_s$$ so that the mean $\bar{m} = 0$. The equilibrium condition at $x = s$ becomes $$V'(s) = -2\lambda(s - 0) \implies 4s^3 - 4s = -2\lambda s$$ Dividing by $s > 0$: $$4s^2 - 4 = -2\lambda \implies s = \sqrt{1 - \frac{\lambda}{2}}$$ This exists whenever $\lambda < 2$. So we have a symmetric two-Dirac equilibrium with support points at $\pm\sqrt{1 - \lambda/2}$, shifted inward from the wells by the consensus pull. **Summary.** For $\lambda < 2$, the system has at least four equilibria: | Equilibrium | Type | |---|---| | $\delta_{-1}$, $\delta_1$ | Single Diracs at wells | | $\delta_0$ | Single Dirac at saddle | | $\frac{1}{2}\delta_{-s} + \frac{1}{2}\delta_s$ | Split equilibrium, $s = \sqrt{1 - \lambda/2}$ | As $\lambda \to 0$, $s \to 1$ and the split equilibrium approaches $\frac{1}{2}\delta_{-1} + \frac{1}{2}\delta_1$ — an even split across both wells. As $\lambda \to 2$, $s \to 0$ and the two support points collide at the origin, merging with $\delta_0$. ## But Wait, There Are More! Our initial menu identified three single-Dirac equilibria ($\delta_{-1}$, $\delta_0$, $\delta_1$) and one symmetric two-Dirac equilibrium. But sadly this equilbria cafe serves a lot more. *The bees collectively stare at the waiter in confusion*. Recall that every support point of an equilibrium must satisfy the same equation: $$V'(x_i) + 2\lambda(x_i - \bar{m}) = 0$$ For $V(x) = (x^2 - 1)^2$, this gives $$4x^3 + (2\lambda - 4)x = 2\lambda\bar{m}$$ The right-hand side is a constant $c = 2\lambda\bar{m}$, independent of $i$. So every support point is a root of the cubic $$p(x) = 4x^3 + (2\lambda - 4)x - c$$ The derivative $p'(x) = 12x^2 + (2\lambda - 4)$ has real roots only when $\lambda < 2$, and in this regime $p$ can have up to three real roots. When $\lambda \geq 2$, $p$ is strictly monotone and admits only one real root — only single-Dirac equilibria are possible. *We have proved*: **all you need is love. [This has been long suspected.](https://www.youtube.com/watch?v=4EGczv7iiEk&list=RD4EGczv7iiEk&start_radio=1))** ### Other Two-Dirac equilibria: It's not just all about ### "Do you want Pizza or -Pizza?" The symmetric split $\frac{1}{2}\delta_{-s} + \frac{1}{2}\delta_s$ is not the only two-point equilibrium. Lets see if there are other equilibria of the form $\alpha\delta_{x_1} + (1-\alpha)\delta_{x_2}$. If $x_1 \neq x_2$ are both roots of $p$, subtracting the equilibrium conditions and dividing by $x_1 - x_2$ gives $$x_1^2 + x_1 x_2 + x_2^2 = 1 - \frac{\lambda}{2}$$ This is an ellipse in the $(x_1, x_2)$ plane. The mean of $\rho = \alpha\delta_{x_1} + (1-\alpha)\delta_{x_2}$ is $$\bar{m} = \alpha x_1 + (1-\alpha)x_2$$ Solving for $\alpha$: $$\bar{m} = \alpha x_1 + x_2 - \alpha x_2 = x_2 + \alpha(x_1 - x_2)$$ $$\alpha = \frac{\bar{m} - x_2}{x_1 - x_2}$$ Now, $\alpha \in (0,1)$ requires $\bar{m} - x_2$ to be strictly between $0$ and $x_1 - x_2$, which is exactly the statement that $\bar{m}$ lies strictly between $x_1$ and $x_2$. This is simply the fact that a convex combination of two distinct points lies in their interior, the mean of a two-point measure cannot fall outside its support. The constraint $x_1^2 + x_1 x_2 + x_2^2 = 1 - \lambda/2$ defines an ellipse in the $(x_1, x_2)$ plane, rotated $45°$ from the standard axes. As $\lambda$ increases toward $2$, the ellipse shrinks and collapses to the origin. The symmetric split sits where the ellipse crosses the anti-diagonal $x_1 = -x_2$, but the full ellipse parametrizes a continuous family. Not every point on the ellipse corresponds to a valid equilibrium though. The weight $\alpha$ must lie in $(0,1)$, which restricts the admissible arc. The following plot shows the ellipse for several values of $\lambda$, with the valid arc highlighted. ![image](https://hackmd.io/_uploads/Hyx4Lq10Zl.png) ### Three-Dirac equilibria When $\lambda < 2$ and $c$ lies between the local maximum and minimum of $p$, all three roots $x_1 < x_2 < x_3$ are real. Any convex combination $\rho = \sum_i \alpha_i \delta_{x_i}$ with $\bar{m} = \sum_i \alpha_i x_i = c/(2\lambda)$ is an equilibrium. This is one linear constraint on the 2-simplex, leaving a one-parameter family of valid weight vectors for each such triple of support points. For $\lambda < 2$, the equilibrium set is considerably larger. The single Diracs at critical points of $V$ and the symmetric two-Dirac split are isolated members of continuous families of multi-Dirac equilibria. Most of these are expected to be unstable. But one needs a careful Hessian analysis to characterize the stability. These are some very cool visualizations made by Claude. We have not verified the stability of these equilibria but one can visualize the evolution of the dynamics of different parameter values for the double. ![blob_1_strong](https://hackmd.io/_uploads/B1-nwBxRZl.gif) ![blob_2_weak](https://hackmd.io/_uploads/SkfnPSg0-x.gif) The following example is interesting as the bees not only show bistability. But they end up converging to the wrong points. ![blob_3_bimodal](https://hackmd.io/_uploads/SJz2DBlCZe.gif) In this example, we consider the double well when one minima is striclty better than the other. ![blob_4_wrong](https://hackmd.io/_uploads/Hkz2vHgCbg.gif) ## The Convex Case We have not yet considered the simplest setting when $V$ is strictly convex with a unique minimum $x^*$. Here the quality gradient and the consensus force are cooperative. Both terms drive the swarm toward $x^*$. The only equilibrium is $\rho = \delta_{x^*}$, and it is globally attracting. This can be shown using the notion of *displacement convexity*. ![blob_convex](https://hackmd.io/_uploads/BJPTmqyCWl.gif)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Google Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully