Skip to content

Port parsing fallback from evaluation to rewards#3485

Merged
copybara-service[bot] merged 1 commit intomainfrom
anisha-fix-reward-fallback
Mar 23, 2026
Merged

Port parsing fallback from evaluation to rewards#3485
copybara-service[bot] merged 1 commit intomainfrom
anisha-fix-reward-fallback

Conversation

@A9isha
Copy link
Copy Markdown
Collaborator

@A9isha A9isha commented Mar 23, 2026

Description

Look for last <answer> </answer> even in reward functions

Notice 1: Once all tests pass, the "pull ready" label will automatically be assigned.
This label is used for administrative purposes. Please do not add it manually.

Notice 2: For external contributions, our settings currently require an approval from a MaxText maintainer to trigger CI tests.

Tests

CI and I ran on v7x-128

Checklist

Before submitting this PR, please make sure (put X in square brackets):

  • I have performed a self-review of my code. For an optional AI review, add the gemini-review label.
  • I have necessary comments in my code, particularly in hard-to-understand areas.
  • I have run end-to-end tests tests and provided workload links above if applicable.
  • I have made or will make corresponding changes to the doc if needed, including adding new documentation pages to the relevant Table of Contents (toctree directive) as explained in our documentation.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 23, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/maxtext/trainers/post_train/rl/utils_rl.py 50.00% 8 Missing ⚠️

📢 Thoughts on this report? Let us know!

@hengtaoguo
Copy link
Copy Markdown
Collaborator

LGTM! Could you also check why the tests are failing? If we update the reward logics in the PR, the expected reward values need to be updated too.

FAILED tests/post_training/unit/rl_utils_test.py::TestCheckNumbers::test_extraction_fails_answer_tags_only - AssertionError: 1.5 != 0

@A9isha A9isha force-pushed the anisha-fix-reward-fallback branch from a2a6eff to 727c9e1 Compare March 23, 2026 21:09
@copybara-service copybara-service Bot merged commit 6a9f060 into main Mar 23, 2026
39 checks passed
@copybara-service copybara-service Bot deleted the anisha-fix-reward-fallback branch March 23, 2026 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants