year: 2023/12
paper: https://journals.sagepub.com/doi/10.1177/10597123241269740 | https://arxiv.org/pdf/2401.05375
website: https://thoughtforms.life/what-do-algorithms-want-a-new-paper-on-the-emergence-of-surprising-behavior-in-the-most-unexpected-places/
code: https://github.com/Zhangtaining/cell_research
connections: basal cognition


Bubble sort displays emergent delayed gratification that is not explicitly in the algorithm.
→ We underestimate the competencies of even the most basic algorithms, and do not know the full extent of their capabilities.
→ It does not take cells, life, or huge complexity to have emergent goal-directed competencies.

Key Findings

  • Cell-view (distributed) versions of sorting algorithms can work as efficiently as traditional centralized versions
  • The algorithms show unexpected robustness and problem-solving abilities not explicitly coded into them
  • When different “algotypes” (cells using different sorting algorithms) are mixed, they show emergent clustering behavior
  • The algorithms demonstrate “delayed gratification” - temporarily moving away from their goal to achieve better results

Algotype Clustering

The unexpected clustering of similar algotypes (elements using the same sorting algorithm) emerges despite:

  • No explicit programming for this behavior
  • No ability for elements to detect others’ algotypes
  • No direct communication about algorithm types

The clustering occurs during the sorting process before elements reach their final positions, with aggregation values reaching about 60-70% (significantly above the random 50%). When the authors allowed duplicate numbers, the clustering became even more pronounced since elements weren’t forced apart by the final sorting requirement.

There's a deterministic start and end point, but inbetween we have emergent complexity, interesting stuff happens.

Traditional vs Multi-Agent (Cell-View) Algorithms

Traditional sorting: A single top-down controller sees the entire array and decides which elements to swap. Operations happen sequentially - the controller examines pairs or elements one at a time.

Multi-agent sorting: Each element is an independent agent (implemented as a thread) that can only see its local neighbors. All agents run in parallel, making decisions simultaneously based on local rules. No central authority coordinates their actions.

The cell-view versions work as follows:
Cell-View Bubble Sort: Each cell compares itself with immediate neighbors. Moves left if smaller than left neighbor, right if bigger than right neighbor.

Cell-View Insertion Sort: Each cell can see all cells to its left. Moves left only if the left side is already sorted AND it’s smaller than its left neighbor.

Cell-View Selection Sort: Each cell has an “ideal” target position (initially leftmost). Tries to swap with whoever occupies that position if it has a smaller value. If swap fails, shifts ideal position right.

Movement constraints:

  • Elements can only swap with adjacent neighbors (no jumping)
  • Array is strictly 1D with only left/right movement through swaps
  • All cells execute their algorithms continuously in parallel

Frozen Cells: Simulating Damage

The researchers introduced “frozen cells” to simulate damaged or defective elements that can’t follow the algorithm properly:

Movable Frozen Cells (“lack of initiative”):

  • Cannot initiate swaps themselves
  • CAN be moved by other active cells
  • Act like passive obstacles that others can push around

Immovable Frozen Cells (“lack of motility”):

  • Cannot initiate swaps
  • CANNOT be moved by others either
  • Complete roadblocks in the array

Key findings with frozen cells:

  • Cell-view algorithms show better error tolerance than traditional versions
  • Bubble sort handles movable frozen cells best
  • Selection sort handles immovable frozen cells best
  • Algorithms demonstrate emergent “delayed gratification” - temporarily decreasing sortedness to navigate around obstacles