allenai / ScienceWorld

ScienceWorld is a text-based virtual environment centered around accomplishing tasks from the standardized elementary science curriculum.
https://sciworld.apps.allenai.org/
Apache License 2.0
199 stars 24 forks source link

Heat transfer is stochastic #33

Open MarcCote opened 1 year ago

MarcCote commented 1 year ago

Some times running the same sequence of commands in ScienceWorld leads to different outcome (here making steam or not).

Steps to reproduce:

Running that procedure 8 times in a given Python instance, I got

6/8 runs that are missing steam!

Doing it a second time, I got

4/8 runs that are missing steam!

0/8 runs was expected.

@aphedges I'd love to see your changes to fix non determinism in the Scala code.

PeterAJansen commented 1 year ago

Hmm, given that EnvObject uses a Set() instead of an Array() for a storage class for objects (and most of the downstream functions in the e.g. object parser, etc., assume Sets() instead of ordered arrays), it would likely be a significant refactor to switch everything over to Arrays. I think the previous patch for determinism was limited to just showing the objects in the same order in the description text, which was solved with a call to sort the objects by name or object ID in the object description function.

aphedges commented 1 year ago

@MarcCote, as @PeterAJansen stated, removing all non-determinism would be a large refactor, so I didn't attempt to fix most of it. I would have tried to fix a non-deterministic action if I were aware of it, but the only remaining non-determinism that I knew about was in gold path generation. For that, I only fixed a single task, and the fix interferes with our generation of training data, so I never tried to upstream my patch.