Research context
Cognitive diversity — agents holding different hypotheses and using different strategies — is valuable for collective search. A population that converges too quickly loses the exploratory capacity needed to find global optima on rugged landscapes. Fazelpour et al. model four conditions that vary by how much AI assistance agents receive and how that assistance is targeted:| Condition | Description |
|---|---|
| No AI | Agents learn socially from neighbors or explore individually. No AI involvement. |
| Personalized AI | AI optimizes the agent’s own current solution by greedy single-bit improvement. |
| Non-personalized AI | AI copies the last module of the globally best agent into the current agent’s solution. |
| Randomized AI | AI copies the last module from a randomly chosen top-10 agent. |
Decision procedures
All four procedures follow the same basic loop. Each timestep, every agent draws a random number againstvelocity to decide whether to engage in social learning or individual/AI-assisted search.
No AI (NOAI_optimized)
The baseline condition. Each agent either:
- Social learning (probability
velocity): copy the state of the highest-fitness connected neighbor if that neighbor outperforms the current agent. - Individual exploration (probability
1 - velocity): flip a single random bit; keep the flip if it improves fitness.
Personalized AI (PERSONALIZED_optimized)
Identical to No AI for the social learning branch. In the exploration branch, with probability trigger, the agent invokes AI assistance instead of random exploration.
The AI runs single_bit_optimization_optimized: it scans bits 10–19 (the computational module) and applies the single flip that yields the largest fitness improvement.
Non-personalized AI (NONPERSONALIZED_optimized)
In the exploration branch, with probability trigger, the agent adopts the last module (bits N/2 to N-1) of the globally best agent:
Randomized AI (RANDOMIZED_optimized)
Same module-swap mechanism as non-personalized, but the donor is drawn randomly from the top 10 agents by fitness rather than the single best:
Metrics tracked
Each condition tracks per-timestep metrics aggregated across simulation runs:| Metric | Description |
|---|---|
average_score_* | Mean fitness across all agents each timestep |
*_hamming | Average pairwise Hamming distance between agent states (cognitive diversity proxy) |
*_counter | Number of AI triggers per timestep |
avgScoreInc_* | Average fitness gain per successful AI intervention |
*_IncCounter | Number of adopted AI suggestions per timestep |
avgScoreSuggestion_* | Average fitness delta of all AI suggestions, including rejected ones |
Running the simulation
The example is invoked from the command line with explicit parameters:| Flag | Meaning |
|---|---|
--n | N — number of bits (must be even) |
--k | K — landscape ruggedness |
--a | Number of agents |
--r | Number of timesteps per simulation |
--s | Number of simulation runs (results are averaged) |
--f | Output filename suffix |
--cache_size | LRU cache size per landscape (default 50000) |
probability, velocity, trigger, r) and runs all combinations in parallel using multiprocessing.Pool. Results are written to a CSV file named:
Parameter sweep
The simulation sweeps four parameters:simulation_runs independent replications; metrics are averaged across replications before saving.
Each combination constructs its own
OptimizedNKLandscape with R=r and a per-simulation seed, so landscapes vary across replications but are reproducible.Integrating with AgentModel
The example runs its own simulation loop directly, but you can wire the same decision procedures into anAgentModel by wrapping one procedure as a timestep function:
Key findings this example can replicate
Homogenization under non-personalized AI
Homogenization under non-personalized AI
Non-personalized AI propagates a single best solution’s module to all agents. This drives Hamming distance toward zero faster than the No AI baseline, reducing the population’s ability to explore diverse regions of the landscape. High
trigger values accelerate this effect.Velocity and diversity trade-off
Velocity and diversity trade-off
Higher
velocity (more social learning) also reduces Hamming distance, because agents converge on the local network optimum. The interaction between velocity and AI trigger rate determines whether the population escapes local optima.Randomized AI as a middle ground
Randomized AI as a middle ground
By sampling from the top 10 rather than the single best, randomized AI preserves more diversity than non-personalized AI while still providing high-quality suggestions. This can yield better long-run fitness on high-
K landscapes.R modulates landscape modularity effects
R modulates landscape modularity effects
Higher
R makes module 1 more self-contained. When AI interventions target module 1 (last module swaps), high-R landscapes show stronger homogenization of that module while module 0 diversity is preserved.