Skip to content

add exact match reward, make_reward_fn wrapper, remove check_answer from default rewards#3443

Open
andytwigg wants to merge 4 commits intomainfrom
atwigg/exact_answer_reward
Open

add exact match reward, make_reward_fn wrapper, remove check_answer from default rewards#3443
andytwigg wants to merge 4 commits intomainfrom
atwigg/exact_answer_reward

Conversation

@andytwigg
Copy link
Collaborator

Description

add exact match reward, make_reward_fn wrapper, remove check_answer from default rewards

check_answer has significant overlap with check_numbers and overlapping reward coefficients, so am commenting it out for simplicity by default.

I added make_reward_fn wrapper so that logging in tunix can see the name of the reward fn, instead of overwriting for each.

Tests

Please describe how you tested this change, and include any instructions and/or
commands to reproduce.

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

codecov bot commented Mar 18, 2026

Codecov Report

❌ Patch coverage is 63.63636% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/maxtext/trainers/post_train/rl/utils_rl.py 70.00% 3 Missing ⚠️
src/maxtext/trainers/post_train/rl/train_rl.py 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Collaborator

@richjames0 richjames0 left a comment

Choose a reason for hiding this comment

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

lgtm

except (TimeoutException, Exception):
pass

# Correct answer gets tmvp_config.reward_exact_format_match points!
Copy link
Collaborator

Choose a reason for hiding this comment

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

since this becomes the primary reward function now and we are skipping check_numbers() by default, could you please bring the debug logic from check_numbers() from here. This really helps in debugging extraction logic

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.

3 participants