Skip to content

fix(reflect): keep the trajectory memory in the success analyst prompt - #520

Open
Lanre Shittu (Shizoqua) wants to merge 1 commit into
microsoft:mainfrom
Shizoqua:fix/reflect-success-memory-context
Open

Lanre Shittu (Shizoqua) wants to merge 1 commit into
microsoft:mainfrom
Shizoqua:fix/reflect-success-memory-context

Conversation

@Shizoqua

Copy link
Copy Markdown
Contributor

Summary

run_success_analyst_minibatch in skillopt/gradient/reflect.py built its "Previous Steps in This Epoch" context as step_buffer_context or trajectory_memory_context. When a step buffer was set, the trajectory memory was dropped. run_error_analyst_minibatch always keeps both, so the failure analyst and the success analyst saw different history for the same epoch.

This change builds the success context the same way as the failure context: the step buffer first, then the trajectory memory. With no context, no previous-steps section is added.

Changes

  • skillopt/gradient/reflect.py: run_success_analyst_minibatch joins the step buffer and the trajectory memory when both are set.
  • tests/test_reflect_success_memory_context.py: new tests (see below).
  • CHANGELOG.md: entry under Fixed.

Tests

  • Five cases where a U+2212 sign is compared with the ASCII form (decimal, thousands separator with "million", percent, small value), plus one normalization test. These fail on upstream main and pass with this change.
  • Three guard cases where the signs differ. These pass on main and with this change.
  • Full suite: 2622 passed, 24 skipped, 4 xfailed.

Fixes #519

run_success_analyst_minibatch built its previous-steps context as
step_buffer_context or trajectory_memory_context. When a step buffer was
set, the trajectory memory was dropped. The failure analyst always
includes both, so the two analysts saw different history for the same
epoch.

Build the success context the same way as the failure context: the step
buffer first, then the trajectory memory. With no context, no previous
steps section is added.

This branch has not been deployed

No deployments
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.

Success analyst prompt drops the trajectory memory when a step buffer is present

1 participant