Skip to content

Conversation

@N00bcak
Copy link
Contributor

@N00bcak N00bcak commented Dec 30, 2025

tl;dr

Add a EncapsulateWrapper to detect and enforce common response signposts used by LLMs (like \boxed{} and <answer></answer>)

Motivation

Currently GEM as a library appears somewhat undecided about how to extract unambiguous answers from LLMs. QAEnv uses <answer> HTML tags while the TextArena environments appear to use \boxed{} TeX tags.

Since they are currently baked into the environment, the environments themselves can become more difficult to use if a different tagging convention is desired (either due to language model constraints/quirks, or experimental consistency).

Taking into account this potential diversity of tagging conventions, this PR hopes to offer a potential direction forward for decoupling action extraction from action handling within GEM environments, to make sure environments can be useful to a wider audience and to reduce implementation complexity (because now environments no longer need to assume a certain kind of tagging format)

Word of Caution

Despite this PR pointing out the inconsistencies in GEM's response tagging and extraction, no real changes have yet been made to existing/in-development environments, their prompts, or their action parsing procedures.

These are breaking changes which may affect experimental results (due to differences in prompting), and I am currently looking for ways to resolve this with minimal impact.

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