{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/text-based-rl-agents-with-commonsense","title":"Text-based RL Agents with Commonsense Knowledge: New Challenges, Environments and Baselines","arxiv_id":"2010.03790","date":"2020-10-08","proceeding":null,"authors":["Keerthiram Murugesan","Mattia Atzeni","Pavan Kapanipathi","Pushkar Shukla","Sadhana Kumaravel","Gerald Tesauro","Kartik Talamadupula","Mrinmaya Sachan","Murray Campbell"],"abstract":"Text-based games have emerged as an important test-bed for Reinforcement Learning (RL) research, requiring RL agents to combine grounded language understanding with sequential decision making. In this paper, we examine the problem of infusing RL agents with commonsense knowledge. Such knowledge would allow agents to efficiently act in the world by pruning out implausible actions, and to perform look-ahead planning to determine how current actions might affect future world states. We design a new text-based gaming environment called TextWorld Commonsense (TWC) for training and evaluating RL agents with a specific kind of commonsense knowledge about objects, their attributes, and affordances. We also introduce several baseline RL agents which track the sequential context and dynamically retrieve the relevant commonsense knowledge from ConceptNet. We show that agents which incorporate commonsense knowledge in TWC perform better, while acting more efficiently. We conduct user-studies to estimate human performance on TWC and show that there is ample room for future improvement.","url_abs":"https://arxiv.org/abs/2010.03790v1","url_pdf":"https://arxiv.org/pdf/2010.03790v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"text-based-rl-agents-with-commonsense","repo_url":"https://github.com/IBM/commonsense-rl","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"text-based-rl-agents-with-commonsense","repo_url":"https://github.com/cognitiveailab/textworldexpress","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"common-sense-reasoning","task_name":"Common Sense Reasoning"},{"task_slug":"commonsense-reasoning-for-rl","task_name":"Commonsense Reasoning for RL"},{"task_slug":"decision-making","task_name":"Decision Making"},{"task_slug":"reinforcement-learning-1","task_name":"Reinforcement Learning (RL)"},{"task_slug":"sequential-decision-making","task_name":"Sequential Decision Making"},{"task_slug":"text-based-games","task_name":"text-based games"}],"methods":[{"method_slug":"bigru","method_name":"BiGRU"},{"method_slug":"gat","method_name":"GAT"},{"method_slug":"pruning","method_name":"Pruning"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/commonsense-rl-on-commonsense-rl","task":"Commonsense Reasoning for RL","dataset":"commonsense-rl","model":"Human","rank_in_archive_order":1,"of":5,"metrics":{"Avg #Steps":"15.00 ± 3.29"},"uses_additional_data":false},{"leaderboard":"/sota/commonsense-rl-on-commonsense-rl","task":"Commonsense Reasoning for RL","dataset":"commonsense-rl","model":"Optimal","rank_in_archive_order":2,"of":5,"metrics":{"Avg #Steps":"15.00 ± 2.00"},"uses_additional_data":false},{"leaderboard":"/sota/commonsense-rl-on-commonsense-rl","task":"Commonsense Reasoning for RL","dataset":"commonsense-rl","model":"TNC-A2C","rank_in_archive_order":3,"of":5,"metrics":{"Avg #Steps":"43.27 ± 0.70"},"uses_additional_data":false},{"leaderboard":"/sota/commonsense-rl-on-commonsense-rl","task":"Commonsense Reasoning for RL","dataset":"commonsense-rl","model":"LSTM-A2C","rank_in_archive_order":4,"of":5,"metrics":{"Avg #Steps":"49.21 ± 0.58"},"uses_additional_data":false},{"leaderboard":"/sota/commonsense-rl-on-commonsense-rl","task":"Commonsense Reasoning for RL","dataset":"commonsense-rl","model":"KG-A2C","rank_in_archive_order":5,"of":5,"metrics":{"Avg #Steps":"49.36 ± 7.50"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2010.03790","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2010.03790"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/IBM/commonsense-rl","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/cognitiveailab/textworldexpress","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"unverified":13},"by_repo_kind":{"official":{"samples":13,"ran":0,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"58c721ed14e522fa","entry":"add_triplets_to_graph","repo":"IBM/commonsense-rl","repo_kind":"official","path":"utils/kg.py","file_url":"https://github.com/IBM/commonsense-rl/blob/HEAD/utils/kg.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"58c721ed14e522fa"}},{"code_sha256_prefix":"07103f48313c8a22","entry":"build_padding","repo":"IBM/commonsense-rl","repo_kind":"official","path":"utils/generic.py","file_url":"https://github.com/IBM/commonsense-rl/blob/HEAD/utils/generic.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"07103f48313c8a22"}},{"code_sha256_prefix":"a8fb47a8145651ed","entry":"construct_graph","repo":"IBM/commonsense-rl","repo_kind":"official","path":"utils/kg.py","file_url":"https://github.com/IBM/commonsense-rl/blob/HEAD/utils/kg.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a8fb47a8145651ed"}},{"code_sha256_prefix":"88d7a924e63c4345","entry":"emb_layer","repo":"IBM/commonsense-rl","repo_kind":"official","path":"models.py","file_url":"https://github.com/IBM/commonsense-rl/blob/HEAD/models.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"88d7a924e63c4345"}},{"code_sha256_prefix":"fd2df73b8fd45096","entry":"getUniqueFileHandler","repo":"IBM/commonsense-rl","repo_kind":"official","path":"utils/generic.py","file_url":"https://github.com/IBM/commonsense-rl/blob/HEAD/utils/generic.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"fd2df73b8fd45096"}},{"code_sha256_prefix":"b95c5d577a7e53d2","entry":"get_extractor","repo":"IBM/commonsense-rl","repo_kind":"official","path":"utils/extractor.py","file_url":"https://github.com/IBM/commonsense-rl/blob/HEAD/utils/extractor.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b95c5d577a7e53d2"}},{"code_sha256_prefix":"27cc7170e9ece2ec","entry":"illegal_locations","repo":"IBM/commonsense-rl","repo_kind":"official","path":"game_generation/twc_make_game.py","file_url":"https://github.com/IBM/commonsense-rl/blob/HEAD/game_generation/twc_make_game.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"27cc7170e9ece2ec"}},{"code_sha256_prefix":"f9e37121fb751fdb","entry":"is_substring","repo":"IBM/commonsense-rl","repo_kind":"official","path":"utils/extractor.py","file_url":"https://github.com/IBM/commonsense-rl/blob/HEAD/utils/extractor.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f9e37121fb751fdb"}},{"code_sha256_prefix":"066e4dbaa7dc5bcd","entry":"load_json","repo":"IBM/commonsense-rl","repo_kind":"official","path":"game_generation/twc_data.py","file_url":"https://github.com/IBM/commonsense-rl/blob/HEAD/game_generation/twc_data.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"066e4dbaa7dc5bcd"}},{"code_sha256_prefix":"d6f593cf555a535b","entry":"make_batch","repo":"IBM/commonsense-rl","repo_kind":"official","path":"games/dataset.py","file_url":"https://github.com/IBM/commonsense-rl/blob/HEAD/games/dataset.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d6f593cf555a535b"}},{"code_sha256_prefix":"42013e4fee0d53d4","entry":"prettify_config","repo":"IBM/commonsense-rl","repo_kind":"official","path":"game_generation/twc_make_game.py","file_url":"https://github.com/IBM/commonsense-rl/blob/HEAD/game_generation/twc_make_game.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"42013e4fee0d53d4"}},{"code_sha256_prefix":"844e853beb7ba89f","entry":"shortest_path_subgraph","repo":"IBM/commonsense-rl","repo_kind":"official","path":"utils/kg.py","file_url":"https://github.com/IBM/commonsense-rl/blob/HEAD/utils/kg.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"844e853beb7ba89f"}},{"code_sha256_prefix":"250f091f8f3d5d75","entry":"tokenize","repo":"IBM/commonsense-rl","repo_kind":"official","path":"utils/extractor.py","file_url":"https://github.com/IBM/commonsense-rl/blob/HEAD/utils/extractor.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"250f091f8f3d5d75"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}