Skip to content

Conversation

@christopherzc
Copy link

Adds a stronger check when parsing the "score" and "moves" fields for info in the inform7 backend.

https://github.com/pearls-lab/TextWorld/blob/c812d677dafc0728e49ab95cb52a35c0a1876c0c/textworld/envs/wrappers/tw_inform7.py#L138

This is largely needed for using Textworld to train Large Language Models, as it appears that some outputs from the models can cause the inform7 backend to mistake malformed outputs as part of its underlying state tracking, thus leading to an error here.

The try catch here isn't a particularly elegant solution but is robust enough that I haven't had the need to modify it, nor encountered this error again, across a large number of RL training runs.

@MarcCote
Copy link
Contributor

MarcCote commented Jan 8, 2026

Thanks for the PR. I'm working on fixing the CI stuff, then I'll merge it. If it's urgent, I can merge it sooner.

@christopherzc
Copy link
Author

Not really urgent but I'm also trying to see if I can find what specifically is breaking the inform7 backend so a more concrete fix can be implemented. Annoyingly, it doesn't seem to be something that is tied to a single 'bad action' so much as the LLM just inputting junk until something finally breaks in the backend.

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.

2 participants