{"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/applying-deep-reinforcement-learning-to-the","title":"Applying Deep Reinforcement Learning to the HP Model for Protein Structure Prediction","arxiv_id":"2211.14939","date":"2022-11-27","proceeding":null,"authors":["Kaiyuan Yang","Houjing Huang","Olafs Vandans","Adithya Murali","Fujia Tian","Roland H. C. Yap","Liang Dai"],"abstract":"A central problem in computational biophysics is protein structure prediction, i.e., finding the optimal folding of a given amino acid sequence. This problem has been studied in a classical abstract model, the HP model, where the protein is modeled as a sequence of H (hydrophobic) and P (polar) amino acids on a lattice. The objective is to find conformations maximizing H-H contacts. It is known that even in this reduced setting, the problem is intractable (NP-hard). In this work, we apply deep reinforcement learning (DRL) to the two-dimensional HP model. We can obtain the conformations of best known energies for benchmark HP sequences with lengths from 20 to 50. Our DRL is based on a deep Q-network (DQN). We find that a DQN based on long short-term memory (LSTM) architecture greatly enhances the RL learning ability and significantly improves the search process. DRL can sample the state space efficiently, without the need of manual heuristics. Experimentally we show that it can find multiple distinct best-known solutions per trial. This study demonstrates the effectiveness of deep reinforcement learning in the HP model for protein folding.","url_abs":"https://arxiv.org/abs/2211.14939v2","url_pdf":"https://arxiv.org/pdf/2211.14939v2.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":"applying-deep-reinforcement-learning-to-the","repo_url":"https://github.com/compsoftmatterbiophysics-cityu-hk/applying-drl-to-hp-model-for-protein-structure-prediction","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"deep-reinforcement-learning","task_name":"Deep Reinforcement Learning"},{"task_slug":"protein-folding","task_name":"Protein Folding"},{"task_slug":"protein-structure-prediction","task_name":"Protein Structure Prediction"},{"task_slug":"reinforcement-learning","task_name":"Reinforcement Learning"},{"task_slug":"reinforcement-learning-1","task_name":"Reinforcement Learning (RL)"},{"task_slug":"reinforcement-learning-2","task_name":"reinforcement-learning"}],"methods":[{"method_slug":"convolution","method_name":"Convolution"},{"method_slug":"dqn","method_name":"DQN"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"q-learning","method_name":"Q-Learning"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2211.14939","atlas_url":"https://app.syntology.ai/?focus=2211.14939","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2211.14939"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/compsoftmatterbiophysics-cityu-hk/applying-drl-to-hp-model-for-protein-structure-prediction","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":11,"unverified":2},"by_repo_kind":{"official":{"samples":13,"ran":11,"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":"1cf642d8e1180240","entry":"CosineAnnealing","repo":"compsoftmatterbiophysics-cityu-hk/applying-drl-to-hp-model-for-protein-structure-prediction","repo_kind":"official","path":"code/annealing_schedule.py","file_url":"https://github.com/compsoftmatterbiophysics-cityu-hk/applying-drl-to-hp-model-for-protein-structure-prediction/blob/HEAD/code/annealing_schedule.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"1cf642d8e1180240"}},{"code_sha256_prefix":"9b255e5def761d98","entry":"CosineAnnealingSchedule","repo":"compsoftmatterbiophysics-cityu-hk/applying-drl-to-hp-model-for-protein-structure-prediction","repo_kind":"official","path":"code/annealing_schedule.py","file_url":"https://github.com/compsoftmatterbiophysics-cityu-hk/applying-drl-to-hp-model-for-protein-structure-prediction/blob/HEAD/code/annealing_schedule.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9b255e5def761d98"}},{"code_sha256_prefix":"4a48db84d98db28a","entry":"avg_std_of_max","repo":"compsoftmatterbiophysics-cityu-hk/applying-drl-to-hp-model-for-protein-structure-prediction","repo_kind":"official","path":"code/plot_rewards.py","file_url":"https://github.com/compsoftmatterbiophysics-cityu-hk/applying-drl-to-hp-model-for-protein-structure-prediction/blob/HEAD/code/plot_rewards.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"4a48db84d98db28a"}},{"code_sha256_prefix":"cfe96fadd0fed716","entry":"delta_ESB_OS","repo":"compsoftmatterbiophysics-cityu-hk/applying-drl-to-hp-model-for-protein-structure-prediction","repo_kind":"official","path":"Waseda_Gym_Lattice/early_stop.py","file_url":"https://github.com/compsoftmatterbiophysics-cityu-hk/applying-drl-to-hp-model-for-protein-structure-prediction/blob/HEAD/Waseda_Gym_Lattice/early_stop.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"cfe96fadd0fed716"}},{"code_sha256_prefix":"38d7a166b731d649","entry":"delta_OSB_ES","repo":"compsoftmatterbiophysics-cityu-hk/applying-drl-to-hp-model-for-protein-structure-prediction","repo_kind":"official","path":"Waseda_Gym_Lattice/early_stop.py","file_url":"https://github.com/compsoftmatterbiophysics-cityu-hk/applying-drl-to-hp-model-for-protein-structure-prediction/blob/HEAD/Waseda_Gym_Lattice/early_stop.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"38d7a166b731d649"}},{"code_sha256_prefix":"e7a0a41e3d3cc24a","entry":"derive_LFR_direction","repo":"compsoftmatterbiophysics-cityu-hk/applying-drl-to-hp-model-for-protein-structure-prediction","repo_kind":"official","path":"code/hpsandbox_util.py","file_url":"https://github.com/compsoftmatterbiophysics-cityu-hk/applying-drl-to-hp-model-for-protein-structure-prediction/blob/HEAD/code/hpsandbox_util.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e7a0a41e3d3cc24a"}},{"code_sha256_prefix":"16c61ce5e9555d27","entry":"extract_max_per_chunk","repo":"compsoftmatterbiophysics-cityu-hk/applying-drl-to-hp-model-for-protein-structure-prediction","repo_kind":"official","path":"code/plot_rewards.py","file_url":"https://github.com/compsoftmatterbiophysics-cityu-hk/applying-drl-to-hp-model-for-protein-structure-prediction/blob/HEAD/code/plot_rewards.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"16c61ce5e9555d27"}},{"code_sha256_prefix":"fc875ade9a7a3423","entry":"label_conf_seq","repo":"compsoftmatterbiophysics-cityu-hk/applying-drl-to-hp-model-for-protein-structure-prediction","repo_kind":"official","path":"code/hpsandbox_util.py","file_url":"https://github.com/compsoftmatterbiophysics-cityu-hk/applying-drl-to-hp-model-for-protein-structure-prediction/blob/HEAD/code/hpsandbox_util.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"fc875ade9a7a3423"}},{"code_sha256_prefix":"57d5b400f5405c0b","entry":"move_LFR_direction","repo":"compsoftmatterbiophysics-cityu-hk/applying-drl-to-hp-model-for-protein-structure-prediction","repo_kind":"official","path":"code/hpsandbox_util.py","file_url":"https://github.com/compsoftmatterbiophysics-cityu-hk/applying-drl-to-hp-model-for-protein-structure-prediction/blob/HEAD/code/hpsandbox_util.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"57d5b400f5405c0b"}},{"code_sha256_prefix":"95240391ed42ab43","entry":"secondsToStr","repo":"compsoftmatterbiophysics-cityu-hk/applying-drl-to-hp-model-for-protein-structure-prediction","repo_kind":"official","path":"Waseda_Gym_Lattice/timer.py","file_url":"https://github.com/compsoftmatterbiophysics-cityu-hk/applying-drl-to-hp-model-for-protein-structure-prediction/blob/HEAD/Waseda_Gym_Lattice/timer.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"95240391ed42ab43"}},{"code_sha256_prefix":"b8267191de192c1f","entry":"seq_parity_stats","repo":"compsoftmatterbiophysics-cityu-hk/applying-drl-to-hp-model-for-protein-structure-prediction","repo_kind":"official","path":"Waseda_Gym_Lattice/early_stop.py","file_url":"https://github.com/compsoftmatterbiophysics-cityu-hk/applying-drl-to-hp-model-for-protein-structure-prediction/blob/HEAD/Waseda_Gym_Lattice/early_stop.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b8267191de192c1f"}},{"code_sha256_prefix":"87cdf5b45663387d","entry":"ExponentialDecay","repo":"compsoftmatterbiophysics-cityu-hk/applying-drl-to-hp-model-for-protein-structure-prediction","repo_kind":"official","path":"code/annealing_schedule.py","file_url":"https://github.com/compsoftmatterbiophysics-cityu-hk/applying-drl-to-hp-model-for-protein-structure-prediction/blob/HEAD/code/annealing_schedule.py","link_basis":"harvester_set","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":"87cdf5b45663387d"}},{"code_sha256_prefix":"676ae37285091875","entry":"plot_moving_avg","repo":"compsoftmatterbiophysics-cityu-hk/applying-drl-to-hp-model-for-protein-structure-prediction","repo_kind":"official","path":"code/plot_rewards.py","file_url":"https://github.com/compsoftmatterbiophysics-cityu-hk/applying-drl-to-hp-model-for-protein-structure-prediction/blob/HEAD/code/plot_rewards.py","link_basis":"harvester_set","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":"676ae37285091875"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}