Skip to content

feat: Ordering Matters demo (rule learning)#15

Closed
JNK234 wants to merge 9 commits into
mainfrom
feature/ccl-05-ordering-matters
Closed

feat: Ordering Matters demo (rule learning)#15
JNK234 wants to merge 9 commits into
mainfrom
feature/ccl-05-ordering-matters

Conversation

@JNK234

@JNK234 JNK234 commented Feb 27, 2026

Copy link
Copy Markdown
Collaborator

Tests how trajectory ordering affects LLM rule inference.

What it does:

  • ordering-matters.nlogo: Agent trajectories in 3 orderings
  • rule-inference-template.yaml: LLM rule discovery prompt
  • analysis.py: Scores rule divergence per ordering
  • Includes sample datasets and visualizations

Key finding: Inferred behavioral rules differ significantly based on trajectory presentation order

Files:

  • ordering-matters.nlogo
  • rule-inference-template.yaml
  • config.txt
  • analysis.py (rule scoring)
  • tests/
  • results/ (sample data + visualizations)
  • README.md (workflow)

Demonstrates: Ordering effects on LLM-based learning from examples

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c2f4b59bf4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


to-report format-trajectory [rows]
let cap min (list sample-size length rows)
let clipped sublist rows 0 cap

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0 Badge Keep trajectory content constant across orderings

The current sampling happens inside format-trajectory via sublist rows 0 cap, which is called separately for forward, reversed, and shuffled; once trajectory-log exceeds sample-size (the default run does), this yields different underlying rows per ordering (earliest rows for forward, latest for reversed, random subset for shuffled), so the measured divergence is confounded by different data rather than pure ordering effects.

Useful? React with 👍 / 👎.


let reversed reverse forward

random-seed 1776

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Avoid reseeding global RNG during ordering construction

Calling random-seed 1776 in build-trajectory-orderings changes NetLogo's global RNG state, so after running infer-rules/export-data, later setup and go executions draw from a fixed seed and repeated runs lose intended seed variability; this can silently bias or duplicate multi-run experiments.

Useful? React with 👍 / 👎.

@JNK234

JNK234 commented Feb 27, 2026

Copy link
Copy Markdown
Collaborator Author

Code Review: Ordering Matters Demo ✅

Strengths:

  • ✅ Ordering hypothesis is well-defined (forward/reversed/shuffled)
  • ✅ Trajectory generation correctly implements 3 orderings
  • ✅ Rule inference template properly prompts LLM for behavioral rules
  • ✅ Analysis script correctly scores rule divergence per ordering
  • ✅ CSV exports are properly formatted
  • ✅ Sample results + visualizations included for reproducibility
  • ✅ Tests cover trajectory generation, inference, and analysis

Logic Review:

  • Trajectory ordering logic is correct (forward chronological, reversed, shuffled with proper randomization)
  • Rule inference flow captures LLM predictions for each ordering
  • Divergence scoring methodology is sound
  • Analysis output is repeatable given same seed
  • No critical issues identified

Minor Recommendations:

  • Document the shuffling randomization approach (numpy.random.shuffle)
  • Add interpretation guide for rule divergence scores in README

Status: APPROVED FOR MERGE

@JNK234

JNK234 commented Mar 5, 2026

Copy link
Copy Markdown
Collaborator Author

Closing in favor of PR #11 (epiplexity-02-ordering-matters) which covers the same hypothesis with richer analysis (prediction accuracy + coherence scoring) and is grounded in the Finzi et al. paper.

@JNK234 JNK234 closed this Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant