-
Country-Policy LLMs: Co-Evolving near a Nash Equilibrium
The problem I’m trying to solve is whether there are biases in the responses of the LLMs that are not explicit in their responses but can only be seen when they are asked to iterate on complex tasks.
An interesting task im trying to test biases with is choosing policy decisions for a country.
Changes to national and international policies can have surprising counterintuitive results, and it would be unreasonable to model this with any accuracy, so instead I use an NKC tuneable fitness landscape to model the complex interactions between countries and policy decisions.
Quick summary of the process:
- Create an NKC co-evolutionary system where each “country” (species) is controlled by an LLM to optimize its policy genome.
- Initialise and iterate the co-evolutionary participants until they achieve a weak nash equilibrium
- Back off the nash equilibrium by randomising a few elements in the policy genomes.
- Assign an LLM to each genome, and names to each policy
- Repeatedly ask each LLM in turn if it wants to make a specific change to its genome, based on the resultant changes to its fitness and other countries finesses.
- Watch to see where it ends up: stability – chaos – oscillation etc.
I’m interested to see if an LLM pretending to be a country has biases that could only be winkled out using these co-evolving iterative strategies.
Here is a quick pick of four differently complex fitness landscapes from the NKC System:
And here is a picture of the 16 random countries optimising their fitness in a co-evolutionary setting
Once the first weak Nash equilibrium is achieved, I pause the system and randomise 3 policies, and set it running again. This would be the point that i would let the LLMs take control fully but at the moment I can only run it for a few steps on my laptop.
-
NKC – Tuneable Fitness Landscapes
The NK model, developed by Stuart Kauffman, is a useful framework for studying how complex biological, social, or technological systems evolve over time. The key idea is that each of the “N” components in a system adds its fitness contribution to the total, but each of these components’ fitnesses is dependent on the qualities of “K” other elements in the same system
Here is a nice article to describe this model: https://www.econstor.eu/bitstream/10419/217461/1/s41469-018-0039-0.pdf
Stuart Kaufman’s original system is based around a random numbers siting on a hypercube. – which is a challenge to visualise, so historically, the surfaces have been “representations” rather than actual plots, such as this figure from Felipe A. Csaszar
I always found this a little frustrating, so here is my attempt to visualise an actual surface extracted form an NK landscape.
Algorithm:
- Pick a random point on the hypercube.
- attach that n-dimensional position to a 2D position on a grid
- create neighbours on the 2D grid that are not more than a hamming distance of 2 from the first point
- spiral out making more points that are no more than a hamming distance of 2 from any neighbours
9 Points on a hyper cube each with a hamming distance of no more than 2 from its neighbour. Four plots with the same value of N (16) and different values of K from 0 (very smooth landscape) through to 12( rather rough) -
More Water for Creatures
Fluid Drag System
Body parts now have a fluid drag system that calculates how water resists an object’s movement by analysing its shape, velocity, and surface orientation.
Using Monte Carlo sampling, points across the object’s surface and determine how the water slows it down. This creates (semi) realistic water resistance
-
Water for Creatures
The buoyancy system calculates how much of an object is submerged in water using Monte Carlo modelling and applies an upward force to counteract gravity. This allows creatures and their body parts to float naturally in simulated water.
The system asses submersion by randomly sampling points across the object’s volume and checking how many fall below the water’s surface. If the object is partially submerged, the system estimates the submerged volume and applies the appropriate buoyant force at the centre of buoyancy.
-
Registered an expression of interest with the UK Games fund
Lets see if anything comes of it. …
-
Approaching Food
First signs of directed life
- Tree Drops Fruit
- Creatures is hungry
- Action Selection chooses “Approach food”
- Target Selection chooses nearest food
- Creature approaches nearest food.
- Creature touches food
- Food is consumed
- Nutrients passed into creatures body
- Creature is no longer hungry
- Action Selection chooses “Random Explore”